Skip to content

Commit 9ab6109

Browse files
authored
ZTS: Improve zts-auto_offline_001_pos
The zts-auto_offline_001_pos test could exceed the 10 minute test limit and be KILLED by the test infrastructure. To prevent this speed up the test case by: * Removing redundant pool configurations. Each of the following vdev types is tested once: mirror, raidz, cache, and special. * The block_device_wait function need only wait on the block device which has been removed as part of the test. Reviewed-by: Paul Zuchowski <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #9827
1 parent 36e5b4a commit 9ab6109

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

tests/zfs-tests/tests/functional/fault/auto_offline_001_pos.ksh

+12-14
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,11 @@ filedev3="$TEST_BASE_DIR/file-vdev-3"
7373
sparedev="$TEST_BASE_DIR/file-vdev-spare"
7474
removedev=$(get_debug_device)
7575

76-
typeset poolconfs=("mirror $filedev1 $removedev"
77-
"raidz $filedev1 $removedev"
78-
"raidz2 $filedev1 $filedev2 $removedev"
76+
typeset poolconfs=(
77+
"mirror $filedev1 $removedev"
7978
"raidz3 $filedev1 $filedev2 $filedev3 $removedev"
8079
"$filedev1 cache $removedev"
81-
"mirror $filedev1 $filedev2 cache $removedev"
82-
"raidz $filedev1 $filedev2 $filedev3 cache $removedev"
80+
"mirror $filedev1 $filedev2 special mirror $filedev3 $removedev"
8381
)
8482

8583
log_must truncate -s $SPA_MINDEVSIZE $filedev1
@@ -91,7 +89,7 @@ for conf in "${poolconfs[@]}"
9189
do
9290
# 1. Create a pool
9391
log_must zpool create -f $TESTPOOL $conf
94-
block_device_wait
92+
block_device_wait ${DEV_DSKDIR}/${removedev}
9593

9694
# 2. Simulate physical removal of one device
9795
remove_disk $removedev
@@ -107,8 +105,8 @@ do
107105

108106
# cleanup
109107
destroy_pool $TESTPOOL
110-
log_must parted "/dev/${removedev}" -s -- mklabel msdos
111-
block_device_wait
108+
log_must parted "${DEV_DSKDIR}/${removedev}" -s -- mklabel msdos
109+
block_device_wait ${DEV_DSKDIR}/${removedev}
112110
done
113111

114112
# 6. Repeat the same tests with a spare device: zed will use the spare to handle
@@ -117,7 +115,7 @@ for conf in "${poolconfs[@]}"
117115
do
118116
# 1. Create a pool with a spare
119117
log_must zpool create -f $TESTPOOL $conf
120-
block_device_wait
118+
block_device_wait ${DEV_DSKDIR}/${removedev}
121119
log_must zpool add $TESTPOOL spare $sparedev
122120

123121
# 3. Simulate physical removal of one device
@@ -139,8 +137,8 @@ do
139137

140138
# cleanup
141139
destroy_pool $TESTPOOL
142-
log_must parted "/dev/${removedev}" -s -- mklabel msdos
143-
block_device_wait
140+
log_must parted "${DEV_DSKDIR}/${removedev}" -s -- mklabel msdos
141+
block_device_wait ${DEV_DSKDIR}/${removedev}
144142
done
145143

146144
# 7. Repeat the same tests again with a faulted spare device: zed should offline
@@ -149,7 +147,7 @@ for conf in "${poolconfs[@]}"
149147
do
150148
# 1. Create a pool with a spare
151149
log_must zpool create -f $TESTPOOL $conf
152-
block_device_wait
150+
block_device_wait ${DEV_DSKDIR}/${removedev}
153151
log_must zpool add $TESTPOOL spare $sparedev
154152

155153
# 2. Fault the spare device making it unavailable
@@ -170,8 +168,8 @@ do
170168

171169
# cleanup
172170
destroy_pool $TESTPOOL
173-
log_must parted "/dev/${removedev}" -s -- mklabel msdos
174-
block_device_wait
171+
log_must parted "${DEV_DSKDIR}/${removedev}" -s -- mklabel msdos
172+
block_device_wait ${DEV_DSKDIR}/${removedev}
175173
done
176174

177175
log_pass "ZED detects physically removed devices"

0 commit comments

Comments
 (0)