2 . ./wvtest-bup.sh || exit $?
6 if ! [ "$(type -p duplicity)" != "" ]; then
8 echo "Cannot find duplicity; skipping test)" 1>&2
12 top="$(WVPASS pwd)" || exit $?
13 tmpdir="$(WVPASS wvmktempdir)" || exit $?
15 bup() { "$top/bup" "$@"; }
16 dup() { duplicity --archive-dir "$tmpdir/dup-cache" "$@"; }
18 WVSTART "import-duplicity"
19 WVPASS make install DESTDIR="$tmpdir/src"
21 export BUP_DIR="$tmpdir/bup"
22 export GIT_DIR="$tmpdir/bup"
23 export PASSPHRASE=bup_duplicity_passphrase
27 WVPASS mkdir duplicity
28 WVPASS dup src file://duplicity
30 WVPASS touch src/new-file
31 WVPASS dup src file://duplicity
32 WVPASS bup import-duplicity "file://duplicity" import-duplicity
33 WVPASSEQ "$(bup ls import-duplicity/ | wc -l)" "3"
34 WVPASSEQ "$(bup ls import-duplicity/latest/ | sort)" "$(ls src | sort)"
35 WVPASS bup restore -C restore/ import-duplicity/latest/
36 WVFAIL "$top/t/compare-trees" src/ restore/ > tmp-compare-trees
37 WVPASSEQ $(cat tmp-compare-trees | wc -l) 1
38 # Note: OS X rsync itemize output is currently only 9 chars, not 11.
39 expected_diff_rx='^\.d\.\.t.\.\.\.\.?\.? \./$'
40 if ! grep -qE "$expected_diff_rx" tmp-compare-trees; then
41 echo -n 'tmp-compare-trees: ' 1>&2
42 cat tmp-compare-trees 1>&2
44 WVPASS grep -qE "$expected_diff_rx" tmp-compare-trees
46 WVPASS rm -rf "$tmpdir"