]> arthur.barton.de Git - bup.git/blobdiff - t/test-fuse.sh
restore: add generative --sparse testing
[bup.git] / t / test-fuse.sh
index e25f3f21d4f4c4ee7e62eff1eb0241442a7dd3d7..5949907b86c8c25c0969d06034a27ff62ac94b49 100755 (executable)
@@ -1,5 +1,6 @@
 #!/usr/bin/env bash
 . ./wvtest-bup.sh || exit $?
+. t/lib.sh || exit $?
 
 set -o pipefail
 
@@ -32,15 +33,16 @@ bup() { "$top/bup" "$@"; }
 savename()
 {
     readonly secs="$1"
-    WVPASS python -c "from time import strftime, localtime; \
+    WVPASS bup-python -c "from time import strftime, localtime; \
        print strftime('%Y-%m-%d-%H%M%S', localtime($secs))"
 }
 
 WVPASS bup init
 WVPASS cd "$tmpdir"
 
-savestamp1=$(WVPASS python -c 'import time; print int(time.time())') || exit $?
+savestamp1=$(WVPASS bup-python -c 'import time; print int(time.time())') || exit $?
 savestamp2=$(($savestamp1 + 1))
+
 savename1="$(savename "$savestamp1")" || exit $?
 savename2="$(savename "$savestamp2")" || exit $?
 
@@ -71,6 +73,9 @@ result=$(WVPASS ls mnt/src/latest) || exit $?
 WVPASSEQ "$result" "foo
 pre-epoch"
 
+result=$(WVPASS cat mnt/src/latest/foo) || exit $?
+WVPASSEQ "$result" "content"
+
 # Right now we don't detect new saves.
 WVPASS bup save -n src -d "$savestamp2" --strip src
 result=$(WVPASS ls mnt/src) || exit $?
@@ -84,7 +89,7 @@ WVPASS bup fuse --meta mnt
 result=$(TZ=UTC LC_ALL=C WVPASS ls -l mnt/src/latest/) || exit $?
 readonly user=$(WVPASS id -un) || $?
 readonly group=$(WVPASS id -gn) || $?
-WVPASSEQ "$result" "total 0
+WVPASSEQ "$result" "total 1
 -rw-r--r-- 1 $user $group 8 Nov 11  2011 foo
 -rw-r--r-- 1 $user $group 8 Jan  1  1970 pre-epoch"