ZTS: Use swapctl to list swap devices on FreeBSD

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11503
This commit is contained in:
Ryan Moeller 2021-01-24 18:56:59 -05:00 committed by Brian Behlendorf
parent 3e33897bec
commit bfb7b9613a
1 changed files with 2 additions and 0 deletions

View File

@ -35,6 +35,8 @@
#
if is_linux; then
SAVESWAPDEVS=$(swapon -s | nawk '(NR != 1) {print $1}')
elif is_freebsd; then
SAVESWAPDEVS=$(swapctl -l | nawk '(NR != 1) {print $1}')
else
SAVESWAPDEVS=$(swap -l | nawk '(NR != 1) {print $1}')
fi