[FILE-6344] Adjusted /proc test

This commit is contained in:
Michael Boelen 2016-09-05 19:28:44 +02:00
parent e31899a421
commit 0a0453e1bc
1 changed files with 13 additions and 9 deletions

View File

@ -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
#