From: Eric Sandeen Date: Tue, 26 May 2015 02:51:57 +0000 (+1000) Subject: xfs/032: properly test for corruption from xfs_copy X-Git-Tag: v2022.05.01~2873 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=ac6c6b9f0b9844ab4b74c842ce7d74e145361a4e;p=xfstests-dev.git xfs/032: properly test for corruption from xfs_copy 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 Reviewed-by: Eryu Guan Signed-off-by: Dave Chinner --- diff --git a/tests/xfs/032 b/tests/xfs/032 index 60c4662c..a3fb89f2 100755 --- a/tests/xfs/032 +++ b/tests/xfs/032 @@ -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));