Skip to content

Commit

Permalink
added spaces examples in the WebDAV locks suite
Browse files Browse the repository at this point in the history
  • Loading branch information
kiranparajuli589 committed Feb 3, 2022
1 parent 1303a29 commit cb7f1f2
Show file tree
Hide file tree
Showing 4 changed files with 151 additions and 17 deletions.
54 changes: 51 additions & 3 deletions tests/acceptance/features/apiWebdavLocks/exclusiveLocks.feature
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ Feature: there can be only one exclusive lock on a resource
| new | shared |
| new | exclusive |

@personalSpace @skipOnOcV10
Examples:
| dav-path | lock-scope |
| spaces | shared |
| spaces | exclusive |

Scenario Outline: if a parent resource is exclusively locked a child resource cannot be locked again
Given using <dav-path> DAV path
And user "Alice" has created folder "PARENT"
Expand All @@ -38,6 +44,12 @@ Feature: there can be only one exclusive lock on a resource
| new | shared |
| new | exclusive |

@personalSpace @skipOnOcV10
Examples:
| dav-path | lock-scope |
| spaces | shared |
| spaces | exclusive |

Scenario Outline: if a parent resource is exclusively locked with depth 0 a child resource can be locked again
Given using <dav-path> DAV path
And user "Alice" has created folder "PARENT"
Expand All @@ -57,6 +69,12 @@ Feature: there can be only one exclusive lock on a resource
| new | shared |
| new | exclusive |

@personalSpace @skipOnOcV10
Examples:
| dav-path | lock-scope |
| spaces | shared |
| spaces | exclusive |

@skipOnOcV10 @issue-34358
Scenario Outline: if a child resource is exclusively locked a parent resource cannot be locked again
Given using <dav-path> DAV path
Expand All @@ -76,16 +94,22 @@ Feature: there can be only one exclusive lock on a resource
| new | shared |
| new | exclusive |

@personalSpace @skipOnOcV10
Examples:
| dav-path | lock-scope |
| spaces | shared |
| spaces | exclusive |

Scenario Outline: if a child resource is exclusively locked a parent resource can be locked with depth 0
Given using <dav-path> DAV path
Given using spaces DAV path
And user "Alice" has created folder "PARENT"
And user "Alice" has created folder "PARENT/CHILD"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "PARENT/CHILD/child.txt"
And user "Alice" has locked folder "PARENT/CHILD" setting the following properties
| lockscope | exclusive |
When user "Alice" locks folder "PARENT" using the WebDAV API setting the following properties
| lockscope | <lock-scope> |
| depth | 0 |
| lockscope | exclusive |
| depth | 0 |
Then the HTTP status code should be "200"
And 1 locks should be reported for file "PARENT/CHILD/child.txt" of user "Alice" by the WebDAV API
Examples:
Expand All @@ -95,6 +119,12 @@ Feature: there can be only one exclusive lock on a resource
| new | shared |
| new | exclusive |

@personalSpace @skipOnOcV10
Examples:
| dav-path | lock-scope |
| spaces | shared |
| spaces | exclusive |

@files_sharing-app-required
Scenario Outline: a share receiver cannot lock a resource exclusively locked by itself
Given using <dav-path> DAV path
Expand All @@ -116,6 +146,12 @@ Feature: there can be only one exclusive lock on a resource
| new | shared |
| new | exclusive |

@personalSpace @skipOnOcV10
Examples:
| dav-path | lock-scope |
| spaces | shared |
| spaces | exclusive |

@files_sharing-app-required
Scenario Outline: a share receiver cannot lock a resource exclusively locked by the owner
Given using <dav-path> DAV path
Expand All @@ -137,6 +173,12 @@ Feature: there can be only one exclusive lock on a resource
| new | shared |
| new | exclusive |

@personalSpace @skipOnOcV10
Examples:
| dav-path | lock-scope |
| spaces | shared |
| spaces | exclusive |

@files_sharing-app-required
Scenario Outline: a share owner cannot lock a resource exclusively locked by a share receiver
Given using <dav-path> DAV path
Expand All @@ -157,3 +199,9 @@ Feature: there can be only one exclusive lock on a resource
| old | exclusive |
| new | shared |
| new | exclusive |

@personalSpace @skipOnOcV10
Examples:
| dav-path | lock-scope |
| spaces | shared |
| spaces | exclusive |
52 changes: 49 additions & 3 deletions tests/acceptance/features/apiWebdavLocks/folder.feature
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ Feature: lock folders
| new | shared |
| new | exclusive |

@personalSpace @skipOnOcV10
Examples:
| dav-path | lock-scope |
| spaces | shared |
| spaces | exclusive |


Scenario Outline: upload to a subfolder of a locked folder
Given using <dav-path> DAV path
And user "Alice" has created folder "PARENT"
Expand All @@ -36,6 +43,12 @@ Feature: lock folders
| new | shared |
| new | exclusive |

@personalSpace @skipOnOcV10
Examples:
| dav-path | lock-scope |
| spaces | shared |
| spaces | exclusive |

@smokeTest
Scenario Outline: create folder in a locked folder
Given using <dav-path> DAV path
Expand All @@ -52,6 +65,12 @@ Feature: lock folders
| new | shared |
| new | exclusive |

@personalSpace @skipOnOcV10
Examples:
| dav-path | lock-scope |
| spaces | shared |
| spaces | exclusive |

Scenario Outline: create folder in a subfolder of a locked folder
Given using <dav-path> DAV path
And user "Alice" has created folder "PARENT"
Expand All @@ -68,6 +87,13 @@ Feature: lock folders
| new | shared |
| new | exclusive |

@personalSpace @skipOnOcV10
Examples:
| dav-path | lock-scope |
| spaces | shared |
| spaces | exclusive |


Scenario Outline: Move file out of a locked folder
Given using <dav-path> DAV path
And user "Alice" has created folder "PARENT"
Expand All @@ -85,6 +111,13 @@ Feature: lock folders
| new | shared |
| new | exclusive |

@personalSpace @skipOnOcV10
Examples:
| dav-path | lock-scope |
| spaces | shared |
| spaces | exclusive |


Scenario Outline: Move file out of a locked sub folder one level higher into locked parent folder
Given using <dav-path> DAV path
And user "Alice" has created folder "PARENT"
Expand All @@ -103,20 +136,33 @@ Feature: lock folders
| new | shared |
| new | exclusive |

@personalSpace @skipOnOcV10
Examples:
| dav-path | lock-scope |
| spaces | shared |
| spaces | exclusive |


Scenario Outline: lockdiscovery of a locked folder
Given using <dav-path> DAV path
Given using old DAV path
And user "Alice" has created folder "PARENT"
And user "Alice" has created a public link share of folder "PARENT" with change permission
And user "Alice" has locked folder "PARENT" setting the following properties
| lockscope | <lock-scope> |
| lockscope | shared |
When user "Alice" gets the following properties of folder "PARENT" using the WebDAV API
| propertyName |
| d:lockdiscovery |
Then the value of the item "//d:lockroot/d:href" in the response to user "Alice" should match "<lock-root>"
Then the value of the item "//d:lockroot/d:href" in the response to user "Alice" should match "/%base_path%\/remote.php\/webdav\/PARENT$/"
And the value of the item "//d:locktoken/d:href" in the response to user "Alice" should match "/^opaquelocktoken:[a-z0-9-]+$/"
Examples:
| dav-path | lock-scope | lock-root |
| old | shared | /%base_path%\/remote.php\/webdav\/PARENT$/ |
| old | exclusive | /%base_path%\/remote.php\/webdav\/PARENT$/ |
| new | shared | /%base_path%\/remote.php\/dav\/files\/%username%\/PARENT$/ |
| new | exclusive | /%base_path%\/remote.php\/dav\/files\/%username%\/PARENT$/ |

@personalSpace @skipOnOcV10
Examples:
| dav-path | lock-scope | lock-root |
| spaces | shared | /%base_path%\/remote.php\/dav\/spaces\/%spaceid%\/PARENT$/ |
| spaces | exclusive | /%base_path%\/remote.php\/dav\/spaces\/%spaceid%\/PARENT$/ |
11 changes: 10 additions & 1 deletion tests/acceptance/features/apiWebdavLocks/publicLink.feature
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ Feature: persistent-locking in case of a public link
| new | shared | new |
| new | exclusive | new |

@skipOnOcV10 @personalSpace
Examples:
| dav-path | lock-scope | webdav_api_version |
| spaces | shared | old |
| spaces | exclusive | old |
| spaces | shared | new |
| spaces | exclusive | new |
| spaces | shared | spaces |
| spaces | exclusive | spaces |

@skipOnOcV10.6 @skipOnOcV10.7
Scenario Outline: Uploading a file into a locked subfolder of a public folder
Given user "Alice" has created a public link share of folder "PARENT" with change permission
Expand Down Expand Up @@ -101,7 +111,6 @@ Feature: persistent-locking in case of a public link
| old | shared |
| old | exclusive |


Examples:
| public-webdav-api-version | lock-scope |
| new | shared |
Expand Down
51 changes: 41 additions & 10 deletions tests/acceptance/features/apiWebdavLocks/requestsWithToken.feature
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ Feature: actions on a locked item are possible if the token is sent with the req
| new | shared |
| new | exclusive |

@personalSpace @skipOnOcV10
Examples:
| dav-path | lock-scope |
| spaces | shared |
| spaces | exclusive |

@smokeTest
Scenario Outline: move a file into a locked folder
Given using <dav-path> DAV path
Expand All @@ -41,6 +47,12 @@ Feature: actions on a locked item are possible if the token is sent with the req
| new | shared |
| new | exclusive |

@personalSpace @skipOnOcV10
Examples:
| dav-path | lock-scope |
| spaces | shared |
| spaces | exclusive |

@smokeTest
Scenario Outline: move a file into a locked folder is impossible when using the wrong token
Given using <dav-path> DAV path
Expand All @@ -63,16 +75,23 @@ Feature: actions on a locked item are possible if the token is sent with the req
| new | shared |
| new | exclusive |

@personalSpace @skipOnOcV10
Examples:
| dav-path | lock-scope |
| spaces | shared |
| spaces | exclusive |

@skipOnOcV10 @issue-34338 @files_sharing-app-required
Scenario Outline: share receiver cannot rename a file in a folder locked by the owner even when sending the locktoken
Given using <dav-path> DAV path
And user "Alice" has created folder "PARENT"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "PARENT/parent.txt"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/PARENT/parent.txt"
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has shared folder "PARENT" with user "Brian"
And user "Alice" has shared folder "/PARENT" with user "Brian"
And user "Brian" has accepted share "/PARENT" offered by user "Alice"
And user "Alice" has locked folder "PARENT" setting the following properties
| lockscope | <lock-scope> |
When user "Brian" moves file "PARENT/parent.txt" to "PARENT/renamed-file.txt" sending the locktoken of file "PARENT" of user "Alice" using the WebDAV API
When user "Brian" moves file "Shares/PARENT/parent.txt" to "Shares/PARENT/renamed-file.txt" sending the locktoken of file "PARENT" of user "Alice" using the WebDAV API
Then the HTTP status code should be "423"
And as "Alice" file "/PARENT/parent.txt" should exist
But as "Alice" file "/PARENT/renamed-file.txt" should not exist
Expand All @@ -83,6 +102,12 @@ Feature: actions on a locked item are possible if the token is sent with the req
| new | shared |
| new | exclusive |

@personalSpace
Examples:
| dav-path | lock-scope |
| spaces | shared |
| spaces | exclusive |

@files_sharing-app-required
Scenario Outline: public cannot overwrite a file in a folder locked by the owner even when sending the locktoken
Given user "Alice" has created folder "PARENT"
Expand Down Expand Up @@ -112,20 +137,26 @@ Feature: actions on a locked item are possible if the token is sent with the req
And user "Brian" has been created with default attributes and without skeleton files
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 shared file "/textfile0.txt" with user "Brian"
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
And user "Alice" has locked file "textfile0.txt" setting the following properties
| lockscope | shared |
And user "Brian" has locked file "textfile0 (2).txt" setting the following properties
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 "200"
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 "textfile0 (2).txt" for user "Brian" should be "from user 0"
When user "Brian" uploads file with content "from user 1" to "textfile0 (2).txt" sending the locktoken of file "textfile0 (2).txt" using the WebDAV API
Then the HTTP status code should be "200"
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 "textfile0 (2).txt" for user "Brian" should be "from user 1"
And the content of file "Shares/textfile0.txt" for user "Brian" should be "from user 1"
Examples:
| dav-path |
| old |
| new |

@personalSpace @skipOnOcV10
Examples:
| dav-path |
| spaces |

0 comments on commit cb7f1f2

Please sign in to comment.