tests: don't >-redirect without eval

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-09 13:39:34 +01:00
committed by Brian Behlendorf
parent 053dac9e7d
commit 62c5ccdf92
51 changed files with 190 additions and 265 deletions
+21 -15
View File
@@ -657,7 +657,7 @@ function default_container_cleanup
destroy_dataset "$TESTPOOL/$TESTCTR" "-Rf"
[[ -e $TESTDIR1 ]] && \
log_must rm -rf $TESTDIR1 > /dev/null 2>&1
log_must rm -rf $TESTDIR1
default_cleanup
}
@@ -3680,15 +3680,17 @@ function is_swap_inuse
return 1
fi
if is_linux; then
swapon -s | grep -w $(readlink -f $device) > /dev/null 2>&1
elif is_freebsd; then
swapctl -l | grep -w $device
else
swap -l | grep -w $device > /dev/null 2>&1
fi
return $?
case "$(uname)" in
Linux)
swapon -s | grep -wq $(readlink -f $device)
;;
FreeBSD)
swapctl -l | grep -wq $device
;;
*)
swap -l | grep -wq $device
;;
esac
}
#
@@ -3698,14 +3700,18 @@ function swap_setup
{
typeset swapdev=$1
if is_linux; then
case "$(uname)" in
Linux)
log_must eval "mkswap $swapdev > /dev/null 2>&1"
log_must swapon $swapdev
elif is_freebsd; then
;;
FreeBSD)
log_must swapctl -a $swapdev
else
log_must swap -a $swapdev
fi
;;
*)
log_must swap -a $swapdev
;;
esac
return 0
}