From b73505c7e056417cba73dcf51b49062c84fd2b59 Mon Sep 17 00:00:00 2001 From: Tony Hutter Date: Wed, 23 Mar 2022 08:15:02 -0700 Subject: 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 Signed-off-by: Tony Hutter Closes #13227 --- scripts/zfs-tests.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'scripts/zfs-tests.sh') 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}" \ -- cgit v1.2.3