summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2014-03-11 19:13:08 +0000
committerLars Wirzenius <liw@liw.fi>2014-03-11 19:13:08 +0000
commitf49ccfdb11d022fdf18b578aa8f702f24144af61 (patch)
tree110436e7c25d68aa874c59868a3942b6728a54f9
parentd3b2d55b438b051c3d14ccc72968cc95d19e71c4 (diff)
downloadobnam-f49ccfdb11d022fdf18b578aa8f702f24144af61.tar.gz
Add yarn for no-op backups
-rw-r--r--yarns/0030-basics.yarn26
-rw-r--r--yarns/9000-implements.yarn7
2 files changed, 32 insertions, 1 deletions
diff --git a/yarns/0030-basics.yarn b/yarns/0030-basics.yarn
index 7e4dffa2..88227fba 100644
--- a/yarns/0030-basics.yarn
+++ b/yarns/0030-basics.yarn
@@ -99,6 +99,32 @@ attribute value changes.
AND user U restores their latest generation in repository R into X
THEN L, restored to X, matches manifest M
+Backup without changes
+----------------------
+
+If we run a backup, then a new one, then the new generation should
+match the first one, and no files should be have been backed up in the
+second generation.
+
+ SCENARIO no-op backup
+ GIVEN a file F in L, with data
+ AND a manifest of L in M
+ WHEN user U backs up directory L to repository R
+ THEN L, restored to X, matches manifest M
+
+Remove the Obnam log file, so we only have the log from the next
+backup run.
+
+ WHEN user U removes file obnam.log
+ AND user U backs up directory L to repository R
+
+Note that Obnam always backs up the root directory, so we match
+against one, not zero, below.
+
+ THEN obnam.log matches INFO \* files backed up: 1$
+ AND L, restored to X, matches manifest M
+
+
Backup to roots at once
-----------------------
diff --git a/yarns/9000-implements.yarn b/yarns/9000-implements.yarn
index baa9ae0c..11d0fab3 100644
--- a/yarns/9000-implements.yarn
+++ b/yarns/9000-implements.yarn
@@ -88,6 +88,11 @@ We need to manipulate extended attributes.
mkdir -p $(dirname "$DATADIR/$MATCH_1")
setfattr --name="$MATCH_2" --value "$MATCH_3" "$DATADIR/$MATCH_1"
+Sometimes we need to remove a file.
+
+ IMPLEMENTS WHEN user (\S+) removes file (\S+)
+ rm -f "$DATADIR/$MATCH_2"
+
Manifest creation and checking
------------------------------
@@ -421,7 +426,7 @@ be careful. `grep -E` regular expressions are used here.
Does any line match?
- IMPLEMENTS THEN (\S+) matches (\S+)
+ IMPLEMENTS THEN (\S+) matches (.*)$
grep -E -e "$MATCH_2" -- "$DATADIR/$MATCH_1"
Do all lines match?