]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfs/032: properly test for corruption from xfs_copy
authorEric Sandeen <sandeen@redhat.com>
Tue, 26 May 2015 02:51:57 +0000 (12:51 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 26 May 2015 02:51:57 +0000 (12:51 +1000)
From the xfs_repair manpage:

    xfs_repair run without the -n option will always return
    a status code of 0.

So we must use "-n" to detect corruption in this test.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
tests/xfs/032

index 60c4662c51f1c29dd8db0c65246190aa56eee6a1..a3fb89f2797f91308b7f931b8cca04df93d3b5b4 100755 (executable)
@@ -68,7 +68,8 @@ while [ $SECTORSIZE -le $PAGESIZE ]; do
 
                $XFS_COPY_PROG -d $SCRATCH_DEV $IMGFILE >> $seqres.full 2>&1 || \
                        _fail "Copy failed for Sector size $SECTORSIZE Block size $BLOCKSIZE"
-               $XFS_REPAIR_PROG $IMGFILE >> $seqres.full 2>&1 || \
+               # Must use "-n" to get exit code; without it xfs_repair always returns 0
+               $XFS_REPAIR_PROG -n $IMGFILE >> $seqres.full 2>&1 || \
                        _fail "Copy corrupted for Sector size $SECTORSIZE Block size $BLOCKSIZE"
 
                BLOCKSIZE=$(($BLOCKSIZE * 2));