George Keishing | eefc07a | 2016-07-26 03:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
George Keishing | 0a46d02 | 2017-01-30 08:11:43 -0600 | [diff] [blame] | 2 | Documentation Test power on for HW CI. |
George Keishing | eefc07a | 2016-07-26 03:25:35 -0500 | [diff] [blame] | 3 | |
George Keishing | d55a4be | 2016-08-26 03:28:17 -0500 | [diff] [blame] | 4 | Resource ../lib/openbmc_ffdc.robot |
George Keishing | 97e9653 | 2016-10-06 12:44:52 -0500 | [diff] [blame] | 5 | Resource ../lib/utils.robot |
George Keishing | 0a46d02 | 2017-01-30 08:11:43 -0600 | [diff] [blame] | 6 | Resource ../lib/state_manager.robot |
George Keishing | 766c623 | 2018-02-02 11:42:55 -0600 | [diff] [blame] | 7 | Resource ../lib/open_power_utils.robot |
Michael Tritz | 96ed277 | 2018-01-17 15:38:38 -0600 | [diff] [blame] | 8 | Resource ../lib/ipmi_client.robot |
George Keishing | 78ce8dc | 2018-03-30 11:49:06 -0500 | [diff] [blame] | 9 | Resource ../lib/boot_utils.robot |
George Keishing | 97e9653 | 2016-10-06 12:44:52 -0500 | [diff] [blame] | 10 | |
George Keishing | fcc6d78 | 2018-01-24 00:44:03 -0600 | [diff] [blame] | 11 | Test Setup Test Setup Execution |
George Keishing | 2f0f4b3 | 2018-01-21 23:25:47 -0600 | [diff] [blame] | 12 | Test Teardown Test Teardown Execution |
George Keishing | 83ada4f | 2016-08-09 03:15:08 -0500 | [diff] [blame] | 13 | |
causten | 147f575 | 2016-08-11 16:24:45 -0500 | [diff] [blame] | 14 | Force Tags chassisboot |
George Keishing | eefc07a | 2016-07-26 03:25:35 -0500 | [diff] [blame] | 15 | |
George Keishing | 0af2441 | 2017-03-10 13:33:23 -0600 | [diff] [blame] | 16 | *** Variables *** |
| 17 | |
| 18 | # User may pass LOOP_COUNT. |
| 19 | # By default 2 cycle for CI/CT. |
| 20 | ${LOOP_COUNT} ${2} |
| 21 | |
George Keishing | 32ed412 | 2017-05-13 03:06:39 -0500 | [diff] [blame] | 22 | # Error strings to check from journald. |
| 23 | ${ERROR_REGEX} SEGV|core-dump |
| 24 | |
Gunnar Mills | 7c8923f | 2016-12-12 21:19:52 -0600 | [diff] [blame] | 25 | *** Test Cases *** |
George Keishing | eefc07a | 2016-07-26 03:25:35 -0500 | [diff] [blame] | 26 | |
George Keishing | 78ce8dc | 2018-03-30 11:49:06 -0500 | [diff] [blame] | 27 | Verify 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 Keishing | 0a46d02 | 2017-01-30 08:11:43 -0600 | [diff] [blame] | 34 | Power On Test |
| 35 | [Documentation] Power off and on. |
| 36 | [Tags] Power_On_Test |
George Keishing | eefc07a | 2016-07-26 03:25:35 -0500 | [diff] [blame] | 37 | |
George Keishing | 0af2441 | 2017-03-10 13:33:23 -0600 | [diff] [blame] | 38 | Repeat Keyword ${LOOP_COUNT} times Host Off And On |
George Keishing | 97e9653 | 2016-10-06 12:44:52 -0500 | [diff] [blame] | 39 | |
George Keishing | 32ed412 | 2017-05-13 03:06:39 -0500 | [diff] [blame] | 40 | Check 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 Tritz | cb64a7c | 2018-02-05 15:25:17 -0600 | [diff] [blame] | 51 | Verify 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 Keishing | 8a5f147 | 2018-04-04 10:08:47 -0500 | [diff] [blame] | 62 | Test 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 Keishing | 97e9653 | 2016-10-06 12:44:52 -0500 | [diff] [blame] | 73 | *** Keywords *** |
George Keishing | 0a46d02 | 2017-01-30 08:11:43 -0600 | [diff] [blame] | 74 | |
George Keishing | fcc6d78 | 2018-01-24 00:44:03 -0600 | [diff] [blame] | 75 | Test Setup Execution |
| 76 | [Documentation] Do test case setup tasks. |
| 77 | Start SOL Console Logging |
| 78 | Set Auto Reboot ${0} |
| 79 | |
George Keishing | 2f0f4b3 | 2018-01-21 23:25:47 -0600 | [diff] [blame] | 80 | Test Teardown Execution |
George Keishing | 0a46d02 | 2017-01-30 08:11:43 -0600 | [diff] [blame] | 81 | [Documentation] Collect FFDC and SOL log. |
Gunnar Mills | eac1af2 | 2016-11-14 15:30:09 -0600 | [diff] [blame] | 82 | FFDC On Test Case Fail |
George Keishing | 97e9653 | 2016-10-06 12:44:52 -0500 | [diff] [blame] | 83 | ${sol_log}= Stop SOL Console Logging |
| 84 | Log ${sol_log} |
George Keishing | 2f0f4b3 | 2018-01-21 23:25:47 -0600 | [diff] [blame] | 85 | Set Auto Reboot ${1} |
George Keishing | 0af2441 | 2017-03-10 13:33:23 -0600 | [diff] [blame] | 86 | |
| 87 | Host Off And On |
| 88 | [Documentation] Verify power off and on. |
| 89 | |
| 90 | Initiate Host PowerOff |
George Keishing | 0af2441 | 2017-03-10 13:33:23 -0600 | [diff] [blame] | 91 | |
| 92 | Initiate Host Boot |
George Keishing | 766c623 | 2018-02-02 11:42:55 -0600 | [diff] [blame] | 93 | Verify OCC State |
George Keishing | 383d29b | 2017-03-25 11:10:52 -0500 | [diff] [blame] | 94 | |
George Keishing | 5f2f7f5 | 2017-06-30 09:17:53 -0500 | [diff] [blame] | 95 | # TODO: Host shutdown race condition. |
| 96 | # Wait 30 seconds before Powering Off. |
| 97 | Sleep 30s |
Michael Tritz | cb64a7c | 2018-02-05 15:25:17 -0600 | [diff] [blame] | 98 | |
| 99 | Measure 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} |