From 50a112227fd001d427522085f037f34c26d0eb7e Mon Sep 17 00:00:00 2001 From: Swikriti Tripathi Date: Fri, 6 Aug 2021 15:03:08 +0545 Subject: [PATCH] add new scenario --- .../apiAntivirus/antivirusMain.feature | 46 +++++++++++-------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/tests/acceptance/features/apiAntivirus/antivirusMain.feature b/tests/acceptance/features/apiAntivirus/antivirusMain.feature index 9b39d1fe..8d890d82 100644 --- a/tests/acceptance/features/apiAntivirus/antivirusMain.feature +++ b/tests/acceptance/features/apiAntivirus/antivirusMain.feature @@ -136,17 +136,22 @@ Feature: Antivirus basic | eicar_com.zip | | eicarcom2.zip | - - Scenario: A file cannot be overwritten with a file containing a virus via public upload - Given as user "Alice" +# @skip @files_primary_s3#69 + Scenario Outline: A file cannot be overwritten with a file containing a virus via public upload + Given the administrator has enabled DAV tech_preview + And as user "Alice" And user "Alice" has created a public link share of folder "FOLDER" with change permissions - When the public uploads file "textfile.txt" from the antivirus test data folder using the old WebDAV API - And the public overwrites file "textfile.txt" with content "X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*" using the old WebDAV API + When the public uploads file "textfile.txt" from the antivirus test data folder using the WebDAV API + And the public overwrites file "textfile.txt" with content "X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*" using the WebDAV API Then the HTTP status code should be "403" And the last lines of the log file should contain log-entries containing these attributes: | user | app | method | message | | -- | files_antivirus | PUT | Infected file deleted | And the content of file "/FOLDER/textfile.txt" for user "Alice" should be "Small text file without virus." + Examples: + | dav-path-version | + | old | + | new | Scenario Outline: An empty file can be uploaded Given using DAV path @@ -159,19 +164,23 @@ Feature: Antivirus basic | old | | new | -# Scenario: A file cannot be overwritten with a file containing a virus via new public upload -# Given the administrator has enabled DAV tech_preview -# And as user "Alice" -# And user "Alice" has created a public link share of folder "FOLDER" with change permissions -# When the public uploads file "textfile.txt" from the antivirus test data folder using the new WebDAV API -# And the public overwrites file "textfile.txt" with content "X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*" using the new WebDAV API -# Then the HTTP status code should be "403" -# And the last lines of the log file should contain log-entries containing these attributes: -# | user | app | method | message | -# | -- | files_antivirus | PUT | Infected file deleted | -# And the content of file "/FOLDER/textfile.txt" for user "Alice" should be "Small text file without virus." + # @skip @files_primary_s3#69 + Scenario Outline: overwriting a file with virus is not possible + Given using DAV path + And user "Alice" has uploaded file "textfile.txt" from the antivirus test data folder to "/ok-textfile.txt" + When user "Alice" uploads file "eicar.com" from the antivirus test data folder to "/ok-textfile.txt" using the WebDAV API + Then the HTTP status code should be "403" + And the last lines of the log file should contain log-entries containing these attributes: + | user | app | method | message | + | Alice | files_antivirus | PUT | Infected file deleted | + And the content of file "/ok-textfile.txt" for user "Alice" should be "Small text file without virus." + Examples: + | dav-path-version | + | old | + | new | - Scenario Outline: overwriting a file with virus in a group share +# @skip @files_primary_s3#69 + Scenario Outline: overwriting a file with virus in a group share is not possible Given using DAV path And user "Brian" has been created with default attributes and without skeleton files And group "grp1" has been created @@ -192,7 +201,8 @@ Feature: Antivirus basic | old | | new | - Scenario Outline: overwriting a file with virus in a share +# @skip @files_primary_s3#69 + Scenario Outline: overwriting a file with virus in a share is not possible Given using DAV path And user "Brian" has been created with default attributes and without skeleton files And user "Alice" has uploaded file "textfile.txt" from the antivirus test data folder to "/ok-textfile.txt"