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]
22 # Copyright (c) 2018 Lawrence Livermore National Security, LLC.
24 . $STF_SUITE/include/libtest.shlib
25 . $STF_SUITE/tests/functional/cli_root/zpool_scrub/zpool_scrub.cfg
29 # zpool status should print "(repairing)" on drives with errors found
33 # 1. Create a file (already done in setup.ksh)
34 # 2. Inject read errors on one vdev
36 # 4. Verify we see "(repairing)" on the bad vdev
39 verify_runnable "global"
41 log_assert "Verify we see '(repairing)' while scrubbing a bad vdev."
45 log_must zinject -c all
46 log_must set_tunable64 SCAN_VDEV_LIMIT $ZFS_SCAN_VDEV_LIMIT_DEFAULT
47 zpool scrub -s $TESTPOOL || true
52 # A file is already created in setup.ksh. Inject read errors on the first disk.
53 log_must zinject -d $DISK1 -e io -T read -f 100 $TESTPOOL
56 log_must zinject -d $DISK1 -D10:1 $TESTPOOL
57 log_must set_tunable64 SCAN_VDEV_LIMIT $ZFS_SCAN_VDEV_LIMIT_SLOW
59 log_must zpool scrub $TESTPOOL
61 # Wait for the scrub to show '(repairing)'. Timeout after 10 sec if it doesn't
63 for i in {0..100} ; do
64 if ! is_pool_scrubbing $TESTPOOL ; then
68 if zpool status | grep "$DISK1" | grep -q '(repairing)' ; then
69 log_pass "Correctly saw '(repairing)' while scrubbing"
74 log_fail "Never saw '(repairing)' while scrubbing"