]> arthur.barton.de Git - bup.git/commitdiff
test-import-duplicity: clean up; add --archive-dir
authorRob Browning <rlb@defaultvalue.org>
Sun, 22 Feb 2015 21:27:43 +0000 (15:27 -0600)
committerRob Browning <rlb@defaultvalue.org>
Mon, 9 Mar 2015 01:55:15 +0000 (20:55 -0500)
If we don't specify an --archive-dir to duplicity, it'll scribble in
~/.cache/duplicity during testing.  This is only a partial fix, given
the duplicity invocations inside import-duplicity itself.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
t/test-import-duplicity.sh

index 7e41f3fb0959052e9462452e57fdd75b19380b90..2ae638b2a5849295e8bb24702a0c54d5a76a175e 100755 (executable)
@@ -9,25 +9,30 @@ tmpdir="$(WVPASS wvmktempdir)" || exit $?
 export BUP_DIR="$tmpdir/bup"
 export GIT_DIR="$tmpdir/bup"
 
-bup() { "$top/bup" "$@"; }
-
 if ! [ "$(type -p duplicity)" != "" ]; then
     # FIXME: add WVSKIP.
     echo "Cannot find duplicity; skipping test)" 1>&2
     exit 0
 fi
 
+bup() { "$top/bup" "$@"; }
+
 export PASSPHRASE=bup_duplicity_passphrase
 D=duplicity.tmp
 WVSTART "import-duplicity"
 WVPASS bup init
 WVPASS cd "$tmpdir"
+
+dup() { duplicity --archive-dir "$tmpdir/dup-cache" "$@"; }
+
 WVPASS mkdir duplicity
-WVPASS duplicity "$top/Documentation" "file://duplicity"
+WVPASS dup "$top/lib" file://duplicity
 WVPASS bup tick
-WVPASS duplicity "$top/Documentation" "file://duplicity"
+WVPASS dup "$top/lib" file://duplicity
 WVPASS bup import-duplicity "file://duplicity" import-duplicity
 WVPASSEQ "$(bup ls import-duplicity/ | wc -l)" "3"
-WVPASSEQ "$(bup ls import-duplicity/latest/ | sort)" "$(ls $top/Documentation | sort)"
+WVPASSEQ "$(bup ls import-duplicity/latest/ | sort)" "$(ls "$top/lib" | sort)"
+WVPASS bup restore -C restore/ import-duplicity/latest/
+WVPASS diff -ruN "$top/lib" restore
 
 WVPASS rm -rf "$tmpdir"