dedup

deduplicating backup program
git clone git://git.2f30.org/dedup
Log | Files | Refs | README | LICENSE

test004 (402B)


      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-rm -r "$repo" snap0
     12 ./dup-pack -r "$repo" snap0 < "$data"
     13 sum0=`$SHA1SUM < "$data" | awk '{print $1}'`
     14 sum1=`./dup-unpack -r "$repo" snap0 | $SHA1SUM | awk '{print $1}'`
     15 [ "$sum0" = "$sum1" ]
     16 rm -rf "$repo" "$data"