From 7b8c04c3b1e01c3cbf399002318523e5cad6d445 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Mon, 17 Oct 2016 17:24:34 +0200 Subject: [PATCH] [BOOT-5202] use generic variables between OSes --- include/tests_boot_services | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/tests_boot_services b/include/tests_boot_services index 9167b155..96f3d065 100644 --- a/include/tests_boot_services +++ b/include/tests_boot_services @@ -682,11 +682,12 @@ if [ ${SKIPTEST} -eq 0 ]; then FOUND=0 FIND="" + UPTIME_IN_SECS="" case "${OS}" in Linux) # Idle time, not real uptime if [ -f /proc/uptime ]; then - FIND=$(cat /proc/uptime | ${CUTBINARY} -d ' ' -f1 | ${CUTBINARY} -d '.' -f1) + UPTIME_IN_SECS=$(cat /proc/uptime | ${CUTBINARY} -d ' ' -f1 | ${CUTBINARY} -d '.' -f1) else Display --indent 2 --text "- Checking uptime" --result "${STATUS_SKIPPED}" --color YELLOW ReportException "${TEST_NO}:1" "No uptime test available for this operating system (/proc/uptime missing)" @@ -729,7 +730,7 @@ Solaris) if [ ! -z "${KSTATBINARY}" ]; then - FIND=$(${KSTATBINARY} -p unix:0:system_misc:snaptime | ${GREPBINARY} "^unix" | ${AWKBINARY} '{print $2}' | ${CUTBINARY} -d "." -f1) + UPTIME_IN_SECS=$(${KSTATBINARY} -p unix:0:system_misc:snaptime | ${GREPBINARY} "^unix" | ${AWKBINARY} '{print $2}' | ${CUTBINARY} -d "." -f1) else Display --indent 2 --text "- Checking uptime" --result "${STATUS_SKIPPED}" --color YELLOW ReportException "${TEST_NO}:2" "No uptime test available for this operating system (kstat missing)" @@ -743,8 +744,7 @@ ReportException "${TEST_NO}:3" "No uptime test available yet for this operating system" ;; esac - if [ ! -z "${FIND}" ]; then - UPTIME_IN_SECS="${FIND}" + if [ ! -z "${UPTIME_IN_SECS}" ]; then UPTIME_IN_DAYS=$((UPTIME_IN_SECS / 60 / 60 / 24)) LogText "Uptime (in seconds): ${UPTIME_IN_SECS}" LogText "Uptime (in days): ${UPTIME_IN_DAYS}"