]> arthur.barton.de Git - bup.git/blob - t/test-restore-single-file.sh
Add tests for index --no-check-device, and support for t/mnt.
[bup.git] / t / test-restore-single-file.sh
1 #!/usr/bin/env bash
2 . ./wvtest-bup.sh
3
4 set -e -o pipefail
5
6 WVSTART 'all'
7
8 top="$(pwd)"
9 tmpdir="$(wvmktempdir)"
10 export BUP_DIR="$tmpdir/bup"
11
12 bup() { "$top/bup" "$@"; }
13
14 mkdir "$tmpdir/foo"
15 mkdir "$tmpdir/foo/bar" # Make sure a dir sorts before baz (regression test).
16 touch "$tmpdir/foo/baz"
17 WVPASS bup init
18 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 rm -rf "$tmpdir"