-WVSTART "restore"
-WVPASS force-delete buprestore.tmp
-WVFAIL bup restore boink
-WVPASS touch "$tmpdir/$D/$D"
-WVPASS bup index -u "$tmpdir/$D"
-WVPASS bup save -n master /
-WVPASS bup restore -C buprestore.tmp "/master/latest/$tmpdir/$D"
-WVPASSEQ "$(ls buprestore.tmp)" "bupdata.tmp"
-WVPASS force-delete buprestore.tmp
-WVPASS bup restore -C buprestore.tmp "/master/latest/$tmpdir/$D/"
-WVPASS touch $D/non-existent-file buprestore.tmp/non-existent-file # else diff fails
-WVPASS diff -ur $D/ buprestore.tmp/
-WVPASS force-delete buprestore.tmp
-WVPASS echo -n "" | WVPASS bup split -n split_empty_string.tmp
-WVPASS bup restore -C buprestore.tmp split_empty_string.tmp/latest/
-WVPASSEQ "$(cat buprestore.tmp/data)" ""
-
-(
- tmp=testrestore.tmp
- WVPASS force-delete $tmp
- WVPASS mkdir $tmp
- export BUP_DIR="$(pwd)/$tmp/bup"
- WVPASS WVPASS bup init
- WVPASS mkdir -p $tmp/src/x/y/z
- WVPASS bup random 8k > $tmp/src/x/y/random-1
- WVPASS bup random 8k > $tmp/src/x/y/z/random-2
- WVPASS bup index -u $tmp/src
- WVPASS bup save --strip -n foo $tmp/src
-
- WVSTART "restore /foo/latest"
- WVPASS bup restore -C $tmp/restore /foo/latest
- WVPASS "$top/t/compare-trees" $tmp/src/ $tmp/restore/latest/
-
- WVSTART "restore /foo/latest/"
- WVPASS force-delete "$tmp/restore"
- WVPASS bup restore -C $tmp/restore /foo/latest/
- for x in $tmp/src/*; do
- WVPASS "$top/t/compare-trees" $x/ $tmp/restore/$(basename $x);
- done
-
- WVSTART "restore /foo/latest/."
- WVPASS force-delete "$tmp/restore"
- WVPASS bup restore -C $tmp/restore /foo/latest/.
- WVPASS "$top/t/compare-trees" $tmp/src/ $tmp/restore/
-
- WVSTART "restore /foo/latest/x"
- WVPASS force-delete "$tmp/restore"
- WVPASS bup restore -C $tmp/restore /foo/latest/x
- WVPASS "$top/t/compare-trees" $tmp/src/x/ $tmp/restore/x/
-
- WVSTART "restore /foo/latest/x/"
- WVPASS force-delete "$tmp/restore"
- WVPASS bup restore -C $tmp/restore /foo/latest/x/
- for x in $tmp/src/x/*; do
- WVPASS "$top/t/compare-trees" $x/ $tmp/restore/$(basename $x);
- done
-
- WVSTART "restore /foo/latest/x/."
- WVPASS force-delete "$tmp/restore"
- WVPASS bup restore -C $tmp/restore /foo/latest/x/.
- WVPASS "$top/t/compare-trees" $tmp/src/x/ $tmp/restore/
-) || exit $?
-