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