6 export BUP_DIR="$TOP/buptest.tmp"
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
32 WVPASS bup random 512 >$D/f
33 WVPASSEQ "$(bup index -s $D/)" "A $D/"
34 WVPASSEQ "$(bup index -s $D/b)" ""
35 WVPASSEQ "$(bup index --check -us $D/b)" "A $D/b"
36 WVPASSEQ "$(bup index --check -us $D/b $D/d)" \
42 WVPASSEQ "$(bup index --check -usx $D)" \
50 WVPASSEQ "$(bup index --check -us $D/a $D/b --fake-valid)" \
53 WVPASSEQ "$(bup index --check -us $D/a)" " $D/a" # stays unmodified
54 WVPASSEQ "$(bup index --check -us $D/d --fake-valid)" \
59 WVPASS bup index -u $D/d/z # becomes modified
60 WVPASSEQ "$(bup index -s $D/a $D $D/b)" \
69 WVPASS bup index -u $D/d/e $D/a --fake-invalid
70 WVPASSEQ "$(cd $D && bup index -m .)" \
77 WVPASSEQ "$(cd $D && bup index -m)" \
84 WVPASSEQ "$(cd $D && bup index -s .)" "$(cd $D && bup index -s .)"
86 WVFAIL bup save -t $D/doesnt-exist-filename
88 mv $BUP_DIR/bupindex $BUP_DIR/bi.old
89 WVFAIL bup save -t $D/d/e/fifotest
90 mkfifo $D/d/e/fifotest
91 WVPASS bup index -u $D/d/e/fifotest
92 WVFAIL bup save -t $D/d/e/fifotest
93 WVFAIL bup save -t $D/d/e
95 WVPASS bup index -u $D/d/e
96 WVFAIL bup save -t $D/d/e/fifotest
97 mv $BUP_DIR/bi.old $BUP_DIR/bupindex
99 WVPASS bup index -u $D/d/e
100 WVPASS bup save -t $D/d/e
101 WVPASSEQ "$(cd $D && bup index -m)" \
107 WVPASS bup save -t $D/d
108 WVPASSEQ "$(cd $D && bup index -m)" \
112 tree1=$(bup save -t $D)
113 WVPASSEQ "$(cd $D && bup index -m)" ""
114 tree2=$(bup save -t $D)
115 WVPASSEQ "$tree1" "$tree2"
116 WVPASSEQ "$(bup index -s / | grep ^D)" ""
117 tree3=$(bup save -t /)
118 WVPASSEQ "$tree1" "$tree3"
119 WVFAIL bup save -r localhost -n r-test $D
120 WVPASS bup save -r :$BUP_DIR -n r-test $D
121 WVFAIL bup save -r :$BUP_DIR/fake/path -n r-test $D
122 WVFAIL bup save -r :$BUP_DIR -n r-test $D/fake/path
125 WVPASS bup split --bench -b <t/testfile1 >tags1.tmp
126 WVPASS bup split -vvvv -b t/testfile2 >tags2.tmp
130 WVPASS bup split -t t/testfile2 >tags2t.tmp
131 WVPASS bup split -t t/testfile2 --fanout 3 >tags2tf.tmp
132 WVFAIL bup split -r $BUP_DIR -c t/testfile2 >tags2c.tmp
133 WVPASS bup split -r :$BUP_DIR -c t/testfile2 >tags2c.tmp
135 | WVPASS bup split -r :$BUP_DIR -c --fanout 3 --max-pack-objects 3 -n lslr
137 WVFAIL bup ls /does-not-exist
139 #WVPASS bup ls /lslr/1971-01-01 # all dates always exist
140 WVFAIL diff -u tags1.tmp tags2.tmp
142 # fanout must be different from non-fanout
143 WVFAIL diff -q tags2t.tmp tags2tf.tmp
144 wc -c t/testfile1 t/testfile2
145 wc -l tags1.tmp tags2.tmp
147 WVPASS bup memtest -c1 -n100
148 WVPASS bup memtest -c1 -n100 --existing
151 WVPASS bup join $(cat tags1.tmp) >out1.tmp
152 WVPASS bup join <tags2.tmp >out2.tmp
153 WVPASS bup join <tags2t.tmp >out2t.tmp
154 WVFAIL bup join -r "$BUP_DIR" <tags2c.tmp >out2c.tmp
155 WVPASS bup join -r ":$BUP_DIR" <tags2c.tmp >out2c.tmp
156 WVPASS diff -u t/testfile1 out1.tmp
157 WVPASS diff -u t/testfile2 out2.tmp
158 WVPASS diff -u t/testfile2 out2t.tmp
159 WVPASS diff -u t/testfile2 out2c.tmp
161 WVSTART "save/git-fsck"
164 cd "$BUP_DIR" || exit 1
167 (cd "$TOP/t/sampledata" && WVPASS bup save -vvn master /) || WVFAIL
168 n=$(git fsck --full --strict 2>&1 |
169 egrep -v 'dangling (commit|tree)' |
172 WVPASS [ "$n" -eq 0 ]
176 rm -rf buprestore.tmp
177 WVFAIL bup restore boink
178 WVPASS bup restore -C buprestore.tmp "/master/latest/$TOP/$D"
179 WVPASSEQ "$(ls buprestore.tmp)" "bupdata.tmp"
180 rm -rf buprestore.tmp
181 WVPASS bup restore -C buprestore.tmp "/master/latest/$TOP/$D/"
182 WVPASS diff -ur $D/ buprestore.tmp/
185 WVPASS bup ftp "cat /master/latest/$TOP/$D/b" >$D/b.new
186 WVPASS bup ftp "cat /master/latest/$TOP/$D/f" >$D/f.new
187 WVPASS bup ftp "cat /master/latest/$TOP/$D/f"{,} >$D/f2.new
188 WVPASS bup ftp "cat /master/latest/$TOP/$D/a" >$D/a.new
189 WVPASSEQ "$(sha1sum <$D/b)" "$(sha1sum <$D/b.new)"
190 WVPASSEQ "$(sha1sum <$D/f)" "$(sha1sum <$D/f.new)"
191 WVPASSEQ "$(cat $D/f.new{,} | sha1sum)" "$(sha1sum <$D/f2.new)"
192 WVPASSEQ "$(sha1sum <$D/a)" "$(sha1sum <$D/a.new)"
196 WVPASS bup fsck --quick
197 if bup fsck --par2-ok; then
198 WVSTART "fsck (par2)"
200 WVSTART "fsck (PAR2 IS MISSING)"
204 WVPASS bup damage $BUP_DIR/objects/pack/*.pack -n10 -s1 -S0
205 WVFAIL bup fsck --quick
206 WVFAIL bup fsck --quick --disable-par2
207 chmod u+w $BUP_DIR/objects/pack/*.idx
208 WVPASS bup damage $BUP_DIR/objects/pack/*.idx -n10 -s1 -S0
209 WVFAIL bup fsck --quick -j4
210 WVPASS bup damage $BUP_DIR/objects/pack/*.pack -n10 -s1024 --percent 0.4 -S0
211 WVFAIL bup fsck --quick
212 WVFAIL bup fsck --quick -rvv -j99 # fails because repairs were needed
213 if bup fsck --par2-ok; then
214 WVPASS bup fsck -r # ok because of repairs from last time
215 WVPASS bup damage $BUP_DIR/objects/pack/*.pack -n202 -s1 --equal -S0
217 WVFAIL bup fsck -rvv # too many errors to be repairable
218 WVFAIL bup fsck -r # too many errors to be repairable
220 WVFAIL bup fsck --quick -r # still fails because par2 was missing