tests: review every instance of $?

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13259
This commit is contained in:
наб
2022-03-23 01:52:39 +01:00
committed by Brian Behlendorf
parent 6586085673
commit 23914a3b91
147 changed files with 560 additions and 1485 deletions
@@ -54,10 +54,7 @@ function cleanup
#
for disk in $DISKLIST; do
log_must zpool online $TESTPOOL $disk
check_state $TESTPOOL $disk "online"
if [[ $? != 0 ]]; then
log_fail "Unable to online $disk"
fi
log_must check_state $TESTPOOL $disk "online"
done
@@ -73,17 +70,11 @@ typeset killpid="$! "
for disk in $DISKLIST; do
for i in 'do_offline' 'do_offline_while_already_offline'; do
log_must zpool offline $TESTPOOL $disk
check_state $TESTPOOL $disk "offline"
if [[ $? != 0 ]]; then
log_fail "$disk of $TESTPOOL is not offline."
fi
log_must check_state $TESTPOOL $disk "offline"
done
log_must zpool online $TESTPOOL $disk
check_state $TESTPOOL $disk "online"
if [[ $? != 0 ]]; then
log_fail "$disk of $TESTPOOL did not match online state"
fi
log_must check_state $TESTPOOL $disk "online"
# Delay for resilver to complete
sleep 3
@@ -55,11 +55,7 @@ function cleanup
#
for disk in $DISKLIST; do
log_must zpool online $TESTPOOL $disk
check_state $TESTPOOL $disk "online"
if [[ $? != 0 ]]; then
log_fail "Unable to online $disk"
fi
log_must check_state $TESTPOOL $disk "online"
done
kill $killpid >/dev/null 2>&1