]> arthur.barton.de Git - bup.git/commitdiff
Add a testcase for the import-duplicity command
authorZoran Zaric <zz@zoranzaric.de>
Mon, 24 Sep 2012 23:13:30 +0000 (01:13 +0200)
committerRob Browning <rlb@defaultvalue.org>
Mon, 9 Mar 2015 01:55:14 +0000 (20:55 -0500)
Signed-off-by: Zoran Zaric <zz@zoranzaric.de>
[rlb@defaultvalue.org: adjust commit message; update tests during rebase
 and move them from test.sh to t/test-import-duplicity.sh following
 break-up of test.sh.]
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
t/test-import-duplicity.sh [new file with mode: 0755]

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"