test005 (436B)
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 "$repo" 10 ./dup-pack -r "$repo" snap0 < "$data" 11 ./dup-gc "$repo" 12 ./dup-rm -r "$repo" snap0 13 ./dup-pack -r "$repo" snap0 < "$data" 14 ./dup-gc "$repo" 15 sum0=`$SHA1SUM < "$data" | awk '{print $1}'` 16 sum1=`./dup-unpack -r "$repo" snap0 | $SHA1SUM | awk '{print $1}'` 17 [ "$sum0" = "$sum1" ] 18 rm -rf "$repo" "$data"