From: Zoran Zaric Date: Mon, 24 Sep 2012 23:13:30 +0000 (+0200) Subject: Add a testcase for the import-duplicity command X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=046d92327c99a398d8aea18786a69250a0d1736c;p=packages%2Fb%2Fbup.git Add a testcase for the import-duplicity command Signed-off-by: Zoran Zaric [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 --- diff --git a/t/test-import-duplicity.sh b/t/test-import-duplicity.sh new file mode 100755 index 0000000..7e41f3f --- /dev/null +++ b/t/test-import-duplicity.sh @@ -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"