Skip to content

Commit 397c375

Browse files
author
Paul Dagnelie
committed
Add testing for sequential resilver
Signed-off-by: Paul Dagnelie <[email protected]>
1 parent 1204617 commit 397c375

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tests/zfs-tests/tests/functional/replacement/replace_resilver_sit_out.ksh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ function replace_test
101101
typeset -i iters=2
102102
typeset disk1=$1
103103
typeset disk2=$2
104+
typeset repl_type=$3
104105

105106
typeset i=0
106107
while [[ $i -lt $iters ]]; do
@@ -114,9 +115,13 @@ function replace_test
114115
((i = i + 1))
115116
done
116117

118+
typeset repl_flag="-w"
119+
if [[ "$repl_type" == "seq" ]]; then
120+
repl_flag="-ws"
121+
fi
117122
# replace disk with a slow drive still present
118123
SECONDS=0
119-
log_must zpool replace -w $TESTPOOL1 $disk1 $disk2
124+
log_must zpool replace $repl_flag $TESTPOOL1 $disk1 $disk2
120125
log_note took $SECONDS seconds to replace disk
121126

122127
for wait_pid in $child_pids
@@ -178,7 +183,11 @@ for type in "raidz2" "raidz3" "draid2"; do
178183
log_note took $SECONDS seconds to reach sit out reading ${size}M
179184
log_must zpool status -s $TESTPOOL1
180185

181-
replace_test $TESTDIR/$TESTFILE1.1 $TESTDIR/$REPLACEFILE
186+
typeset repl_type="replace"
187+
if [[ "$type" == "draid2" && $((RANDOM % 2)) -eq 0 ]]; then
188+
repl_type="seq"
189+
fi
190+
replace_test $TESTDIR/$TESTFILE1.1 $TESTDIR/$REPLACEFILE $repl_type
182191

183192
log_must eval "zpool iostat -v $TESTPOOL1 | grep \"$REPLACEFILE\""
184193

0 commit comments

Comments
 (0)