blob: 104cc421e5a98f426b7734d8ebfe36b2d8a3c296 [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 Keishing22e57e12018-04-18 09:39:31 -05004Library DateTime
5
George Keishingd55a4be2016-08-26 03:28:17 -05006Resource ../lib/openbmc_ffdc.robot
George Keishing97e96532016-10-06 12:44:52 -05007Resource ../lib/utils.robot
George Keishing0a46d022017-01-30 08:11:43 -06008Resource ../lib/state_manager.robot
George Keishing766c6232018-02-02 11:42:55 -06009Resource ../lib/open_power_utils.robot
Michael Tritz96ed2772018-01-17 15:38:38 -060010Resource ../lib/ipmi_client.robot
George Keishing78ce8dc2018-03-30 11:49:06 -050011Resource ../lib/boot_utils.robot
George Keishing97e96532016-10-06 12:44:52 -050012
George Keishingfcc6d782018-01-24 00:44:03 -060013Test Setup Test Setup Execution
George Keishing2f0f4b32018-01-21 23:25:47 -060014Test Teardown Test Teardown Execution
George Keishing83ada4f2016-08-09 03:15:08 -050015
causten147f5752016-08-11 16:24:45 -050016Force Tags chassisboot
George Keishingeefc07a2016-07-26 03:25:35 -050017
George Keishing0af24412017-03-10 13:33:23 -060018*** Variables ***
19
20# User may pass LOOP_COUNT.
21# By default 2 cycle for CI/CT.
22${LOOP_COUNT} ${2}
23
George Keishing32ed4122017-05-13 03:06:39 -050024# Error strings to check from journald.
George Keishing22e57e12018-04-18 09:39:31 -050025${ERROR_REGEX} SEGV|core-dump
26${STANDBY_REGEX} Startup finished in
27
28# 3 minutes standby boot time.
29${startup_time_threshold} 180
George Keishing32ed4122017-05-13 03:06:39 -050030
Gunnar Mills7c8923f2016-12-12 21:19:52 -060031*** Test Cases ***
George Keishingeefc07a2016-07-26 03:25:35 -050032
George Keishing78ce8dc2018-03-30 11:49:06 -050033Verify Front And Rear LED At Standby
34 [Documentation] Front and Rear LED should be off at standby.
35 [Tags] Verify_Front_And_Rear_LED_At_Standby
36
37 REST Power Off stack_mode=skip quiet=1
38 Verify Identify LED State Off
39
George Keishing0a46d022017-01-30 08:11:43 -060040Power On Test
41 [Documentation] Power off and on.
42 [Tags] Power_On_Test
George Keishingeefc07a2016-07-26 03:25:35 -050043
George Keishing0af24412017-03-10 13:33:23 -060044 Repeat Keyword ${LOOP_COUNT} times Host Off And On
George Keishing97e96532016-10-06 12:44:52 -050045
George Keishing32ed4122017-05-13 03:06:39 -050046Check For Application Failures
47 [Documentation] Parse the journal log and check for failures.
48 [Tags] Check_For_Application_Failures
49
Joy Onyerikwub9922612018-05-14 12:36:57 -050050 ${journal_log} ${stderr} ${rc}= BMC Execute Command
51 ... journalctl --no-pager | egrep '${ERROR_REGEX}' ignore_err=1
George Keishing32ed4122017-05-13 03:06:39 -050052
53 Should Be Empty ${journal_log}
54
Michael Tritzcb64a7c2018-02-05 15:25:17 -060055Verify Uptime Average Against Threshold
56 [Documentation] Compare BMC average boot time to a constant threshold.
57 [Tags] Verify_Uptime_Average_Against_Threshold
58
59 OBMC Reboot (off)
George Keishing22e57e12018-04-18 09:39:31 -050060
61 # Example output:
62 # Startup finished in 10.074s (kernel) + 2min 23.506s (userspace) = 2min 33.581s.
63 ${startup_time} ${stderr} ${rc}= BMC Execute Command
64 ... journalctl --no-pager | egrep '${STANDBY_REGEX}' | tail -1
65 Should Not Be Empty ${startup_time}
66
67 # Example time conversion:
68 # Get the "2min 33.581s" string total time taken to reach standby.
69 # Convert time "2min 33.581s" to unit 153.581.
70 ${startup_time}= Convert Time ${startup_time.split("= ",1)[1].strip(".")}
71
72 Should Be True ${startup_time} < ${startup_time_threshold}
73 ... msg=${startup_time} greater than threshold value of ${startup_time_threshold}.
Michael Tritzcb64a7c2018-02-05 15:25:17 -060074
George Keishing8a5f1472018-04-04 10:08:47 -050075Test SSH And IPMI Connections
76 [Documentation] Try SSH and IPMI commands to verify each connection.
77 [Tags] Test_SSH_And_IPMI_Connections
78
79 Check If BMC Is Up 3 min 20 sec
80 Wait Until Keyword Succeeds
81 ... 3 min 30 sec Wait for BMC state Ready
82
83 BMC Execute Command true
84 Run IPMI Standard Command chassis status
85
George Keishing97e96532016-10-06 12:44:52 -050086*** Keywords ***
George Keishing0a46d022017-01-30 08:11:43 -060087
George Keishingfcc6d782018-01-24 00:44:03 -060088Test Setup Execution
89 [Documentation] Do test case setup tasks.
90 Start SOL Console Logging
91 Set Auto Reboot ${0}
92
George Keishing2f0f4b32018-01-21 23:25:47 -060093Test Teardown Execution
George Keishing0a46d022017-01-30 08:11:43 -060094 [Documentation] Collect FFDC and SOL log.
Gunnar Millseac1af22016-11-14 15:30:09 -060095 FFDC On Test Case Fail
George Keishing97e96532016-10-06 12:44:52 -050096 ${sol_log}= Stop SOL Console Logging
97 Log ${sol_log}
George Keishing2f0f4b32018-01-21 23:25:47 -060098 Set Auto Reboot ${1}
George Keishing0af24412017-03-10 13:33:23 -060099
100Host Off And On
101 [Documentation] Verify power off and on.
102
103 Initiate Host PowerOff
George Keishing0af24412017-03-10 13:33:23 -0600104
105 Initiate Host Boot
George Keishing766c6232018-02-02 11:42:55 -0600106 Verify OCC State
George Keishing383d29b2017-03-25 11:10:52 -0500107
George Keishing5f2f7f52017-06-30 09:17:53 -0500108 # TODO: Host shutdown race condition.
109 # Wait 30 seconds before Powering Off.
110 Sleep 30s
Michael Tritzcb64a7c2018-02-05 15:25:17 -0600111