test001 (490B)
1 #!/bin/sh 2 set -ex 3 4 SHA1SUM=${SHA1SUM:-sha1sum} 5 6 repo=`mktemp -u` 7 data=`mktemp` 8 dd if=/dev/urandom of="$data" bs=1M count=64 9 ./dup-init -Z snappy "$repo" 10 ./dup-pack -r "$repo" snap0 < "$data" 11 ./dup-pack -r "$repo" snap1 < "$data" 12 du -sh "$repo" 13 sum0=`$SHA1SUM < "$data" | awk '{print $1}'` 14 sum1=`./dup-unpack -r "$repo" snap0 | $SHA1SUM | awk '{print $1}'` 15 sum2=`./dup-unpack -r "$repo" snap1 | $SHA1SUM | awk '{print $1}'` 16 [ "$sum0" = "$sum1" ] 17 [ "$sum0" = "$sum2" ] 18 rm -rf "$repo" "$data"