]> arthur.barton.de Git - bup.git/blobdiff - t/test-import-duplicity.sh
Add a testcase for the import-duplicity command
[bup.git] / t / test-import-duplicity.sh
diff --git a/t/test-import-duplicity.sh b/t/test-import-duplicity.sh
new file mode 100755 (executable)
index 0000000..7e41f3f
--- /dev/null
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+. ./wvtest-bup.sh || exit $?
+
+set -o pipefail
+
+top="$(WVPASS pwd)" || exit $?
+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
+
+export PASSPHRASE=bup_duplicity_passphrase
+D=duplicity.tmp
+WVSTART "import-duplicity"
+WVPASS bup init
+WVPASS cd "$tmpdir"
+WVPASS mkdir duplicity
+WVPASS duplicity "$top/Documentation" "file://duplicity"
+WVPASS bup tick
+WVPASS duplicity "$top/Documentation" "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)"
+
+WVPASS rm -rf "$tmpdir"