aboutsummaryrefslogtreecommitdiffstats
path: root/tests/zfs-tests
diff options
context:
space:
mode:
authorRyan Moeller <[email protected]>2020-02-18 14:22:56 -0500
committerGitHub <[email protected]>2020-02-18 11:22:56 -0800
commit5f087dda784b26f16e72eff32c0e2c2b7c483adb (patch)
tree5948fd65b72984b68588ecbc91c33142e48e48e2 /tests/zfs-tests
parent8b3547a481a74b39c5d0eed256896fb25e8310e9 (diff)
Enable zpool events tunables and tests on FreeBSD
We have have made the necessary changes in our module code to expose zevents through both devd and the zpool events ioctl. Now the tunables can be exposed and zpool events tests can be enabled on both platforms. A few minor tweaks to the tests were needed to accommodate the way wc formats output on FreeBSD. zed remains to be ported. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10008
Diffstat (limited to 'tests/zfs-tests')
-rw-r--r--tests/zfs-tests/include/tunables.cfg2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_clear.ksh6
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_errors.ksh4
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_follow.ksh4
4 files changed, 8 insertions, 8 deletions
diff --git a/tests/zfs-tests/include/tunables.cfg b/tests/zfs-tests/include/tunables.cfg
index 2a4ea9bdc..01176c781 100644
--- a/tests/zfs-tests/include/tunables.cfg
+++ b/tests/zfs-tests/include/tunables.cfg
@@ -73,7 +73,7 @@ VDEV_VALIDATE_SKIP vdev.validate_skip vdev_validate_skip
VOL_INHIBIT_DEV UNSUPPORTED zvol_inhibit_dev
VOL_MODE vol.mode zvol_volmode
VOL_RECURSIVE vol.recursive UNSUPPORTED
-ZEVENT_LEN_MAX UNSUPPORTED zfs_zevent_len_max
+ZEVENT_LEN_MAX zevent.len_max zfs_zevent_len_max
ZIO_SLOW_IO_MS zio.slow_io_ms zio_slow_io_ms
%%%%
while read name FreeBSD Linux; do
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_clear.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_clear.ksh
index 67038a474..054d39be3 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_clear.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_clear.ksh
@@ -43,14 +43,14 @@ for i in `seq 1 $EVENTS_NUM`; do
done
# wait a bit to allow the kernel module to process new events
zpool_events_settle
-EVENTS_NUM="$(zpool events -H | wc -l)"
+EVENTS_NUM=$(zpool events -H | wc -l | xargs)
# 3. Verify 'zpool events -c' successfully clear new events
-CLEAR_OUTPUT="$(zpool events -c)"
+CLEAR_OUTPUT=$(zpool events -c)
if [[ "$CLEAR_OUTPUT" != "cleared $EVENTS_NUM events" ]]; then
log_fail "Failed to clear $EVENTS_NUM events: $CLEAR_OUTPUT"
fi
-EVENTS_NUM="$(zpool events -H | wc -l)"
+EVENTS_NUM=$(zpool events -H | wc -l)
if [[ $EVENTS_NUM -ne 0 ]]; then
log_fail "Unexpected events number: $EVENTS_NUM != 0"
fi
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_errors.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_errors.ksh
index ba940210e..4645e245c 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_errors.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_errors.ksh
@@ -129,11 +129,11 @@ function do_test
fi
fi
- if [ "$val" == "0" ] || [ "$events" == "" ] ; then
+ if [ -z "$val" -o $val -eq 0 -o -z "$events" -o $events -eq 0 ] ; then
log_fail "Didn't see any errors or events ($val/$events)"
fi
- if [ "$val" != "$events" ] ; then
+ if [ $val -ne $events ] ; then
log_fail "$val $POOLTYPE $str errors != $events events"
else
log_note "$val $POOLTYPE $str errors == $events events"
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_follow.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_follow.ksh
index a996e57c1..258de033b 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_follow.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_follow.ksh
@@ -56,8 +56,8 @@ done
zpool_events_settle
# 4. Verify 'zpool events -f' successfully recorded these new events
-EVENTS_LOG="$(cat $EVENTS_FILE | wc -l)"
-if [[ "$EVENTS_LOG" != "$EVENTS_NUM" ]]; then
+EVENTS_LOG=$(cat $EVENTS_FILE | wc -l)
+if [[ $EVENTS_LOG -ne $EVENTS_NUM ]]; then
log_fail "Unexpected number of events: $EVENTS_LOG != $EVENTS_NUM"
fi