io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] test: save dmesg output for each test and test file
@ 2020-09-18 10:47 Lukas Czerner
  2020-09-18 10:47 ` [PATCH 2/5] test: make a distinction between successful and skipped test Lukas Czerner
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Lukas Czerner @ 2020-09-18 10:47 UTC (permalink / raw)
  To: io-uring

Currently the dmesg output for each test will overwritten for every
test file so in the end only the dmesg output of the last test run will
be stored.

Fix it by using the test file name as well as test name in the dmesg log
file.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
 test/runtests.sh | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/test/runtests.sh b/test/runtests.sh
index fa240f2..5107a0a 100755
--- a/test/runtests.sh
+++ b/test/runtests.sh
@@ -28,13 +28,18 @@ fi
 _check_dmesg()
 {
 	local dmesg_marker="$1"
-	local seqres="$2.seqres"
+	if [ -n "$3" ]; then
+		local dmesg_log=$(echo "${2}_${3}.dmesg" | \
+				  sed 's/\(\/\|_\/\|\/_\)/_/g')
+	else
+		local dmesg_log="${2}.dmesg"
+	fi
 
 	if [ $DO_KMSG -eq 0 ]; then
 		return 0
 	fi
 
-	dmesg | bash -c "$DMESG_FILTER" | grep -A 9999 "$dmesg_marker" >"${seqres}.dmesg"
+	dmesg | bash -c "$DMESG_FILTER" | grep -A 9999 "$dmesg_marker" >"$dmesg_log"
 	grep -q -e "kernel BUG at" \
 	     -e "WARNING:" \
 	     -e "BUG:" \
@@ -45,12 +50,12 @@ _check_dmesg()
 	     -e "INFO: possible circular locking dependency detected" \
 	     -e "general protection fault:" \
 	     -e "blktests failure" \
-	     "${seqres}.dmesg"
+	     "$dmesg_log"
 	# shellcheck disable=SC2181
 	if [[ $? -eq 0 ]]; then
 		return 1
 	else
-		rm -f "${seqres}.dmesg"
+		rm -f "$dmesg_log"
 		return 0
 	fi
 }
@@ -94,7 +99,7 @@ run_test()
 		echo "Test $test_name failed with ret $status"
 		FAILED="$FAILED <$test_string>"
 		RET=1
-	elif ! _check_dmesg "$dmesg_marker" "$test_name"; then
+	elif ! _check_dmesg "$dmesg_marker" "$test_name" "$dev"; then
 		echo "Test $test_name failed dmesg check"
 		FAILED="$FAILED <$test_string>"
 		RET=1
-- 
2.26.2


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

end of thread, other threads:[~2020-09-18 10:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-18 10:47 [PATCH 1/5] test: save dmesg output for each test and test file Lukas Czerner
2020-09-18 10:47 ` [PATCH 2/5] test: make a distinction between successful and skipped test Lukas Czerner
2020-09-18 10:47 ` [PATCH 3/5] test: store test output to a log file Lukas Czerner
2020-09-18 10:47 ` [PATCH 4/5] test: make test output more readable Lukas Czerner
2020-09-18 10:47 ` [PATCH 5/5] test: handle the case when timeout is forced to KILL Lukas Czerner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).