-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tests for cli command uploads sessions
- Loading branch information
1 parent
fdc61d0
commit 4a01ed6
Showing
3 changed files
with
179 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
tests/acceptance/features/cliCommands/uploadSessions.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
@env-config @cli-uploads-sessions | ||
Feature: List upload sessions via CLI command | ||
As a user | ||
I want to list the upload sessions | ||
So that I can manage the upload sessions | ||
|
||
Background: | ||
Given user "Alice" has been created with default attributes and without skeleton files | ||
|
||
|
||
Scenario: user lists all upload sessions | ||
Given user "Alice" has uploaded file with content "uploaded content" to "/file0.txt" | ||
And the config "POSTPROCESSING_DELAY" has been set to "10s" | ||
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" | ||
When the administrator lists all the upload sessions | ||
Then the command should be successful | ||
And the CLI response should contain these entries: | ||
| file1.txt | | ||
| file2.txt | | ||
And the CLI response should not contain these entries: | ||
| file0.txt | | ||
|
||
|
||
Scenario: user lists all upload sessions that are currently in postprocessing | ||
Given the following configs have been set: | ||
| config | value | | ||
| POSTPROCESSING_STEPS | virusscan | | ||
| ANTIVIRUS_INFECTED_FILE_HANDLING | abort | | ||
And user "Alice" uploads file "filesForUpload/filesWithVirus/eicar.com" to "/virusFile.txt" using the WebDAV API | ||
And the config "POSTPROCESSING_DELAY" has been set to "10s" | ||
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" | ||
When the administrator lists all the upload sessions with flag "processing" | ||
Then the command should be successful | ||
And the CLI response should contain these entries: | ||
| file1.txt | | ||
| file2.txt | | ||
And the CLI response should not contain these entries: | ||
| virusFile.txt | | ||
|
||
|
||
Scenario: user lists all upload sessions that are infected by virus | ||
Given the following configs have been set: | ||
| config | value | | ||
| POSTPROCESSING_STEPS | virusscan | | ||
| ANTIVIRUS_INFECTED_FILE_HANDLING | abort | | ||
And user "Alice" uploads file "filesForUpload/filesWithVirus/eicar.com" to "/virusFile.txt" using the WebDAV API | ||
And user "Alice" has uploaded file with content "uploaded content" to "/file1.txt" | ||
When the administrator lists all the upload sessions with flag "has-virus" | ||
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 | | ||
|
||
|
||
Scenario: user lists all expired upload sessions | ||
Given the config "POSTPROCESSING_DELAY" has been set to "10s" | ||
And user "Alice" has uploaded file with content "uploaded content" to "/file1.txt" | ||
And the config "STORAGE_USERS_UPLOAD_EXPIRATION" has been set to "0" | ||
And user "Alice" has uploaded file with content "uploaded content" to "/file2.txt" | ||
And user "Alice" has uploaded file with content "uploaded content" to "/file3.txt" | ||
When the administrator lists all the upload sessions with flag "expired" | ||
Then the command should be successful | ||
And the CLI response should contain these entries: | ||
| file2.txt | | ||
| file3.txt | | ||
And the CLI response should not contain these entries: | ||
| file1.txt | | ||
|
||
|
||
Scenario: user cleans all expired upload sessions | ||
Given the config "POSTPROCESSING_DELAY" has been set to "10s" | ||
And user "Alice" has uploaded file with content "upload content" to "/file1.txt" | ||
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 | ||
Then the command should be successful | ||
And the CLI response should contain these entries: | ||
| file2.txt | | ||
| file3.txt | |