From dff58cd5e33003fdf3eb73549c450b76838c6cbe Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 12 Jan 2014 10:29:02 +0000 Subject: Add test for multiple clients sharing a repository As part of this, make every repository operation step require an explicit client name. The v6 reference formats have a client name embedded that is the hostname of my laptop, so make those tests use that name. This fixes what would not have run previously on any system that isn't named havelock. Oops. --- yarns/0050-multiple-clients.yarn | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 yarns/0050-multiple-clients.yarn (limited to 'yarns/0050-multiple-clients.yarn') diff --git a/yarns/0050-multiple-clients.yarn b/yarns/0050-multiple-clients.yarn new file mode 100644 index 00000000..63383654 --- /dev/null +++ b/yarns/0050-multiple-clients.yarn @@ -0,0 +1,40 @@ +Multiple clients sharing a repository +===================================== + +An Obnam backup repository may be shared by multiple clients. There +are a couple of aspects of this that need testing: whether it works at +all, when each client is run in sequence, and whether it works +concurrently, with locks used to exclude other clients from modifying +the shared data. + +The concurrency is really hard to test well. There is a non-yarn test +for locking, which we assume will test that, and so in this yarn test +suite we do not test concurrency at all. + + SCENARIO two clients sharing a repository + GIVEN directory L1 with interesting filesystem objects + AND directory L2 with interesting filesystem objects + AND a manifest of directory L1 in M1 + AND a manifest of directory L2 in M2 + WHEN user U1 backs up directory L1 to repository R + WHEN user U2 backs up directory L2 to repository R + AND user U1 restores their latest generation in repository R into X1 + AND user U2 restores their latest generation in repository R into X2 + THEN L1, restored to X1, matches manifest M1 + AND L2, restored to X2, matches manifest M2 + +In addition to backing up, we check for forget working. We first make +a change to both sets of live data, and + + GIVEN 1kB of new data in directory L1 + AND 2kB of new data in directory L2 + AND a manifest of directory L1 in M1A + AND a manifest of directory L2 in M2A + WHEN user U1 backs up directory L1 to repository R + AND user U2 backs up directory L2 to repository R + AND user U1 forgets the oldest generation in repository R + AND user U2 forgets the oldest generation in repository R + AND user U1 restores their latest generation in repository R into X1A + AND user U2 restores their latest generation in repository R into X2A + THEN L1, restored to X1A, matches manifest M1A + AND L2, restored to X2A, matches manifest M2A -- cgit v1.2.1