]> arthur.barton.de Git - bup.git/blob - test-sh
cmd-index: indexfiles should start with a well-known header.
[bup.git] / test-sh
1 #!/bin/bash
2 set -e
3 echo "Testing \"integration\" in $0:"
4
5 TOP="$(pwd)"
6 export BUP_DIR="$TOP/buptest.tmp"
7
8 bup()
9 {
10     "$TOP/bup" "$@"
11 }
12
13 set -x
14 rm -rf "$BUP_DIR"
15 bup init
16 bup split --bench -b <testfile1 >tags1.tmp
17 bup split -vvvv -b testfile2 >tags2.tmp
18 bup split -t testfile2 >tags2t.tmp
19 bup split -t testfile2 --fanout 3 >tags2tf.tmp
20 bup split -r "$BUP_DIR" -c testfile2 >tags2c.tmp
21 ls -lR | bup split -r "$BUP_DIR" -c --fanout 3 --max-pack-objects 3 -n lslr
22 diff -u tags1.tmp tags2.tmp || true
23 if diff -q tags2t.tmp tags2tf.tmp; then
24     echo "fanout tree same as non-fanout tree!?"
25     false
26 fi
27 wc -c testfile1 testfile2
28 wc -l tags1.tmp tags2.tmp
29 bup join $(cat tags1.tmp) >out1.tmp
30 bup join <tags2.tmp >out2.tmp
31 bup join <tags2t.tmp >out2t.tmp
32 bup join -r "$BUP_DIR" <tags2c.tmp >out2c.tmp
33 diff -u testfile1 out1.tmp
34 diff -u testfile2 out2.tmp
35 diff -u testfile2 out2t.tmp
36 diff -u testfile2 out2c.tmp
37
38 (
39     set -e
40     cd "$BUP_DIR" || exit 1
41     #git repack -Ad
42     #git prune
43     (cd "$TOP/t/sampledata" && bup save -vvn master .) || exit 1
44     n=$(git fsck --full --strict 2>&1 | 
45           egrep -v 'dangling (commit|tree)' |
46           tee -a /dev/stderr | 
47           wc -l)
48     if [ "$n" -ne 0 ]; then
49         echo "git fsck error."
50         exit 5
51     fi
52 ) || exit 1