blob: c690237655b4ca1de838c6f99ff4b47fa67998ac [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)
Michael Tritzcb64a7c2018-02-05 15:25:17 -060056 ${uptime}= Measure BMC Boot Time
57 Should Be True ${uptime} < 180
58 ... msg=${uptime} exceeds threshold.
59
George Keishing8a5f1472018-04-04 10:08:47 -050060Test SSH And IPMI Connections
61 [Documentation] Try SSH and IPMI commands to verify each connection.
62 [Tags] Test_SSH_And_IPMI_Connections
63
64 Check If BMC Is Up 3 min 20 sec
65 Wait Until Keyword Succeeds
66 ... 3 min 30 sec Wait for BMC state Ready
67
68 BMC Execute Command true
69 Run IPMI Standard Command chassis status
70
George Keishing97e96532016-10-06 12:44:52 -050071*** Keywords ***
George Keishing0a46d022017-01-30 08:11:43 -060072
George Keishingfcc6d782018-01-24 00:44:03 -060073Test Setup Execution
74 [Documentation] Do test case setup tasks.
75 Start SOL Console Logging
76 Set Auto Reboot ${0}
77
George Keishing2f0f4b32018-01-21 23:25:47 -060078Test Teardown Execution
George Keishing0a46d022017-01-30 08:11:43 -060079 [Documentation] Collect FFDC and SOL log.
Gunnar Millseac1af22016-11-14 15:30:09 -060080 FFDC On Test Case Fail
George Keishing97e96532016-10-06 12:44:52 -050081 ${sol_log}= Stop SOL Console Logging
82 Log ${sol_log}
George Keishing2f0f4b32018-01-21 23:25:47 -060083 Set Auto Reboot ${1}
George Keishing0af24412017-03-10 13:33:23 -060084
85Host Off And On
86 [Documentation] Verify power off and on.
87
88 Initiate Host PowerOff
George Keishing0af24412017-03-10 13:33:23 -060089
90 Initiate Host Boot
George Keishing766c6232018-02-02 11:42:55 -060091 Verify OCC State
George Keishing383d29b2017-03-25 11:10:52 -050092
George Keishing5f2f7f52017-06-30 09:17:53 -050093 # TODO: Host shutdown race condition.
94 # Wait 30 seconds before Powering Off.
95 Sleep 30s
Michael Tritzcb64a7c2018-02-05 15:25:17 -060096
97Measure BMC Boot Time
98 [Documentation] Reboot the BMC and collect uptime.
99
100 Open Connection And Log In
101 ${uptime}=
102 ... Execute Command cut -d " " -f 1 /proc/uptime| cut -d "." -f 1
103 ${uptime}= Convert To Integer ${uptime}
104 [return] ${uptime}