From fb53e586fe38fe4d4dfc615d4979e0d2077ac220 Mon Sep 17 00:00:00 2001 From: mboelen Date: Fri, 19 Sep 2014 01:46:40 +0200 Subject: [PATCH] Added /proc/modules as dependency to KRNL-5723 and KRNL-5726 --- include/tests_kernel | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/include/tests_kernel b/include/tests_kernel index 8ea17455..69f975d1 100644 --- a/include/tests_kernel +++ b/include/tests_kernel @@ -175,7 +175,7 @@ # Description : Check if Linux is build as a monolithic kernel or not Register --test-no KRNL-5723 --os Linux --weight L --network NO --description "Determining if Linux kernel is monolithic" if [ ${SKIPTEST} -eq 0 ]; then - if [ ! "${LSMODBINARY}" = "" ]; then + if [ ! "${LSMODBINARY}" = "" -a -f /proc/modules ]; then logtext "Test: checking if kernel is monolithic or modular" # Checking if any modules are loaded FIND=`${LSMODBINARY} | grep -v "^Module" | wc -l | tr -s ' ' | tr -d ' '` @@ -190,8 +190,7 @@ MONOLITHIC_KERNEL=0 fi else - logtext "Test skipped, no lsmod binary found" - # Exception? + logtext "Test skipped, lsmod binary not found or /proc/modules can not be opened" fi fi # @@ -201,7 +200,7 @@ # Description : Checking Linux loaded kernel modules Register --test-no KRNL-5726 --os Linux --weight L --network NO --description "Checking Linux loaded kernel modules" if [ ${SKIPTEST} -eq 0 ]; then - if [ ! "${LSMODBINARY}" = "" ]; then + if [ ! "${LSMODBINARY}" = "" -a -f /proc/modules ]; then FIND=`lsmod | awk '{ if ($1!="Module") print $1 }' | sort` Display --indent 2 --text "- Checking loaded kernel modules" --result DONE --color GREEN if [ ! "${FIND}" = "" ]; then @@ -218,8 +217,7 @@ logtext "Notice: No loaded kernel modules could indicate a broken/malformed lsmod, or a (custom) monolithic kernel" fi else - logtext "Test skipped, no lsmod binary found" - # Exception? + logtext "Test skipped, lsmod binary not found or /proc/modules can not be opened" fi fi #