]> arthur.barton.de Git - bup.git/blob - t/test-import-duplicity.sh
test-import-duplicity: clean up; add --archive-dir
[bup.git] / t / test-import-duplicity.sh
1 #!/usr/bin/env bash
2 . ./wvtest-bup.sh || exit $?
3
4 set -o pipefail
5
6 top="$(WVPASS pwd)" || exit $?
7 tmpdir="$(WVPASS wvmktempdir)" || exit $?
8
9 export BUP_DIR="$tmpdir/bup"
10 export GIT_DIR="$tmpdir/bup"
11
12 if ! [ "$(type -p duplicity)" != "" ]; then
13     # FIXME: add WVSKIP.
14     echo "Cannot find duplicity; skipping test)" 1>&2
15     exit 0
16 fi
17
18 bup() { "$top/bup" "$@"; }
19
20 export PASSPHRASE=bup_duplicity_passphrase
21 D=duplicity.tmp
22 WVSTART "import-duplicity"
23 WVPASS bup init
24 WVPASS cd "$tmpdir"
25
26 dup() { duplicity --archive-dir "$tmpdir/dup-cache" "$@"; }
27
28 WVPASS mkdir duplicity
29 WVPASS dup "$top/lib" file://duplicity
30 WVPASS bup tick
31 WVPASS dup "$top/lib" 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 "$top/lib" | sort)"
35 WVPASS bup restore -C restore/ import-duplicity/latest/
36 WVPASS diff -ruN "$top/lib" restore
37
38 WVPASS rm -rf "$tmpdir"