130
130
# Actual tests are below. If you add test cases above, these need to be tweaked.
131
131
# ---------------------------------------------------------------------------------
132
132
133
-
134
- cat ${DUC_TEST_DIR} .out | grep -q " Indexed 77 files and 47 directories, (91869B apparent, 540672B actual)"
133
+ # An exact match is expected on the apparent size; the actual size may vary.
134
+ cat ${DUC_TEST_DIR} .out | grep -q " Indexed 77 files and 47 directories, (91869B apparent, [0-9]*B actual)"
135
135
136
136
if [ " $? " = " 0" ]; then
137
137
echo " report: ok"
@@ -153,16 +153,26 @@ if [ "$?" != "0" ]; then
153
153
exit 1
154
154
fi
155
155
156
- testsum=" 33e2be27a9e70e81d4006a2d7b555948"
156
+ # When two or more hard links point to the same file and when running duc with
157
+ # the `--check-hard-links' option, only one of the hard links will be
158
+ # counted. However, duc may pick up and display a different hard link depending
159
+ # on the system it is being run on. Since our tests include three hard links to
160
+ # the same file, we should be expecting three possible outcomes, all equally
161
+ # valid, each corresponding to one of the following MD5 checksums.
162
+ testsum0=" 78dbf880ef6917ea665fddb5ebb44428"
163
+ testsum1=" 38ab7b7d1ec6ac57d672c5618371386d"
164
+ testsum2=" 33e2be27a9e70e81d4006a2d7b555948"
157
165
md5sum ${DUC_TEST_DIR} .out > /tmp/.duc.md5sum
158
- grep -q $testsum /tmp/.duc.md5sum
166
+ grep -q " $testsum0 \| $testsum1 \| $testsum2 " /tmp/.duc.md5sum
159
167
160
168
if [ " $? " = " 0" ]; then
161
169
echo " md5sum: ok"
162
170
else
163
171
echo " md5sum: failed"
164
- echo " expected: "
165
- echo " $testsum ${DUC_TEST_DIR} .out"
172
+ echo " expected one of: "
173
+ echo " $testsum0 ${DUC_TEST_DIR} .out"
174
+ echo " $testsum1 ${DUC_TEST_DIR} .out"
175
+ echo " $testsum2 ${DUC_TEST_DIR} .out"
166
176
echo " got: "
167
177
cat /tmp/.duc.md5sum
168
178
exit 1
0 commit comments