From eb3f1831708a5290ea7178344f30c89723ca7641 Mon Sep 17 00:00:00 2001 From: Jasmine Baral Date: Thu, 20 May 2021 17:24:59 +0545 Subject: [PATCH] Add tests with brackets in name and run on sqlite db --- .drone.star | 9 ++++++ .../apiProvisioning-v1/addUser.feature | 13 +++++++++ .../apiProvisioning-v2/addUser.feature | 13 +++++++++ .../apiProvisioningGroups-v1/addGroup.feature | 29 +++++++++++-------- .../features/apiWebdavMove2/moveFile.feature | 7 +++++ 5 files changed, 59 insertions(+), 12 deletions(-) diff --git a/.drone.star b/.drone.star index 0d3eaf6cb6d3..09940899d7aa 100644 --- a/.drone.star +++ b/.drone.star @@ -273,6 +273,15 @@ config = { 'runAllSuites': True, 'numberOfParts': 8, }, + 'apiOnSqlite': { + 'suites': { + 'apiOnSqlite': 'apiOnSqlite', + }, + 'databases': ['sqlite'], + 'useHttps': False, + 'filterTags': '@sqliteDB', + 'runAllSuites': True, + } } } diff --git a/tests/acceptance/features/apiProvisioning-v1/addUser.feature b/tests/acceptance/features/apiProvisioning-v1/addUser.feature index b20095d1697b..d51346f340fb 100644 --- a/tests/acceptance/features/apiProvisioning-v1/addUser.feature +++ b/tests/acceptance/features/apiProvisioning-v1/addUser.feature @@ -197,3 +197,16 @@ Feature: add user Then the OCS status code should be "105" And the HTTP status code should be "200" And user "brand-new-user" should not exist + + @sqliteDB + Scenario: admin tries to create user with brackets in the username + When the administrator sends a user creation request for the following users with password using the provisioning API + | username | password | + | [user1] | %alt1% | + | [ user2 ] | %alt1% | + Then the OCS status code of responses on all endpoints should be "101" + And the HTTP status code of responses on all endpoints should be "200" + And the following users should not exist + | username | + | [user1] | + | [ user2 ] | diff --git a/tests/acceptance/features/apiProvisioning-v2/addUser.feature b/tests/acceptance/features/apiProvisioning-v2/addUser.feature index a735efa34592..65f0da6a38c8 100644 --- a/tests/acceptance/features/apiProvisioning-v2/addUser.feature +++ b/tests/acceptance/features/apiProvisioning-v2/addUser.feature @@ -197,3 +197,16 @@ Feature: add user Then the OCS status code should be "400" And the HTTP status code should be "400" And user "brand-new-user" should not exist + + @sqliteDB + Scenario: admin tries to create user with brackets in the username + When the administrator sends a user creation request for the following users with password using the provisioning API + | username | password | + | [user1] | %alt1% | + | [ user2 ] | %alt1% | + Then the OCS status code of responses on all endpoints should be "400" + And the HTTP status code of responses on all endpoints should be "400" + And the following users should not exist + | username | + | [user1] | + | [ user2 ] | diff --git a/tests/acceptance/features/apiProvisioningGroups-v1/addGroup.feature b/tests/acceptance/features/apiProvisioningGroups-v1/addGroup.feature index 538980b548a1..18603248df6f 100644 --- a/tests/acceptance/features/apiProvisioningGroups-v1/addGroup.feature +++ b/tests/acceptance/features/apiProvisioningGroups-v1/addGroup.feature @@ -22,20 +22,23 @@ Feature: add groups | España§àôœ€ | | नेपाली | + @sqliteDB Scenario: admin creates a group with special characters When the administrator sends a group creation request for the following groups using the provisioning API - | groupname | comment | - | brand-new-group | dash | - | the.group | dot | - | left,right | comma | - | 0 | The "false" group | - | Finance (NP) | Space and brackets | - | Admin&Finance | Ampersand | - | admin:Pokhara@Nepal | Colon and @ | - | maint+eng | Plus sign | - | $x<=>[y*z^2]! | Maths symbols | - | Mgmt\Middle | Backslash | - | 😅 😆 | emoji | + | groupname | comment | + | brand-new-group | dash | + | the.group | dot | + | left,right | comma | + | 0 | The "false" group | + | Finance (NP) | Space and brackets | + | Admin&Finance | Ampersand | + | admin:Pokhara@Nepal | Colon and @ | + | maint+eng | Plus sign | + | $x<=>[y*z^2]! | Maths symbols | + | Mgmt\Middle | Backslash | + | 😅 😆 | emoji | + | [group1] | brackets | + | group [ 2 ] | bracketsAndSpace | Then the OCS status code of responses on all endpoints should be "100" And the HTTP status code of responses on all endpoints should be "200" And these groups should exist: @@ -51,6 +54,8 @@ Feature: add groups | $x<=>[y*z^2]! | | Mgmt\Middle | | 😅 😆 | + | [group1] | + | group [ 2 ] | @toImplementOnOCIS @issue-product-284 Scenario: admin creates a group with % and # in name diff --git a/tests/acceptance/features/apiWebdavMove2/moveFile.feature b/tests/acceptance/features/apiWebdavMove2/moveFile.feature index 067178117f8e..fc32c6dd07ba 100644 --- a/tests/acceptance/features/apiWebdavMove2/moveFile.feature +++ b/tests/acceptance/features/apiWebdavMove2/moveFile.feature @@ -290,16 +290,23 @@ Feature: move (rename) file | old | | new | + @sqliteDB Scenario: renaming to a file with special characters Given user "Alice" has uploaded file with content "ownCloud test text file 0" to "textfile0.txt" And user "Alice" has uploaded file with content "ownCloud test text file 1" to "textfile1.txt" + And user "Alice" has uploaded file with content "ownCloud test text file 2" to "textfile2.txt" + And user "Alice" has uploaded file with content "ownCloud test text file 3" to "textfile3.txt" When user "Alice" moves the following file using the WebDAV API | source | destination | | /textfile0.txt | *a@b#c$e%f&g* | | /textfile1.txt | 1 2 3##.## | + | /textfile2.txt | file[2] | + | /textfile3.txt | file [ 3 ] | Then the HTTP status code of responses on all endpoints should be "201" And the content of file "*a@b#c$e%f&g*" for user "Alice" should be "ownCloud test text file 0" And the content of file "1 2 3##.##" for user "Alice" should be "ownCloud test text file 1" + And the content of file "file[2]" for user "Alice" should be "ownCloud test text file 2" + And the content of file "file [ 3 ]" for user "Alice" should be "ownCloud test text file 3" @issue-ocis-reva-265 #after fixing the issues merge this Scenario into the one above