summaryrefslogtreecommitdiff
blob: d2c1c9612e6707bfaa9e0e5cde313a735760cdf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
Fixes test failures on ZFS.

https://github.com/chaos/scrub/commit/5c66fc0537f4ecb21d4c3dcdd9020a02c8a2d819

From 5c66fc0537f4ecb21d4c3dcdd9020a02c8a2d819 Mon Sep 17 00:00:00 2001
From: Jim Garlick <garlick.jim@gmail.com>
Date: Mon, 9 Mar 2015 16:20:38 -0700
Subject: [PATCH] test: use a power of 2 for file sizes

Reduce the change of tests failing due to block size round-up.
Freebsd was failing that way.
--- a/test/t02
+++ b/test/t02
@@ -1,6 +1,6 @@
 #!/bin/sh
 TESTFILE=${TMPDIR:-/tmp}/scrub-testfile.$$
 rm -f $TESTFILE
-./pad 400k $TESTFILE || exit 1
+./pad 512k $TESTFILE || exit 1
 $PATH_SCRUB -r $TESTFILE 2>&1 | sed -e "s!${TESTFILE}!file!" >t02.out || exit 1
 diff t02.exp t02.out >t02.diff
--- a/test/t02.exp
+++ b/test/t02.exp
@@ -1,5 +1,5 @@
 scrub: using NNSA NAP-14.1-C patterns
-scrub: scrubbing file 409600 bytes (~400KB)
+scrub: scrubbing file 524288 bytes (~512KB)
 scrub: random  |................................................|
 scrub: random  |................................................|
 scrub: 0x00    |................................................|
--- a/test/t03
+++ b/test/t03
@@ -1,6 +1,6 @@
 #!/bin/sh
 TESTFILE=${TMPDIR:-/tmp}/scrub-testfile.$$
 rm -f $TESTFILE
-./pad 400k $TESTFILE || exit 1
+./pad 512k $TESTFILE || exit 1
 $PATH_SCRUB -r -p dod $TESTFILE 2>&1 | sed -e "s!$TESTFILE!file!" >t03.out || exit 1
 diff t03.exp t03.out >t03.diff
--- a/test/t03.exp
+++ b/test/t03.exp
@@ -1,5 +1,5 @@
 scrub: using DoD 5220.22-M patterns
-scrub: scrubbing file 409600 bytes (~400KB)
+scrub: scrubbing file 524288 bytes (~512KB)
 scrub: random  |................................................|
 scrub: 0x00    |................................................|
 scrub: 0xff    |................................................|
--- a/test/t04
+++ b/test/t04
@@ -1,6 +1,6 @@
 #!/bin/sh
 TESTFILE=${TMPDIR:-/tmp}/scrub-testfile.$$
 rm -f $TESTFILE
-./pad 400k $TESTFILE || exit 1
+./pad 512k $TESTFILE || exit 1
 $PATH_SCRUB -r -p bsi $TESTFILE 2>&1 | sed -e "s!$TESTFILE!file!" >t04.out || exit 1
 diff t04.exp t04.out >t04.diff
--- a/test/t04.exp
+++ b/test/t04.exp
@@ -1,5 +1,5 @@
 scrub: using BSI patterns
-scrub: scrubbing file 409600 bytes (~400KB)
+scrub: scrubbing file 524288 bytes (~512KB)
 scrub: 0xff    |................................................|
 scrub: 0xfe    |................................................|
 scrub: 0xfd    |................................................|
--- a/test/t05
+++ b/test/t05
@@ -1,6 +1,6 @@
 #!/bin/sh
 TESTFILE=${TMPDIR:-/tmp}/scrub-testfile.$$
 rm -f $TESTFILE
-./pad 400k $TESTFILE || exit 1
+./pad 512k $TESTFILE || exit 1
 $PATH_SCRUB -r -p fastold $TESTFILE 2>&1 | sed -e "s!$TESTFILE!file!" >t05.out || exit 1
 diff t05.exp t05.out >t05.diff
--- a/test/t05.exp
+++ b/test/t05.exp
@@ -1,5 +1,5 @@
 scrub: using pre v1.7 scrub (skip random) patterns
-scrub: scrubbing file 409600 bytes (~400KB)
+scrub: scrubbing file 524288 bytes (~512KB)
 scrub: 0x00    |................................................|
 scrub: 0xff    |................................................|
 scrub: 0xaa    |................................................|
--- a/test/t06
+++ b/test/t06
@@ -1,7 +1,7 @@
 #!/bin/sh
 TESTFILE=${TMPDIR:-/tmp}/scrub-testfile.$$
 rm -f $TESTFILE
-./pad 400k $TESTFILE || exit 1
+./pad 512k $TESTFILE || exit 1
 $PATH_SCRUB -r -p old $TESTFILE 2>&1 | sed -e "s!$TESTFILE!file!" >t06.out || exit 1
 diff t06.exp t06.out >t06.diff
 rc=$?
--- a/test/t06.exp
+++ b/test/t06.exp
@@ -1,5 +1,5 @@
 scrub: using pre v1.7 scrub patterns
-scrub: scrubbing file 409600 bytes (~400KB)
+scrub: scrubbing file 524288 bytes (~512KB)
 scrub: 0x00    |................................................|
 scrub: 0xff    |................................................|
 scrub: 0xaa    |................................................|
--- a/test/t07
+++ b/test/t07
@@ -1,7 +1,7 @@
 #!/bin/sh
 TESTFILE=${TMPDIR:-/tmp}/scrub-testfile.$$
 rm -f $TESTFILE
-./pad 400k $TESTFILE
+./pad 512k $TESTFILE
 (./tsig $TESTFILE && ./tsig $TESTFILE) >t07.out 2>&1
 diff t07.exp t07.out >t07.diff 
 rc=$?
--- a/test/t11
+++ b/test/t11
@@ -1,7 +1,7 @@
 #!/bin/sh
 TESTFILE=${TMPDIR:-/tmp}/scrub-testfile.$$
 rm -f $TESTFILE
-./pad 400k $TESTFILE || exit 1
+./pad 512k $TESTFILE || exit 1
 $PATH_SCRUB -r -p gutmann $TESTFILE 2>&1 | sed -e "s!$TESTFILE!file!" >t11.out || exit 1
 diff t11.exp t11.out >t11.diff
 rc=$?
--- a/test/t11.exp
+++ b/test/t11.exp
@@ -1,5 +1,5 @@
 scrub: using Gutmann patterns
-scrub: scrubbing file 409600 bytes (~400KB)
+scrub: scrubbing file 524288 bytes (~512KB)
 scrub: random  |................................................|
 scrub: random  |................................................|
 scrub: random  |................................................|
--- a/test/t12
+++ b/test/t12
@@ -1,14 +1,14 @@
 #!/bin/sh
 TESTFILE=${TMPDIR:-/tmp}/scrub-testfile.$$
 rm -f $TESTFILE
-./pad 400k $TESTFILE || exit 1
-$PATH_SCRUB -s 400k $TESTFILE 2>&1 | sed -e "s!$TESTFILE!file!" >t12.out
+./pad 512k $TESTFILE || exit 1
+$PATH_SCRUB -s 512k $TESTFILE 2>&1 | sed -e "s!$TESTFILE!file!" >t12.out
 test $? = 0 || exit 1
 ./tsize $TESTFILE >>t12.out 2>&1
-$PATH_SCRUB -f -s 300k $TESTFILE 2>&1 | sed -e "s!$TESTFILE!file!" >>t12.out
+$PATH_SCRUB -f -s 256k $TESTFILE 2>&1 | sed -e "s!$TESTFILE!file!" >>t12.out
 test $? = 0 || exit 1
 ./tsize $TESTFILE >>t12.out 2>&1
-$PATH_SCRUB -f -s 500k $TESTFILE 2>&1 | sed -e "s!$TESTFILE!file!" >>t12.out
+$PATH_SCRUB -f -s 1024k $TESTFILE 2>&1 | sed -e "s!$TESTFILE!file!" >>t12.out
 test $? = 0 || exit 1
 ./tsize $TESTFILE >>t12.out 2>&1
 diff t12.exp t12.out >t12.diff
--- a/test/t12.exp
+++ b/test/t12.exp
@@ -1,22 +1,22 @@
 scrub: using NNSA NAP-14.1-C patterns
-scrub: scrubbing file 409600 bytes (~400KB)
+scrub: scrubbing file 524288 bytes (~512KB)
 scrub: random  |................................................|
 scrub: random  |................................................|
 scrub: 0x00    |................................................|
 scrub: verify  |................................................|
-409600
+524288
 scrub: warning: -s size < file size
 scrub: using NNSA NAP-14.1-C patterns
-scrub: scrubbing file 307200 bytes (~300KB)
+scrub: scrubbing file 262144 bytes (~256KB)
 scrub: random  |................................................|
 scrub: random  |................................................|
 scrub: 0x00    |................................................|
 scrub: verify  |................................................|
-409600
+524288
 scrub: using NNSA NAP-14.1-C patterns
-scrub: scrubbing file 512000 bytes (~500KB)
+scrub: scrubbing file 1048576 bytes (~1024KB)
 scrub: random  |................................................|
 scrub: random  |................................................|
 scrub: 0x00    |................................................|
 scrub: verify  |................................................|
-512000
+1048576
--- a/test/t15
+++ b/test/t15
@@ -2,7 +2,7 @@
 TEST=`basename $0 | cut -d- -f1`
 TESTFILE=${TMPDIR:-/tmp}/scrub-testfile.$$
 rm -f $TESTFILE
-./pad 400k $TESTFILE || exit 1
+./pad 512k $TESTFILE || exit 1
 
 $PATH_SCRUB -p custom="0123456789abcdef" $TESTFILE 2>&1 \
 		| sed -e "s!${TESTFILE}!file!" 2>&1 >$TEST.out|| exit 1
--- a/test/t15.exp
+++ b/test/t15.exp
@@ -1,7 +1,7 @@
 scrub: using Custom single-pass patterns
-scrub: scrubbing file 409600 bytes (~400KB)
+scrub: scrubbing file 524288 bytes (~512KB)
 scrub: 0x30313233343536373839616263646566|......................|
 0000000 001 002 003   S   C   R   U   B   B   E   D   !  \0   d   e   f
 0000020   0   1   2   3   4   5   6   7   8   9   a   b   c   d   e   f
 *
-1440000
+2000000
--- a/test/t16
+++ b/test/t16
@@ -2,7 +2,7 @@
 TEST=`basename $0 | cut -d- -f1`
 TESTFILE=${TMPDIR:-/tmp}/scrub-testfile.$$
 rm -f $TESTFILE
-./pad 400k $TESTFILE || exit 1
+./pad 512k $TESTFILE || exit 1
 
 od -c $TESTFILE >$TEST.out || exit 1
 
--- a/test/t16.exp
+++ b/test/t16.exp
@@ -1,10 +1,10 @@
 0000000  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
 *
-1437760  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0   x
-1440000
+1777760  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0   x
+2000000
 scrub: using Quick Fill with 0xff patterns
 scrub: (dryrun) scrub reg file file
 0000000  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
 *
-1437760  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0   x
-1440000
+1777760  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0   x
+2000000
--- a/test/t17
+++ b/test/t17
@@ -3,9 +3,9 @@ TEST=`basename $0 | cut -d- -f1`
 TMPLATE="${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"
 TESTDIR=`mktemp -d $TMPLATE` || exit 1
 
-./pad 400k $TESTDIR/a || exit 1
-./pad 400k $TESTDIR/b || exit 1
-./pad 400k $TESTDIR/c || exit 1
+./pad 512k $TESTDIR/a || exit 1
+./pad 512k $TESTDIR/b || exit 1
+./pad 512k $TESTDIR/c || exit 1
 
 echo Created 3 files >$TEST.out
 
--- a/test/t17.exp
+++ b/test/t17.exp
@@ -1,16 +1,16 @@
 Created 3 files
 scrub: using NNSA NAP-14.1-C patterns
-scrub: scrubbing file/a 409600 bytes (~400KB)
+scrub: scrubbing file/a 524288 bytes (~512KB)
 scrub: random  |................................................|
 scrub: random  |................................................|
 scrub: 0x00    |................................................|
 scrub: verify  |................................................|
-scrub: scrubbing file/b 409600 bytes (~400KB)
+scrub: scrubbing file/b 524288 bytes (~512KB)
 scrub: random  |................................................|
 scrub: random  |................................................|
 scrub: 0x00    |................................................|
 scrub: verify  |................................................|
-scrub: scrubbing file/c 409600 bytes (~400KB)
+scrub: scrubbing file/c 524288 bytes (~512KB)
 scrub: random  |................................................|
 scrub: random  |................................................|
 scrub: 0x00    |................................................|
--- a/test/t22
+++ b/test/t22
@@ -3,9 +3,9 @@ TEST=`basename $0 | cut -d- -f1`
 TMPLATE="${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"
 TESTDIR=`mktemp -d $TMPLATE` || exit 1
 
-./pad 400k $TESTDIR/a || exit 1
-./pad 400k $TESTDIR/b || exit 1
-./pad 400k $TESTDIR/c || exit 1
+./pad 512k $TESTDIR/a || exit 1
+./pad 512k $TESTDIR/b || exit 1
+./pad 512k $TESTDIR/c || exit 1
 
 echo Created 3 files >$TEST.out