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/"
31 WVPASSEQ "$(bup index -s $D/)" "A $D/"
32 WVPASSEQ "$(bup index -s $D/b)" ""
33 WVPASSEQ "$(bup index --check -us $D/b)" "A $D/b"
34 WVPASSEQ "$(bup index --check -us $D/b $D/d)" \
40 WVPASSEQ "$(bup index --check -usx $D)" \
48 WVPASSEQ "$(bup index --check -us $D/a $D/b --fake-valid)" \
51 WVPASSEQ "$(bup index --check -us $D/a)" " $D/a" # stays unmodified
52 WVPASSEQ "$(bup index --check -us $D/d --fake-valid)" \
57 WVPASS bup index -u $D/d/z # becomes modified
58 WVPASSEQ "$(bup index -s $D/a $D $D/b)" \
67 WVPASS bup index -u $D/d/e $D/a --fake-invalid
68 WVPASSEQ "$(cd $D && bup index -m .)" \
75 WVPASSEQ "$(cd $D && bup index -m)" \
82 WVPASSEQ "$(cd $D && bup index -s .)" "$(cd $D && bup index -s .)"
84 WVFAIL bup save -t $D/doesnt-exist-filename
86 mv $BUP_DIR/bupindex $BUP_DIR/bi.old
87 WVFAIL bup save -t $D/d/e/fifotest
88 mkfifo $D/d/e/fifotest
89 WVPASS bup index -u $D/d/e/fifotest
90 WVFAIL bup save -t $D/d/e/fifotest
91 WVFAIL bup save -t $D/d/e
93 WVPASS bup index -u $D/d/e
94 WVFAIL bup save -t $D/d/e/fifotest
95 mv $BUP_DIR/bi.old $BUP_DIR/bupindex
97 WVPASS bup index -u $D/d/e
98 WVPASS bup save -t $D/d/e
99 WVPASSEQ "$(cd $D && bup index -m)" \
105 WVPASS bup save -t $D/d
106 WVPASSEQ "$(cd $D && bup index -m)" \
110 tree1=$(bup save -t $D)
111 WVPASSEQ "$(cd $D && bup index -m)" ""
112 tree2=$(bup save -t $D)
113 WVPASSEQ "$tree1" "$tree2"
114 WVPASSEQ "$(bup index -s / | grep ^D)" ""
115 tree3=$(bup save -t /)
116 WVPASSEQ "$tree1" "$tree3"
119 WVPASS bup split --bench -b <t/testfile1 >tags1.tmp
120 WVPASS bup split -vvvv -b t/testfile2 >tags2.tmp
124 WVPASS bup split -t t/testfile2 >tags2t.tmp
125 WVPASS bup split -t t/testfile2 --fanout 3 >tags2tf.tmp
126 WVPASS bup split -r "$BUP_DIR" -c t/testfile2 >tags2c.tmp
128 | WVPASS bup split -r "$BUP_DIR" -c --fanout 3 --max-pack-objects 3 -n lslr
130 WVFAIL bup ls /does-not-exist
132 #WVPASS bup ls /lslr/1971-01-01 # all dates always exist
133 WVFAIL diff -u tags1.tmp tags2.tmp
135 # fanout must be different from non-fanout
136 WVFAIL diff -q tags2t.tmp tags2tf.tmp
137 wc -c t/testfile1 t/testfile2
138 wc -l tags1.tmp tags2.tmp
141 WVPASS bup join $(cat tags1.tmp) >out1.tmp
142 WVPASS bup join <tags2.tmp >out2.tmp
143 WVPASS bup join <tags2t.tmp >out2t.tmp
144 WVPASS bup join -r "$BUP_DIR" <tags2c.tmp >out2c.tmp
145 WVPASS diff -u t/testfile1 out1.tmp
146 WVPASS diff -u t/testfile2 out2.tmp
147 WVPASS diff -u t/testfile2 out2t.tmp
148 WVPASS diff -u t/testfile2 out2c.tmp
150 WVSTART "save/git-fsck"
153 cd "$BUP_DIR" || exit 1
156 (cd "$TOP/t/sampledata" && WVPASS bup save -vvn master /) || WVFAIL
157 n=$(git fsck --full --strict 2>&1 |
158 egrep -v 'dangling (commit|tree)' |
161 WVPASS [ "$n" -eq 0 ]
166 WVPASS bup fsck --quick
167 if bup fsck --par2-ok; then
168 WVSTART "fsck (par2)"
170 WVSTART "fsck (PAR2 IS MISSING)"
174 WVPASS bup damage $BUP_DIR/objects/pack/*.pack -n10 -s1 -S0
175 WVFAIL bup fsck --quick
176 WVFAIL bup fsck --quick --disable-par2
177 chmod u+w $BUP_DIR/objects/pack/*.idx
178 WVPASS bup damage $BUP_DIR/objects/pack/*.idx -n10 -s1 -S0
179 WVFAIL bup fsck --quick -j4
180 WVPASS bup damage $BUP_DIR/objects/pack/*.pack -n10 -s1024 --percent 0.4 -S0
181 WVFAIL bup fsck --quick
182 WVFAIL bup fsck --quick -rvv -j99 # fails because repairs were needed
183 if bup fsck --par2-ok; then
184 WVPASS bup fsck -r # ok because of repairs from last time
185 WVPASS bup damage $BUP_DIR/objects/pack/*.pack -n202 -s1 --equal -S0
187 WVFAIL bup fsck -rvv # too many errors to be repairable
188 WVFAIL bup fsck -r # too many errors to be repairable
190 WVFAIL bup fsck --quick -r # still fails because par2 was missing