summaryrefslogtreecommitdiff
path: root/yarns/0030-basics.yarn
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2014-01-26 14:51:57 +0000
committerLars Wirzenius <liw@liw.fi>2014-01-26 14:51:57 +0000
commit57d016517b38043962dfd4a428869565163c1fa2 (patch)
tree09607142d3942bf248589bc34405ffb6c7023a2d /yarns/0030-basics.yarn
parentf5502b638093291eb9cf39c1506f77ef391ff270 (diff)
downloadobnam-57d016517b38043962dfd4a428869565163c1fa2.tar.gz
Fix file restore, add xattr value change test
The single file restore test had a bug, in that it was depending on various test steps to execute fast enough that the wall clock did not advance to the next second. This has been fixed by allowing manifests to be done on single files instead of just directories. Add a test for an extended attribute value changing, and that being the only change in the live data. The backup needs to notice that it has changed. This was intended to be the original change in this commit, but I ran into the test bug above, so I had to fix that too. I was too lazy to detangle the two sets of changes for commits.
Diffstat (limited to 'yarns/0030-basics.yarn')
-rw-r--r--yarns/0030-basics.yarn44
1 files changed, 29 insertions, 15 deletions
diff --git a/yarns/0030-basics.yarn b/yarns/0030-basics.yarn
index 34cad9d2..ae553c14 100644
--- a/yarns/0030-basics.yarn
+++ b/yarns/0030-basics.yarn
@@ -19,7 +19,7 @@ program must be able to handle.
SCENARIO backup simple data
GIVEN 100kB of new data in directory L
- AND a manifest of directory L in M
+ AND a manifest of L in M
WHEN user U backs up directory L to repository R
AND user U restores their latest generation in repository R into X
THEN L, restored to X, matches manifest M
@@ -46,7 +46,7 @@ more disk space than the one in live data.
SCENARIO backup a sparse file
GIVEN a file S in L, with a hole, data, a hole
- AND a manifest of directory L in M
+ AND a manifest of L in M
WHEN user U backs up directory L to repository R
AND user U restores their latest generation in repository R into X
THEN L, restored to X, matches manifest M
@@ -81,7 +81,20 @@ duplication.
SCENARIO backup non-basic filesystem objects
GIVEN directory L with interesting filesystem objects
- AND a manifest of directory L in M
+ AND a manifest of L in M
+ WHEN user U backs up directory L to repository R
+ AND user U restores their latest generation in repository R into X
+ THEN L, restored to X, matches manifest M
+
+As a special case, Obnam needs to notice when only an extended
+attribute value changes.
+
+ SCENARIO backup notices when extended attribute value changes
+ GIVEN a file F in L, with data
+ AND file L/F has extended attribute user.foo set to foo
+ WHEN user U backs up directory L to repository R
+ GIVEN file L/F has extended attribute user.foo set to bar
+ AND a manifest of L in M
WHEN user U backs up directory L to repository R
AND user U restores their latest generation in repository R into X
THEN L, restored to X, matches manifest M
@@ -95,8 +108,8 @@ assume that if we can backup two, then it'll all work well.
SCENARIO backup two roots
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
+ AND a manifest of L1 in M1
+ AND a manifest of L2 in M2
WHEN user U backs up directories L1 and L2 to repository R
AND user U restores their latest generation in repository R into X
THEN L1, restored to X, matches manifest M1
@@ -117,16 +130,17 @@ backup, if the backup finishes successfully.
Restore a single file
---------------------
-We need to be able to restore only a single file.
+We need to be able to restore only a single file. Note that when
+restoring a single file, we do not set the parent directory's
+modification time according to the backup, so we need to manipulate
+the manifest to avoid getting an error.
SCENARIO restore a single file
GIVEN a file F in L, with data
- AND a manifest of directory L in M
- AND 100kB of new data in directory L
- AND manifest M has Mtime for the first entry set from L
+ AND a manifest of L/F in M
WHEN user U backs up directory L to repository R
AND user U restores file L/F to X from their latest generation in repository R
- THEN L, restored to X, matches manifest M
+ THEN L/F, restored to X, matches manifest M
Pretend backing up: the `--pretend` setting
-------------------------------------------
@@ -139,9 +153,9 @@ than a real one.
SCENARIO a pretend backup
GIVEN directory L with interesting filesystem objects
WHEN user U backs up directory L to repository R
- GIVEN a manifest of directory R in M1
+ GIVEN a manifest of R in M1
WHEN user U pretends to back up directory L to repository R
- GIVEN a manifest of directory R in M2
+ GIVEN a manifest of R in M2
THEN manifests M1 and M2 match
Exclude cache directories
@@ -162,7 +176,7 @@ The directory `L` now contains what we want to restore: only the
wanted data, no cache directory. This is a good time to create the
manifest.
- AND a manifest of directory L in M
+ AND a manifest of L in M
We now create the cache directory and tag it. Then we backup,
excluding caches, and restore, and verify. However, there's a snag:
@@ -203,7 +217,7 @@ create one. Test that such timestamps work.
SCENARIO pre-epoch timestamps
GIVEN file L/file has Unix timestamp -3600
- AND a manifest of directory L in M
+ AND a manifest of L in M
WHEN user U backs up directory L to repository R
AND user U restores their latest generation in repository R into X
THEN L, restored to X, matches manifest M
@@ -220,7 +234,7 @@ setting to a new size, the backup should still work.
AND user U sets configuration node-size to 65536
WHEN user U backs up directory L to repository R
GIVEN 100Kb of new data in directory L
- AND a manifest of directory L in M
+ AND a manifest of L in M
AND user U sets configuration node-size to 4096
WHEN user U backs up directory L to repository R
AND user U restores their latest generation in repository R into X