From 111ff55579095d5c2e816653d1acf5cca8239a2f Mon Sep 17 00:00:00 2001 From: Sabin Panta <64484313+S-Panta@users.noreply.github.com> Date: Wed, 14 Jun 2023 12:26:10 +0545 Subject: [PATCH] add tests by setting ANTIVIRUS_MAX_SCAN_SIZE env (#6484) --- .../features/apiAntivirus/antivirus.feature | 29 ++++++++++++++++++ .../filesWithVirus/eicarcom2.zip | Bin 308 -> 0 bytes 2 files changed, 29 insertions(+) delete mode 100644 tests/acceptance/filesForUpload/filesWithVirus/eicarcom2.zip diff --git a/tests/acceptance/features/apiAntivirus/antivirus.feature b/tests/acceptance/features/apiAntivirus/antivirus.feature index ee8d983748..87fcca24b9 100644 --- a/tests/acceptance/features/apiAntivirus/antivirus.feature +++ b/tests/acceptance/features/apiAntivirus/antivirus.feature @@ -259,3 +259,32 @@ Feature: antivirus | filename | newfilename | | eicar.com | virusFile1.txt | | eicar_com.zip | virusFile2.zip | + + @env-config + Scenario Outline: upload a file with virus smaller than the upload threshold + Given the config "ANTIVIRUS_MAX_SCAN_SIZE" has been set to "100" + And using DAV path + When user "Alice" uploads file "filesForUpload/filesWithVirus/eicar.com" to "/aFileWithVirus.txt" using the WebDAV API + Then the HTTP status code should be "201" + And user "Alice" should get a notification with subject "Virus found" and message: + | message | + | Virus found in aFileWithVirus.txt. Upload not possible. Virus: Win.Test.EICAR_HDB-1 | + And as "Alice" file "/aFileWithVirus.txt" should not exist + Examples: + | dav-path-version | + | old | + | new | + | spaces | + + @env-config + Scenario Outline: upload a file with virus larger than the upload threshold + Given the config "ANTIVIRUS_MAX_SCAN_SIZE" has been set to "100" + And using DAV path + When user "Alice" uploads file "filesForUpload/filesWithVirus/eicar_com.zip" to "/aFileWithVirus.txt" using the WebDAV API + Then the HTTP status code should be "201" + And as "Alice" file "/aFileWithVirus.txt" should exist + Examples: + | dav-path-version | + | old | + | new | + | spaces | \ No newline at end of file diff --git a/tests/acceptance/filesForUpload/filesWithVirus/eicarcom2.zip b/tests/acceptance/filesForUpload/filesWithVirus/eicarcom2.zip deleted file mode 100644 index 4bda6119ad1e57f1087d87804a0dfab63e1e4f46..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 308 zcmWIWW@h1H00E;luQe_z+&0_+WP>m-5T|A)ClxQ@nhv>R_`nW2pcxZcQ1$Z+ui7-Iih0QXceGH5Y3Jm`nK`gK?7#YlgjBF5x0ogEYo&+lb8nz8#7{bd41FeDT9)r~a0HhZ{KL7v#