dedup

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

commit d21add912c5c0cff4dbbcbb03d98e3b83155813a
parent 891041b03c66d2c37f4aef65de717e0f3740d1d1
Author: sin <sin@2f30.org>
Date:   Wed,  1 May 2019 21:01:38 +0100

Break dotest into one file per test

Diffstat:
Ddotest | 116-------------------------------------------------------------------------------
Aruntests | 8++++++++
Atest000 | 16++++++++++++++++
Atest001 | 16++++++++++++++++
Atest002 | 10++++++++++
Atest003 | 10++++++++++
Atest004 | 14++++++++++++++
Atest005 | 16++++++++++++++++
Atest006 | 16++++++++++++++++
9 files changed, 106 insertions(+), 116 deletions(-)

diff --git a/dotest b/dotest @@ -1,116 +0,0 @@ -#!/bin/sh -set -ex - -test0() -{ - repo=`mktemp -d` - data=`mktemp` - dd if=/dev/urandom of="$data" bs=1M count=64 - ./dup-init -Z none "$repo" - ./dup-pack -r "$repo" snap0 < "$data" - ./dup-pack -r "$repo" snap1 < "$data" - du -sh "$repo" - sum0=`sha1sum "$data" | awk '{print $1}'` - sum1=`./dup-unpack -r "$repo" snap0 | sha1sum | awk '{print $1}'` - sum2=`./dup-unpack -r "$repo" snap1 | sha1sum | awk '{print $1}'` - [ "$sum0" = "$sum1" ] - [ "$sum0" = "$sum2" ] - rm -rf "$repo" "$data" -} - -test1() -{ - repo=`mktemp -d` - data=`mktemp` - dd if=/dev/urandom of="$data" bs=1M count=64 - ./dup-init -Z snappy "$repo" - ./dup-pack -r "$repo" snap0 < "$data" - ./dup-pack -r "$repo" snap1 < "$data" - du -sh "$repo" - sum0=`sha1sum "$data" | awk '{print $1}'` - sum1=`./dup-unpack -r "$repo" snap0 | sha1sum | awk '{print $1}'` - sum2=`./dup-unpack -r "$repo" snap1 | sha1sum | awk '{print $1}'` - [ "$sum0" = "$sum1" ] - [ "$sum0" = "$sum2" ] - rm -rf "$repo" "$data" -} - -test2() -{ - repo=`mktemp -d` - data=`mktemp` - dd if=/dev/urandom of="$data" bs=1M count=64 - ./dup-init -Z none "$repo" - ./dup-pack -r "$repo" snap0 < "$data" - ./dup-check -r "$repo" snap0 - rm -rf "$repo" "$data" -} - -test3() -{ - repo=`mktemp -d` - data=`mktemp` - dd if=/dev/urandom of="$data" bs=1M count=64 - ./dup-init -Z snappy "$repo" - ./dup-pack -r "$repo" snap0 < "$data" - ./dup-check -r "$repo" snap0 - rm -rf "$repo" "$data" -} - -test4() -{ - repo=`mktemp -d` - data=`mktemp` - dd if=/dev/urandom of="$data" bs=1M count=64 - ./dup-init "$repo" - ./dup-pack -r "$repo" snap0 < "$data" - ./dup-rm -r "$repo" snap0 < "$data" - ./dup-pack -r "$repo" snap0 < "$data" - sum0=`sha1sum "$data" | awk '{print $1}'` - sum1=`./dup-unpack -r "$repo" snap0 | sha1sum | awk '{print $1}'` - [ "$sum0" = "$sum1" ] - rm -rf "$repo" "$data" -} - -test5() -{ - repo=`mktemp -d` - data=`mktemp` - dd if=/dev/urandom of="$data" bs=1M count=64 - ./dup-init "$repo" - ./dup-pack -r "$repo" snap0 < "$data" - ./dup-gc "$repo" - ./dup-rm -r "$repo" snap0 < "$data" - ./dup-pack -r "$repo" snap0 < "$data" - ./dup-gc "$repo" - sum0=`sha1sum "$data" | awk '{print $1}'` - sum1=`./dup-unpack -r "$repo" snap0 | sha1sum | awk '{print $1}'` - [ "$sum0" = "$sum1" ] - rm -rf "$repo" "$data" -} - -test6() -{ - repo=`mktemp -d` - data=`mktemp` - dd if=/dev/urandom of="$data" bs=1M count=64 - ./dup-init -H blake2s "$repo" - ./dup-pack -r "$repo" snap0 < "$data" - ./dup-pack -r "$repo" snap1 < "$data" - du -sh "$repo" - sum0=`sha1sum "$data" | awk '{print $1}'` - sum1=`./dup-unpack -r "$repo" snap0 | sha1sum | awk '{print $1}'` - sum2=`./dup-unpack -r "$repo" snap1 | sha1sum | awk '{print $1}'` - [ "$sum0" = "$sum1" ] - [ "$sum0" = "$sum2" ] - rm -rf "$repo" "$data" -} - -make -test0 -test1 -test2 -test3 -test4 -test5 -test6 diff --git a/runtests b/runtests @@ -0,0 +1,8 @@ +#!/bin/sh +set -ex + +make +for t in test* +do + sh $t +done diff --git a/test000 b/test000 @@ -0,0 +1,16 @@ +#!/bin/sh +set -ex + +repo=`mktemp -d` +data=`mktemp` +dd if=/dev/urandom of="$data" bs=1M count=64 +./dup-init -Z none "$repo" +./dup-pack -r "$repo" snap0 < "$data" +./dup-pack -r "$repo" snap1 < "$data" +du -sh "$repo" +sum0=`sha1sum "$data" | awk '{print $1}'` +sum1=`./dup-unpack -r "$repo" snap0 | sha1sum | awk '{print $1}'` +sum2=`./dup-unpack -r "$repo" snap1 | sha1sum | awk '{print $1}'` +[ "$sum0" = "$sum1" ] +[ "$sum0" = "$sum2" ] +rm -rf "$repo" "$data" diff --git a/test001 b/test001 @@ -0,0 +1,16 @@ +#!/bin/sh +set -ex + +repo=`mktemp -d` +data=`mktemp` +dd if=/dev/urandom of="$data" bs=1M count=64 +./dup-init -Z snappy "$repo" +./dup-pack -r "$repo" snap0 < "$data" +./dup-pack -r "$repo" snap1 < "$data" +du -sh "$repo" +sum0=`sha1sum "$data" | awk '{print $1}'` +sum1=`./dup-unpack -r "$repo" snap0 | sha1sum | awk '{print $1}'` +sum2=`./dup-unpack -r "$repo" snap1 | sha1sum | awk '{print $1}'` +[ "$sum0" = "$sum1" ] +[ "$sum0" = "$sum2" ] +rm -rf "$repo" "$data" diff --git a/test002 b/test002 @@ -0,0 +1,10 @@ +#!/bin/sh +set -ex + +repo=`mktemp -d` +data=`mktemp` +dd if=/dev/urandom of="$data" bs=1M count=64 +./dup-init -Z none "$repo" +./dup-pack -r "$repo" snap0 < "$data" +./dup-check -r "$repo" snap0 +rm -rf "$repo" "$data" diff --git a/test003 b/test003 @@ -0,0 +1,10 @@ +#!/bin/sh +set -ex + +repo=`mktemp -d` +data=`mktemp` +dd if=/dev/urandom of="$data" bs=1M count=64 +./dup-init -Z snappy "$repo" +./dup-pack -r "$repo" snap0 < "$data" +./dup-check -r "$repo" snap0 +rm -rf "$repo" "$data" diff --git a/test004 b/test004 @@ -0,0 +1,14 @@ +#!/bin/sh +set -ex + +repo=`mktemp -d` +data=`mktemp` +dd if=/dev/urandom of="$data" bs=1M count=64 +./dup-init "$repo" +./dup-pack -r "$repo" snap0 < "$data" +./dup-rm -r "$repo" snap0 < "$data" +./dup-pack -r "$repo" snap0 < "$data" +sum0=`sha1sum "$data" | awk '{print $1}'` +sum1=`./dup-unpack -r "$repo" snap0 | sha1sum | awk '{print $1}'` +[ "$sum0" = "$sum1" ] +rm -rf "$repo" "$data" diff --git a/test005 b/test005 @@ -0,0 +1,16 @@ +#!/bin/sh +set -ex + +repo=`mktemp -d` +data=`mktemp` +dd if=/dev/urandom of="$data" bs=1M count=64 +./dup-init "$repo" +./dup-pack -r "$repo" snap0 < "$data" +./dup-gc "$repo" +./dup-rm -r "$repo" snap0 < "$data" +./dup-pack -r "$repo" snap0 < "$data" +./dup-gc "$repo" +sum0=`sha1sum "$data" | awk '{print $1}'` +sum1=`./dup-unpack -r "$repo" snap0 | sha1sum | awk '{print $1}'` +[ "$sum0" = "$sum1" ] +rm -rf "$repo" "$data" diff --git a/test006 b/test006 @@ -0,0 +1,16 @@ +#!/bin/sh +set -ex + +repo=`mktemp -d` +data=`mktemp` +dd if=/dev/urandom of="$data" bs=1M count=64 +./dup-init -H blake2s "$repo" +./dup-pack -r "$repo" snap0 < "$data" +./dup-pack -r "$repo" snap1 < "$data" +du -sh "$repo" +sum0=`sha1sum "$data" | awk '{print $1}'` +sum1=`./dup-unpack -r "$repo" snap0 | sha1sum | awk '{print $1}'` +sum2=`./dup-unpack -r "$repo" snap1 | sha1sum | awk '{print $1}'` +[ "$sum0" = "$sum1" ] +[ "$sum0" = "$sum2" ] +rm -rf "$repo" "$data"