From e3ff3418b02d5af704bccdd613f43db40f843336 Mon Sep 17 00:00:00 2001 From: Nalem7 <61624650+nabim777@users.noreply.github.com> Date: Fri, 16 Jun 2023 09:09:38 +0545 Subject: [PATCH] [tests-only][full-ci]add test for creating a version file with virus content (#6521) (#6535) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add test for creating a version file with virus content * rebasing --------- Co-authored-by: nabim777 <“nabinalemagar019@gmail.com”> --- .../features/apiAntivirus/antivirus.feature | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/tests/acceptance/features/apiAntivirus/antivirus.feature b/tests/acceptance/features/apiAntivirus/antivirus.feature index 549f099884..8e72e7de7f 100644 --- a/tests/acceptance/features/apiAntivirus/antivirus.feature +++ b/tests/acceptance/features/apiAntivirus/antivirus.feature @@ -265,7 +265,7 @@ 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" @@ -313,3 +313,25 @@ Feature: antivirus | old | de | Virus gefunden | In aFileWithVirus.txt wurde potenziell schädlicher Code gefunden. Das Hochladen wurde abgebrochen. Grund: Win.Test.EICAR_HDB-1 | | new | de | Virus gefunden | In aFileWithVirus.txt wurde potenziell schädlicher Code gefunden. Das Hochladen wurde abgebrochen. Grund: Win.Test.EICAR_HDB-1 | | spaces | de | Virus gefunden | In aFileWithVirus.txt wurde potenziell schädlicher Code gefunden. Das Hochladen wurde abgebrochen. Grund: Win.Test.EICAR_HDB-1 | + + @issue-enterprise-5709 + Scenario Outline: try to create a version of file by uploading virus content + Given using DAV path + And user "Alice" has uploaded file with content "hello world" to "test.txt" + And user "Alice" has uploaded file with content "hello nepal" to "test.txt" + When user "Alice" uploads file with content "X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*" to "test.txt" using the WebDAV API + Then the HTTP status code should be "204" + And user "Alice" should get a notification with subject "Virus found" and message: + | message | + | Virus found in test.txt. Upload not possible. Virus: Win.Test.EICAR_HDB-1 | + And as "Alice" file "/test.txt" should exist + And the version folder of file "/test.txt" for user "Alice" should contain "1" element + And the content of file "/test.txt" for user "Alice" should be "hello nepal" + When user "Alice" restores version index "1" of file "/test.txt" using the WebDAV API + Then the HTTP status code should be "204" + And the content of file "/test.txt" for user "Alice" should be "hello world" + Examples: + | dav-path-version | + | old | + | new | + | spaces |