summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--yarns/0030-basics.yarn26
-rw-r--r--yarns/0040-generations.yarn24
-rw-r--r--yarns/0100-fuse.yarn8
-rw-r--r--yarns/9000-implements.yarn45
-rw-r--r--yarns/obnam.sh1
5 files changed, 43 insertions, 61 deletions
diff --git a/yarns/0030-basics.yarn b/yarns/0030-basics.yarn
index 17a21288..5c86b227 100644
--- a/yarns/0030-basics.yarn
+++ b/yarns/0030-basics.yarn
@@ -18,11 +18,11 @@ Just a few files with a bit of data in each. This is what every backup
program must be able to handle.
SCENARIO backup simple data
- GIVEN 100kB of live data
- AND a manifest of live data in M
- WHEN user backs up live data
+ GIVEN 100kB of new data in directory L
+ AND a manifest of directory L in M
+ WHEN user backs up directory L
AND user restores their latest generation into X
- THEN live data, restored to X, matches manifest M
+ THEN L, restored to X, matches manifest M
AND user can fsck the repository
Backup sparse files
@@ -45,12 +45,12 @@ sparse. We'll settle for making sure the restored file does not use
more disk space than the one in live data.
SCENARIO backup a sparse file
- GIVEN a file S in live data, with a hole, data, a hole
- AND a manifest of live data in M
- WHEN user backs up live data
+ GIVEN a file S in L, with a hole, data, a hole
+ AND a manifest of directory L in M
+ WHEN user backs up directory L
AND user restores their latest generation into X
- THEN live data, restored to X, matches manifest M
- AND restored file S in X doesn't use more disk
+ THEN L, restored to X, matches manifest M
+ AND file S from L, restored in X doesn't use more disk
Backup all interesting file and metadata types
----------------------------------------------
@@ -80,8 +80,8 @@ other parts of Obnam's test suite as well, and this reduces code
duplication.
SCENARIO backup non-basic filesystem objects
- GIVEN live data with interesting filesystem objects
- AND a manifest of live data in M
- WHEN user backs up live data
+ GIVEN directory L with interesting filesystem objects
+ AND a manifest of directory L in M
+ WHEN user backs up directory L
AND user restores their latest generation into X
- THEN live data, restored to X, matches manifest M
+ THEN L, restored to X, matches manifest M
diff --git a/yarns/0040-generations.yarn b/yarns/0040-generations.yarn
index 61de6ce4..753540c2 100644
--- a/yarns/0040-generations.yarn
+++ b/yarns/0040-generations.yarn
@@ -22,16 +22,16 @@ to actually happen, we'll add a regression test when we find the
problem.)
SCENARIO backup two generations
- GIVEN 1MB of live data
- AND a manifest of live data in G1
- WHEN user backs up live data
- GIVEN 2MB of live data
- AND a manifest of live data in G2
- WHEN user backs up live data
+ GIVEN 1MB of new data in directory L
+ AND a manifest of directory L in G1
+ WHEN user backs up directory L
+ GIVEN 2MB of new data in directory L
+ AND a manifest of directory L in G2
+ WHEN user backs up directory L
AND user restores generation 1 to R1
AND user restores generation 2 to R2
- THEN live data, restored to R1, matches manifest G1
- AND live data, restored to R2, matches manifest G2
+ THEN L, restored to R1, matches manifest G1
+ AND L, restored to R2, matches manifest G2
Listing generations (`obnam generations`, `obnam genids`)
-------------------
@@ -40,10 +40,10 @@ When we make some number of generations, the Obnam generation listing
commands should show that number of generations.
SCENARIO list generations
- GIVEN 1MB of live data
- WHEN user backs up live data
- AND user backs up live data
- AND user backs up live data
+ GIVEN 1MB of new data in directory L
+ WHEN user backs up directory L
+ AND user backs up directory L
+ AND user backs up directory L
THEN user sees 3 generations
AND user sees 3 generation ids
diff --git a/yarns/0100-fuse.yarn b/yarns/0100-fuse.yarn
index 303399d9..53ddd21c 100644
--- a/yarns/0100-fuse.yarn
+++ b/yarns/0100-fuse.yarn
@@ -7,11 +7,11 @@ test suite concentrates on verifying that at least the basics work.
SCENARIO Browsing backups with FUSE plugin
ASSUMING user is in group fuse
- GIVEN live data with interesting filesystem objects
- AND a manifest of live data in M
- WHEN user backs up live data
+ GIVEN directory L with interesting filesystem objects
+ AND a manifest of directory L in M
+ WHEN user backs up directory L
AND user FUSE mounts their repository at F
- THEN live data, restored to F/latest, matches manifest M
+ THEN L, restored to F/latest, matches manifest M
FINALLY unmount repository F
We can only run this test if the user is in the `fuse` group. This may
diff --git a/yarns/9000-implements.yarn b/yarns/9000-implements.yarn
index 5d05b7dd..d46885d3 100644
--- a/yarns/9000-implements.yarn
+++ b/yarns/9000-implements.yarn
@@ -13,8 +13,6 @@ variables that can be used by any IMPLEMENTS sections.
Variables:
-* `LIVEDATA`: the pathname of the directory where live data is stored
- (for single-client scenarios).
* `REPO`: the pathname of the backup repository.
Functions:
@@ -31,13 +29,9 @@ Live data generation
--------------------
The simplest way to generate test live data is to just generate the
-necessary number of bytes, split over some number of files. This works
-for single-client scenarios.
-
- IMPLEMENTS GIVEN (\S+) of live data
- genbackupdata --quiet --create "$MATCH_1" "$LIVEDATA"
-
-Generate requested amount of data in the named directory.
+necessary number of bytes, split over some number of files. We have
+the user name the directory explicitly, to avoid hidden dependencies
+between steps.
IMPLEMENTS GIVEN (\S+) of new data in directory (\S+)
genbackupdata --quiet --create "$MATCH_1" "$DATADIR/$MATCH_2"
@@ -47,17 +41,17 @@ hole in it, and it may matter where the hole is: at the beginning,
middle, or end of the file. Thus, we provide a way for scenarios to
specify that.
- IMPLEMENTS GIVEN a file (\S+) in live data, with (.+)
- mkdir -p "$LIVEDATA"
- "$SRCDIR/mksparse" "$LIVEDATA/$MATCH_1" "$MATCH_2"
+ IMPLEMENTS GIVEN a file (\S+) in (\S+), with (.+)
+ mkdir -p "$DATADIR/$MATCH_2"
+ "$SRCDIR/mksparse" "$DATADIR/$MATCH_2/$MATCH_1" "$MATCH_3"
Create some _interesting_ data, using the `mkfunnyfarm` utility.
See the utility for details, but this is about creating files and
other filesystem objects that are not the most common easy cases for
backup programs (regular files with data and no holes).
- IMPLEMENTS GIVEN live data with interesting filesystem objects
- "$SRCDIR/mkfunnyfarm" "$LIVEDATA"
+ IMPLEMENTS GIVEN directory (\S+) with interesting filesystem objects
+ "$SRCDIR/mkfunnyfarm" "$DATADIR/$MATCH_1"
Manifest creation and checking
------------------------------
@@ -70,12 +64,6 @@ naming goes wrong.
IMPLEMENTS GIVEN a manifest of directory (\S+) in (\S+)
manifest "$DATADIR/$MATCH_1" > "$DATADIR/$MATCH_2"
-We have not, however, made it explicit where the user's live data is,
-so we have another rule for that.
-
- IMPLEMENTS GIVEN a manifest of live data in (\S+)
- manifest "$LIVEDATA" > "$DATADIR/$MATCH_1"
-
We need to check a directory tree against an existing manifest. We do
this by generating a temporary manifest and diffing against that. We
store the temporary manifest in a file so that if things fail, we can
@@ -83,9 +71,9 @@ see what the temporary manifest actually contains. Being able to look
at the actual file is easier than trying to interpret complicated
diffs.
- IMPLEMENTS THEN live data, restored to (\S+), matches manifest (\S+)
- manifest "$DATADIR/$MATCH_1/$LIVEDATA" > "$DATADIR/temp-manifest"
- diff -u "$DATADIR/$MATCH_2" "$DATADIR/temp-manifest"
+ IMPLEMENTS THEN (\S+), restored to (\S+), matches manifest (\S+)
+ manifest "$DATADIR/$MATCH_2/$DATADIR/$MATCH_1" > "$DATADIR/temp-manifest"
+ diff -u "$DATADIR/$MATCH_3" "$DATADIR/temp-manifest"
rm -f "$DATADIR/temp-manifest"
Backing up
@@ -94,11 +82,6 @@ Backing up
The simplest way to run a backup, for single-client scenarios. In
addition to backing up, this makes a manifest of the data.
- IMPLEMENTS WHEN user backs up live data
- run_obnam backup -r "$REPO" "$LIVEDATA"
-
-Back up a named directory.
-
IMPLEMENTS WHEN user backs up directory (\S+)
run_obnam backup -r "$REPO" "$DATADIR/$MATCH_1"
@@ -163,9 +146,9 @@ Checks on files
Check that a restored file uses at most as much disk space as the
original one in live data.
- IMPLEMENTS THEN restored file (\S+) in (\S+) doesn't use more disk
- old=$(stat -c %b "$LIVEDATA/$MATCH_1")
- new=$(stat -c %b "$DATADIR/$MATCH_2/$LIVEDATA/$MATCH_1")
+ IMPLEMENTS THEN file (\S+) from (\S+), restored in (\S+) doesn't use more disk
+ old=$(stat -c %b "$DATADIR/$MATCH_2/$MATCH_1")
+ new=$(stat -c %b "$DATADIR/$MATCH_3/$DATADIR/$MATCH_2/$MATCH_1")
test "$old" -lt "$new"
Checks on contents of files
diff --git a/yarns/obnam.sh b/yarns/obnam.sh
index 2375db0a..2767c5b0 100644
--- a/yarns/obnam.sh
+++ b/yarns/obnam.sh
@@ -17,7 +17,6 @@
# Set variables to help referring to common things in $DATADIR.
-LIVEDATA="$DATADIR/live-data"
REPO="$DATADIR/repo"