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)" ""
34 WVPASSEQ "$(bup index --check -us $D/b)" "A $D/b"
35 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
53 WVPASS bup index -u $D/a # becomes modified
54 WVPASSEQ "$(bup index -s $D/a $D $D/b)" \
63 # FIXME: currently directories are never marked unmodified, so -m just skips
64 # them. Eventually, we should actually store the hashes of completed
65 # directories, at which time the output of -m will change, so we'll have to
66 # change this test too.
67 WVPASSEQ "$(cd $D && bup index -m .)" \
71 WVPASSEQ "$(cd $D && bup index -m)" \
75 WVPASSEQ "$(cd $D && bup index -s .)" "$(cd $D && bup index -s .)"
79 WVPASS bup split --bench -b <t/testfile1 >tags1.tmp
80 WVPASS bup split -vvvv -b t/testfile2 >tags2.tmp
84 WVPASS bup split -t t/testfile2 >tags2t.tmp
85 WVPASS bup split -t t/testfile2 --fanout 3 >tags2tf.tmp
86 WVPASS bup split -r "$BUP_DIR" -c t/testfile2 >tags2c.tmp
88 | WVPASS bup split -r "$BUP_DIR" -c --fanout 3 --max-pack-objects 3 -n lslr
90 WVFAIL bup ls /does-not-exist
92 WVPASS bup ls /lslr/1971-01-01 # all dates always exist
93 WVFAIL diff -u tags1.tmp tags2.tmp
95 # fanout must be different from non-fanout
96 WVFAIL diff -q tags2t.tmp tags2tf.tmp
97 wc -c t/testfile1 t/testfile2
98 wc -l tags1.tmp tags2.tmp
101 WVPASS bup join $(cat tags1.tmp) >out1.tmp
102 WVPASS bup join <tags2.tmp >out2.tmp
103 WVPASS bup join <tags2t.tmp >out2t.tmp
104 WVPASS bup join -r "$BUP_DIR" <tags2c.tmp >out2c.tmp
105 WVPASS diff -u t/testfile1 out1.tmp
106 WVPASS diff -u t/testfile2 out2.tmp
107 WVPASS diff -u t/testfile2 out2t.tmp
108 WVPASS diff -u t/testfile2 out2c.tmp
110 WVSTART "save/git-fsck"
113 cd "$BUP_DIR" || exit 1
116 (cd "$TOP/t/sampledata" && WVPASS bup save -vvn master /) || WVFAIL
117 n=$(git fsck --full --strict 2>&1 |
118 egrep -v 'dangling (commit|tree)' |
121 WVPASS [ "$n" -eq 0 ]
126 if bup fsck --par2-ok; then
127 WVSTART "fsck (par2)"
129 WVSTART "fsck (PAR2 IS MISSING)"
133 WVPASS bup damage $BUP_DIR/objects/pack/*.pack -n10 -s1 -S0
135 WVFAIL bup fsck --disable-par2
136 chmod u+w $BUP_DIR/objects/pack/*.idx
137 WVPASS bup damage $BUP_DIR/objects/pack/*.idx -n10 -s1 -S0
139 WVPASS bup damage $BUP_DIR/objects/pack/*.pack -n10 -s1024 --percent 0.4 -S0
141 WVFAIL bup fsck -rvv -j99 # fails because repairs were needed
142 if bup fsck --par2-ok; then
143 WVPASS bup fsck -r # ok because of repairs from last time
144 WVPASS bup damage $BUP_DIR/objects/pack/*.pack -n201 -s1 --equal -S0
146 WVFAIL bup fsck -rvv # too many errors to be repairable
147 WVFAIL bup fsck -r # too many errors to be repairable
149 WVFAIL bup fsck -r # still fails because par2 was missing