tests: Add diagnostic info for kernel bug, warning, and oops
authorKienan Stewart <kstewart@efficios.com>
Tue, 23 Jan 2024 15:08:34 +0000 (10:08 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 7 Mar 2024 19:04:14 +0000 (14:04 -0500)
When test_select_poll_epoll fails with an error due to hitting one a new
WARNING, OOPS, or BUG statements in dmesg, the user must go and read the
the logs themselves to try and find the matching statements.

Providing the previous and new messages in diagnostic output will allow
a person reading the test results to more quickly ascertain if the
messages are pertinent to lttng-modules or not. That being said, there
is no guarantee that there are not other WARNINGs, OOPs, or BUGs in
dmesg between before and after that are pertinent.

Change-Id: Ida026dfe852cafdcc55979089c92995949e2ef0d
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/regression/kernel/test_select_poll_epoll

index 09c911df978854a0f9f661a1d7ddd191fc9d614a..a359945cd59881fa564c776bbf51d5e76bca64c0 100755 (executable)
@@ -390,12 +390,18 @@ check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
        NEW_BUG=$(dmesg | grep " BUG:" | cut -d' ' -f1 | tail -1)
 
        if test "$LAST_WARNING" != "$NEW_WARNING"; then
+               diag "Last WARNING before tests: ${LAST_WARNING}"
+               diag "Last WARNING after tests: ${NEW_WARNING}"
                fail "New WARNING generated"
        fi
        if test "$LAST_OOPS" != "$NEW_OOPS"; then
+               diag "Last OOPS before tests: ${LAST_OOPS}"
+               diag "Last OOPS after tests: ${NEW_OOPS}"
                fail "New OOPS generated"
        fi
        if test "$LAST_BUG" != "$NEW_BUG"; then
+               diag "Last BUG before tests: ${LAST_BUG}"
+               diag "Last BUG after tests: ${NEW_BUG}"
                fail "New BUG generated"
        fi
 }
This page took 0.025885 seconds and 4 git commands to generate.