X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=t%2Ftest-restore-single-file.sh;h=f211ebc89614175706595e016ab4acff6e6f8951;hb=57aaebfd07e7f35aed2ebd44191669b1d9db49df;hp=b64a966be78df176340fa68d9ddcbcefa4ff314b;hpb=53649c18ec3db90f80ff4657315009538d4333f3;p=bup.git diff --git a/t/test-restore-single-file.sh b/t/test-restore-single-file.sh index b64a966..f211ebc 100755 --- a/t/test-restore-single-file.sh +++ b/t/test-restore-single-file.sh @@ -1,22 +1,26 @@ #!/usr/bin/env bash -. ./wvtest-bup.sh +. ./wvtest-bup.sh || exit $? -set -e -o pipefail +set -o pipefail WVSTART 'all' -top="$(pwd)" -tmpdir="$(wvmktempdir)" +top="$(WVPASS pwd)" || exit $? +tmpdir="$(WVPASS wvmktempdir)" || exit $? export BUP_DIR="$tmpdir/bup" bup() { "$top/bup" "$@"; } -touch "$tmpdir/foo" -WVPASS bup init -WVPASS bup index "$tmpdir/foo" +WVPASS mkdir "$tmpdir/foo" +WVPASS mkdir "$tmpdir/foo/bar" # Make sure a dir sorts before baz (regression test). +WVPASS touch "$tmpdir/foo/baz" +WVPASS WVPASS bup init +WVPASS WVPASS bup index "$tmpdir/foo" WVPASS bup save -n foo "$tmpdir/foo" +# Make sure the timestamps will differ if metadata isn't being restored. WVPASS bup tick -WVPASS bup restore -C "$tmpdir/restore" "foo/latest/$tmpdir/foo" -WVPASS "$top/t/compare-trees" "$tmpdir/foo" "$tmpdir/restore/foo" +WVPASS bup restore -C "$tmpdir/restore" "foo/latest/$tmpdir/foo/baz" +WVPASS "$top/t/compare-trees" "$tmpdir/foo/baz" "$tmpdir/restore/baz" + +WVPASS rm -rf "$tmpdir" -rm -rf "$tmpdir"