aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorTony Hutter <[email protected]>2022-03-23 08:15:02 -0700
committerGitHub <[email protected]>2022-03-23 09:15:02 -0600
commitb73505c7e056417cba73dcf51b49062c84fd2b59 (patch)
tree8d4a3b6d2c5d708717f7a2166baa0992dcf4f6e1 /scripts
parent6b444cb9711a8c0a089612dc3ac67e45c4a4e108 (diff)
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 <[email protected]> Signed-off-by: Tony Hutter <[email protected]> Closes #13227
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/zfs-tests.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/zfs-tests.sh b/scripts/zfs-tests.sh
index 2477d0f91..851ff8b74 100755
--- a/scripts/zfs-tests.sh
+++ b/scripts/zfs-tests.sh
@@ -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}" \