]> arthur.barton.de Git - bup.git/blob - t/test-restore-single-file.sh
Remove all of the remaining test-related "set -e" usage.
[bup.git] / t / test-restore-single-file.sh
1 #!/usr/bin/env bash
2 . ./wvtest-bup.sh
3
4 WVSTART 'all'
5
6 top="$(WVPASS pwd)" || exit $?
7 tmpdir="$(WVPASS wvmktempdir)" || exit $?
8 export BUP_DIR="$tmpdir/bup"
9
10 bup() { "$top/bup" "$@"; }
11
12 WVPASS mkdir "$tmpdir/foo"
13 WVPASS mkdir "$tmpdir/foo/bar" # Make sure a dir sorts before baz (regression test).
14 WVPASS touch "$tmpdir/foo/baz"
15 WVPASS WVPASS bup init
16 WVPASS WVPASS bup index "$tmpdir/foo"
17 WVPASS bup save -n foo "$tmpdir/foo"
18 # Make sure the timestamps will differ if metadata isn't being restored.
19 WVPASS bup tick
20 WVPASS bup restore -C "$tmpdir/restore" "foo/latest/$tmpdir/foo/baz"
21 WVPASS "$top/t/compare-trees" "$tmpdir/foo/baz" "$tmpdir/restore/baz"
22
23 WVPASS rm -rf "$tmpdir"
24