From: Rob Browning Date: Mon, 17 Mar 2014 17:59:12 +0000 (-0500) Subject: test-on.sh: add some simple "bup on" tests. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=b47b97112cfe42628b123a8303992df3ffe0d6fe;p=packages%2Fb%2Fbup.git test-on.sh: add some simple "bup on" tests. Signed-off-by: Rob Browning --- diff --git a/Makefile b/Makefile index a2a22bf..311663c 100644 --- a/Makefile +++ b/Makefile @@ -96,6 +96,7 @@ runtests-cmdline: all TMPDIR="$(test_tmp)" t/test-index-check-device.sh TMPDIR="$(test_tmp)" t/test-ls.sh TMPDIR="$(test_tmp)" t/test-meta.sh + TMPDIR="$(test_tmp)" t/test-on.sh TMPDIR="$(test_tmp)" t/test-restore-map-owner.sh TMPDIR="$(test_tmp)" t/test-restore-single-file.sh TMPDIR="$(test_tmp)" t/test-rm-between-index-and-save.sh diff --git a/t/test-on.sh b/t/test-on.sh new file mode 100755 index 0000000..9064676 --- /dev/null +++ b/t/test-on.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +. ./wvtest-bup.sh +. ./lib.sh + +set -o pipefail + +top="$(WVPASS pwd)" || exit $? +tmpdir="$(WVPASS wvmktempdir)" || exit $? + +export BUP_DIR="$tmpdir/bup" +export GIT_DIR="$tmpdir/bup" + +bup() { "$top/bup" "$@"; } +compare-trees() { "$top/t/compare-trees" "$@"; } + +WVPASS bup init +WVPASS cd "$tmpdir" + +WVSTART "index/save" +WVPASS mkdir src src/foo +WVPASS date > src/bar +WVPASS bup random 1k > src/baz +WVPASS bup on - index src +WVPASS bup on - save -n src src +WVPASS bup restore -C restore "src/latest/$(pwd)/src/." +WVPASS compare-trees src/ restore/ +WVPASS rm -r restore + +WVSTART "split" +WVPASS bup on - split -n baz src/baz +WVPASS bup join baz > restore-baz +WVPASS cmp src/baz restore-baz + +WVPASS rm -rf "$tmpdir"