diff options
author | Lars Wirzenius <liw@liw.fi> | 2014-04-16 08:17:56 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2014-04-16 08:17:56 +0100 |
commit | fed6a6131a0a791b54946900ef3587c25be33da7 (patch) | |
tree | 55cbd3e53f1adc507167a034581005652720ff56 /yarns/0090-lock-handling.yarn | |
parent | 28a8609455a627f941fba76f87db118aeadeef22 (diff) | |
download | obnam-fed6a6131a0a791b54946900ef3587c25be33da7.tar.gz |
Add scenario for forcing another client's lock
Diffstat (limited to 'yarns/0090-lock-handling.yarn')
-rw-r--r-- | yarns/0090-lock-handling.yarn | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/yarns/0090-lock-handling.yarn b/yarns/0090-lock-handling.yarn index fe509c53..edf40a96 100644 --- a/yarns/0090-lock-handling.yarn +++ b/yarns/0090-lock-handling.yarn @@ -32,3 +32,34 @@ Now we can force the lock open and verify that a backup now succeeds. WHEN user U forces open the lock on repository R AND user U attempts to back up directory L to repository R THEN the attempt succeeded + + +Forcing of someone else's lock +------------------------------ + +We also need to force a lock by someone else. This is otherwise +similar to the basic lock forcing scenario, but the lock is held by a +different client. The lock is created before the second client even +gets added to the client list, to maximise the difficulty. + + SCENARIO force someone else's lock + +We first create the repository and back up some data as the first +client. + + GIVEN 1kB of new data in directory L + WHEN user U1 backs up directory L to repository R + +We then lock the repository as the first user, and verify that a +backup now fails when run as the second client. + + AND user U1 locks repository R + AND user U2 attempts to back up directory L to repository R + THEN the attempt failed with exit code 1 + AND the error message matches "R681AEX" + +The second client can force the lock open and successfully back up. + + WHEN user U2 forces open the lock on repository R + AND user U2 attempts to back up directory L to repository R + THEN the attempt succeeded |