diff options
author | Brian Behlendorf <[email protected]> | 2017-04-12 13:36:48 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2017-04-12 13:36:48 -0700 |
commit | 00481e7dad1d5608ae244eb053517e2c36d9a6de (patch) | |
tree | b3491e29349bcfa219906a11385a71d3168d9bd6 /scripts/zfs-tests.sh | |
parent | 120ff39a75ad52efc359308a5e128a58998dd2f3 (diff) |
OpenZFS 7503 - zfs-test should tail ::zfs_dbgmsg on test failure
Authored by: Pavel Zakharov <[email protected]>
Reviewed by: John Kennedy <[email protected]>
Reviewed by: Matt Ahrens <[email protected]>
Approved by: Gordon Ross <[email protected]>
Reviewed-by: Giuseppe Di Natale <[email protected]>
Reviewed-by: George Melikov <[email protected]>
Ported-by: Brian Behlendorf <[email protected]>
Porting Notes:
- Enable internal log for DEBUG builds and in zfs-tests.sh.
- callbacks/zfs_dbgmsg.ksh - Dump interal log via kstat.
- callbacks/zfs_dmesg.ksh - Dump dmesg log.
- default.cfg - 'Test Suite Specific Commands' dropped.
OpenZFS-issue: https://www.illumos.org/issues/7503
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/55a1300
Closes #6002
Diffstat (limited to 'scripts/zfs-tests.sh')
-rwxr-xr-x | scripts/zfs-tests.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/zfs-tests.sh b/scripts/zfs-tests.sh index 54c2b3909..5228d4579 100755 --- a/scripts/zfs-tests.sh +++ b/scripts/zfs-tests.sh @@ -41,6 +41,9 @@ FILEDIR=${FILEDIR:-/var/tmp} DISKS=${DISKS:-""} SINGLETEST=() SINGLETESTUSER="root" +ZFS_DBGMSG="$STF_SUITE/callbacks/zfs_dbgmsg.ksh" +ZFS_DMESG="$STF_SUITE/callbacks/zfs_dmesg.ksh" +TESTFAIL_CALLBACKS=${TESTFAIL_CALLBACKS:-"$ZFS_DBGMSG:$ZFS_DMESG"} # # Attempt to remove loopback devices and files which where created earlier @@ -475,6 +478,14 @@ if [ -x "$STF_PATH/setenforce" ]; then sudo setenforce permissive &>/dev/null fi +# +# Enable interal ZFS debug log and clear it. +# +if [ -e /sys/module/zfs/parameters/zfs_dbgmsg_enable ]; then + sudo /bin/sh -c "echo 1 >/sys/module/zfs/parameters/zfs_dbgmsg_enable" + sudo /bin/sh -c "echo 0 >/proc/spl/kstat/zfs/dbgmsg" +fi + msg "FILEDIR: $FILEDIR" msg "FILES: $FILES" msg "LOOPBACKS: $LOOPBACKS" @@ -491,6 +502,7 @@ export STF_PATH export DISKS export KEEP export __ZFS_POOL_EXCLUDE +export TESTFAIL_CALLBACKS export PATH=$STF_PATH msg "${TEST_RUNNER} ${QUIET} -c ${RUNFILE} -i ${STF_SUITE}" |