]> arthur.barton.de Git - bup.git/commitdiff
test-on.sh: add some simple "bup on" tests.
authorRob Browning <rlb@defaultvalue.org>
Mon, 17 Mar 2014 17:59:12 +0000 (12:59 -0500)
committerRob Browning <rlb@defaultvalue.org>
Mon, 17 Mar 2014 18:02:51 +0000 (13:02 -0500)
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Makefile
t/test-on.sh [new file with mode: 0755]

index a2a22bf7c8e1875c3e4cdfb3a7effde151577997..311663c774e1f008dce4884da0e6161e6928f19c 100644 (file)
--- 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 (executable)
index 0000000..9064676
--- /dev/null
@@ -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"