From ab71616900cd0abae4b73ce7b11308a76f499c7a Mon Sep 17 00:00:00 2001 From: mboelen Date: Thu, 25 Sep 2014 19:00:36 +0200 Subject: [PATCH] Added Mac OS uptime test [BOOT-5202] --- include/tests_boot_services | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/include/tests_boot_services b/include/tests_boot_services index a86d7a32..d4ea4885 100644 --- a/include/tests_boot_services +++ b/include/tests_boot_services @@ -525,6 +525,15 @@ ReportException "${TEST_NO}:1" "No uptime test available for this operating system (/proc/uptime missing)" 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) if [ ! "${KSTATBINARY}" = "" ]; then 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` logtext "Uptime (in seconds): ${UPTIME_IN_SECS}" logtext "Uptime (in days): ${UPTIME_IN_DAYS}" + report "uptime_in_seconds=${UPTIME_IN_SECS}" + report "uptime_in_days=${UPTIME_IN_DAYS}" else logtext "Result: no uptime information available" fi fi - - - # ################################################################################# #