diff --git a/tests/acceptance/bootstrap/CliContext.php b/tests/acceptance/bootstrap/CliContext.php index 53f0da33822..d636e564fd0 100644 --- a/tests/acceptance/bootstrap/CliContext.php +++ b/tests/acceptance/bootstrap/CliContext.php @@ -397,14 +397,16 @@ class CliContext implements Context { } /** - * @When the administrator restarts the upload sessions of file :file + * @When /^the administrator (restarts|resumes) the upload session of file "([^"]*)" using the CLI$/ * + * @param string $flag * @param string $file * * @return void * @throws JsonException */ - public function theAdministratorRestartsUploadSessionsOfFile(string $file): void { + public function theAdministratorResumesOrRestartsUploadSessionOfFileUsingTheCLI(string $flag, string $file): void { + $flag = rtrim($flag, "s"); $response = CliHelper::runCommand(["command" => "storage-users uploads sessions --json"]); $this->featureContext->theHTTPStatusCodeShouldBe(200, '', $response); $responseArray = $this->getJSONDecodedCliMessage($response); @@ -415,7 +417,7 @@ class CliContext implements Context { } } - $command = "storage-users uploads sessions --id=$uploadId --restart --json"; + $command = "storage-users uploads sessions --id=$uploadId --$flag --json"; $body = [ "command" => $command, ]; diff --git a/tests/acceptance/features/cliCommands/authAppToken.feature b/tests/acceptance/features/cliCommands/authAppToken.feature index 686d713ffa6..7119a706a6e 100644 --- a/tests/acceptance/features/cliCommands/authAppToken.feature +++ b/tests/acceptance/features/cliCommands/authAppToken.feature @@ -1,6 +1,6 @@ @env-config Feature: create auth-app token - As an admin + As an administrator I want to create auth-app Tokens So that I can use 3rd party apps diff --git a/tests/acceptance/features/cliCommands/backupConsistency.feature b/tests/acceptance/features/cliCommands/backupConsistency.feature index a83a5d147d4..843dfc0734d 100644 --- a/tests/acceptance/features/cliCommands/backupConsistency.feature +++ b/tests/acceptance/features/cliCommands/backupConsistency.feature @@ -1,6 +1,6 @@ @env-config Feature: backup consistency - As a user + As an administrator I want to check my data for inconsistencies So that I can backup my data diff --git a/tests/acceptance/features/cliCommands/emailNotification.feature b/tests/acceptance/features/cliCommands/emailNotification.feature index 54fe3bafd5f..a1529206a0e 100644 --- a/tests/acceptance/features/cliCommands/emailNotification.feature +++ b/tests/acceptance/features/cliCommands/emailNotification.feature @@ -1,6 +1,6 @@ @env-config @email Feature: get grouped email notification - As a user + As an administrator I want to get email notification of grouped events related to me either daily or weekly So that I can stay updated about the events either once a day or once a week diff --git a/tests/acceptance/features/cliCommands/searchReIndex.feature b/tests/acceptance/features/cliCommands/searchReIndex.feature index ffaf43eb9aa..88e6a7560c1 100644 --- a/tests/acceptance/features/cliCommands/searchReIndex.feature +++ b/tests/acceptance/features/cliCommands/searchReIndex.feature @@ -1,6 +1,6 @@ @env-config Feature: reindex space via CLI command - As an admin + As an administrator I want to reindex space So that I can improve search performance by ensuring that the index is up-to-date diff --git a/tests/acceptance/features/cliCommands/staleUpload.feature b/tests/acceptance/features/cliCommands/staleUpload.feature index 201d1f0dac6..289cc57cebf 100644 --- a/tests/acceptance/features/cliCommands/staleUpload.feature +++ b/tests/acceptance/features/cliCommands/staleUpload.feature @@ -1,6 +1,6 @@ @env-config @cli-stale-uploads Feature: stale upload via CLI command - As a user + As an administrator I want to manage stale uploads So that I clean up stale uploads from storage diff --git a/tests/acceptance/features/cliCommands/trashBin.feature b/tests/acceptance/features/cliCommands/trashBin.feature index a0f0f24e10c..60e0b0b5e4b 100644 --- a/tests/acceptance/features/cliCommands/trashBin.feature +++ b/tests/acceptance/features/cliCommands/trashBin.feature @@ -1,6 +1,6 @@ @env-config Feature: trashbin - As a administrator + As an administrator I want to manage trash-bin So that I can manage handle trashed resources efficiently diff --git a/tests/acceptance/features/cliCommands/uploadSessions.feature b/tests/acceptance/features/cliCommands/uploadSessions.feature index 0fd8a4e413f..f226cb03ae4 100644 --- a/tests/acceptance/features/cliCommands/uploadSessions.feature +++ b/tests/acceptance/features/cliCommands/uploadSessions.feature @@ -1,6 +1,6 @@ @env-config @cli-uploads-sessions Feature: List upload sessions via CLI command - As a user + As an administrator I want to list the upload sessions So that I can manage the upload sessions @@ -106,7 +106,7 @@ Feature: List upload sessions via CLI command When the administrator waits for "3" seconds Then for user "Alice" file "file1.txt" of space "Personal" should be in postprocessing And for user "Alice" file "file2.txt" of space "Personal" should be in postprocessing - When the administrator restarts the upload sessions of file "file1.txt" + When the administrator restarts the upload session of file "file1.txt" using the CLI Then the command should be successful And the CLI response should contain these entries: | file1.txt | @@ -179,6 +179,27 @@ Feature: List upload sessions via CLI command Then the content of file "file.txt" for user "Alice" should be "upload content" + Scenario: resume upload session of a single file + Given the config "POSTPROCESSING_DELAY" has been set to "3s" + And user "Alice" has uploaded file with content "uploaded content" to "file1.txt" + And user "Alice" has uploaded file with content "uploaded content" to "file2.txt" + And the administrator has waited for "1" seconds + And the administrator has stopped the server + And the administrator has started the server + When the administrator waits for "3" seconds + Then for user "Alice" file "file1.txt" of space "Personal" should be in postprocessing + And for user "Alice" file "file2.txt" of space "Personal" should be in postprocessing + When the administrator resumes the upload session of file "file1.txt" using the CLI + Then the command should be successful + And the CLI response should contain these entries: + | file1.txt | + And the CLI response should not contain these entries: + | file2.txt | + When the administrator waits for "3" seconds + Then for user "Alice" file "file2.txt" of space "Personal" should be in postprocessing + And the content of file "file1.txt" for user "Alice" should be "uploaded content" + + Scenario: restart expired upload sessions Given a file "large.zip" with the size of "2GB" has been created locally And the config "STORAGE_USERS_UPLOAD_EXPIRATION" has been set to "1"