blob: 9ef2cb55a8397b69b05c65a4778a3e83566ee506 [file] [log] [blame]
George Keishingeefc07a2016-07-26 03:25:35 -05001*** Settings ***
George Keishing0a46d022017-01-30 08:11:43 -06002Documentation Test power on for HW CI.
George Keishingeefc07a2016-07-26 03:25:35 -05003
George Keishingd55a4be2016-08-26 03:28:17 -05004Resource ../lib/openbmc_ffdc.robot
George Keishing97e96532016-10-06 12:44:52 -05005Resource ../lib/utils.robot
George Keishing0a46d022017-01-30 08:11:43 -06006Resource ../lib/state_manager.robot
George Keishing766c6232018-02-02 11:42:55 -06007Resource ../lib/open_power_utils.robot
Michael Tritz96ed2772018-01-17 15:38:38 -06008Resource ../lib/ipmi_client.robot
George Keishing78ce8dc2018-03-30 11:49:06 -05009Resource ../lib/boot_utils.robot
George Keishing97e96532016-10-06 12:44:52 -050010
George Keishingfcc6d782018-01-24 00:44:03 -060011Test Setup Test Setup Execution
George Keishing2f0f4b32018-01-21 23:25:47 -060012Test Teardown Test Teardown Execution
George Keishing83ada4f2016-08-09 03:15:08 -050013
causten147f5752016-08-11 16:24:45 -050014Force Tags chassisboot
George Keishingeefc07a2016-07-26 03:25:35 -050015
George Keishing0af24412017-03-10 13:33:23 -060016*** Variables ***
17
18# User may pass LOOP_COUNT.
19# By default 2 cycle for CI/CT.
20${LOOP_COUNT} ${2}
21
George Keishing32ed4122017-05-13 03:06:39 -050022# Error strings to check from journald.
23${ERROR_REGEX} SEGV|core-dump
24
Gunnar Mills7c8923f2016-12-12 21:19:52 -060025*** Test Cases ***
George Keishingeefc07a2016-07-26 03:25:35 -050026
George Keishing78ce8dc2018-03-30 11:49:06 -050027Verify Front And Rear LED At Standby
28 [Documentation] Front and Rear LED should be off at standby.
29 [Tags] Verify_Front_And_Rear_LED_At_Standby
30
31 REST Power Off stack_mode=skip quiet=1
32 Verify Identify LED State Off
33
George Keishing0a46d022017-01-30 08:11:43 -060034Power On Test
35 [Documentation] Power off and on.
36 [Tags] Power_On_Test
George Keishingeefc07a2016-07-26 03:25:35 -050037
George Keishing0af24412017-03-10 13:33:23 -060038 Repeat Keyword ${LOOP_COUNT} times Host Off And On
George Keishing97e96532016-10-06 12:44:52 -050039
George Keishing32ed4122017-05-13 03:06:39 -050040Check For Application Failures
41 [Documentation] Parse the journal log and check for failures.
42 [Tags] Check_For_Application_Failures
43
44 Open Connection And Log In
45
46 ${journal_log}= Execute Command On BMC
47 ... journalctl --no-pager | egrep '${ERROR_REGEX}'
48
49 Should Be Empty ${journal_log}
50
Michael Tritzcb64a7c2018-02-05 15:25:17 -060051Verify Uptime Average Against Threshold
52 [Documentation] Compare BMC average boot time to a constant threshold.
53 [Tags] Verify_Uptime_Average_Against_Threshold
54
55 OBMC Reboot (off)
56 Wait Until Keyword Succeeds
57 ... 3 min 0 sec Wait for BMC state Ready
58 ${uptime}= Measure BMC Boot Time
59 Should Be True ${uptime} < 180
60 ... msg=${uptime} exceeds threshold.
61
George Keishing8a5f1472018-04-04 10:08:47 -050062Test SSH And IPMI Connections
63 [Documentation] Try SSH and IPMI commands to verify each connection.
64 [Tags] Test_SSH_And_IPMI_Connections
65
66 Check If BMC Is Up 3 min 20 sec
67 Wait Until Keyword Succeeds
68 ... 3 min 30 sec Wait for BMC state Ready
69
70 BMC Execute Command true
71 Run IPMI Standard Command chassis status
72
George Keishing97e96532016-10-06 12:44:52 -050073*** Keywords ***
George Keishing0a46d022017-01-30 08:11:43 -060074
George Keishingfcc6d782018-01-24 00:44:03 -060075Test Setup Execution
76 [Documentation] Do test case setup tasks.
77 Start SOL Console Logging
78 Set Auto Reboot ${0}
79
George Keishing2f0f4b32018-01-21 23:25:47 -060080Test Teardown Execution
George Keishing0a46d022017-01-30 08:11:43 -060081 [Documentation] Collect FFDC and SOL log.
Gunnar Millseac1af22016-11-14 15:30:09 -060082 FFDC On Test Case Fail
George Keishing97e96532016-10-06 12:44:52 -050083 ${sol_log}= Stop SOL Console Logging
84 Log ${sol_log}
George Keishing2f0f4b32018-01-21 23:25:47 -060085 Set Auto Reboot ${1}
George Keishing0af24412017-03-10 13:33:23 -060086
87Host Off And On
88 [Documentation] Verify power off and on.
89
90 Initiate Host PowerOff
George Keishing0af24412017-03-10 13:33:23 -060091
92 Initiate Host Boot
George Keishing766c6232018-02-02 11:42:55 -060093 Verify OCC State
George Keishing383d29b2017-03-25 11:10:52 -050094
George Keishing5f2f7f52017-06-30 09:17:53 -050095 # TODO: Host shutdown race condition.
96 # Wait 30 seconds before Powering Off.
97 Sleep 30s
Michael Tritzcb64a7c2018-02-05 15:25:17 -060098
99Measure BMC Boot Time
100 [Documentation] Reboot the BMC and collect uptime.
101
102 Open Connection And Log In
103 ${uptime}=
104 ... Execute Command cut -d " " -f 1 /proc/uptime| cut -d "." -f 1
105 ${uptime}= Convert To Integer ${uptime}
106 [return] ${uptime}