dedup

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

test006 (611B)


      1 #!/bin/sh
      2 set -ex
      3 
      4 SHA1SUM=${SHA1SUM:-sha1sum}
      5 
      6 keyfile=`mktemp -u`
      7 repo=`mktemp -u`
      8 data=`mktemp`
      9 dd if=/dev/urandom of="$data" bs=1M count=64
     10 ./dup-keygen "$keyfile"
     11 ./dup-init -E XChaCha20-Poly1305 -k "$keyfile" "$repo"
     12 ./dup-pack -k "$keyfile" -r "$repo" snap0 < "$data"
     13 ./dup-gc -k "$keyfile" "$repo"
     14 ./dup-rm -k "$keyfile" -r "$repo" snap0
     15 ./dup-pack -k "$keyfile" -r "$repo" snap0 < "$data"
     16 ./dup-gc -k "$keyfile" "$repo"
     17 sum0=`$SHA1SUM < "$data" | awk '{print $1}'`
     18 sum1=`./dup-unpack -k "$keyfile" -r "$repo" snap0 | $SHA1SUM | awk '{print $1}'`
     19 [ "$sum0" = "$sum1" ]
     20 rm -rf "$keyfile" "$repo" "$data"