6 # This file and its contents are supplied under the terms of the
7 # Common Development and Distribution License ("CDDL"), version 1.0.
8 # You may only use this file in accordance with the terms of version
11 # A full copy of the text of the CDDL should have accompanied this
12 # source. A copy of the CDDL is also available via the Internet at
13 # http://www.illumos.org/license/CDDL.
19 # Copyright (c) 2019, Datto Inc. All rights reserved.
20 # Copyright (c) 2020 by Lawrence Livermore National Security, LLC.
23 .
$STF_SUITE/include
/libtest.shlib
24 .
$STF_SUITE/tests
/functional
/replacement
/replacement.cfg
28 # Executing 'zpool replace -s' for raidz vdevs failed. Sequential
29 # resilvers are only allowed for stripe/mirror pools.
32 # 1. Create a raidz pool, verify 'zpool replace -s' fails
33 # 2. Create a stripe/mirror pool, verify 'zpool replace -s' passes
38 log_must set_tunable32 SCAN_SUSPEND_PROGRESS \
39 $ORIG_SCAN_SUSPEND_PROGRESS
40 destroy_pool
$TESTPOOL1
41 rm -f ${VDEV_FILES[@]} $SPARE_VDEV_FILE
44 log_assert
"Sequential resilver is not allowed for raidz vdevs"
46 ORIG_SCAN_SUSPEND_PROGRESS
=$
(get_tunable SCAN_SUSPEND_PROGRESS
)
50 log_must truncate
-s $VDEV_FILE_SIZE ${VDEV_FILES[@]} $SPARE_VDEV_FILE
53 for vdev_type
in "raidz" "raidz2" "raidz3"; do
54 log_must zpool create
-f $TESTPOOL1 $vdev_type ${VDEV_FILES[@]}
55 log_mustnot zpool replace
-s $TESTPOOL1 ${VDEV_FILES[1]} \
57 destroy_pool
$TESTPOOL1
61 log_must zpool create
$TESTPOOL1 ${VDEV_FILES[@]}
62 log_must zpool replace
-s $TESTPOOL1 ${VDEV_FILES[1]} $SPARE_VDEV_FILE
63 destroy_pool
$TESTPOOL1
66 log_must zpool create
$TESTPOOL1 mirror
${VDEV_FILES[0]} ${VDEV_FILES[1]}
67 log_must zpool replace
-s $TESTPOOL1 ${VDEV_FILES[1]} $SPARE_VDEV_FILE
68 destroy_pool
$TESTPOOL1
70 log_pass
"Sequential resilver is not allowed for raidz vdevs"