]> arthur.barton.de Git - bup.git/blobdiff - t/test-on.sh
index: fix -H option
[bup.git] / t / test-on.sh
index 61e6dd847d037556ef97b5d14965e6581f5b3a30..24c2c383511363941c1ab263ef2836a56d0c55f2 100755 (executable)
@@ -22,7 +22,7 @@ WVPASS date > src/bar
 WVPASS bup random 1k > src/baz
 WVPASS bup on - index src
 WVPASS bup on - save -ctn src src > get.log
-WVPASSEQ "$(cat get.log | wc -l)" 2
+WVPASSEQ $(WVPASS cat get.log | WVPASS wc -l) 2
 tree_id=$(WVPASS awk 'FNR == 1' get.log) || exit $?
 commit_id=$(WVPASS awk 'FNR == 2' get.log) || exit $?
 WVPASS git ls-tree "$tree_id"
@@ -43,4 +43,16 @@ WVPASS git cat-file commit "$commit_id" | head -n 1 \
 WVPASS bup join baz > restore-baz
 WVPASS cmp src/baz restore-baz
 
+WVSTART "index-cache"
+# the 'a-zA-Z0-9_' is '\w' from python,
+# the trailing _ is because there's no dir specified
+# and that should thus be empty
+hostname=$(bup python -c "from bup import helpers ; print(helpers.hostname().decode('iso8859-1'))")
+idxcache=$(echo "$hostname" | sed 's/[^@a-zA-Z0-9_]/_/g')_
+# there should be an index-cache now
+for idx in "$tmpdir"/bup/objects/pack/*.idx ; do
+    cachedidx="$tmpdir/bup/index-cache/$idxcache/$(basename "$idx")"
+    WVPASS cmp "$idx" "$cachedidx"
+done
+
 WVPASS rm -rf "$tmpdir"