2 . ./wvtest-bup.sh || exit $?
6 top="$(WVPASS pwd)" || exit $?
7 tmpdir="$(WVPASS wvmktempdir)" || exit $?
8 export BUP_DIR="$tmpdir/bup"
11 bup() { "$top/bup" "$@"; }
14 # Fixed in commit 8585613c1f45f3e20feec00b24fc7e3a948fa23e ("Store
15 # metadata in the index....")
18 WVPASS echo "content" > "$D"/foo
19 WVPASS echo "content" > "$D"/bar
21 WVPASS bup index -ux "$D"
22 WVPASS bup save -n save-fail-missing "$D"
23 WVPASS echo "content" > "$D"/baz
25 WVPASS bup index -ux "$D"
27 # When "bup tick" is removed above, this may fail (complete with warning),
28 # since the ctime/mtime of "foo" might be pushed back:
29 WVPASS bup save -n save-fail-missing "$D"
30 # when the save-call failed, foo is missing from output, since only
31 # then bup notices, that it was removed:
32 WVPASSEQ "$(bup ls -A save-fail-missing/latest/$TOP/$D/)" "bar
37 WVPASS bup index -ux "$D"
38 WVPASS bup save -n save-fail-missing "$D"
40 WVPASSEQ "$(bup ls -A save-fail-missing/latest/$TOP/$D/)" "bar
44 # TODO: Test for racecondition between reading a file and reading its metadata?
49 WVPASS rm -r "$BUP_DIR"
54 WVPASS bup index -ux "$D"
55 WVPASS bup save -n save-fail-missing "$D"
59 WVPASS bup index -ux "$D"
61 # with directories, bup notices that foo is missing, so it fails
62 # (complete with delayed error)
63 WVFAIL bup save -n save-fail-missing "$D"
64 # ...but foo is still saved since it was just fine in the index
65 WVPASSEQ "$(bup ls -AF save-fail-missing/latest/$TOP/$D/)" "bar/
70 WVPASS bup index -ux "$D"
71 # no non-zero-exitcode anymore:
72 WVPASS bup save -n save-fail-missing "$D"
74 WVPASSEQ "$(bup ls -AF save-fail-missing/latest/$TOP/$D/)" "bar/
77 WVPASS rm -rf "$tmpdir"