From ee368d68922c5c57ce39b7dc49c798eef3b8e9bf Mon Sep 17 00:00:00 2001 From: Nalem7 <61624650+nabim777@users.noreply.github.com> Date: Thu, 15 Jun 2023 15:32:04 +0545 Subject: [PATCH] [tests-only][full-ci]add test for creating a version file with virus content (#6521) 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 | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/tests/acceptance/features/apiAntivirus/antivirus.feature b/tests/acceptance/features/apiAntivirus/antivirus.feature index a74dd31ddd7..3781de74413 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" @@ -293,4 +293,26 @@ Feature: antivirus | dav-path-version | | old | | new | - | spaces | \ No newline at end of file + | spaces | + + @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 |