From 125f704a10ce445ef7084a46386e06f62d85227e Mon Sep 17 00:00:00 2001 From: Yann ILAS Date: Wed, 11 May 2016 15:20:08 +0200 Subject: [PATCH] FILE-xyzz : Bind mount the /var/tmp directory to /tmp (#193) Check if a bind mount is done between /var/tmp and the directory /tmp --- include/tests_filesystems | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/include/tests_filesystems b/include/tests_filesystems index f4b2ad73..02f06d07 100644 --- a/include/tests_filesystems +++ b/include/tests_filesystems @@ -542,6 +542,35 @@ fi # ################################################################################# +# + # Test : FILE-xyzz + # Description : Bind mount the /var/tmp directory to /tmp +# +################################################################################# +# + Register --test-no FILE-xyzz --os Linux --weight L --network NO --description "Checking /var/tmp is bind to /tmp" + if [ ${SKIPTEST} -eq 0 ]; then + if [ -f /etc/fstab ]; then + FIND=`cat /etc/fstab | awk '{ if ($2=="/var/tmp") { print $4 } }'` + BIND=`echo ${FIND} | awk '{ if ($1 ~ "bind") { print "YES" } else { print "NO" } }'` + + if [ ! "${FIND}" = "" ]; then + LogText "Result: mount system /var/tmp is configured with options: ${FIND}" + if [ "${BIND}" = "YES" ]; then + Display --indent 2 --text "- /var/tmp is bind to /tmp" --result OK --color GREEN + LogText "Result : /var/tmp is bind to /tmp" + else + Display --indent 2 --text "- /var/tmp is not bind to /tmp" --result "NON DEFAULT" --color RED + LogText "Result: /var/tmp is not bind to /tmp" + fi + else + LogText "Result: no mount point /var/tmp or expected options found" + Display --indent 2 --text "- /var/tmp is not bind to /tmp" --result "NON DEFAULT" --color RED + fi + fi + fi +# +################################################################################# # # Test : FILE-6378 # Description : Check for nodirtime option