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 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 mv $BUP_DIR/bupindex $BUP_DIR/bi.old
94 WVFAIL bup save -t $D/d/e/fifotest
95 mkfifo $D/d/e/fifotest
96 WVPASS bup index -u $D/d/e/fifotest
97 WVFAIL bup save -t $D/d/e/fifotest
98 WVFAIL bup save -t $D/d/e
100 WVPASS bup index -u $D/d/e
101 WVFAIL bup save -t $D/d/e/fifotest
102 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 tree1=$(bup save -t $D) || WVFAIL
124 WVPASSEQ "$(cd $D && bup index -m)" ""
125 tree2=$(bup save -t $D) || WVFAIL
126 WVPASSEQ "$tree1" "$tree2"
127 WVPASSEQ "$(bup index -s / | grep ^D)" ""
128 tree3=$(bup save -t /) || WVFAIL
129 WVPASSEQ "$tree1" "$tree3"
130 WVPASS bup save -r :$BUP_DIR -n r-test $D
131 WVFAIL bup save -r :$BUP_DIR/fake/path -n r-test $D
132 WVFAIL bup save -r :$BUP_DIR -n r-test $D/fake/path
137 WVPASS bup split -b a.tmp >taga.tmp
138 WVPASS bup split -b b.tmp >tagb.tmp
139 cat a.tmp b.tmp | WVPASS bup split -b >tagab.tmp
140 WVPASSEQ $(cat taga.tmp | wc -l) 1
141 WVPASSEQ $(cat tagb.tmp | wc -l) 1
142 WVPASSEQ $(cat tagab.tmp | wc -l) 1
143 WVPASSEQ $(cat tag[ab].tmp | wc -l) 2
144 WVPASSEQ "$(bup split -b a.tmp b.tmp)" "$(cat tagab.tmp)"
145 WVPASSEQ "$(bup split -b --keep-boundaries a.tmp b.tmp)" "$(cat tag[ab].tmp)"
146 WVPASSEQ "$(cat tag[ab].tmp | bup split -b --keep-boundaries --git-ids)" \
148 WVPASSEQ "$(cat tag[ab].tmp | bup split -b --git-ids)" \
150 WVPASS bup split --bench -b <t/testfile1 >tags1.tmp
151 WVPASS bup split -vvvv -b t/testfile2 >tags2.tmp
154 WVPASS bup midx --check -a
155 WVPASS bup midx -o $BUP_DIR/objects/pack/test1.midx \
156 $BUP_DIR/objects/pack/*.idx
157 WVPASS bup midx --check -a
158 WVPASS bup midx -o $BUP_DIR/objects/pack/test1.midx \
159 $BUP_DIR/objects/pack/*.idx \
160 $BUP_DIR/objects/pack/*.idx
161 WVPASS bup midx --check -a
162 all=$(echo $BUP_DIR/objects/pack/*.idx $BUP_DIR/objects/pack/*.midx)
163 WVPASS bup midx -o $BUP_DIR/objects/pack/zzz.midx $all
165 WVPASS bup midx -o $BUP_DIR/objects/pack/yyy.midx $all
167 WVPASSEQ "$(echo $BUP_DIR/objects/pack/*.midx)" \
168 "$BUP_DIR/objects/pack/yyy.midx"
170 WVPASS bup split -t t/testfile2 >tags2t.tmp
171 WVPASS bup split -t t/testfile2 --fanout 3 >tags2tf.tmp
172 WVPASS bup split -r "$BUP_DIR" -c t/testfile2 >tags2c.tmp
173 WVPASS bup split -r :$BUP_DIR -c t/testfile2 >tags2c.tmp
175 | WVPASS bup split -r :$BUP_DIR -c --fanout 3 --max-pack-objects 3 -n lslr
177 WVFAIL bup ls /does-not-exist
179 WVPASS bup ls /lslr/latest
180 WVPASS bup ls /lslr/latest/
181 #WVPASS bup ls /lslr/1971-01-01 # all dates always exist
182 WVFAIL diff -u tags1.tmp tags2.tmp
184 # fanout must be different from non-fanout
185 WVFAIL diff tags2t.tmp tags2tf.tmp
186 wc -c t/testfile1 t/testfile2
187 wc -l tags1.tmp tags2.tmp
190 WVPASS bup bloom -c $(ls -1 $BUP_DIR/objects/pack/*.idx|head -n1)
191 rm $BUP_DIR/objects/pack/bup.bloom
192 WVPASS bup bloom -k 4
193 WVPASS bup bloom -c $(ls -1 $BUP_DIR/objects/pack/*.idx|head -n1)
194 WVPASS bup bloom -d buptest.tmp/objects/pack --ruin --force
195 WVFAIL bup bloom -c $(ls -1 $BUP_DIR/objects/pack/*.idx|head -n1)
196 WVPASS bup bloom --force -k 5
197 WVPASS bup bloom -c $(ls -1 $BUP_DIR/objects/pack/*.idx|head -n1)
200 WVPASS bup memtest -c1 -n100
201 WVPASS bup memtest -c1 -n100 --existing
204 WVPASS bup join $(cat tags1.tmp) >out1.tmp
205 WVPASS bup join <tags2.tmp >out2.tmp
206 WVPASS bup join <tags2t.tmp -o out2t.tmp
207 WVPASS bup join -r "$BUP_DIR" <tags2c.tmp >out2c.tmp
208 WVPASS bup join -r ":$BUP_DIR" <tags2c.tmp >out2c.tmp
209 WVPASS diff -u t/testfile1 out1.tmp
210 WVPASS diff -u t/testfile2 out2.tmp
211 WVPASS diff -u t/testfile2 out2t.tmp
212 WVPASS diff -u t/testfile2 out2c.tmp
214 WVSTART "save/git-fsck"
217 cd "$BUP_DIR" || exit 1
220 (cd "$TOP/t/sampledata" && WVPASS bup save -vvn master /) || WVFAIL
221 n=$(git fsck --full --strict 2>&1 |
222 egrep -v 'dangling (commit|tree|blob)' |
225 WVPASS [ "$n" -eq 0 ]
229 rm -rf buprestore.tmp
230 WVFAIL bup restore boink
231 WVPASS bup restore -C buprestore.tmp "/master/latest/$TOP/$D"
232 WVPASSEQ "$(ls buprestore.tmp)" "bupdata.tmp"
233 rm -rf buprestore.tmp
234 WVPASS bup restore -C buprestore.tmp "/master/latest/$TOP/$D/"
235 touch $D/non-existent-file buprestore.tmp/non-existent-file # else diff fails
236 WVPASS diff -ur $D/ buprestore.tmp/
239 WVPASS bup ftp "cat /master/latest/$TOP/$D/b" >$D/b.new
240 WVPASS bup ftp "cat /master/latest/$TOP/$D/f" >$D/f.new
241 WVPASS bup ftp "cat /master/latest/$TOP/$D/f"{,} >$D/f2.new
242 WVPASS bup ftp "cat /master/latest/$TOP/$D/a" >$D/a.new
243 WVPASSEQ "$(sha1sum <$D/b)" "$(sha1sum <$D/b.new)"
244 WVPASSEQ "$(sha1sum <$D/f)" "$(sha1sum <$D/f.new)"
245 WVPASSEQ "$(cat $D/f.new{,} | sha1sum)" "$(sha1sum <$D/f2.new)"
246 WVPASSEQ "$(sha1sum <$D/a)" "$(sha1sum <$D/a.new)"
249 WVFAIL bup tag -d v0.n 2>/dev/null
250 WVFAIL bup tag v0.n non-existant 2>/dev/null
251 WVPASSEQ "$(bup tag)" ""
252 WVPASS bup tag v0.1 master
253 WVPASSEQ "$(bup tag)" "v0.1"
254 WVPASS bup tag -d v0.1
256 # This section destroys data in the bup repository, so it is done last.
259 WVPASS bup fsck --quick
260 if bup fsck --par2-ok; then
261 WVSTART "fsck (par2)"
263 WVSTART "fsck (PAR2 IS MISSING)"
267 WVPASS bup damage $BUP_DIR/objects/pack/*.pack -n10 -s1 -S0
268 WVFAIL bup fsck --quick
269 WVFAIL bup fsck --quick --disable-par2
270 chmod u+w $BUP_DIR/objects/pack/*.idx
271 WVPASS bup damage $BUP_DIR/objects/pack/*.idx -n10 -s1 -S0
272 WVFAIL bup fsck --quick -j4
273 WVPASS bup damage $BUP_DIR/objects/pack/*.pack -n10 -s1024 --percent 0.4 -S0
274 WVFAIL bup fsck --quick
275 WVFAIL bup fsck --quick -rvv -j99 # fails because repairs were needed
276 if bup fsck --par2-ok; then
277 WVPASS bup fsck -r # ok because of repairs from last time
278 WVPASS bup damage $BUP_DIR/objects/pack/*.pack -n202 -s1 --equal -S0
280 WVFAIL bup fsck -rvv # too many errors to be repairable
281 WVFAIL bup fsck -r # too many errors to be repairable
283 WVFAIL bup fsck --quick -r # still fails because par2 was missing
286 WVSTART "exclude-bupdir"
290 export BUP_DIR="$D/.bup"
293 WVPASS bup random 128k >$D/b
295 WVPASS bup random 512 >$D/f
296 WVPASS bup index -ux $D
297 bup save -n exclude-bupdir $D
298 WVPASSEQ "$(bup ls exclude-bupdir/latest/$TOP/$D/)" "a
307 export BUP_DIR="$D/.bup"
310 WVPASS bup random 128k >$D/b
312 WVPASS bup random 512 >$D/f
313 WVPASS bup index -ux --exclude $D/d $D
314 bup save -n exclude $D
315 WVPASSEQ "$(bup ls exclude/latest/$TOP/$D/)" "a
319 WVPASS bup index -ux --exclude $D/d --exclude $TOP/$D/g --exclude $D/h $D
320 bup save -n exclude $D
321 WVPASSEQ "$(bup ls exclude/latest/$TOP/$D/)" "a
325 WVSTART "exclude-from"
326 D=exclude-fromdir.tmp
327 EXCLUDE_FILE=exclude-from.tmp
330 $D/h" > $EXCLUDE_FILE
333 export BUP_DIR="$D/.bup"
336 WVPASS bup random 128k >$D/b
338 WVPASS bup random 512 >$D/f
340 WVPASS bup index -ux --exclude-from $EXCLUDE_FILE $D
341 bup save -n exclude-from $D
342 WVPASSEQ "$(bup ls exclude-from/latest/$TOP/$D/)" "a
351 export BUP_DIR="$D/.bup"
354 WVPASS bup random 128k >$D/b
356 WVPASS bup random 512 >$D/f
357 WVPASS bup index -ux $D
358 bup save --strip -n strip $D
359 WVPASSEQ "$(bup ls strip/latest/)" "a
368 export BUP_DIR="$D/.bup"
371 WVPASS bup random 128k >$D/b
373 WVPASS bup random 512 >$D/f
374 WVPASS bup index -ux $D
375 bup save --strip-path $TOP -n strip-path $D
376 WVPASSEQ "$(bup ls strip-path/latest/$D/)" "a
381 WVSTART "graft_points"
385 export BUP_DIR="$D/.bup"
388 WVPASS bup random 128k >$D/b
390 WVPASS bup random 512 >$D/f
391 WVPASS bup index -ux $D
392 bup save --graft $TOP/$D=/grafted -n graft-point-absolute $D
393 WVPASSEQ "$(bup ls graft-point-absolute/latest/grafted/)" "a
397 bup save --graft $D=grafted -n graft-point-relative $D
398 WVPASSEQ "$(bup ls graft-point-relative/latest/$TOP/grafted/)" "a
405 INDEXFILE=tmpindexfile.tmp
409 export BUP_DIR="$D/.bup"
414 WVPASS bup index -ux $D
415 bup save --strip -n bupdir $D
416 WVPASSEQ "$(bup ls bupdir/latest/)" "a
419 WVPASS bup index -f $INDEXFILE --exclude=$D/c -ux $D
420 bup save --strip -n indexfile -f $INDEXFILE $D
421 WVPASSEQ "$(bup ls indexfile/latest/)" "a
425 WVSTART "import-rsnapshot"
427 export BUP_DIR="$TOP/$D/.bup"
431 mkdir -p $D/hourly.0/buptest/a
432 touch $D/hourly.0/buptest/a/b
433 mkdir -p $D/hourly.0/buptest/c/d
434 touch $D/hourly.0/buptest/c/d/e
436 WVPASS bup import-rsnapshot $D/
437 WVPASSEQ "$(bup ls buptest/latest/)" "a/