HW_CI test list: Check system uptime average

This commit extends the hardware CI test bucket by verifying the average
system uptime after a boot is less than an arbitrary threshold. A
threshold of 3 minutes was selected by experimentation - a healthy
system typically had an uptime of around 2.5 minutes.

Change-Id: I6266330ca6b912b4f68787fc141d1945f6b13e16
Signed-off-by: Michael Tritz <mtritz@us.ibm.com>
Signed-off-by: Saqib Khan <khansa@us.ibm.com>
diff --git a/tests/test_basic_poweron.robot b/tests/test_basic_poweron.robot
index 64f9d0d..b60f509 100644
--- a/tests/test_basic_poweron.robot
+++ b/tests/test_basic_poweron.robot
@@ -59,6 +59,17 @@
     BMC Execute Command  true
     Run IPMI Standard Command  chassis status
 
+Verify Uptime Average Against Threshold
+    [Documentation]  Compare BMC average boot time to a constant threshold.
+    [Tags]  Verify_Uptime_Average_Against_Threshold
+
+    OBMC Reboot (off)
+    Wait Until Keyword Succeeds
+    ...  3 min  0 sec  Wait for BMC state  Ready
+    ${uptime}=  Measure BMC Boot Time
+    Should Be True  ${uptime} < 180
+    ...  msg=${uptime} exceeds threshold.
+
 *** Keywords ***
 
 Test Setup Execution
@@ -84,3 +95,12 @@
     # TODO: Host shutdown race condition.
     # Wait 30 seconds before Powering Off.
     Sleep  30s
+
+Measure BMC Boot Time
+    [Documentation]  Reboot the BMC and collect uptime.
+
+    Open Connection And Log In
+    ${uptime}=
+    ...   Execute Command    cut -d " " -f 1 /proc/uptime| cut -d "." -f 1
+    ${uptime}=  Convert To Integer  ${uptime}
+    [return]  ${uptime}