[PATCH v3 12/14] btrfs-progs: tests/common: Detect ungraceful failure case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



run_mustfail() checks the return value but doesn't check if the failure
is graceful.

Add such ungraceful failure check, for incoming "mkfs.btrfs --rootdir"
test cases, as old "--rootdir" never fail gracefully.

Signed-off-by: Qu Wenruo <quwenruo.btrfs@xxxxxxx>
---
 tests/common | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/common b/tests/common
index 242ded1d..b49d9ff3 100644
--- a/tests/common
+++ b/tests/common
@@ -227,6 +227,11 @@ run_mustfail()
 		$INSTRUMENT "$@" >> "$RESULTS" 2>&1
 	fi
 	if [ $? != 0 ]; then
+		if [ $? -gt 128 ]; then
+			"failed (ungracefully): $@" >> "$RESULTS"
+			_fail "unexpected ungraceful failure: $msg"
+			return 1
+		fi
 		echo "failed (expected): $@" >> "$RESULTS"
 		return 0
 	else
-- 
2.14.1

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux