git: b2c207ddfc45 - stable/13 - Fix the zfsd_autoreplace_001_neg test
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 06 Sep 2023 20:45:03 UTC
The branch stable/13 has been updated by asomers:
URL: https://cgit.FreeBSD.org/src/commit/?id=b2c207ddfc459b82c0ec5d0c52ab66a9cc169257
commit b2c207ddfc459b82c0ec5d0c52ab66a9cc169257
Author: Alan Somers <asomers@FreeBSD.org>
AuthorDate: 2023-07-05 22:37:39 +0000
Commit: Alan Somers <asomers@FreeBSD.org>
CommitDate: 2023-09-06 20:44:53 +0000
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)
---
tests/sys/cddl/zfs/tests/zfsd/zfsd_autoreplace_001_neg.ksh | 7 ++++---
1 file 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"