8 top="$(WVPASS pwd)" || exit $?
9 tmpdir="$(WVPASS wvmktempdir)" || exit $?
10 export BUP_DIR="$tmpdir/bup"
12 bup() { "$top/bup" "$@"; }
20 WVPASS force-delete $D
22 WVFAIL bup index --exclude-from $D/cannot-exist $D
23 WVPASSEQ "$(bup index --check -p)" ""
24 WVPASSEQ "$(bup index --check -p $D)" ""
26 WVFAIL bup index --check -u $D.fake
27 WVPASS bup index --check -u $D
28 WVPASSEQ "$(bup index --check -p $D)" "$D/"
30 WVPASS bup random 128k >$D/b
31 WVPASS mkdir $D/d $D/d/e
32 WVPASS bup random 512 >$D/f
33 WVPASS ln -s non-existent-file $D/g
34 WVPASSEQ "$(bup index -s $D/)" "A $D/"
35 WVPASSEQ "$(bup index -s $D/b)" ""
36 WVPASSEQ "$(bup index --check -us $D/b)" "A $D/b"
37 WVPASSEQ "$(bup index --check -us $D/b $D/d)" \
43 WVPASSEQ "$(bup index --check -usx $D)" \
52 WVPASSEQ "$(bup index --check -us $D/a $D/b --fake-valid)" \
55 WVPASSEQ "$(bup index --check -us $D/a)" " $D/a" # stays unmodified
56 WVPASSEQ "$(bup index --check -us $D/d --fake-valid)" \
61 WVPASS bup index -u $D/d/z # becomes modified
62 WVPASSEQ "$(bup index -s $D/a $D $D/b)" \
72 WVPASS bup index -u $D/d/e $D/a --fake-invalid
73 WVPASSEQ "$(cd $D && bup index -m .)" \
81 WVPASSEQ "$(cd $D && bup index -m)" \
89 WVPASSEQ "$(cd $D && bup index -s .)" "$(cd $D && bup index -s .)"
91 WVFAIL bup save -t $D/doesnt-exist-filename
93 WVPASS mv "$BUP_DIR/bupindex" "$BUP_DIR/bi.old"
94 WVFAIL bup save -t $D/d/e/fifotest
95 WVPASS mkfifo $D/d/e/fifotest
96 WVPASS bup index -u $D/d/e/fifotest
97 WVPASS bup save -t $D/d/e/fifotest
98 WVPASS bup save -t $D/d/e
99 WVPASS rm -f $D/d/e/fifotest
100 WVPASS bup index -u $D/d/e
101 WVFAIL bup save -t $D/d/e/fifotest
102 WVPASS mv "$BUP_DIR/bi.old" "$BUP_DIR/bupindex"
104 WVPASS bup index -u $D/d/e
105 WVPASS bup save -t $D/d/e
106 WVPASSEQ "$(cd $D && bup index -m)" \
113 WVPASS bup save -t $D/d
114 WVPASS bup index --fake-invalid $D/d/z
115 WVPASS bup save -t $D/d/z
116 WVPASS bup save -t $D/d/z # test regenerating trees when no files are changed
117 WVPASS bup save -t $D/d
118 WVPASSEQ "$(cd $D && bup index -m)" \
123 WVPASS bup save -r ":$BUP_DIR" -n r-test $D
124 WVFAIL bup save -r ":$BUP_DIR/fake/path" -n r-test $D
125 WVFAIL bup save -r ":$BUP_DIR" -n r-test $D/fake/path
127 WVPASS rm -rf "$tmpdir"