4 top="$(WVPASS pwd)" || exit $?
5 tmpdir="$(WVPASS wvmktempdir)" || exit $?
6 export BUP_DIR="$tmpdir/bup"
9 bup() { "$top/bup" "$@"; }
12 # Fixed in commit 8585613c1f45f3e20feec00b24fc7e3a948fa23e ("Store
13 # metadata in the index....")
16 WVPASS echo "content" > "$D"/foo
17 WVPASS echo "content" > "$D"/bar
19 WVPASS bup index -ux "$D"
20 WVPASS bup save -n save-fail-missing "$D"
21 WVPASS echo "content" > "$D"/baz
23 WVPASS bup index -ux "$D"
25 # When "bup tick" is removed above, this may fail (complete with warning),
26 # since the ctime/mtime of "foo" might be pushed back:
27 WVPASS bup save -n save-fail-missing "$D"
28 # when the save-call failed, foo is missing from output, since only
29 # then bup notices, that it was removed:
30 WVPASSEQ "$(bup ls -a save-fail-missing/latest/$TOP/$D/)" "bar
35 WVPASS bup index -ux "$D"
36 WVPASS bup save -n save-fail-missing "$D"
38 WVPASSEQ "$(bup ls -a save-fail-missing/latest/$TOP/$D/)" "bar
42 # TODO: Test for racecondition between reading a file and reading its metadata?
47 WVPASS rm -r "$BUP_DIR"
52 WVPASS bup index -ux "$D"
53 WVPASS bup save -n save-fail-missing "$D"
57 WVPASS bup index -ux "$D"
59 # with directories, bup notices that foo is missing, so it fails
60 # (complete with delayed error)
61 WVFAIL bup save -n save-fail-missing "$D"
62 # ... so "foo" is absent from "bup ls"
63 WVPASSEQ "$(bup ls -a save-fail-missing/latest/$TOP/$D/)" "bar/
67 WVPASS bup index -ux "$D"
68 # no non-zero-exitcode anymore:
69 WVPASS bup save -n save-fail-missing "$D"
70 # foo is (still...) missing, of course:
71 WVPASSEQ "$(bup ls -a save-fail-missing/latest/$TOP/$D/)" "bar/
74 WVPASS rm -rf "$tmpdir"