mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-30 18:56:23 +03:00
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 <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <ryan@iXsystems.com> Closes #10008
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user