summaryrefslogtreecommitdiff
path: root/yarns/9000-implements.yarn
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2013-12-05 19:30:15 +0000
committerLars Wirzenius <liw@liw.fi>2013-12-05 19:30:15 +0000
commitcfb79fc07a9c0ba3ec93a0f25b5e02369b281cc8 (patch)
tree5ed5f5b901aff9acea2e7b056d9b182045825158 /yarns/9000-implements.yarn
parentf3c06b927f9ae95f9d921050bc50f52228a28761 (diff)
downloadobnam-cfb79fc07a9c0ba3ec93a0f25b5e02369b281cc8.tar.gz
Add scenario for obnam diff
Diffstat (limited to 'yarns/9000-implements.yarn')
-rw-r--r--yarns/9000-implements.yarn22
1 files changed, 22 insertions, 0 deletions
diff --git a/yarns/9000-implements.yarn b/yarns/9000-implements.yarn
index d46885d3..956e8df5 100644
--- a/yarns/9000-implements.yarn
+++ b/yarns/9000-implements.yarn
@@ -140,9 +140,31 @@ Ditto for generation ids.
n=$(wc -l < "$DATADIR/generation-id.list")
test "$MATCH_1" = "$n"
+Diffs between generations
+-------------------------
+
+Compute the difference between two generations. The generations are
+identified by the ordinal, not generation id, since the ids are
+unpredictable.
+
+ IMPLEMENTS WHEN user diffs generations (\d+) and (\d+) into (\S+)
+ id1=$(run_obnam -r "$REPO" genids | awk -v "n=$MATCH_1" 'NR == n')
+ id2=$(run_obnam -r "$REPO" genids | awk -v "n=$MATCH_2" 'NR == n')
+ run_obnam diff -r "$REPO" "$id1" "$id2" > "$DATADIR/$MATCH_3"
+
Checks on files
---------------
+Is a file empty?
+
+ IMPLEMENTS THEN file (\S+) is empty
+ diff -u /dev/null "$DATADIR/$MATCH_1"
+
+Is a file not empty?
+
+ IMPLEMENTS THEN file (\S+) is not empty
+ ! diff -u /dev/null "$DATADIR/$MATCH_1"
+
Check that a restored file uses at most as much disk space as the
original one in live data.