From 0a0453e1bc1683861880f09529ad8a44c12566fc Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Mon, 5 Sep 2016 19:28:44 +0200 Subject: [PATCH] [FILE-6344] Adjusted /proc test --- include/tests_filesystems | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/include/tests_filesystems b/include/tests_filesystems index cf848c8b..2c23740f 100644 --- a/include/tests_filesystems +++ b/include/tests_filesystems @@ -308,17 +308,21 @@ if [ ${SKIPTEST} -eq 0 ]; then # Proc should be mounted with 'hidepid=2' or 'hidepid=1' at least LogText "Test: check proc mount with incorrect mount options" - FIND=$(mount | ${EGREPBINARY} "^/proc" | ${EGREPBINARY} -o "hidepid=[0-9]") + FIND=$(mount | ${EGREPBINARY} "/proc " | ${EGREPBINARY} -o "hidepid=[0-9]") if [ "${FIND}" = "hidepid=2" ]; then - Display --indent 2 --text "- Testing proc mount" --result "${STATUS_OK}" --color GREEN + Display --indent 2 --text "- Testing /proc mount (hidepid)" --result "${STATUS_OK}" --color GREEN LogText "Result: proc mount mounted with hidepid=2" - else - if [ "${FIND}" = "" ]; then - HIDEPID1_SUGGESTION=" (or at least hidepid=1)" - fi - Display --indent 2 --text "- Testing proc mount" --result "${STATUS_SUGGESTION}" --color YELLOW - LogText "Result: /proc filesystem is not mounted with option hidepid=2" - #ReportSuggestion ${TEST_NO} "Consider mounting /proc via /etc/fstab with mount option hidepid=2" + AddHP 3 3 + elif [ "${FIND}" = "hidepid=1" ]; then + Display --indent 2 --text "- Testing /proc mount (hidepid)" --result "${STATUS_OK}" --color GREEN + LogText "Result: proc mount mounted with hidepid=1" + AddHP 2 3 + elif [ -z "${FIND}" ]; then + # HIDEPID1_SUGGESTION=" (or at least hidepid=1)" + AddHP 0 3 + Display --indent 2 --text "- Testing /proc mount (hidepid)" --result "${STATUS_SUGGESTION}" --color YELLOW + LogText "Result: /proc filesystem is not mounted with option hidepid=1 or hidepid=2" + # TODO ReportSuggestion "${TEST_NO}" "Consider mounting /proc via /etc/fstab with mount option hidepid=2" "/proc" "-" fi fi #