5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
24 # Copyright (c) 2018 by Lawrence Livermore National Security, LLC.
28 # Verify zpool status -s (slow IOs) works
32 # 2. Inject slow IOs into the pool
33 # 3. Verify we can see the slow IOs with "zpool status -s".
34 # 4. Verify we can see delay events.
37 . $STF_SUITE/include/libtest.shlib
38 . $STF_SUITE/include/zpool_script.shlib
42 verify_runnable "both"
44 default_mirror_setup_noexit $DISKS
48 log_must zinject -c all
49 log_must set_tunable64 ZIO_SLOW_IO_MS $OLD_SLOW_IO
50 log_must set_tunable64 SLOW_IO_EVENTS_PER_SECOND $OLD_SLOW_IO_EVENTS
51 default_cleanup_noexit
56 log_must zpool events -c
58 # Mark any IOs greater than 10ms as slow IOs
59 OLD_SLOW_IO=$(get_tunable ZIO_SLOW_IO_MS)
60 OLD_SLOW_IO_EVENTS=$(get_tunable SLOW_IO_EVENTS_PER_SECOND)
61 log_must set_tunable64 ZIO_SLOW_IO_MS 10
62 log_must set_tunable64 SLOW_IO_EVENTS_PER_SECOND 1000
65 log_must zinject -d $DISK -D20:100 $TESTPOOL
66 log_must mkfile 1048576 /$TESTPOOL/testfile
67 log_must zpool sync $TESTPOOL
69 log_must zinject -c all
70 SLOW_IOS=$(zpool status -sp | grep "$DISK" | awk '{print $6}')
71 DELAY_EVENTS=$(zpool events | grep delay | wc -l)
73 if [ $SLOW_IOS -gt 0 ] && [ $DELAY_EVENTS -gt 0 ] ; then
74 log_pass "Correctly saw $SLOW_IOS slow IOs and $DELAY_EVENTS delay events"
76 log_fail "Only saw $SLOW_IOS slow IOs and $DELAY_EVENTS delay events"