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 "$top/t/sync-tree" "$top/t/sampledata/" "$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) 4
38 # Note: OS X rsync itemize output is currently only 9 chars, not 11.
39 # Expect something like this (without the leading spaces):
41 # .L..t...... abs-symlink -> /home/foo/bup/t/sampledata/var/abs-symlink-target
44 expected_diff_rx='^\.d\.\.t.\.\.\.\.?\.? \./$|^\.L\.\.t.\.\.\.\.?\.? '
45 if ! grep -qE "$expected_diff_rx" tmp-compare-trees; then
46 echo -n 'tmp-compare-trees: ' 1>&2
47 cat tmp-compare-trees 1>&2
49 WVPASS grep -qE "$expected_diff_rx" tmp-compare-trees
51 WVPASS rm -rf "$tmpdir"