Skip to content

ZTS: Polish online_offline tests #17259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,17 @@ DISKLIST=$(get_disklist $TESTPOOL)

function cleanup
{
kill $killpid >/dev/null 2>&1

#
# Ensure we don't leave disks in the offline state
#
for disk in $DISKLIST; do
log_must zpool online $TESTPOOL $disk
log_must check_state $TESTPOOL $disk "online"

done
log_must zpool wait -t resilver $TESTPOOL

kill $killpid >/dev/null 2>&1
[[ -e $TESTDIR ]] && log_must rm -rf $TESTDIR/*
}

Expand All @@ -77,8 +78,7 @@ for disk in $DISKLIST; do
log_must zpool online $TESTPOOL $disk
log_must check_state $TESTPOOL $disk "online"

# Delay for resilver to complete
sleep 3
log_must zpool wait -t resilver $TESTPOOL
done

log_must kill $killpid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,17 @@ DISKLIST=$(get_disklist $TESTPOOL)

function cleanup
{
kill $killpid >/dev/null 2>&1

#
# Ensure we don't leave disks in the offline state
#
for disk in $DISKLIST; do
log_must zpool online $TESTPOOL $disk
log_must check_state $TESTPOOL $disk "online"
done
log_must zpool wait -t resilver $TESTPOOL

kill $killpid >/dev/null 2>&1
[[ -e $TESTDIR ]] && log_must rm -rf $TESTDIR/*
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ function cleanup
destroy_pool $TESTPOOL1
fi

kill $killpid >/dev/null 2>&1
[[ -e $TESTDIR ]] && log_must rm -rf $TESTDIR/*
}

Expand All @@ -59,7 +58,7 @@ log_onexit cleanup

specials_list=""
for i in 0 1 2; do
mkfile $MINVDEVSIZE $TESTDIR/$TESTFILE1.$i
log_must mkfile $MINVDEVSIZE $TESTDIR/$TESTFILE1.$i
specials_list="$specials_list $TESTDIR/$TESTFILE1.$i"
done
disk=($specials_list)
Expand All @@ -68,15 +67,9 @@ create_pool $TESTPOOL1 $specials_list
log_must zfs create $TESTPOOL1/$TESTFS1
log_must zfs set mountpoint=$TESTDIR1 $TESTPOOL1/$TESTFS1

file_trunc -f $((64 * 1024 * 1024)) -b 8192 -c 0 -r $TESTDIR/$TESTFILE1 &
typeset killpid="$! "

for i in 0 1 2; do
log_mustnot zpool offline $TESTPOOL1 ${disk[$i]}
check_state $TESTPOOL1 ${disk[$i]} "online"
done

log_must kill $killpid
sync_all_pools

log_pass
Loading