Added Mac OS uptime test [BOOT-5202]

This commit is contained in:
mboelen 2014-09-25 19:00:36 +02:00
parent d690369543
commit ab71616900

View File

@ -525,6 +525,15 @@
ReportException "${TEST_NO}:1" "No uptime test available for this operating system (/proc/uptime missing)" ReportException "${TEST_NO}:1" "No uptime test available for this operating system (/proc/uptime missing)"
fi fi
;; ;;
MacOS)
if [ ! "${SYSCTLBINARY}" = "" ]; then
FIND=`${SYSCTLBINARY} kern.boottime | awk '{ print $5 }' | sed -e 's/,//'`
else
Display --indent 2 --text "- Checking uptime" --result SKIPPED --color YELLOW
ReportException "${TEST_NO}:3" "No uptime test available for this operating system (sysctl missing)"
fi
;;
Solaris) Solaris)
if [ ! "${KSTATBINARY}" = "" ]; then if [ ! "${KSTATBINARY}" = "" ]; then
FIND=`${KSTATBINARY} -p unix:0:system_misc:snaptime | grep "^unix" | awk '{print $2}' | cut -d "." -f1` FIND=`${KSTATBINARY} -p unix:0:system_misc:snaptime | grep "^unix" | awk '{print $2}' | cut -d "." -f1`
@ -545,13 +554,12 @@
UPTIME_IN_DAYS=`expr ${UPTIME_IN_SECS} / 60 / 60 / 24` UPTIME_IN_DAYS=`expr ${UPTIME_IN_SECS} / 60 / 60 / 24`
logtext "Uptime (in seconds): ${UPTIME_IN_SECS}" logtext "Uptime (in seconds): ${UPTIME_IN_SECS}"
logtext "Uptime (in days): ${UPTIME_IN_DAYS}" logtext "Uptime (in days): ${UPTIME_IN_DAYS}"
report "uptime_in_seconds=${UPTIME_IN_SECS}"
report "uptime_in_days=${UPTIME_IN_DAYS}"
else else
logtext "Result: no uptime information available" logtext "Result: no uptime information available"
fi fi
fi fi
# #
################################################################################# #################################################################################
# #