From 7af9a9e88c6d625ece35c8c175a5848e8d720c4c Mon Sep 17 00:00:00 2001 From: mboelen Date: Thu, 4 Sep 2014 20:38:57 +0200 Subject: [PATCH] Fixed typo when searching for swap partition --- include/tests_filesystems | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/include/tests_filesystems b/include/tests_filesystems index 77a5e847..629ee97e 100644 --- a/include/tests_filesystems +++ b/include/tests_filesystems @@ -191,7 +191,18 @@ for I in ${FIND}; do FOUND=1 logtext "Swap partition found: ${I}" - # YYY add test if partition is not a normal partition (e.g. UUID=) + # YYY Add a test if partition is not a normal partition (e.g. UUID=) + # Can be ^/dev/mapper/vg-name_lv-name + # Can be ^/dev/partition + # Can be ^UUID=uuid --> /dev/disk/by-uuid/ + # if [ ! "${BLKIDBINARY}" = "" ]; then + # FIND2=`${BLKIDBINARY} | awk '{ if ($2=="UUID=\"${UUID}\"") print $1 }' | sed 's/:$//'` + # else + # logtext "Result: blkid binary not found, trying by checking device listing" + # if [ -f /dev/disk/by-uuid/${UUID} ]; then + # logtext "Result: found disk via /dev/disk/by-uuid listing" + # fi + # fi report "swap_partition[]=${I}" done if [ ${FOUND} -eq 1 ]; then @@ -212,7 +223,7 @@ if [ ${SKIPTEST} -eq 0 ]; then # Swap partitions should be mounted with 'sw' or 'swap' logtext "Test: check swap partitions with incorrect mount options" - FIND=`awk '{ if ($3=="swap" && ($4!="sw" && $4!="swap")) print $1 }' /etc/fstab` + FIND=`awk '{ if ($3=="swap" && ($4!="sw" && $4!="swap" $4!="defaults")) print $1 }' /etc/fstab` if [ "${FIND}" = "" ]; then Display --indent 2 --text "- Testing swap partitions..." --result OK --color GREEN logtext "Result: all swap partitions have correct options (sw or swap)"