8 top="$(WVPASS pwd)" || exit $?
9 tmpdir="$(WVPASS wvmktempdir)" || exit $?
10 export BUP_DIR="$tmpdir/bup"
12 bup() { "$top/bup" "$@"; }
13 sha1sum() { "$top/dev/checksum" -t sha1 "$@"; }
20 WVPASS force-delete $D
23 WVPASS bup random 128k >$D/b
24 WVPASS mkdir $D/d $D/d/e
25 WVPASS bup random 512 >$D/f
33 WVPASS bup bloom -c $(ls -1 "$BUP_DIR"/objects/pack/*.idx|head -n1)
34 WVPASS rm "$BUP_DIR"/objects/pack/bup.bloom
36 WVPASS bup bloom -c $(ls -1 "$BUP_DIR"/objects/pack/*.idx|head -n1)
37 WVPASS bup bloom -d "$BUP_DIR"/objects/pack --ruin --force
38 WVFAIL bup bloom -c $(ls -1 "$BUP_DIR"/objects/pack/*.idx|head -n1)
39 WVPASS bup bloom --force -k 5
40 WVPASS bup bloom -c $(ls -1 "$BUP_DIR"/objects/pack/*.idx|head -n1)
44 WVPASS bup memtest -c1 -n100
45 WVPASS bup memtest -c1 -n100 --existing
48 WVSTART "save/git-fsck"
53 WVPASS bup random 4k | WVPASS bup split -b
54 (WVPASS cd "$top/test/sampledata" && WVPASS bup save -vvn master /) || exit $?
55 result="$(LC_ALL=C git fsck --full --strict 2>&1)" || exit $?
57 WVFAIL egrep -v 'dangling (commit|tree|blob)' |
58 WVPASS tee -a /dev/stderr |
59 WVPASS wc -l) || exit $?
64 WVSTART "pack name and idx same as git"
66 # reuse packs from previous test
67 WVPASS cd "$BUP_DIR"/objects/pack/
69 for pack in *.pack ; do
70 bup_idx_sha=$(sha1sum $(basename $pack .pack).idx) || exit $?
71 gitname=$(git index-pack $pack) || exit $?
72 # make sure we named it correctly (like git)
73 WVPASSEQ pack-$gitname.pack $pack
74 # make sure we wrote the index correctly
75 git_idx_sha=$(sha1sum $(basename $pack .pack).idx) || exit $?
76 WVPASSEQ "$bup_idx_sha" "$git_idx_sha"
82 WVPASS bup ftp "cat /master/latest/$tmpdir/$D/b" >$D/b.new
83 WVPASS bup ftp "cat /master/latest/$tmpdir/$D/f" >$D/f.new
84 WVPASS bup ftp "cat /master/latest/$tmpdir/$D/f"{,} >$D/f2.new
85 WVPASS bup ftp "cat /master/latest/$tmpdir/$D/a" >$D/a.new
86 WVPASSEQ "$(sha1sum <$D/b)" "$(sha1sum <$D/b.new)"
87 WVPASSEQ "$(sha1sum <$D/f)" "$(sha1sum <$D/f.new)"
88 WVPASSEQ "$(cat $D/f.new{,} | sha1sum)" "$(sha1sum <$D/f2.new)"
89 WVPASSEQ "$(sha1sum <$D/a)" "$(sha1sum <$D/a.new)"
93 WVFAIL bup tag -d v0.n 2>/dev/null
94 WVFAIL bup tag v0.n non-existant 2>/dev/null
95 WVPASSEQ "$(bup tag)" ""
96 WVPASS bup tag v0.1 master
97 WVPASSEQ "$(bup tag)" "v0.1"
98 WVFAIL bup tag v0.1 master
99 WVPASS bup tag -f v0.1 master
100 WVPASS bup tag -d v0.1
101 WVPASS bup tag -f -d v0.1
102 WVFAIL bup tag -d v0.1
107 INDEXFILE=tmpindexfile.tmp
108 WVPASS rm -f $INDEXFILE
109 WVPASS force-delete $D
111 export BUP_DIR="$D/.bup"
116 WVPASS bup index -ux $D
117 WVPASS bup save --strip -n bupdir $D
118 WVPASSEQ "$(bup ls -F bupdir/latest/)" "a
121 WVPASS bup index -f $INDEXFILE --exclude=$D/c -ux $D
122 WVPASS bup save --strip -n indexfile -f $INDEXFILE $D
123 WVPASSEQ "$(bup ls indexfile/latest/)" "a
127 WVSTART "import-rsnapshot"
129 export BUP_DIR="$tmpdir/$D/.bup"
130 WVPASS force-delete $D
133 WVPASS mkdir -p $D/hourly.0/buptest/a
134 WVPASS touch $D/hourly.0/buptest/a/b
135 WVPASS mkdir -p $D/hourly.0/buptest/c/d
136 WVPASS touch $D/hourly.0/buptest/c/d/e
138 WVPASS bup import-rsnapshot $D/
139 WVPASSEQ "$(bup ls -F buptest/latest/)" "a/
144 expect_py_ver=$(LC_CTYPE=C "$top/dev/python" \
145 -c 'import platform; print(platform.python_version())') \
147 actual_py_ver=$(bup features | grep Python: | sed -Ee 's/ +Python: //') || exit $?
148 WVPASSEQ "$expect_py_ver" "$actual_py_ver"
151 WVSTART id-other-than
152 result=$("$top/dev/id-other-than" --user 0) || exit $?
153 WVPASS echo "$result" | WVPASS grep -qE '.*:[0-9]+$'
154 result=$("$top/dev/id-other-than" --group 0) || exit $?
155 WVPASS echo "$result" | WVPASS grep -qE '.*:[0-9]+$'
158 WVPASS rm -rf "$tmpdir"