diff --git a/tests/acceptance/bootstrap/CliContext.php b/tests/acceptance/bootstrap/CliContext.php index a7e52a189e9..4710b8a084a 100644 --- a/tests/acceptance/bootstrap/CliContext.php +++ b/tests/acceptance/bootstrap/CliContext.php @@ -257,12 +257,14 @@ public function theAdministratorListsAllTheUploadSessions(?string $flag = null): } /** - * @When the administrator cleans all expired upload sessions + * @When the administrator cleans upload sessions with flag :flag + * + * @param string $flag * * @return void */ - public function theAdministratorCleansAllExpiredUploadSessions(): void { - $command = "storage-users uploads sessions --expired --clean --json"; + public function theAdministratorCleansUploadSessionsWithFlag(string $flag): void { + $command = "storage-users uploads sessions --$flag --clean --json"; $body = [ "command" => $command ]; diff --git a/tests/acceptance/features/cliCommands/uploadSessions.feature b/tests/acceptance/features/cliCommands/uploadSessions.feature index 241e2bf14af..bfd24dfb0ba 100644 --- a/tests/acceptance/features/cliCommands/uploadSessions.feature +++ b/tests/acceptance/features/cliCommands/uploadSessions.feature @@ -76,7 +76,7 @@ Feature: List upload sessions via CLI command And the config "STORAGE_USERS_UPLOAD_EXPIRATION" has been set to "0" And user "Alice" has uploaded file with content "upload content" to "/file2.txt" And user "Alice" has uploaded file with content "upload content" to "/file3.txt" - When the administrator cleans all expired upload sessions + When the administrator cleans upload sessions with flag "expired" Then the command should be successful And the CLI response should contain these entries: | file2.txt | @@ -107,3 +107,19 @@ Feature: List upload sessions via CLI command | file1.txt | And the CLI response should not contain these entries: | file2.txt | + + + Scenario: clean all upload sessions that are not in postprocessing + Given the following configs have been set: + | config | value | + | POSTPROCESSING_STEPS | virusscan | + | ANTIVIRUS_INFECTED_FILE_HANDLING | abort | + And user "Alice" has uploaded file "filesForUpload/filesWithVirus/eicar.com" to "/virusFile.txt" + And the config "POSTPROCESSING_DELAY" has been set to "10s" + And user "Alice" has uploaded file with content "upload content" to "/file1.txt" + When the administrator cleans upload sessions with flag "processing=false" + Then the command should be successful + And the CLI response should contain these entries: + | virusFile.txt | + And the CLI response should not contain these entries: + | file1.txt |