Skip to content

Commit 2245bce

Browse files
committed
refactor for adding not upload tests
Signed-off-by: nabim777 <[email protected]>
1 parent d9deb78 commit 2245bce

File tree

1 file changed

+53
-24
lines changed

1 file changed

+53
-24
lines changed

tests/acceptance/features/cliCommands/uploadSessions.feature

Lines changed: 53 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -247,56 +247,85 @@ Feature: List upload sessions via CLI command
247247
And the content of file "file1.txt" for user "Alice" should be "uploaded content"
248248

249249

250-
Scenario: resume all failed upload using postprocessing command
251-
Given the config "POSTPROCESSING_DELAY" has been set to "3s"
252-
And user "Alice" has uploaded file with content "uploaded content" to "file1.txt"
253-
And user "Alice" has uploaded file with content "uploaded content" to "file2.txt"
250+
Scenario: resume all failed upload but not for finished using postprocessing command
251+
Given the following configs have been set:
252+
| config | value |
253+
| POSTPROCESSING_STEPS | virusscan,delay |
254+
| ANTIVIRUS_INFECTED_FILE_HANDLING | abort |
255+
| POSTPROCESSING_DELAY | 10s |
256+
And user "Alice" has created a new TUS resource in the space "Personal" with the following headers:
257+
| Upload-Length | 10 |
258+
# dGV4dEZpbGUudHh0 is the base64 encode of textFile.txt
259+
| Upload-Metadata | filename dGV4dEZpbGUudHh0 |
260+
| Tus-Resumable | 1.0.0 |
261+
And user "Alice" has uploaded file with checksum "SHA1 8cb2237d0679ca88db6464eac60da96345513964" to the last created TUS Location with offset "0" and content "12345" via TUS inside of the space "Personal" using the WebDAV API
262+
And user "Alice" has uploaded file with content "uploaded content" to "file.txt"
254263
And the administrator has waited for "1" seconds
255264
And the administrator has stopped the server
256265
And the administrator has started the server
257-
When the administrator waits for "3" seconds
258-
Then for user "Alice" file "file1.txt" of space "Personal" should be in postprocessing
259-
And for user "Alice" file "file2.txt" of space "Personal" should be in postprocessing
260266
When the administrator resumes all uploads session using post processing command
261267
Then the command should be successful
262268
When the administrator waits for "3" seconds
263-
And the content of file "file1.txt" for user "Alice" should be "uploaded content"
264-
And the content of file "file2.txt" for user "Alice" should be "uploaded content"
269+
And the content of file "file.txt" for user "Alice" should be "uploaded content"
270+
And the administrator lists all the upload sessions
271+
Then the command should be successful
272+
And the CLI response should contain these entries:
273+
| textFile.txt |
274+
And the CLI response should not contain these entries:
275+
| file.txt |
265276

266277

267278
Scenario: resume all failed upload on finished step using postprocessing command
268-
Given the config "POSTPROCESSING_DELAY" has been set to "3s"
269-
And user "Alice" has uploaded file with content "uploaded content" to "file1.txt"
270-
And user "Alice" has uploaded file with content "uploaded content" to "file2.txt"
279+
Given the following configs have been set:
280+
| config | value |
281+
| POSTPROCESSING_STEPS | virusscan,delay |
282+
| ANTIVIRUS_INFECTED_FILE_HANDLING | abort |
283+
| POSTPROCESSING_DELAY | 10s |
284+
And user "Alice" has created a new TUS resource in the space "Personal" with the following headers:
285+
| Upload-Length | 10 |
286+
# dGV4dEZpbGUudHh0 is the base64 encode of textFile.txt
287+
| Upload-Metadata | filename dGV4dEZpbGUudHh0 |
288+
| Tus-Resumable | 1.0.0 |
289+
And user "Alice" has uploaded file with checksum "SHA1 8cb2237d0679ca88db6464eac60da96345513964" to the last created TUS Location with offset "0" and content "12345" via TUS inside of the space "Personal" using the WebDAV API
290+
And user "Alice" has uploaded file with content "uploaded content" to "file.txt"
271291
And the administrator has waited for "1" seconds
272292
And the administrator has stopped the server
273293
And the administrator has started the server
274-
When the administrator waits for "3" seconds
275-
Then for user "Alice" file "file1.txt" of space "Personal" should be in postprocessing
276-
And for user "Alice" file "file2.txt" of space "Personal" should be in postprocessing
277294
When the administrator resumes all uploads session in finished step using post processing command
278295
Then the command should be successful
279296
When the administrator waits for "3" seconds
280-
And the content of file "file1.txt" for user "Alice" should be "uploaded content"
281-
And the content of file "file2.txt" for user "Alice" should be "uploaded content"
297+
And the content of file "file.txt" for user "Alice" should be "uploaded content"
298+
And the administrator lists all the upload sessions
299+
Then the command should be successful
300+
And the CLI response should contain these entries:
301+
| textFile.txt |
302+
And the CLI response should not contain these entries:
303+
| file.txt |
282304

283305

284306
# Scenario: resume all failed upload on virus scan step using postprocessing command
285307
# Given the following configs have been set:
286308
# | config | value |
287-
# | POSTPROCESSING_STEPS | virusscan |
288-
# | ANTIVIRUS_INFECTED_FILE_HANDLING | abort |
289-
# | POSTPROCESSING_DELAY | 10s |
309+
# | POSTPROCESSING_STEPS | virusscan,delay |
310+
# | ANTIVIRUS_INFECTED_FILE_HANDLING | continue |
311+
# | POSTPROCESSING_DELAY | 3s |
312+
# And user "Alice" has uploaded file "filesForUpload/filesWithVirus/eicar.com" to "/virusFile.txt"
290313
# And user "Alice" has uploaded file with content "uploaded content" to "file1.txt"
291-
# And user "Alice" has uploaded file with content "uploaded content" to "file2.txt"
292314
# And the administrator has waited for "1" seconds
293315
# And the administrator has stopped the server
294316
# And the administrator has started the server
295317
# When the administrator waits for "3" seconds
296-
# Then for user "Alice" file "file1.txt" of space "Personal" should be in postprocessing
297-
# And for user "Alice" file "file2.txt" of space "Personal" should be in postprocessing
318+
# And the administrator lists all the upload sessions with flag "has-virus"
319+
# Then the command should be successful
320+
# And the CLI response should contain these entries:
321+
# | virusFile.txt |
322+
# And the CLI response should not contain these entries:
323+
# | file1.txt |
298324
# When the administrator resumes all uploads session in virusscan step using post processing command
299325
# Then the command should be successful
326+
# And the content of file "file1.txt" for user "Alice" should be "uploaded content"
327+
# Then for user "Alice" file "file1.txt" of space "Personal" should be in postprocessing
328+
300329
# When the administrator waits for "3" seconds
330+
# And the content of file "eicar.com" for user "Alice" should be "uploaded content"
301331
# And the content of file "file1.txt" for user "Alice" should be "uploaded content"
302-
# And the content of file "file2.txt" for user "Alice" should be "uploaded content"

0 commit comments

Comments
 (0)