summaryrefslogtreecommitdiff
path: root/yarns
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2013-12-05 17:14:02 +0000
committerLars Wirzenius <liw@liw.fi>2013-12-05 17:14:02 +0000
commitac42720f7d0309036c6af31372f28d13c7da5d80 (patch)
tree6e4e162c79d21d39537a84f548d34a678c58a1d2 /yarns
parent15eb3b40ecfd0bd4117695d8fa991df60f1cee24 (diff)
downloadobnam-ac42720f7d0309036c6af31372f28d13c7da5d80.tar.gz
Add test for generations and gen ids
Diffstat (limited to 'yarns')
-rw-r--r--yarns/0040-generations.yarn11
-rw-r--r--yarns/9000-implements.yarn17
2 files changed, 27 insertions, 1 deletions
diff --git a/yarns/0040-generations.yarn b/yarns/0040-generations.yarn
index 39eb8c9e..adc7d849 100644
--- a/yarns/0040-generations.yarn
+++ b/yarns/0040-generations.yarn
@@ -36,7 +36,16 @@ problem.)
Listing generations (`obnam generations`, `obnam genids`)
-------------------
-FIXME.
+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
+ THEN user sees 3 generations
+ AND user sees 3 generation ids
Listing contents of a generation (`obnam ls`)
--------------------------------
diff --git a/yarns/9000-implements.yarn b/yarns/9000-implements.yarn
index bd264c92..41f99118 100644
--- a/yarns/9000-implements.yarn
+++ b/yarns/9000-implements.yarn
@@ -117,6 +117,23 @@ that is unpredictable.
id=$(run_obnam -r "$REPO" genids | awk -v "n=$MATCH_1" 'NR == n')
run_obnam restore -r "$REPO" --to "$DATADIR/$MATCH_2" --generation "$id"
+Checks on generations
+---------------------
+
+Check that number of generations is correct.
+
+ IMPLEMENTS THEN user sees (\d+) generations
+ run_obnam generations -r "$REPO" > "$DATADIR/generation.list"
+ n=$(wc -l < "$DATADIR/generation.list")
+ test "$MATCH_1" = "$n"
+
+Ditto for generation ids.
+
+ IMPLEMENTS THEN user sees (\d+) generation ids
+ run_obnam generations -r "$REPO" > "$DATADIR/generation-id.list"
+ n=$(wc -l < "$DATADIR/generation-id.list")
+ test "$MATCH_1" = "$n"
+
Checks on files
---------------