Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only][full-ci]tests: add tests for lock expiration #7777

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions tests/acceptance/features/apiLocks/lockFiles.feature
Original file line number Diff line number Diff line change
Expand Up @@ -367,3 +367,22 @@ Feature: lock files
| new | exclusive |
| spaces | shared |
| spaces | exclusive |


Scenario Outline: lock expiration
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "textfile0.txt"
And user "Alice" has locked file "textfile0.txt" setting the following properties
| lockscope | <lock-scope> |
| timeout | Second-5 |
When the user waits for "5" seconds to expire the lock
Then user "Alice" should be able to upload file "filesForUpload/lorem.txt" to "textfile0.txt"
And 0 locks should be reported for file "textfile0.txt" of user "Alice" by the WebDAV API
Examples:
| dav-path-version | lock-scope |
| old | shared |
| old | exclusive |
| new | shared |
| new | exclusive |
| spaces | shared |
| spaces | exclusive |
11 changes: 11 additions & 0 deletions tests/acceptance/features/bootstrap/WebDavLockingContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,17 @@ public function numberOfLockShouldBeReported(int $count, string $file, string $u
);
}

/**
* @When the user waits for :time seconds to expire the lock
*
* @param int $time
*
* @return void
*/
public function waitForCertainSecondsToExpireTheLock(int $time): void {
\sleep($time);
}

/**
* This will run before EVERY scenario.
* It will set the properties for this object.
Expand Down