16
if test ! -f $SRCDIR/tests/$i.img.bz2 -a \
17
! -f $SRCDIR/tests/$i.results ;
16
RESULTS=$SRCDIR/tests/$i.results
17
IMAGE_BZ2=$SRCDIR/tests/$i.img.bz2
18
IMAGE=tests/tmp/$i.img.$$
19
if test ! -f $IMAGE_BZ2 -a ! -f $RESULTS ;
19
21
echo "non-existent"
22
bunzip2 < $SRCDIR/tests/$i.img.bz2 > /tmp/test.img.$$
23
./tst_probe /tmp/test.img.$$ > tests/$i.out
24
/bin/rm -f /tmp/test.img.$$ tests/$i.ok tests/$i.failed
25
cmp -s tests/$i.out $SRCDIR/tests/$i.results
24
if [ "$i" = "swap0" ]; then
25
# swap is native-endian, so regenerate before testing
26
dd if=/dev/zero of=$IMAGE bs=16k count=64 2> /dev/null
27
mkswap -v0 $IMAGE > /dev/null
28
elif [ "$i" = "swap1" ]; then
29
# swap is native-endian, so regenerate before testing
30
dd if=/dev/zero of=$IMAGE bs=16k count=64 2> /dev/null
31
# check if mkswap supports the "-U" option
32
if mkswap -h 2>&1 | grep -q -- '-U'; then
33
UUID="-U 8ff8e77f-8553-485e-8656-58be67a81666"
35
RMUUID="| grep -v UUID"
36
RES_TMP=$SRCDIR/tests/tmp/$i.results
37
grep -v UUID $RESULTS > $RES_TMP
40
mkswap -v1 -L SWAP-TEST $UUID $IMAGE >/dev/null
42
bunzip2 < $IMAGE_BZ2 > $IMAGE
44
eval ./tst_probe $IMAGE $RMUUID > tests/$i.out
45
/bin/rm -f $IMAGE tests/$i.ok tests/$i.failed
46
cmp -s tests/$i.out $RESULTS
26
48
if [ $? = 0 ]; then
31
diff -c tests/$i.out $SRCDIR/tests/$i.results > tests/$i.failed
53
diff -c tests/$i.out $RESULTS > tests/$i.failed