tdotest - dedup - deduplicating backup program
HTML git clone git://bitreich.org/dedup/ git://hg6vgqziawt5s4dj.onion/dedup/
DIR Log
DIR Files
DIR Refs
DIR Tags
DIR README
DIR LICENSE
---
tdotest (2686B)
---
1 #!/bin/sh
2 set -ex
3
4 test0()
5 {
6 repo=`mktemp -d`
7 data=`mktemp`
8 dd if=/dev/urandom of="$data" bs=1M count=64
9 ./dup-init -Z none "$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"
19 }
20
21 test1()
22 {
23 repo=`mktemp -d`
24 data=`mktemp`
25 dd if=/dev/urandom of="$data" bs=1M count=64
26 ./dup-init -Z snappy "$repo"
27 ./dup-pack -r "$repo" snap0 < "$data"
28 ./dup-pack -r "$repo" snap1 < "$data"
29 du -sh "$repo"
30 sum0=`sha1sum "$data" | awk '{print $1}'`
31 sum1=`./dup-unpack -r "$repo" snap0 | sha1sum | awk '{print $1}'`
32 sum2=`./dup-unpack -r "$repo" snap1 | sha1sum | awk '{print $1}'`
33 [ "$sum0" = "$sum1" ]
34 [ "$sum0" = "$sum2" ]
35 rm -rf "$repo" "$data"
36 }
37
38 test2()
39 {
40 repo=`mktemp -d`
41 data=`mktemp`
42 dd if=/dev/urandom of="$data" bs=1M count=64
43 ./dup-init -Z none "$repo"
44 ./dup-pack -r "$repo" snap0 < "$data"
45 ./dup-check -r "$repo" snap0
46 rm -rf "$repo" "$data"
47 }
48
49 test3()
50 {
51 repo=`mktemp -d`
52 data=`mktemp`
53 dd if=/dev/urandom of="$data" bs=1M count=64
54 ./dup-init -Z snappy "$repo"
55 ./dup-pack -r "$repo" snap0 < "$data"
56 ./dup-check -r "$repo" snap0
57 rm -rf "$repo" "$data"
58 }
59
60 test4()
61 {
62 repo=`mktemp -d`
63 data=`mktemp`
64 dd if=/dev/urandom of="$data" bs=1M count=64
65 ./dup-init "$repo"
66 ./dup-pack -r "$repo" snap0 < "$data"
67 ./dup-rm -r "$repo" snap0 < "$data"
68 ./dup-pack -r "$repo" snap0 < "$data"
69 sum0=`sha1sum "$data" | awk '{print $1}'`
70 sum1=`./dup-unpack -r "$repo" snap0 | sha1sum | awk '{print $1}'`
71 [ "$sum0" = "$sum1" ]
72 rm -rf "$repo" "$data"
73 }
74
75 test5()
76 {
77 repo=`mktemp -d`
78 data=`mktemp`
79 dd if=/dev/urandom of="$data" bs=1M count=64
80 ./dup-init "$repo"
81 ./dup-pack -r "$repo" snap0 < "$data"
82 ./dup-gc "$repo"
83 ./dup-rm -r "$repo" snap0 < "$data"
84 ./dup-pack -r "$repo" snap0 < "$data"
85 ./dup-gc "$repo"
86 sum0=`sha1sum "$data" | awk '{print $1}'`
87 sum1=`./dup-unpack -r "$repo" snap0 | sha1sum | awk '{print $1}'`
88 [ "$sum0" = "$sum1" ]
89 rm -rf "$repo" "$data"
90 }
91
92 test6()
93 {
94 repo=`mktemp -d`
95 data=`mktemp`
96 dd if=/dev/urandom of="$data" bs=1M count=64
97 ./dup-init -H blake2s "$repo"
98 ./dup-pack -r "$repo" snap0 < "$data"
99 ./dup-pack -r "$repo" snap1 < "$data"
100 du -sh "$repo"
101 sum0=`sha1sum "$data" | awk '{print $1}'`
102 sum1=`./dup-unpack -r "$repo" snap0 | sha1sum | awk '{print $1}'`
103 sum2=`./dup-unpack -r "$repo" snap1 | sha1sum | awk '{print $1}'`
104 [ "$sum0" = "$sum1" ]
105 [ "$sum0" = "$sum2" ]
106 rm -rf "$repo" "$data"
107 }
108
109 make
110 test0
111 test1
112 test2
113 test3
114 test4
115 test5
116 test6