ZTS: Log test name to /dev/kmsg on Linux

Add a -K option to the test suite to log each test name to /dev/kmsg
(on Linux), so if there's a kernel warning we'll be able to match
it up to a particular test.

Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes  #13227
This commit is contained in:
Tony Hutter
2022-03-23 08:15:02 -07:00
committed by GitHub
parent 6b444cb971
commit b73505c7e0
2 changed files with 32 additions and 10 deletions
+8 -1
View File
@@ -39,6 +39,7 @@ VERBOSE="no"
QUIET=""
CLEANUP="yes"
CLEANUPALL="no"
KMSG=""
LOOPBACK="yes"
STACK_TRACER="no"
FILESIZE="4G"
@@ -326,6 +327,7 @@ OPTIONS:
-q Quiet test-runner output
-x Remove all testpools, dm, lo, and files (unsafe)
-k Disable cleanup after test failure
-K Log test names to /dev/kmsg
-f Use files only, disables block device tests
-S Enable stack tracer (negative performance impact)
-c Only create and populate constrained path
@@ -357,7 +359,7 @@ $0 -x
EOF
}
while getopts 'hvqxkfScRmn:d:s:r:?t:T:u:I:' OPTION; do
while getopts 'hvqxkKfScRmn:d:s:r:?t:T:u:I:' OPTION; do
case $OPTION in
h)
usage
@@ -375,6 +377,9 @@ while getopts 'hvqxkfScRmn:d:s:r:?t:T:u:I:' OPTION; do
k)
CLEANUP="no"
;;
K)
KMSG="yes"
;;
f)
LOOPBACK="no"
;;
@@ -705,6 +710,7 @@ REPORT_FILE=$(mktemp_file zts-report)
msg "${TEST_RUNNER}" \
"${QUIET:+-q}" \
"${KMEMLEAK:+-m}" \
"${KMSG:+-K}" \
"-c \"${RUNFILES}\"" \
"-T \"${TAGS}\"" \
"-i \"${STF_SUITE}\"" \
@@ -712,6 +718,7 @@ msg "${TEST_RUNNER}" \
{ ${TEST_RUNNER} \
${QUIET:+-q} \
${KMEMLEAK:+-m} \
${KMSG:+-K} \
-c "${RUNFILES}" \
-T "${TAGS}" \
-i "${STF_SUITE}" \