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 | 22e57e1 | 2018-04-18 09:39:31 -0500 | [diff] [blame] | 4 | Library DateTime |
| 5 | |
George Keishing | d55a4be | 2016-08-26 03:28:17 -0500 | [diff] [blame] | 6 | Resource ../lib/openbmc_ffdc.robot |
George Keishing | 97e9653 | 2016-10-06 12:44:52 -0500 | [diff] [blame] | 7 | Resource ../lib/utils.robot |
George Keishing | 0a46d02 | 2017-01-30 08:11:43 -0600 | [diff] [blame] | 8 | Resource ../lib/state_manager.robot |
George Keishing | 766c623 | 2018-02-02 11:42:55 -0600 | [diff] [blame] | 9 | Resource ../lib/open_power_utils.robot |
Michael Tritz | 96ed277 | 2018-01-17 15:38:38 -0600 | [diff] [blame] | 10 | Resource ../lib/ipmi_client.robot |
George Keishing | 78ce8dc | 2018-03-30 11:49:06 -0500 | [diff] [blame] | 11 | Resource ../lib/boot_utils.robot |
George Keishing | 97e9653 | 2016-10-06 12:44:52 -0500 | [diff] [blame] | 12 | |
George Keishing | fcc6d78 | 2018-01-24 00:44:03 -0600 | [diff] [blame] | 13 | Test Setup Test Setup Execution |
George Keishing | 2f0f4b3 | 2018-01-21 23:25:47 -0600 | [diff] [blame] | 14 | Test Teardown Test Teardown Execution |
George Keishing | 83ada4f | 2016-08-09 03:15:08 -0500 | [diff] [blame] | 15 | |
causten | 147f575 | 2016-08-11 16:24:45 -0500 | [diff] [blame] | 16 | Force Tags chassisboot |
George Keishing | eefc07a | 2016-07-26 03:25:35 -0500 | [diff] [blame] | 17 | |
George Keishing | 0af2441 | 2017-03-10 13:33:23 -0600 | [diff] [blame] | 18 | *** Variables *** |
| 19 | |
| 20 | # User may pass LOOP_COUNT. |
| 21 | # By default 2 cycle for CI/CT. |
| 22 | ${LOOP_COUNT} ${2} |
| 23 | |
George Keishing | 32ed412 | 2017-05-13 03:06:39 -0500 | [diff] [blame] | 24 | # Error strings to check from journald. |
George Keishing | 22e57e1 | 2018-04-18 09:39:31 -0500 | [diff] [blame] | 25 | ${ERROR_REGEX} SEGV|core-dump |
| 26 | ${STANDBY_REGEX} Startup finished in |
| 27 | |
| 28 | # 3 minutes standby boot time. |
| 29 | ${startup_time_threshold} 180 |
George Keishing | 32ed412 | 2017-05-13 03:06:39 -0500 | [diff] [blame] | 30 | |
Gunnar Mills | 7c8923f | 2016-12-12 21:19:52 -0600 | [diff] [blame] | 31 | *** Test Cases *** |
George Keishing | eefc07a | 2016-07-26 03:25:35 -0500 | [diff] [blame] | 32 | |
George Keishing | 78ce8dc | 2018-03-30 11:49:06 -0500 | [diff] [blame] | 33 | Verify 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 Keishing | 0a46d02 | 2017-01-30 08:11:43 -0600 | [diff] [blame] | 40 | Power On Test |
| 41 | [Documentation] Power off and on. |
| 42 | [Tags] Power_On_Test |
George Keishing | eefc07a | 2016-07-26 03:25:35 -0500 | [diff] [blame] | 43 | |
George Keishing | 0af2441 | 2017-03-10 13:33:23 -0600 | [diff] [blame] | 44 | Repeat Keyword ${LOOP_COUNT} times Host Off And On |
George Keishing | 97e9653 | 2016-10-06 12:44:52 -0500 | [diff] [blame] | 45 | |
George Keishing | 32ed412 | 2017-05-13 03:06:39 -0500 | [diff] [blame] | 46 | Check For Application Failures |
| 47 | [Documentation] Parse the journal log and check for failures. |
| 48 | [Tags] Check_For_Application_Failures |
| 49 | |
| 50 | Open Connection And Log In |
| 51 | |
| 52 | ${journal_log}= Execute Command On BMC |
| 53 | ... journalctl --no-pager | egrep '${ERROR_REGEX}' |
| 54 | |
| 55 | Should Be Empty ${journal_log} |
| 56 | |
Michael Tritz | cb64a7c | 2018-02-05 15:25:17 -0600 | [diff] [blame] | 57 | Verify Uptime Average Against Threshold |
| 58 | [Documentation] Compare BMC average boot time to a constant threshold. |
| 59 | [Tags] Verify_Uptime_Average_Against_Threshold |
| 60 | |
| 61 | OBMC Reboot (off) |
George Keishing | 22e57e1 | 2018-04-18 09:39:31 -0500 | [diff] [blame] | 62 | |
| 63 | # Example output: |
| 64 | # Startup finished in 10.074s (kernel) + 2min 23.506s (userspace) = 2min 33.581s. |
| 65 | ${startup_time} ${stderr} ${rc}= BMC Execute Command |
| 66 | ... journalctl --no-pager | egrep '${STANDBY_REGEX}' | tail -1 |
| 67 | Should Not Be Empty ${startup_time} |
| 68 | |
| 69 | # Example time conversion: |
| 70 | # Get the "2min 33.581s" string total time taken to reach standby. |
| 71 | # Convert time "2min 33.581s" to unit 153.581. |
| 72 | ${startup_time}= Convert Time ${startup_time.split("= ",1)[1].strip(".")} |
| 73 | |
| 74 | Should Be True ${startup_time} < ${startup_time_threshold} |
| 75 | ... msg=${startup_time} greater than threshold value of ${startup_time_threshold}. |
Michael Tritz | cb64a7c | 2018-02-05 15:25:17 -0600 | [diff] [blame] | 76 | |
George Keishing | 8a5f147 | 2018-04-04 10:08:47 -0500 | [diff] [blame] | 77 | Test SSH And IPMI Connections |
| 78 | [Documentation] Try SSH and IPMI commands to verify each connection. |
| 79 | [Tags] Test_SSH_And_IPMI_Connections |
| 80 | |
| 81 | Check If BMC Is Up 3 min 20 sec |
| 82 | Wait Until Keyword Succeeds |
| 83 | ... 3 min 30 sec Wait for BMC state Ready |
| 84 | |
| 85 | BMC Execute Command true |
| 86 | Run IPMI Standard Command chassis status |
| 87 | |
George Keishing | 97e9653 | 2016-10-06 12:44:52 -0500 | [diff] [blame] | 88 | *** Keywords *** |
George Keishing | 0a46d02 | 2017-01-30 08:11:43 -0600 | [diff] [blame] | 89 | |
George Keishing | fcc6d78 | 2018-01-24 00:44:03 -0600 | [diff] [blame] | 90 | Test Setup Execution |
| 91 | [Documentation] Do test case setup tasks. |
| 92 | Start SOL Console Logging |
| 93 | Set Auto Reboot ${0} |
| 94 | |
George Keishing | 2f0f4b3 | 2018-01-21 23:25:47 -0600 | [diff] [blame] | 95 | Test Teardown Execution |
George Keishing | 0a46d02 | 2017-01-30 08:11:43 -0600 | [diff] [blame] | 96 | [Documentation] Collect FFDC and SOL log. |
Gunnar Mills | eac1af2 | 2016-11-14 15:30:09 -0600 | [diff] [blame] | 97 | FFDC On Test Case Fail |
George Keishing | 97e9653 | 2016-10-06 12:44:52 -0500 | [diff] [blame] | 98 | ${sol_log}= Stop SOL Console Logging |
| 99 | Log ${sol_log} |
George Keishing | 2f0f4b3 | 2018-01-21 23:25:47 -0600 | [diff] [blame] | 100 | Set Auto Reboot ${1} |
George Keishing | 0af2441 | 2017-03-10 13:33:23 -0600 | [diff] [blame] | 101 | |
| 102 | Host Off And On |
| 103 | [Documentation] Verify power off and on. |
| 104 | |
| 105 | Initiate Host PowerOff |
George Keishing | 0af2441 | 2017-03-10 13:33:23 -0600 | [diff] [blame] | 106 | |
| 107 | Initiate Host Boot |
George Keishing | 766c623 | 2018-02-02 11:42:55 -0600 | [diff] [blame] | 108 | Verify OCC State |
George Keishing | 383d29b | 2017-03-25 11:10:52 -0500 | [diff] [blame] | 109 | |
George Keishing | 5f2f7f5 | 2017-06-30 09:17:53 -0500 | [diff] [blame] | 110 | # TODO: Host shutdown race condition. |
| 111 | # Wait 30 seconds before Powering Off. |
| 112 | Sleep 30s |
Michael Tritz | cb64a7c | 2018-02-05 15:25:17 -0600 | [diff] [blame] | 113 | |
| 114 | Measure BMC Boot Time |
| 115 | [Documentation] Reboot the BMC and collect uptime. |
| 116 | |
| 117 | Open Connection And Log In |
| 118 | ${uptime}= |
| 119 | ... Execute Command cut -d " " -f 1 /proc/uptime| cut -d "." -f 1 |
| 120 | ${uptime}= Convert To Integer ${uptime} |
| 121 | [return] ${uptime} |