FS/XFS testing framework
 help / color / mirror / Atom feed
* [PATCH 1/2] common: return failure if _check_xxx_filesystem finds corruption
@ 2014-12-15 17:09 Eryu Guan
  2014-12-15 17:09 ` [PATCH 2/2] check: treat _check_{test,scratch}_fs failures as test failures Eryu Guan
  2014-12-15 20:31 ` [PATCH 1/2] common: return failure if _check_xxx_filesystem finds corruption Dave Chinner
  0 siblings, 2 replies; 6+ messages in thread
From: Eryu Guan @ 2014-12-15 17:09 UTC (permalink / raw)
  To: fstests; +Cc: Eryu Guan

Tests like xfs/179 depend on the return value of _check_scratch_fs to
detect fs corruption, but _check_$FSTYP_filesystem always returns 0.

Make _check_$FSTYP_filesystem return failure on corruption.

Also don't exit if these functions called by 'check', like what
_check_xfs_filesystem() does.

Signed-off-by: Eryu Guan <eguan@redhat.com>
---
 common/rc | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/common/rc b/common/rc
index 692d45c..87d2928 100644
--- a/common/rc
+++ b/common/rc
@@ -1717,7 +1717,10 @@ _check_generic_filesystem()
 
     if [ $ok -eq 0 ]; then
 	status=1
-	exit 1
+	if [ "$iam" != "check" ]; then
+		exit 1
+	fi
+	return 1
     fi
 
     return 0
@@ -1819,6 +1822,7 @@ _check_xfs_filesystem()
 	if [ "$iam" != "check" ]; then
 		exit 1
 	fi
+	return 1
     fi
 
     return 0
@@ -1863,7 +1867,8 @@ _check_udf_filesystem()
     $here/src/udf_test $OPT_ARG $device | tee $seqres.checkfs | egrep "Error|Warning" | \
 	_udf_test_known_error_filter | \
 	egrep -iv "Error count:.*[0-9]+.*total occurrences:.*[0-9]+|Warning count:.*[0-9]+.*total occurrences:.*[0-9]+" && \
-        echo "Warning UDF Verifier reported errors see $seqres.checkfs."
+        echo "Warning UDF Verifier reported errors see $seqres.checkfs." && return 1
+    return 0
 }
 
 _check_xfs_test_fs()
@@ -1928,7 +1933,10 @@ _check_btrfs_filesystem()
 
     if [ $ok -eq 0 ]; then
 	status=1
-	exit 1
+	if [ "$iam" != "check" ]; then
+		exit 1
+	fi
+	return 1
     fi
 
     return 0
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-12-16  3:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-15 17:09 [PATCH 1/2] common: return failure if _check_xxx_filesystem finds corruption Eryu Guan
2014-12-15 17:09 ` [PATCH 2/2] check: treat _check_{test,scratch}_fs failures as test failures Eryu Guan
2014-12-15 23:27   ` Dave Chinner
2014-12-16  3:31     ` Eryu Guan
2014-12-15 20:31 ` [PATCH 1/2] common: return failure if _check_xxx_filesystem finds corruption Dave Chinner
2014-12-16  3:28   ` Eryu Guan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox