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