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
This commit is contained in:
Yann ILAS 2016-05-11 15:20:08 +02:00 committed by Michael Boelen
parent 8ba1f51c19
commit 125f704a10

View File

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