[tests-only][full-ci]Move locks related tests to local api tests and link the failing lock tests with correct issues (#7643)

* Link the failing lock tests with correct issues that they are failing with

* Move locks relates tests to new suite

Signed-off-by: Swikriti Tripathi <swikriti808@gmail.com>

* address reviews

Signed-off-by: Swikriti Tripathi <swikriti808@gmail.com>

* Add new scenario for trying to lock a folder

Signed-off-by: Swikriti Tripathi <swikriti808@gmail.com>

---------

Signed-off-by: Swikriti Tripathi <swikriti808@gmail.com>
This commit is contained in:
Swikriti Tripathi
2023-11-17 16:22:12 +05:45
committed by GitHub
parent a9afb49bed
commit 792c8cc1b9
7 changed files with 145 additions and 204 deletions

View File

@@ -256,3 +256,114 @@ Feature: lock files
| key | value |
| d:lockdiscovery/d:activelock/d:lockscope/d:exclusive | |
| d:lockdiscovery/d:activelock/oc:ownername | Brian Murphy |
@issue-7599
Scenario Outline: two users having both a shared lock can use the resource
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file with content "some data" to "textfile0.txt"
And user "Brian" has uploaded file with content "some data" to "textfile0.txt"
And user "Alice" has shared file "/textfile0.txt" with user "Brian"
And user "Alice" has locked file "textfile0.txt" setting the following properties
| lockscope | shared |
And user "Brian" has locked file "Shares/textfile0.txt" setting the following properties
| lockscope | shared |
When user "Alice" uploads file with content "from user 0" to "textfile0.txt" sending the locktoken of file "textfile0.txt" using the WebDAV API
Then the HTTP status code should be "204"
And the content of file "textfile0.txt" for user "Alice" should be "from user 0"
And the content of file "Shares/textfile0.txt" for user "Brian" should be "from user 0"
When user "Brian" uploads file with content "from user 1" to "Shares/textfile0.txt" sending the locktoken of file "Shares/textfile0.txt" using the WebDAV API
Then the HTTP status code should be "204"
And the content of file "textfile0.txt" for user "Alice" should be "from user 1"
And the content of file "Shares/textfile0.txt" for user "Brian" should be "from user 1"
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@issue-7638
Scenario Outline: locking a file does not lock other items with the same name in other parts of the file system
Given using <dav-path-version> DAV path
And user "Alice" has created folder "locked"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/locked/textfile0.txt"
And user "Alice" has created folder "notlocked"
And user "Alice" has created folder "notlocked/textfile0.txt"
When user "Alice" locks file "locked/textfile0.txt" using the WebDAV API setting the following properties
| lockscope | <lock-scope> |
Then the HTTP status code should be "200"
And user "Alice" should be able to upload file "filesForUpload/lorem.txt" to "/notlocked/textfile0.txt/real-file.txt"
And user "Alice" should be able to upload file "filesForUpload/lorem.txt" to "/textfile0.txt"
But user "Alice" should not be able to upload file "filesForUpload/lorem.txt" to "/locked/textfile0.txt"
Examples:
| dav-path-version | lock-scope |
| old | shared |
| old | exclusive |
| new | shared |
| new | exclusive |
| spaces | shared |
| spaces | exclusive |
@issue-7638 @issue-7599
Scenario Outline: locking a file in a received share does not lock other items with the same name in other received shares (shares from different users)
Given using <dav-path-version> DAV path
And user "Carol" has been created with default attributes and without skeleton files
And user "Alice" has created folder "FromAlice"
And user "Brian" has created folder "FromBrian"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/FromAlice/textfile0.txt"
And user "Brian" has uploaded file "filesForUpload/textfile.txt" to "/FromBrian/textfile0.txt"
And user "Alice" has shared folder "FromAlice" with user "Carol"
And user "Brian" has shared folder "FromBrian" with user "Carol"
When user "Carol" locks file "/Shares/FromBrian/textfile0.txt" using the WebDAV API setting the following properties
| lockscope | <lock-scope> |
Then the HTTP status code should be "200"
And user "Carol" should be able to upload file "filesForUpload/lorem.txt" to "/Shares/FromAlice/textfile0.txt"
But user "Carol" should not be able to upload file "filesForUpload/lorem.txt" to "/Shares/FromBrian/textfile0.txt"
Examples:
| dav-path-version | lock-scope |
| old | shared |
| old | exclusive |
| new | shared |
| new | exclusive |
| spaces | shared |
| spaces | exclusive |
@issue-7638 @issue-7599
Scenario Outline: locking a file in a received share does not lock other items with the same name in other received shares (shares from same user)
Given using <dav-path-version> DAV path
And user "Alice" has created folder "locked/"
And user "Alice" has created folder "notlocked/"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/locked/textfile0.txt"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/notlocked/textfile0.txt"
And user "Alice" has shared folder "locked" with user "Brian"
And user "Alice" has shared folder "notlocked" with user "Brian"
When user "Brian" locks file "/Shares/locked/textfile0.txt" using the WebDAV API setting the following properties
| lockscope | <lock-scope> |
Then the HTTP status code should be "200"
And user "Brian" should be able to upload file "filesForUpload/lorem.txt" to "/Shares/notlocked/textfile0.txt"
But user "Brian" should not be able to upload file "filesForUpload/lorem.txt" to "/Shares/locked/textfile0.txt"
Examples:
| dav-path-version | lock-scope |
| old | shared |
| old | exclusive |
| new | shared |
| new | exclusive |
| spaces | shared |
| spaces | exclusive |
@issue-7641
Scenario Outline: try to lock a folder
Given using <dav-path-version> DAV path
And user "Alice" has created folder "locked/"
When user "Alice" tries to lock folder "locked/" using the WebDAV API setting the following properties
| lockscope | <lock-scope> |
Then the HTTP status code should be "403"
And user "Alice" should be able to upload file "filesForUpload/lorem.txt" to "locked/textfile0.txt"
And user "Alice" should be able to create folder "/locked/sub-folder"
Examples:
| dav-path-version | lock-scope |
| old | shared |
| old | exclusive |
| new | shared |
| new | exclusive |
| spaces | shared |
| spaces | exclusive |