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 | 82462bf | 2018-09-20 23:48:43 -0500 | [diff] [blame] | 12 | Resource ../lib/remote_logging_utils.robot |
George Keishing | 97e9653 | 2016-10-06 12:44:52 -0500 | [diff] [blame] | 13 | |
George Keishing | bde0915 | 2018-06-14 14:53:08 -0500 | [diff] [blame] | 14 | Test Teardown FFDC On Test Case Fail |
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 | 82462bf | 2018-09-20 23:48:43 -0500 | [diff] [blame] | 33 | Test Remote Logging Configuration |
| 34 | [Documentation] Configure remote log server and verify configuration. |
| 35 | [Tags] Test_Remote_Logging_Configuration |
| 36 | |
| 37 | # Dummy IP and port to update /etc/rsyslog.d/server.conf |
| 38 | Configure Remote Log Server With Parameters |
| 39 | ... remote_host=10.10.10.10 remote_port=514 |
| 40 | |
| 41 | Verify Rsyslog Config On BMC remote_host=10.10.10.10 remote_port=514 |
| 42 | |
| 43 | # Reset to default configuration. |
| 44 | Configure Remote Log Server With Parameters |
| 45 | ... remote_host=${EMPTY} remote_port=0 |
| 46 | |
| 47 | |
George Keishing | 78ce8dc | 2018-03-30 11:49:06 -0500 | [diff] [blame] | 48 | Verify Front And Rear LED At Standby |
| 49 | [Documentation] Front and Rear LED should be off at standby. |
| 50 | [Tags] Verify_Front_And_Rear_LED_At_Standby |
| 51 | |
| 52 | REST Power Off stack_mode=skip quiet=1 |
| 53 | Verify Identify LED State Off |
| 54 | |
George Keishing | c5fef58 | 2018-07-18 08:41:28 -0500 | [diff] [blame] | 55 | |
George Keishing | c3d2343 | 2018-08-28 00:36:38 -0500 | [diff] [blame] | 56 | Verify Application Services Running At Standby |
| 57 | [Documentation] Check if there are services that have not completed. |
| 58 | [Tags] Verify_Application_Services_Running_At_Standby |
| 59 | |
| 60 | # Application services running on the BMC are not tightly coupled. |
| 61 | # At standby, there shouldn't be any pending job waiting to complete. |
| 62 | # Examples: |
| 63 | # Failure o/p: |
| 64 | # root@witherspoon:~# systemctl list-jobs --no-pager | cat |
| 65 | # JOB UNIT TYPE STATE |
| 66 | # 35151 xyz.openbmc_project.ObjectMapper.service start running |
| 67 | # 1 jobs listed. |
| 68 | # |
| 69 | # Success o/p: |
| 70 | # root@witherspoon:~# systemctl list-jobs --no-pager | cat |
| 71 | # No jobs running. |
| 72 | |
| 73 | REST Power Off stack_mode=skip quiet=1 |
| 74 | ${stdout} ${stderr} ${rc}= BMC Execute Command |
| 75 | ... systemctl list-jobs --no-pager | cat |
| 76 | Should Be Equal As Strings ${stdout} No jobs running. |
| 77 | |
| 78 | |
George Keishing | 0a46d02 | 2017-01-30 08:11:43 -0600 | [diff] [blame] | 79 | Power On Test |
| 80 | [Documentation] Power off and on. |
| 81 | [Tags] Power_On_Test |
George Keishing | bde0915 | 2018-06-14 14:53:08 -0500 | [diff] [blame] | 82 | [Setup] Test Setup Execution |
| 83 | [Teardown] Test Teardown Execution |
George Keishing | eefc07a | 2016-07-26 03:25:35 -0500 | [diff] [blame] | 84 | |
George Keishing | 0af2441 | 2017-03-10 13:33:23 -0600 | [diff] [blame] | 85 | Repeat Keyword ${LOOP_COUNT} times Host Off And On |
George Keishing | 97e9653 | 2016-10-06 12:44:52 -0500 | [diff] [blame] | 86 | |
George Keishing | c5fef58 | 2018-07-18 08:41:28 -0500 | [diff] [blame] | 87 | |
George Keishing | 32ed412 | 2017-05-13 03:06:39 -0500 | [diff] [blame] | 88 | Check For Application Failures |
| 89 | [Documentation] Parse the journal log and check for failures. |
| 90 | [Tags] Check_For_Application_Failures |
| 91 | |
George Keishing | c5fef58 | 2018-07-18 08:41:28 -0500 | [diff] [blame] | 92 | Check For Regex In Journald ${ERROR_REGEX} error_check=${0} |
George Keishing | 32ed412 | 2017-05-13 03:06:39 -0500 | [diff] [blame] | 93 | |
George Keishing | 3e53aa0 | 2018-07-12 10:07:52 -0500 | [diff] [blame] | 94 | |
Michael Tritz | cb64a7c | 2018-02-05 15:25:17 -0600 | [diff] [blame] | 95 | Verify Uptime Average Against Threshold |
| 96 | [Documentation] Compare BMC average boot time to a constant threshold. |
| 97 | [Tags] Verify_Uptime_Average_Against_Threshold |
| 98 | |
| 99 | OBMC Reboot (off) |
George Keishing | 22e57e1 | 2018-04-18 09:39:31 -0500 | [diff] [blame] | 100 | |
George Keishing | 3e53aa0 | 2018-07-12 10:07:52 -0500 | [diff] [blame] | 101 | Wait Until Keyword Succeeds |
| 102 | ... 1 min 30 sec Check BMC Uptime Journald |
George Keishing | 22e57e1 | 2018-04-18 09:39:31 -0500 | [diff] [blame] | 103 | |
Michael Tritz | cb64a7c | 2018-02-05 15:25:17 -0600 | [diff] [blame] | 104 | |
George Keishing | 8a5f147 | 2018-04-04 10:08:47 -0500 | [diff] [blame] | 105 | Test SSH And IPMI Connections |
| 106 | [Documentation] Try SSH and IPMI commands to verify each connection. |
| 107 | [Tags] Test_SSH_And_IPMI_Connections |
| 108 | |
| 109 | Check If BMC Is Up 3 min 20 sec |
| 110 | Wait Until Keyword Succeeds |
| 111 | ... 3 min 30 sec Wait for BMC state Ready |
| 112 | |
| 113 | BMC Execute Command true |
| 114 | Run IPMI Standard Command chassis status |
| 115 | |
George Keishing | 97e9653 | 2016-10-06 12:44:52 -0500 | [diff] [blame] | 116 | *** Keywords *** |
George Keishing | 0a46d02 | 2017-01-30 08:11:43 -0600 | [diff] [blame] | 117 | |
George Keishing | fcc6d78 | 2018-01-24 00:44:03 -0600 | [diff] [blame] | 118 | Test Setup Execution |
| 119 | [Documentation] Do test case setup tasks. |
| 120 | Start SOL Console Logging |
| 121 | Set Auto Reboot ${0} |
| 122 | |
George Keishing | 2f0f4b3 | 2018-01-21 23:25:47 -0600 | [diff] [blame] | 123 | Test Teardown Execution |
George Keishing | 0a46d02 | 2017-01-30 08:11:43 -0600 | [diff] [blame] | 124 | [Documentation] Collect FFDC and SOL log. |
Gunnar Mills | eac1af2 | 2016-11-14 15:30:09 -0600 | [diff] [blame] | 125 | FFDC On Test Case Fail |
George Keishing | 97e9653 | 2016-10-06 12:44:52 -0500 | [diff] [blame] | 126 | ${sol_log}= Stop SOL Console Logging |
| 127 | Log ${sol_log} |
George Keishing | 2f0f4b3 | 2018-01-21 23:25:47 -0600 | [diff] [blame] | 128 | Set Auto Reboot ${1} |
George Keishing | 0af2441 | 2017-03-10 13:33:23 -0600 | [diff] [blame] | 129 | |
| 130 | Host Off And On |
| 131 | [Documentation] Verify power off and on. |
| 132 | |
| 133 | Initiate Host PowerOff |
George Keishing | 0af2441 | 2017-03-10 13:33:23 -0600 | [diff] [blame] | 134 | |
| 135 | Initiate Host Boot |
George Keishing | 766c623 | 2018-02-02 11:42:55 -0600 | [diff] [blame] | 136 | Verify OCC State |
George Keishing | 383d29b | 2017-03-25 11:10:52 -0500 | [diff] [blame] | 137 | |
George Keishing | 5f2f7f5 | 2017-06-30 09:17:53 -0500 | [diff] [blame] | 138 | # TODO: Host shutdown race condition. |
| 139 | # Wait 30 seconds before Powering Off. |
| 140 | Sleep 30s |
Michael Tritz | cb64a7c | 2018-02-05 15:25:17 -0600 | [diff] [blame] | 141 | |
George Keishing | 3e53aa0 | 2018-07-12 10:07:52 -0500 | [diff] [blame] | 142 | |
| 143 | Check BMC Uptime Journald |
| 144 | [Documentation] Check BMC journald uptime entry. |
| 145 | |
| 146 | # Example output: |
| 147 | # Startup finished in 10.074s (kernel) + 2min 23.506s (userspace) = 2min 33.581s. |
| 148 | ${startup_time} ${stderr} ${rc}= BMC Execute Command |
| 149 | ... journalctl --no-pager | egrep '${STANDBY_REGEX}' | tail -1 |
| 150 | Should Not Be Empty ${startup_time} |
| 151 | |
| 152 | # Example time conversion: |
| 153 | # Get the "2min 33.581s" string total time taken to reach standby. |
| 154 | # Convert time "2min 33.581s" to unit 153.581. |
| 155 | ${startup_time}= Convert Time ${startup_time.split("= ",1)[1].strip(".")} |
| 156 | |
| 157 | Should Be True ${startup_time} < ${startup_time_threshold} |
| 158 | ... msg=${startup_time} greater than threshold value of ${startup_time_threshold}. |