From 11dcf94f7e9533d732c518790dc5aa7bcf94995d Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Wed, 30 Jan 2019 14:46:44 +0545 Subject: [PATCH] check lock timeout --- .../apiWebdavLocks/publicLink.feature | 197 ---------------- .../publicLinkLockdiscovery.feature | 221 ++++++++++++++++++ .../apiWebdavLocks/setTimeout.feature | 146 ++++++++++++ .../bootstrap/WebDavLockingContext.php | 5 +- 4 files changed, 370 insertions(+), 199 deletions(-) create mode 100644 tests/acceptance/features/apiWebdavLocks/publicLinkLockdiscovery.feature create mode 100644 tests/acceptance/features/apiWebdavLocks/setTimeout.feature diff --git a/tests/acceptance/features/apiWebdavLocks/publicLink.feature b/tests/acceptance/features/apiWebdavLocks/publicLink.feature index 8d37f5434630..19d59a14449c 100644 --- a/tests/acceptance/features/apiWebdavLocks/publicLink.feature +++ b/tests/acceptance/features/apiWebdavLocks/publicLink.feature @@ -75,200 +75,3 @@ Feature: persistent-locking in case of a public link | lockscope | shared | Then the HTTP status code should be "423" And the value of the item "//d:no-conflicting-lock/d:href" in the response should be "" - - Scenario Outline: lockdiscovery root of public link when root is locked - Given user "user0" has created a public link share of folder "PARENT" with change permission - And user "user0" has locked folder "PARENT" setting following properties - | lockscope | | - When the public gets the following properties of entry "/" in the last created public link using the WebDAV API - | d:lockdiscovery | - Then the value of the item "//d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/$/" - And the value of the item "//d:locktoken/d:href" in the response should be "opaquelocktoken:" - Examples: - | lock-scope | - | shared | - | exclusive | - - Scenario Outline: lockdiscovery subfolder of a locked public link when root is locked - Given user "user0" has created a public link share of folder "PARENT" with change permission - And user "user0" has locked folder "PARENT" setting following properties - | lockscope | | - When the public gets the following properties of entry "/CHILD" in the last created public link using the WebDAV API - | d:lockdiscovery | - Then the value of the item "//d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/$/" - And the value of the item "//d:locktoken/d:href" in the response should be "opaquelocktoken:" - Examples: - | lock-scope | - | shared | - | exclusive | - - Scenario Outline: lockdiscovery subfolder of a public link when subfolder is locked - Given user "user0" has created a public link share of folder "PARENT" with change permission - And user "user0" has locked folder "PARENT/CHILD" setting following properties - | lockscope | | - When the public gets the following properties of entry "/CHILD" in the last created public link using the WebDAV API - | d:lockdiscovery | - Then the value of the item "//d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/CHILD$/" - And the value of the item "//d:locktoken/d:href" in the response should be "opaquelocktoken:" - Examples: - | lock-scope | - | shared | - | exclusive | - - Scenario Outline: lockdiscovery file in a subfolder of a public link when subfolder is locked - Given user "user0" has created a public link share of folder "PARENT" with change permission - And user "user0" has locked folder "PARENT/CHILD" setting following properties - | lockscope | | - When the public gets the following properties of entry "/CHILD/child.txt" in the last created public link using the WebDAV API - | d:lockdiscovery | - Then the value of the item "//d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/CHILD$/" - And the value of the item "//d:locktoken/d:href" in the response should be "opaquelocktoken:" - Examples: - | lock-scope | - | shared | - | exclusive | - - Scenario Outline: lockdiscovery file in a subfolder of a public link when root is locked - Given user "user0" has created a public link share of folder "PARENT" with change permission - And user "user0" has locked folder "PARENT" setting following properties - | lockscope | | - When the public gets the following properties of entry "/CHILD/child.txt" in the last created public link using the WebDAV API - | d:lockdiscovery | - Then the value of the item "//d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/$/" - And the value of the item "//d:locktoken/d:href" in the response should be "opaquelocktoken:" - Examples: - | lock-scope | - | shared | - | exclusive | - - Scenario Outline: lockdiscovery file in a subfolder of a public link when the file is locked - Given user "user0" has created a public link share of folder "PARENT" with change permission - And user "user0" has locked folder "PARENT/CHILD/child.txt" setting following properties - | lockscope | | - When the public gets the following properties of entry "/CHILD/child.txt" in the last created public link using the WebDAV API - | d:lockdiscovery | - Then the value of the item "//d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/CHILD\/child.txt$/" - And the value of the item "//d:locktoken/d:href" in the response should be "opaquelocktoken:" - Examples: - | lock-scope | - | shared | - | exclusive | - - Scenario Outline: lockdiscovery file in a subfolder of a public link when the folder above the public link is locked - Given user "user0" has created a public link share of folder "PARENT/CHILD" with change permission - And user "user0" has locked folder "PARENT" setting following properties - | lockscope | | - When the public gets the following properties of entry "/child.txt" in the last created public link using the WebDAV API - | d:lockdiscovery | - Then the value of the item "//d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/$/" - And the value of the item "//d:locktoken/d:href" in the response should be "opaquelocktoken:" - - Examples: - | lock-scope | - | shared | - | exclusive | - - Scenario Outline: lockdiscovery root of public link when root is locked by public - Given user "user0" has created a public link share of folder "PARENT" with change permission - And the public has locked the last public shared folder setting following properties - | lockscope | | - When the public gets the following properties of entry "/" in the last created public link using the WebDAV API - | d:lockdiscovery | - Then the value of the item "//d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/$/" - And the value of the item "//d:locktoken/d:href" in the response should be "opaquelocktoken:" - Examples: - | lock-scope | - | shared | - | exclusive | - - Scenario Outline: lockdiscovery subfolder of public link when root is locked by public - Given user "user0" has created a public link share of folder "PARENT" with change permission - And the public has locked the last public shared folder setting following properties - | lockscope | | - When the public gets the following properties of entry "/CHILD" in the last created public link using the WebDAV API - | d:lockdiscovery | - Then the value of the item "//d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/$/" - And the value of the item "//d:locktoken/d:href" in the response should be "opaquelocktoken:" - Examples: - | lock-scope | - | shared | - | exclusive | - - Scenario Outline: lockdiscovery subfolder of public link when subfolder is locked by public - Given user "user0" has created a public link share of folder "PARENT" with change permission - And the public has locked "CHILD" in the last public shared folder setting following properties - | lockscope | | - When the public gets the following properties of entry "/CHILD" in the last created public link using the WebDAV API - | d:lockdiscovery | - Then the value of the item "//d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/CHILD$/" - And the value of the item "//d:locktoken/d:href" in the response should be "opaquelocktoken:" - Examples: - | lock-scope | - | shared | - | exclusive | - - Scenario: lockdiscovery root of public link when root is locked by public and user - Given user "user0" has created a public link share of folder "PARENT" with change permission - And user "user0" has locked folder "PARENT" setting following properties - | lockscope | shared | - And the public has locked the last public shared folder setting following properties - | lockscope | shared | - When the public gets the following properties of entry "/" in the last created public link using the WebDAV API - | d:lockdiscovery | - Then the value of the item "//d:activelock[1]/d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/$/" - And the value of the item "//d:activelock[2]/d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/$/" - And the value of the item "//d:activelock[1]/d:locktoken/d:href" in the response should be "opaquelocktoken:" - And the value of the item "//d:activelock[2]/d:locktoken/d:href" in the response should be "opaquelocktoken:" - - Scenario: lockdiscovery subfolder of public link when root is locked by user and subfolder is locked by public - Given user "user0" has created a public link share of folder "PARENT" with change permission - And user "user0" has locked folder "PARENT" setting following properties - | lockscope | shared | - And the public has locked "CHILD" in the last public shared folder setting following properties - | lockscope | shared | - When the public gets the following properties of entry "/CHILD" in the last created public link using the WebDAV API - | d:lockdiscovery | - Then the value of the item "//d:activelock[1]/d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/$/" - And the value of the item "//d:activelock[2]/d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/CHILD$/" - And the value of the item "//d:activelock[1]/d:locktoken/d:href" in the response should be "opaquelocktoken:" - And the value of the item "//d:activelock[2]/d:locktoken/d:href" in the response should be "opaquelocktoken:" - - Scenario: lockdiscovery root of public link when user has locked folder above public link and public has locked root of public link - Given user "user0" has created a public link share of folder "PARENT/CHILD" with change permission - And user "user0" has locked folder "PARENT" setting following properties - | lockscope | shared | - And the public has locked "/" in the last public shared folder setting following properties - | lockscope | shared | - When the public gets the following properties of entry "/" in the last created public link using the WebDAV API - | d:lockdiscovery | - Then the value of the item "//d:activelock[1]/d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/$/" - And the value of the item "//d:activelock[2]/d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/$/" - And the value of the item "//d:activelock[1]/d:locktoken/d:href" in the response should be "opaquelocktoken:" - And the value of the item "//d:activelock[2]/d:locktoken/d:href" in the response should be "opaquelocktoken:" - - Scenario: lockdiscovery subfolder of public link when user has locked folder above public link and public has locked subfolder of public link - Given user "user0" has created a public link share of folder "PARENT/CHILD" with change permission - And user "user0" has created folder "PARENT/CHILD/GRANDCHILD" - And user "user0" has locked folder "PARENT" setting following properties - | lockscope | shared | - And the public has locked "/GRANDCHILD" in the last public shared folder setting following properties - | lockscope | shared | - When the public gets the following properties of entry "/GRANDCHILD" in the last created public link using the WebDAV API - | d:lockdiscovery | - Then the value of the item "//d:activelock[1]/d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/$/" - And the value of the item "//d:activelock[2]/d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/GRANDCHILD$/" - And the value of the item "//d:activelock[1]/d:locktoken/d:href" in the response should be "opaquelocktoken:" - And the value of the item "//d:activelock[2]/d:locktoken/d:href" in the response should be "opaquelocktoken:" - - Scenario: lockdiscovery file in public link when user has locked folder above public link and public has locked file inside of public link - Given user "user0" has created a public link share of folder "PARENT/CHILD" with change permission - And user "user0" has locked folder "PARENT" setting following properties - | lockscope | shared | - And the public has locked "/child.txt" in the last public shared folder setting following properties - | lockscope | shared | - When the public gets the following properties of entry "/child.txt" in the last created public link using the WebDAV API - | d:lockdiscovery | - Then the value of the item "//d:activelock[1]/d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/$/" - And the value of the item "//d:activelock[2]/d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/child.txt$/" - And the value of the item "//d:activelock[1]/d:locktoken/d:href" in the response should be "opaquelocktoken:" - And the value of the item "//d:activelock[2]/d:locktoken/d:href" in the response should be "opaquelocktoken:" diff --git a/tests/acceptance/features/apiWebdavLocks/publicLinkLockdiscovery.feature b/tests/acceptance/features/apiWebdavLocks/publicLinkLockdiscovery.feature new file mode 100644 index 000000000000..ac60e51aa3ce --- /dev/null +++ b/tests/acceptance/features/apiWebdavLocks/publicLinkLockdiscovery.feature @@ -0,0 +1,221 @@ +@api @TestAlsoOnExternalUserBackend @smokeTest @public_link_share-feature-required +Feature: LOCKDISCOVERY for public links + + Background: + Given user "user0" has been created with default attributes + + Scenario Outline: lockdiscovery root of public link when root is locked + Given user "user0" has created a public link share of folder "PARENT" with change permission + And user "user0" has locked folder "PARENT" setting following properties + | lockscope | | + When the public gets the following properties of entry "/" in the last created public link using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/$/" + And the value of the item "//d:locktoken/d:href" in the response should be "opaquelocktoken:" + And the value of the item "//d:timeout" in the response should match "/Second-\d+/" + Examples: + | lock-scope | + | shared | + | exclusive | + + Scenario Outline: lockdiscovery subfolder of a locked public link when root is locked + Given user "user0" has created a public link share of folder "PARENT" with change permission + And user "user0" has locked folder "PARENT" setting following properties + | lockscope | | + When the public gets the following properties of entry "/CHILD" in the last created public link using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/$/" + And the value of the item "//d:locktoken/d:href" in the response should be "opaquelocktoken:" + And the value of the item "//d:timeout" in the response should match "/Second-\d+/" + Examples: + | lock-scope | + | shared | + | exclusive | + + Scenario Outline: lockdiscovery subfolder of a public link when subfolder is locked + Given user "user0" has created a public link share of folder "PARENT" with change permission + And user "user0" has locked folder "PARENT/CHILD" setting following properties + | lockscope | | + When the public gets the following properties of entry "/CHILD" in the last created public link using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/CHILD$/" + And the value of the item "//d:locktoken/d:href" in the response should be "opaquelocktoken:" + And the value of the item "//d:timeout" in the response should match "/Second-\d+/" + Examples: + | lock-scope | + | shared | + | exclusive | + + Scenario Outline: lockdiscovery file in a subfolder of a public link when subfolder is locked + Given user "user0" has created a public link share of folder "PARENT" with change permission + And user "user0" has locked folder "PARENT/CHILD" setting following properties + | lockscope | | + When the public gets the following properties of entry "/CHILD/child.txt" in the last created public link using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/CHILD$/" + And the value of the item "//d:locktoken/d:href" in the response should be "opaquelocktoken:" + And the value of the item "//d:timeout" in the response should match "/Second-\d+/" + Examples: + | lock-scope | + | shared | + | exclusive | + + Scenario Outline: lockdiscovery file in a subfolder of a public link when root is locked + Given user "user0" has created a public link share of folder "PARENT" with change permission + And user "user0" has locked folder "PARENT" setting following properties + | lockscope | | + When the public gets the following properties of entry "/CHILD/child.txt" in the last created public link using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/$/" + And the value of the item "//d:locktoken/d:href" in the response should be "opaquelocktoken:" + And the value of the item "//d:timeout" in the response should match "/Second-\d+/" + Examples: + | lock-scope | + | shared | + | exclusive | + + Scenario Outline: lockdiscovery file in a subfolder of a public link when the file is locked + Given user "user0" has created a public link share of folder "PARENT" with change permission + And user "user0" has locked folder "PARENT/CHILD/child.txt" setting following properties + | lockscope | | + When the public gets the following properties of entry "/CHILD/child.txt" in the last created public link using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/CHILD\/child.txt$/" + And the value of the item "//d:locktoken/d:href" in the response should be "opaquelocktoken:" + And the value of the item "//d:timeout" in the response should match "/Second-\d+/" + Examples: + | lock-scope | + | shared | + | exclusive | + + Scenario Outline: lockdiscovery file in a subfolder of a public link when the folder above the public link is locked + Given user "user0" has created a public link share of folder "PARENT/CHILD" with change permission + And user "user0" has locked folder "PARENT" setting following properties + | lockscope | | + When the public gets the following properties of entry "/child.txt" in the last created public link using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/$/" + And the value of the item "//d:locktoken/d:href" in the response should be "opaquelocktoken:" + And the value of the item "//d:timeout" in the response should match "/Second-\d+/" + Examples: + | lock-scope | + | shared | + | exclusive | + + Scenario Outline: lockdiscovery root of public link when root is locked by public + Given user "user0" has created a public link share of folder "PARENT" with change permission + And the public has locked the last public shared folder setting following properties + | lockscope | | + When the public gets the following properties of entry "/" in the last created public link using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/$/" + And the value of the item "//d:locktoken/d:href" in the response should be "opaquelocktoken:" + And the value of the item "//d:timeout" in the response should match "/Second-\d+/" + Examples: + | lock-scope | + | shared | + | exclusive | + + Scenario Outline: lockdiscovery subfolder of public link when root is locked by public + Given user "user0" has created a public link share of folder "PARENT" with change permission + And the public has locked the last public shared folder setting following properties + | lockscope | | + When the public gets the following properties of entry "/CHILD" in the last created public link using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/$/" + And the value of the item "//d:locktoken/d:href" in the response should be "opaquelocktoken:" + And the value of the item "//d:timeout" in the response should match "/Second-\d+/" + Examples: + | lock-scope | + | shared | + | exclusive | + + Scenario Outline: lockdiscovery subfolder of public link when subfolder is locked by public + Given user "user0" has created a public link share of folder "PARENT" with change permission + And the public has locked "CHILD" in the last public shared folder setting following properties + | lockscope | | + When the public gets the following properties of entry "/CHILD" in the last created public link using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/CHILD$/" + And the value of the item "//d:locktoken/d:href" in the response should be "opaquelocktoken:" + And the value of the item "//d:timeout" in the response should match "/Second-\d+/" + Examples: + | lock-scope | + | shared | + | exclusive | + + Scenario: lockdiscovery root of public link when root is locked by public and user + Given user "user0" has created a public link share of folder "PARENT" with change permission + And user "user0" has locked folder "PARENT" setting following properties + | lockscope | shared | + And the public has locked the last public shared folder setting following properties + | lockscope | shared | + When the public gets the following properties of entry "/" in the last created public link using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:activelock[1]/d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/$/" + And the value of the item "//d:activelock[2]/d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/$/" + And the value of the item "//d:activelock[1]/d:locktoken/d:href" in the response should be "opaquelocktoken:" + And the value of the item "//d:activelock[2]/d:locktoken/d:href" in the response should be "opaquelocktoken:" + And the value of the item "//d:activelock[1]/d:timeout" in the response should match "/Second-\d+/" + And the value of the item "//d:activelock[2]/d:timeout" in the response should match "/Second-\d+/" + + Scenario: lockdiscovery subfolder of public link when root is locked by user and subfolder is locked by public + Given user "user0" has created a public link share of folder "PARENT" with change permission + And user "user0" has locked folder "PARENT" setting following properties + | lockscope | shared | + And the public has locked "CHILD" in the last public shared folder setting following properties + | lockscope | shared | + When the public gets the following properties of entry "/CHILD" in the last created public link using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:activelock[1]/d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/$/" + And the value of the item "//d:activelock[2]/d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/CHILD$/" + And the value of the item "//d:activelock[1]/d:locktoken/d:href" in the response should be "opaquelocktoken:" + And the value of the item "//d:activelock[2]/d:locktoken/d:href" in the response should be "opaquelocktoken:" + And the value of the item "//d:activelock[1]/d:timeout" in the response should match "/Second-\d+/" + And the value of the item "//d:activelock[2]/d:timeout" in the response should match "/Second-\d+/" + + Scenario: lockdiscovery root of public link when user has locked folder above public link and public has locked root of public link + Given user "user0" has created a public link share of folder "PARENT/CHILD" with change permission + And user "user0" has locked folder "PARENT" setting following properties + | lockscope | shared | + And the public has locked "/" in the last public shared folder setting following properties + | lockscope | shared | + When the public gets the following properties of entry "/" in the last created public link using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:activelock[1]/d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/$/" + And the value of the item "//d:activelock[2]/d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/$/" + And the value of the item "//d:activelock[1]/d:locktoken/d:href" in the response should be "opaquelocktoken:" + And the value of the item "//d:activelock[2]/d:locktoken/d:href" in the response should be "opaquelocktoken:" + And the value of the item "//d:activelock[1]/d:timeout" in the response should match "/Second-\d+/" + And the value of the item "//d:activelock[2]/d:timeout" in the response should match "/Second-\d+/" + + Scenario: lockdiscovery subfolder of public link when user has locked folder above public link and public has locked subfolder of public link + Given user "user0" has created a public link share of folder "PARENT/CHILD" with change permission + And user "user0" has created folder "PARENT/CHILD/GRANDCHILD" + And user "user0" has locked folder "PARENT" setting following properties + | lockscope | shared | + And the public has locked "/GRANDCHILD" in the last public shared folder setting following properties + | lockscope | shared | + When the public gets the following properties of entry "/GRANDCHILD" in the last created public link using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:activelock[1]/d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/$/" + And the value of the item "//d:activelock[2]/d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/GRANDCHILD$/" + And the value of the item "//d:activelock[1]/d:locktoken/d:href" in the response should be "opaquelocktoken:" + And the value of the item "//d:activelock[2]/d:locktoken/d:href" in the response should be "opaquelocktoken:" + And the value of the item "//d:activelock[1]/d:timeout" in the response should match "/Second-\d+/" + And the value of the item "//d:activelock[2]/d:timeout" in the response should match "/Second-\d+/" + + Scenario: lockdiscovery file in public link when user has locked folder above public link and public has locked file inside of public link + Given user "user0" has created a public link share of folder "PARENT/CHILD" with change permission + And user "user0" has locked folder "PARENT" setting following properties + | lockscope | shared | + And the public has locked "/child.txt" in the last public shared folder setting following properties + | lockscope | shared | + When the public gets the following properties of entry "/child.txt" in the last created public link using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:activelock[1]/d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/$/" + And the value of the item "//d:activelock[2]/d:lockroot/d:href" in the response should match "/%base_path%\/public.php\/webdav\/child.txt$/" + And the value of the item "//d:activelock[1]/d:locktoken/d:href" in the response should be "opaquelocktoken:" + And the value of the item "//d:activelock[2]/d:locktoken/d:href" in the response should be "opaquelocktoken:" + And the value of the item "//d:activelock[1]/d:timeout" in the response should match "/Second-\d+/" + And the value of the item "//d:activelock[2]/d:timeout" in the response should match "/Second-\d+/" diff --git a/tests/acceptance/features/apiWebdavLocks/setTimeout.feature b/tests/acceptance/features/apiWebdavLocks/setTimeout.feature new file mode 100644 index 000000000000..840411e7e578 --- /dev/null +++ b/tests/acceptance/features/apiWebdavLocks/setTimeout.feature @@ -0,0 +1,146 @@ +@api @TestAlsoOnExternalUserBackend @smokeTest @public_link_share-feature-required +Feature: set timeouts of LOCKS + + Background: + Given user "user0" has been created with default attributes + + Scenario Outline: set timeout on folder + Given using DAV path + When user "user0" locks folder "PARENT" using the WebDAV API setting following properties + | lockscope | shared | + | timeout | | + And user "user0" gets the following properties of folder "PARENT" using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:timeout" in the response should match "" + When user "user0" gets the following properties of folder "PARENT/CHILD" using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:timeout" in the response should match "" + When user "user0" gets the following properties of folder "PARENT/parent.txt" using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:timeout" in the response should match "" + Examples: + | dav-path | timeout | result | + | old | second-999 | /Second-\d{3}$/ | + | old | second-99999999 | /Second-\d{5}$/ | + | old | infinite | /Second-\d{5}$/ | + | old | second--1 | /Second-\d{5}$/ | + | old | second-0 | /Second-\d{4}$/ | + | new | second-999 | /Second-\d{3}$/ | + | new | second-99999999 | /Second-\d{5}$/ | + | new | infinite | /Second-\d{5}$/ | + | new | second--1 | /Second-\d{5}$/ | + | new | second-0 | /Second-\d{4}$/ | + + Scenario Outline: as owner set timeout on folder as receiver check it + Given using DAV path + And user "user1" has been created with default attributes + And user "user0" has shared folder "PARENT" with user "user1" + When user "user0" locks folder "PARENT" using the WebDAV API setting following properties + | lockscope | shared | + | timeout | | + And user "user1" gets the following properties of folder "PARENT (2)" using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:timeout" in the response should match "" + When user "user1" gets the following properties of folder "PARENT (2)/CHILD" using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:timeout" in the response should match "" + When user "user1" gets the following properties of folder "PARENT (2)/parent.txt" using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:timeout" in the response should match "" + Examples: + | dav-path | timeout | result | + | old | second-999 | /Second-\d{3}$/ | + | old | second-99999999 | /Second-\d{5}$/ | + | old | infinite | /Second-\d{5}$/ | + | old | second--1 | /Second-\d{5}$/ | + | old | second-0 | /Second-\d{4}$/ | + | new | second-999 | /Second-\d{3}$/ | + | new | second-99999999 | /Second-\d{5}$/ | + | new | infinite | /Second-\d{5}$/ | + | new | second--1 | /Second-\d{5}$/ | + | new | second-0 | /Second-\d{4}$/ | + + Scenario Outline: as share receiver set timeout on folder as owner check it + Given using DAV path + And user "user1" has been created with default attributes + And user "user0" has shared folder "PARENT" with user "user1" + When user "user1" locks folder "PARENT (2)" using the WebDAV API setting following properties + | lockscope | shared | + | timeout | | + And user "user0" gets the following properties of folder "PARENT" using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:timeout" in the response should match "" + When user "user0" gets the following properties of folder "PARENT/CHILD" using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:timeout" in the response should match "" + When user "user0" gets the following properties of folder "PARENT/parent.txt" using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:timeout" in the response should match "" + Examples: + | dav-path | timeout | result | + | old | second-999 | /Second-\d{3}$/ | + | old | second-99999999 | /Second-\d{5}$/ | + | old | infinite | /Second-\d{5}$/ | + | old | second--1 | /Second-\d{5}$/ | + | old | second-0 | /Second-\d{4}$/ | + | new | second-999 | /Second-\d{3}$/ | + | new | second-99999999 | /Second-\d{5}$/ | + | new | infinite | /Second-\d{5}$/ | + | new | second--1 | /Second-\d{5}$/ | + | new | second-0 | /Second-\d{4}$/ | + + Scenario Outline: as owner set timeout on folder as public check it + Given using DAV path + And user "user0" has created a public link share of folder "PARENT" + When user "user0" locks folder "PARENT" using the WebDAV API setting following properties + | lockscope | shared | + | timeout | | + And the public gets the following properties of entry "/" in the last created public link using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:timeout" in the response should match "" + When the public gets the following properties of entry "/CHILD" in the last created public link using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:timeout" in the response should match "" + When the public gets the following properties of entry "/parent.txt" in the last created public link using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:timeout" in the response should match "" + Examples: + | dav-path | timeout | result | + | old | second-999 | /Second-\d{3}$/ | + | old | second-99999999 | /Second-\d{5}$/ | + | old | infinite | /Second-\d{5}$/ | + | old | second--1 | /Second-\d{5}$/ | + | old | second-0 | /Second-\d{4}$/ | + | new | second-999 | /Second-\d{3}$/ | + | new | second-99999999 | /Second-\d{5}$/ | + | new | infinite | /Second-\d{5}$/ | + | new | second--1 | /Second-\d{5}$/ | + | new | second-0 | /Second-\d{4}$/ | + + Scenario Outline: as public set timeout on folder as owner check it + Given using DAV path + And user "user0" has created a public link share of folder "PARENT" + When the public locks the last public shared folder using the WebDAV API setting following properties + | lockscope | shared | + | timeout | | + And user "user0" gets the following properties of folder "PARENT" using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:timeout" in the response should match "" + When user "user0" gets the following properties of folder "PARENT/CHILD" using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:timeout" in the response should match "" + When user "user0" gets the following properties of folder "PARENT/parent.txt" using the WebDAV API + | d:lockdiscovery | + Then the value of the item "//d:timeout" in the response should match "" + Examples: + | dav-path | timeout | result | + | old | second-999 | /Second-\d{3}$/ | + | old | second-99999999 | /Second-\d{5}$/ | + | old | infinite | /Second-\d{5}$/ | + | old | second--1 | /Second-\d{5}$/ | + | old | second-0 | /Second-\d{4}$/ | + | new | second-999 | /Second-\d{3}$/ | + | new | second-99999999 | /Second-\d{5}$/ | + | new | infinite | /Second-\d{5}$/ | + | new | second--1 | /Second-\d{5}$/ | + | new | second-0 | /Second-\d{4}$/ | \ No newline at end of file diff --git a/tests/acceptance/features/bootstrap/WebDavLockingContext.php b/tests/acceptance/features/bootstrap/WebDavLockingContext.php index 2891d2837661..edae4e1ea9ee 100644 --- a/tests/acceptance/features/bootstrap/WebDavLockingContext.php +++ b/tests/acceptance/features/bootstrap/WebDavLockingContext.php @@ -73,8 +73,9 @@ public function lockFileUsingWebDavAPI( $headers = []; $propertiesRows = $properties->getRows(); foreach ($propertiesRows as $property) { - if ($property[0] === "depth") { //depth is set in the header not in the xml - $headers["Depth"] = $property[1]; + if ($property[0] === "depth" || $property[0] === "timeout") { + //properties that are set in the header not in the xml + $headers[$property[0]] = $property[1]; } else { $body .= ""; }