From 01c687eb55be18e38a4c6ccc995afa1ad1df788e Mon Sep 17 00:00:00 2001 From: alobodzinski Date: Mon, 5 Sep 2016 19:30:04 +0200 Subject: [PATCH] FILE-6336: Fixed flawed logic: work correctly even if there is no swap at all (#272) --- include/tests_filesystems | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/tests_filesystems b/include/tests_filesystems index 2c23740f..9bca8c65 100644 --- a/include/tests_filesystems +++ b/include/tests_filesystems @@ -276,8 +276,8 @@ # Swap partitions should be mounted with 'sw' or 'swap' LogText "Test: check swap partitions with incorrect mount options" #FIND=`${AWKBINARY} '{ if ($3=="swap" && ($4!="sw" && $4!="swap" && $4!="defaults")) print $1 }' /etc/fstab` - FIND=`${AWKBINARY} '{ if ($3=="swap" && ($4~/sw/ || $4=="defaults")) { print $1 }}' /etc/fstab` - if [ ! "${FIND}" = "" ]; then + FIND=`${AWKBINARY} '{ if ($3=="swap" && ($4!~/sw/ && $4!="defaults")) { print $1 }}' /etc/fstab` + if [ "${FIND}" = "" ]; then Display --indent 2 --text "- Testing swap partitions" --result "${STATUS_OK}" --color GREEN LogText "Result: all swap partitions have correct options (sw or swap)" else