aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Somers <asomers@FreeBSD.org>2023-07-05 22:37:39 +0000
committerAlan Somers <asomers@FreeBSD.org>2023-09-06 20:44:53 +0000
commitb2c207ddfc459b82c0ec5d0c52ab66a9cc169257 (patch)
tree81a39805e48c4db2a887ac900dbcff7d2629c2b4
parent422efa7050a7a0a75f04aed2c857a2e2ea4f51ed (diff)
downloadsrc-b2c207ddfc459b82c0ec5d0c52ab66a9cc169257.tar.gz
src-b2c207ddfc459b82c0ec5d0c52ab66a9cc169257.zip
Fix the zfsd_autoreplace_001_neg test
It only ever worked by accident. * Actually set autoreplace=off as stated in the description * Wait for the removed device to disappear from the pool before proceeding. * In the assertion, verify that the new disk does not get added, as described in the description. Sponsored by: Axcient (cherry picked from commit be092bcde96bdcfde9013d60e442cca023bfbd1b)
-rw-r--r--tests/sys/cddl/zfs/tests/zfsd/zfsd_autoreplace_001_neg.ksh7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/sys/cddl/zfs/tests/zfsd/zfsd_autoreplace_001_neg.ksh b/tests/sys/cddl/zfs/tests/zfsd/zfsd_autoreplace_001_neg.ksh
index 5020946feb99..2fc631074787 100644
--- a/tests/sys/cddl/zfs/tests/zfsd/zfsd_autoreplace_001_neg.ksh
+++ b/tests/sys/cddl/zfs/tests/zfsd/zfsd_autoreplace_001_neg.ksh
@@ -37,7 +37,7 @@
# ID: zfsd_autoreplace_001_neg
#
# DESCRIPTION:
-# In a pool without the autoreplace property unset, a vdev will not be
+# In a pool without the autoreplace property set, a vdev will not be
# replaced by physical path
#
# STRATEGY:
@@ -62,7 +62,7 @@ function verify_assertion
{
# 9. Verify that it does not get added to the pool
for ((timeout=0; timeout<4; timeout=$timeout+1)); do
- log_mustnot check_state $TESTPOOL $REMOVAL_DISK "ONLINE"
+ log_mustnot check_state $TESTPOOL $NEW_DISK "ONLINE"
$SLEEP 5
done
}
@@ -81,9 +81,10 @@ log_must create_gnops $OTHER_DISKS
for keyword in "${MY_KEYWORDS[@]}" ; do
log_must create_gnop $REMOVAL_DISK $PHYSPATH
log_must create_pool $TESTPOOL $keyword $ALLNOPS
- log_must $ZPOOL set autoreplace=on $TESTPOOL
+ log_must $ZPOOL set autoreplace=off $TESTPOOL
log_must destroy_gnop $REMOVAL_DISK
+ log_must wait_for_pool_removal 20
log_must create_gnop $NEW_DISK $PHYSPATH
verify_assertion
destroy_pool "$TESTPOOL"