diff options
author | Michael Boelen <michael.boelen@cisofy.com> | 2018-09-17 12:46:36 +0300 |
---|---|---|
committer | Michael Boelen <michael.boelen@cisofy.com> | 2018-09-17 12:46:36 +0300 |
commit | f0c84e3d0190b43c08ec5d04eaa4f1ebf05bd39e (patch) | |
tree | bb1e77065bcba5578b8a54f84d78fcfb1efe8b82 | |
parent | d3d4137192595f9baa66822689b2ef336eea2725 (diff) |
[KRNL-5788] ignore exception when no vmlinuz file was discovered
-rw-r--r-- | include/tests_kernel | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/include/tests_kernel b/include/tests_kernel index 2b3b7dc3..c735d65e 100644 --- a/include/tests_kernel +++ b/include/tests_kernel @@ -370,11 +370,13 @@ if [ "${LINUX_VERSION}" = "Debian" -o "${LINUX_VERSION}" = "Ubuntu" ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi Register --test-no KRNL-5788 --os Linux --preqs-met ${PREQS_MET} --weight L --network NO --category security --description "Checking availability new Linux kernel" if [ ${SKIPTEST} -eq 0 ]; then + HAS_VMLINUZ=0 LogText "Test: Searching apt-cache, to determine if a newer kernel is available" if [ -x ${ROOTDIR}usr/bin/apt-cache ]; then LogText "Result: found ${ROOTDIR}usr/bin/apt-cache" LogText "Test: checking readlink location of ${ROOTDIR}vmlinuz" if [ -f ${ROOTDIR}vmlinuz ]; then + HAS_VMLINUZ=1 FINDKERNFILE=$(readlink -f ${ROOTDIR}vmlinuz) LogText "Output: readlink reported file ${FINDKERNFILE}" LogText "Test: checking package from dpkg -S" @@ -395,9 +397,11 @@ if IsEmpty "${FINDINST}"; then Display --indent 2 --text "- Checking for available kernel update" --result "${STATUS_UNKNOWN}" --color YELLOW LogText "Result: Exception occurred, no output from apt-cache policy" - ReportException "${TEST_NO}:01" - LogText "Exception: apt-cache policy did not return an installed kernel version" - ReportSuggestion ${TEST_NO} "Check the output of apt-cache policy manually to determine why output is empty" + if [ ${HAS_VMLINUZ} -eq 1 ]; then + ReportException "${TEST_NO}:01" + ReportSuggestion ${TEST_NO} "Check the output of apt-cache policy to determine why its output is empty" + fi + LogText "Result: apt-cache policy did not return an installed kernel version" else if [ "${FINDINST}" = "${FINDCAND}" ]; then if [ -e /dev/grsec ]; then |