Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
Steven Sombar | 0acb341 | 2018-01-24 09:38:42 -0600 | [diff] [blame] | 2 | |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 3 | Documentation Utilities for Robot keywords that use REST. |
Steven Sombar | 0acb341 | 2018-01-24 09:38:42 -0600 | [diff] [blame] | 4 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 5 | Resource ../lib/resource.txt |
| 6 | Resource ../lib/rest_client.robot |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 7 | Resource ../lib/connection_client.robot |
Rahul Maheshwari | d1f45f2 | 2018-10-26 05:16:39 -0500 | [diff] [blame] | 8 | Resource ../lib/boot_utils.robot |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 9 | Resource ../lib/common_utils.robot |
Michael Walsh | 391ba9b | 2017-08-24 11:36:24 -0500 | [diff] [blame] | 10 | Library String |
George Keishing | 30c12ff | 2016-09-02 10:25:29 -0500 | [diff] [blame] | 11 | Library DateTime |
| 12 | Library Process |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 13 | Library OperatingSystem |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 14 | Library gen_print.py |
| 15 | Library gen_robot_print.py |
Michael Walsh | 5f3f414 | 2017-05-22 17:09:47 -0500 | [diff] [blame] | 16 | Library gen_cmd.py |
Sunil M | acd110a | 2017-05-23 04:14:32 -0500 | [diff] [blame] | 17 | Library gen_robot_keyword.py |
Michael Walsh | e53e47a | 2017-06-30 17:03:24 -0500 | [diff] [blame] | 18 | Library bmc_ssh_utils.py |
Michael Walsh | fdc5ced | 2017-08-17 13:15:15 -0500 | [diff] [blame] | 19 | Library utils.py |
Charles Paul Hofer | 3581615 | 2017-10-02 11:55:11 -0500 | [diff] [blame] | 20 | Library var_funcs.py |
Sridevi Ramesh | 0d88ab3 | 2017-09-21 11:07:28 -0500 | [diff] [blame] | 21 | Library SCPLibrary WITH NAME scp |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 22 | |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 23 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 24 | *** Variables *** |
Steven Sombar | 0acb341 | 2018-01-24 09:38:42 -0600 | [diff] [blame] | 25 | |
Steven Sombar | 0acb341 | 2018-01-24 09:38:42 -0600 | [diff] [blame] | 26 | ${SYSTEM_SHUTDOWN_TIME} ${5} |
| 27 | |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 28 | # Assign default value to QUIET for programs which may not define it. |
| 29 | ${QUIET} ${0} |
Steven Sombar | 0acb341 | 2018-01-24 09:38:42 -0600 | [diff] [blame] | 30 | |
Sridevi Ramesh | 1699d37 | 2016-12-06 00:20:22 -0600 | [diff] [blame] | 31 | ${HOST_SETTING} ${SETTINGS_URI}host0 |
Steven Sombar | 0acb341 | 2018-01-24 09:38:42 -0600 | [diff] [blame] | 32 | |
Steven Sombar | 0acb341 | 2018-01-24 09:38:42 -0600 | [diff] [blame] | 33 | ${boot_prog_method} ${EMPTY} |
Michael Walsh | fdc5ced | 2017-08-17 13:15:15 -0500 | [diff] [blame] | 34 | ${power_policy_setup} ${0} |
| 35 | ${bmc_power_policy_method} ${EMPTY} |
Michael Walsh | fdc5ced | 2017-08-17 13:15:15 -0500 | [diff] [blame] | 36 | |
Sridevi Ramesh | 0d88ab3 | 2017-09-21 11:07:28 -0500 | [diff] [blame] | 37 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 38 | *** Keywords *** |
Sridevi Ramesh | 1699d37 | 2016-12-06 00:20:22 -0600 | [diff] [blame] | 39 | |
Steven Sombar | 0acb341 | 2018-01-24 09:38:42 -0600 | [diff] [blame] | 40 | |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 41 | Verify Ping and REST Authentication |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 42 | [Documentation] Verify ping and rest authentication. |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 43 | ${l_ping}= Run Keyword And Return Status |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 44 | ... Ping Host ${OPENBMC_HOST} |
George Keishing | c4d3dc0 | 2016-09-19 03:45:55 -0500 | [diff] [blame] | 45 | Run Keyword If '${l_ping}' == '${False}' |
| 46 | ... Fail msg=Ping Failed |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 47 | |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 48 | ${l_rest}= Run Keyword And Return Status |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 49 | ... Initialize OpenBMC |
George Keishing | c4d3dc0 | 2016-09-19 03:45:55 -0500 | [diff] [blame] | 50 | Run Keyword If '${l_rest}' == '${False}' |
| 51 | ... Fail msg=REST Authentication Failed |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 52 | |
| 53 | # Just to make sure the SSH is working for SCP |
| 54 | Open Connection And Log In |
| 55 | ${system} ${stderr}= Execute Command hostname return_stderr=True |
| 56 | Should Be Empty ${stderr} |
| 57 | |
Steven Sombar | 0acb341 | 2018-01-24 09:38:42 -0600 | [diff] [blame] | 58 | |
George Keishing | c4d3dc0 | 2016-09-19 03:45:55 -0500 | [diff] [blame] | 59 | Check If BMC is Up |
| 60 | [Documentation] Wait for Host to be online. Checks every X seconds |
| 61 | ... interval for Y minutes and fails if timed out. |
| 62 | ... Default MAX timedout is 10 min, interval 10 seconds. |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 63 | [Arguments] ${max_timeout}=${OPENBMC_REBOOT_TIMEOUT} min |
George Keishing | c4d3dc0 | 2016-09-19 03:45:55 -0500 | [diff] [blame] | 64 | ... ${interval}=10 sec |
| 65 | |
Steven Sombar | 0acb341 | 2018-01-24 09:38:42 -0600 | [diff] [blame] | 66 | # Description of argument(s): |
| 67 | # max_timeout Maximum time to wait. |
| 68 | # This should be expressed in Robot Framework's time format |
| 69 | # (e.g. "10 minutes"). |
| 70 | # interfal Interval to wait between status checks. |
| 71 | # This should be expressed in Robot Framework's time format |
| 72 | # (e.g. "5 seconds"). |
| 73 | |
George Keishing | c4d3dc0 | 2016-09-19 03:45:55 -0500 | [diff] [blame] | 74 | Wait Until Keyword Succeeds |
| 75 | ... ${max_timeout} ${interval} Verify Ping and REST Authentication |
| 76 | |
George Keishing | b370081 | 2016-08-31 03:03:30 -0500 | [diff] [blame] | 77 | |
George Keishing | 06ae4aa | 2016-08-30 01:41:28 -0500 | [diff] [blame] | 78 | Flush REST Sessions |
| 79 | [Documentation] Removes all the active session objects |
| 80 | Delete All Sessions |
George Keishing | b370081 | 2016-08-31 03:03:30 -0500 | [diff] [blame] | 81 | |
Steven Sombar | 0acb341 | 2018-01-24 09:38:42 -0600 | [diff] [blame] | 82 | |
Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 83 | Trigger Host Watchdog Error |
George Keishing | 37cfa6b | 2017-06-15 10:25:55 -0500 | [diff] [blame] | 84 | [Documentation] Inject host watchdog timeout error via REST. |
Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 85 | [Arguments] ${milliseconds}=1000 ${sleep_time}=5s |
Steven Sombar | 0acb341 | 2018-01-24 09:38:42 -0600 | [diff] [blame] | 86 | |
Michael Walsh | b5839d0 | 2017-04-12 16:11:20 -0500 | [diff] [blame] | 87 | # Description of argument(s): |
| 88 | # milliseconds The time watchdog timer value in milliseconds (e.g. 1000 = |
| 89 | # 1 second). |
Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 90 | # sleep_time Time delay for host watchdog error to get injected. |
| 91 | # Default is 5 seconds. |
| 92 | |
Michael Walsh | 4ffd1a1 | 2018-03-14 10:35:44 -0500 | [diff] [blame] | 93 | ${data}= Create Dictionary |
| 94 | ... data=xyz.openbmc_project.State.Watchdog.Action.PowerCycle |
| 95 | ${status} ${result}= Run Keyword And Ignore Error |
| 96 | ... Read Attribute ${HOST_WATCHDOG_URI} ExpireAction |
| 97 | Run Keyword If '${status}' == 'PASS' |
| 98 | ... Write Attribute ${HOST_WATCHDOG_URI} ExpireAction data=${data} |
George Keishing | 37cfa6b | 2017-06-15 10:25:55 -0500 | [diff] [blame] | 99 | |
| 100 | ${data}= Create Dictionary data=${milliseconds} |
Michael Walsh | 4ffd1a1 | 2018-03-14 10:35:44 -0500 | [diff] [blame] | 101 | Write Attribute ${HOST_WATCHDOG_URI} Interval data=${data} |
| 102 | |
| 103 | ${data}= Create Dictionary data=${True} |
| 104 | Write Attribute ${HOST_WATCHDOG_URI} Enabled data=${data} |
George Keishing | 37cfa6b | 2017-06-15 10:25:55 -0500 | [diff] [blame] | 105 | |
Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 106 | Sleep ${sleep_time} |
Prashanth Katti | ae7c228 | 2017-03-15 07:43:46 -0500 | [diff] [blame] | 107 | |
Steven Sombar | 0acb341 | 2018-01-24 09:38:42 -0600 | [diff] [blame] | 108 | |
Prashanth Katti | ae7c228 | 2017-03-15 07:43:46 -0500 | [diff] [blame] | 109 | Login To OS Host |
Steven Sombar | 0acb341 | 2018-01-24 09:38:42 -0600 | [diff] [blame] | 110 | [Documentation] Login to OS Host and return the Login response code. |
Prashanth Katti | ae7c228 | 2017-03-15 07:43:46 -0500 | [diff] [blame] | 111 | [Arguments] ${os_host}=${OS_HOST} ${os_username}=${OS_USERNAME} |
| 112 | ... ${os_password}=${OS_PASSWORD} |
Steven Sombar | 0acb341 | 2018-01-24 09:38:42 -0600 | [diff] [blame] | 113 | |
Gunnar Mills | 28e403b | 2017-10-25 16:16:38 -0500 | [diff] [blame] | 114 | # Description of arguments: |
Prashanth Katti | ae7c228 | 2017-03-15 07:43:46 -0500 | [diff] [blame] | 115 | # ${os_host} IP address of the OS Host. |
| 116 | # ${os_username} OS Host Login user name. |
| 117 | # ${os_password} OS Host Login passwrd. |
| 118 | |
Rahul Maheshwari | d1f45f2 | 2018-10-26 05:16:39 -0500 | [diff] [blame] | 119 | REST Power On stack_mode=skip quiet=1 |
Prashanth Katti | ae7c228 | 2017-03-15 07:43:46 -0500 | [diff] [blame] | 120 | |
George Keishing | 3f223b8 | 2017-06-28 03:50:35 -0500 | [diff] [blame] | 121 | SSHLibrary.Open Connection ${os_host} |
Sridevi Ramesh | ea36b41 | 2017-03-09 04:08:02 -0600 | [diff] [blame] | 122 | ${resp}= Login ${os_username} ${os_password} |
| 123 | [Return] ${resp} |
Prashanth Katti | 884ee06 | 2017-03-16 05:05:03 -0500 | [diff] [blame] | 124 | |
Steven Sombar | 0acb341 | 2018-01-24 09:38:42 -0600 | [diff] [blame] | 125 | |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 126 | Initiate Auto Reboot |
| 127 | [Documentation] Initiate an auto reboot. |
| 128 | [Arguments] ${milliseconds}=5000 |
Sweta Potthuri | e5a9fc7 | 2017-05-03 07:02:46 -0500 | [diff] [blame] | 129 | |
| 130 | # Description of argument(s): |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 131 | # milliseconds The number of milliseconds for the watchdog timer. |
Sweta Potthuri | e5a9fc7 | 2017-05-03 07:02:46 -0500 | [diff] [blame] | 132 | |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 133 | # Set the auto reboot policy. |
| 134 | Set Auto Reboot ${1} |
| 135 | # Set the watchdog timer. |
| 136 | Trigger Host Watchdog Error ${milliseconds} |
| 137 | |
| 138 | |
| 139 | Initiate OS Host Reboot |
| 140 | [Documentation] Initiate an OS reboot. |
| 141 | [Arguments] ${os_host}=${OS_HOST} ${os_username}=${OS_USERNAME} |
| 142 | ... ${os_password}=${OS_PASSWORD} |
| 143 | |
| 144 | # Description of argument(s): |
| 145 | # os_host The host name or IP address of the OS. |
| 146 | # os_username The username to be used to sign in to the OS. |
| 147 | # os_password The password to be used to sign in to the OS. |
| 148 | |
| 149 | ${cmd_buf}= Run Keyword If '${os_username}' == 'root' |
| 150 | ... Set Variable reboot |
| 151 | ... ELSE |
| 152 | ... Set Variable echo ${os_password} | sudo -S reboot |
| 153 | |
| 154 | ${output} ${stderr} ${rc}= OS Execute Command |
| 155 | ... ${cmd_buf} fork=${1} |
| 156 | |
| 157 | |
| 158 | Initiate OS Host Power Off |
| 159 | [Documentation] Initiate an OS reboot. |
| 160 | [Arguments] ${os_host}=${OS_HOST} ${os_username}=${OS_USERNAME} |
| 161 | ... ${os_password}=${OS_PASSWORD} ${hard}=${0} |
| 162 | |
| 163 | # Description of argument(s): |
| 164 | # os_host The DNS name or IP of the OS. |
| 165 | # os_username The username to be used to sign in to the OS. |
| 166 | # os_password The password to be used to sign in to the OS. |
| 167 | # hard Indicates whether to do a hard vs. soft power off. |
| 168 | |
| 169 | ${time_string}= Run Keyword If ${hard} Set Variable ${SPACE}now |
| 170 | ... ELSE Set Variable ${EMPTY} |
| 171 | |
| 172 | ${cmd_buf}= Run Keyword If '${os_username}' == 'root' |
| 173 | ... Set Variable shutdown${time_string} |
| 174 | ... ELSE |
| 175 | ... Set Variable echo ${os_password} | sudo -S shutdown${time_string} |
| 176 | |
| 177 | ${output} ${stderr} ${rc}= OS Execute Command |
| 178 | ... ${cmd_buf} fork=${1} |
Sweta Potthuri | e5a9fc7 | 2017-05-03 07:02:46 -0500 | [diff] [blame] | 179 | |
George Keishing | 3987a1e | 2017-09-20 09:13:02 -0500 | [diff] [blame] | 180 | |
Steven Sombar | 5f3af44 | 2018-02-14 08:30:15 -0600 | [diff] [blame] | 181 | Set System LED State |
| 182 | [Documentation] Set given system LED via REST. |
| 183 | [Arguments] ${led_name} ${led_state} |
| 184 | # Description of argument(s): |
| 185 | # led_name System LED name (e.g. heartbeat, identify, beep). |
| 186 | # led_state LED state to be set (e.g. On, Off). |
| 187 | |
| 188 | ${args}= Create Dictionary |
| 189 | ... data=xyz.openbmc_project.Led.Physical.Action.${led_state} |
| 190 | Write Attribute ${LED_PHYSICAL_URI}${led_name} State data=${args} |
| 191 | |
| 192 | Verify LED State ${led_name} ${led_state} |
| 193 | |
| 194 | |
Steven Sombar | aaf72c4 | 2017-09-05 12:02:00 -0500 | [diff] [blame] | 195 | Read Turbo Setting Via REST |
| 196 | [Documentation] Return turbo setting via REST. |
Steven Sombar | ea79a49 | 2018-04-18 11:14:57 -0500 | [diff] [blame] | 197 | # Returns 1 if TurboAllowed, 0 if not. |
Steven Sombar | aaf72c4 | 2017-09-05 12:02:00 -0500 | [diff] [blame] | 198 | |
Steven Sombar | ea79a49 | 2018-04-18 11:14:57 -0500 | [diff] [blame] | 199 | ${turbo_setting}= Read Attribute |
| 200 | ... ${CONTROL_HOST_URI}turbo_allowed TurboAllowed |
| 201 | [Return] ${turbo_setting} |
| 202 | |
Steven Sombar | aaf72c4 | 2017-09-05 12:02:00 -0500 | [diff] [blame] | 203 | |
Steven Sombar | aaf72c4 | 2017-09-05 12:02:00 -0500 | [diff] [blame] | 204 | Set Turbo Setting Via REST |
| 205 | [Documentation] Set turbo setting via REST. |
Steven Sombar | 80bc859 | 2018-04-24 11:44:53 -0500 | [diff] [blame] | 206 | [Arguments] ${setting} ${verify}=${False} |
Steven Sombar | 0acb341 | 2018-01-24 09:38:42 -0600 | [diff] [blame] | 207 | |
Steven Sombar | aaf72c4 | 2017-09-05 12:02:00 -0500 | [diff] [blame] | 208 | # Description of argument(s): |
Steven Sombar | 80bc859 | 2018-04-24 11:44:53 -0500 | [diff] [blame] | 209 | # setting State to set TurboAllowed, 1=allowed, 0=not allowed. |
| 210 | # verify If True, read the TurboAllowed setting to confirm. |
Steven Sombar | aaf72c4 | 2017-09-05 12:02:00 -0500 | [diff] [blame] | 211 | |
Steven Sombar | ea79a49 | 2018-04-18 11:14:57 -0500 | [diff] [blame] | 212 | ${data}= Create Dictionary data=${${setting}} |
Steven Sombar | 80bc859 | 2018-04-24 11:44:53 -0500 | [diff] [blame] | 213 | Write Attribute ${CONTROL_HOST_URI}turbo_allowed TurboAllowed |
| 214 | ... verify=${verify} data=${data} |
George Keishing | ef74a8c | 2017-10-20 10:23:52 -0500 | [diff] [blame] | 215 | |
Steven Sombar | 0acb341 | 2018-01-24 09:38:42 -0600 | [diff] [blame] | 216 | |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 217 | Set REST Logging Policy |
| 218 | [Documentation] Enable or disable REST logging setting. |
| 219 | [Arguments] ${policy_setting}=${True} |
George Keishing | ef74a8c | 2017-10-20 10:23:52 -0500 | [diff] [blame] | 220 | |
| 221 | # Description of argument(s): |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 222 | # policy_setting The policy setting value which can be either |
| 223 | # True or False. |
George Keishing | ef74a8c | 2017-10-20 10:23:52 -0500 | [diff] [blame] | 224 | |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 225 | ${log_dict}= Create Dictionary data=${policy_setting} |
| 226 | Write Attribute ${BMC_LOGGING_URI}${/}rest_api_logs Enabled |
| 227 | ... data=${log_dict} verify=${1} expected_value=${policy_setting} |
Sridevi Ramesh | 0d88ab3 | 2017-09-21 11:07:28 -0500 | [diff] [blame] | 228 | |
Steven Sombar | 0acb341 | 2018-01-24 09:38:42 -0600 | [diff] [blame] | 229 | |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 230 | Old Get Boot Progress |
| 231 | [Documentation] Get the boot progress the old way (via org location). |
| 232 | [Arguments] ${quiet}=${QUIET} |
George Keishing | 034902d | 2017-11-10 13:15:38 -0600 | [diff] [blame] | 233 | |
| 234 | # Description of argument(s): |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 235 | # quiet Indicates whether this keyword should run without any output to |
| 236 | # the console. |
| 237 | |
| 238 | ${state}= Read Attribute ${OPENBMC_BASE_URI}sensors/host/BootProgress |
| 239 | ... value quiet=${quiet} |
| 240 | |
| 241 | [Return] ${state} |
| 242 | |
| 243 | |
| 244 | Set Boot Progress Method |
| 245 | [Documentation] Set the boot_prog_method to either 'Old' or 'New'. |
| 246 | |
| 247 | # The boot progress data has moved from an 'org' location to an 'xyz' |
| 248 | # location. This keyword will determine whether the new method of getting |
| 249 | # the boot progress is valid and will set the global boot_prog_method |
| 250 | # variable accordingly. If boot_prog_method is already set (either by a |
| 251 | # prior call to this function or via a -v parm), this keyword will simply |
| 252 | # return. |
| 253 | |
| 254 | # Note: There are interim builds that contain boot_progress in both the |
| 255 | # old and the new location values. It is nearly impossible for this |
| 256 | # keyword to determine whether the old boot_progress or the new one is |
| 257 | # active. When using such builds where the old boot_progress is active, |
| 258 | # the only recourse users will have is that they may specify |
| 259 | # -v boot_prog_method:Old to force old behavior on such builds. |
| 260 | |
| 261 | Run Keyword If '${boot_prog_method}' != '${EMPTY}' Return From Keyword |
| 262 | |
| 263 | ${new_status} ${new_value}= Run Keyword And Ignore Error |
| 264 | ... New Get Boot Progress |
| 265 | # If the new style read fails, the method must necessarily be "Old". |
| 266 | Run Keyword If '${new_status}' == 'PASS' |
| 267 | ... Run Keywords |
| 268 | ... Set Global Variable ${boot_prog_method} New AND |
| 269 | ... Rqpvars boot_prog_method AND |
| 270 | ... Return From Keyword |
| 271 | |
| 272 | # Default method is "Old". |
| 273 | Set Global Variable ${boot_prog_method} Old |
| 274 | Rqpvars boot_prog_method |
| 275 | |
| 276 | |
| 277 | Initiate Power On |
| 278 | [Documentation] Initiates the power on and waits until the Is Power On |
| 279 | ... keyword returns that the power state has switched to on. |
| 280 | [Arguments] ${wait}=${1} |
| 281 | |
| 282 | # Description of argument(s): |
| 283 | # wait Indicates whether to wait for a powered on state after issuing |
| 284 | # the power on command. |
| 285 | |
| 286 | @{arglist}= Create List |
| 287 | ${args}= Create Dictionary data=@{arglist} |
| 288 | ${resp}= Call Method ${OPENBMC_BASE_URI}control/chassis0/ powerOn |
| 289 | ... data=${args} |
| 290 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
| 291 | |
| 292 | # Does caller want to wait for power on status? |
| 293 | Run Keyword If '${wait}' == '${0}' Return From Keyword |
| 294 | Wait Until Keyword Succeeds 3 min 10 sec Is Power On |
| 295 | |
| 296 | |
| 297 | Initiate Power Off |
| 298 | [Documentation] Initiates the power off and waits until the Is Power Off |
| 299 | ... keyword returns that the power state has switched to off. |
| 300 | |
| 301 | @{arglist}= Create List |
| 302 | ${args}= Create Dictionary data=@{arglist} |
| 303 | ${resp}= Call Method ${OPENBMC_BASE_URI}control/chassis0/ powerOff |
| 304 | ... data=${args} |
| 305 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
| 306 | Wait Until Keyword Succeeds 1 min 10 sec Is Power Off |
| 307 | |
| 308 | |
| 309 | Get Boot Progress |
| 310 | [Documentation] Get the boot progress and return it. |
| 311 | [Arguments] ${quiet}=${QUIET} |
| 312 | |
| 313 | # Description of argument(s): |
| 314 | # quiet Indicates whether this keyword should run without any output to |
| 315 | # the console. |
| 316 | |
| 317 | Set Boot Progress Method |
| 318 | ${state}= Run Keyword If '${boot_prog_method}' == 'New' |
| 319 | ... New Get Boot Progress quiet=${quiet} |
| 320 | ... ELSE |
| 321 | ... Old Get Boot Progress quiet=${quiet} |
| 322 | |
| 323 | [Return] ${state} |
| 324 | |
| 325 | |
| 326 | New Get Boot Progress |
| 327 | [Documentation] Get the boot progress the new way (via xyz location). |
| 328 | [Arguments] ${quiet}=${QUIET} |
| 329 | |
| 330 | # Description of argument(s): |
| 331 | # quiet Indicates whether this keyword should run without any output to |
| 332 | # the console. |
| 333 | |
| 334 | ${state}= Read Attribute ${HOST_STATE_URI} BootProgress quiet=${quiet} |
| 335 | |
| 336 | [Return] ${state.rsplit('.', 1)[1]} |
| 337 | |
| 338 | |
| 339 | New Get Power Policy |
| 340 | [Documentation] Returns the BMC power policy (new method). |
| 341 | ${currentPolicy}= Read Attribute ${POWER_RESTORE_URI} PowerRestorePolicy |
| 342 | |
| 343 | [Return] ${currentPolicy} |
| 344 | |
| 345 | |
| 346 | Old Get Power Policy |
| 347 | [Documentation] Returns the BMC power policy (old method). |
| 348 | ${currentPolicy}= Read Attribute ${HOST_SETTING} power_policy |
| 349 | |
| 350 | [Return] ${currentPolicy} |
| 351 | |
| 352 | |
| 353 | Get Auto Reboot |
| 354 | [Documentation] Returns auto reboot setting. |
| 355 | ${setting}= Read Attribute ${CONTROL_HOST_URI}/auto_reboot AutoReboot |
| 356 | |
| 357 | [Return] ${setting} |
| 358 | |
| 359 | |
| 360 | Trigger Warm Reset |
| 361 | [Documentation] Initiate a warm reset. |
| 362 | |
| 363 | log to console "Triggering warm reset" |
| 364 | ${data}= create dictionary data=@{EMPTY} |
| 365 | ${resp}= openbmc post request |
| 366 | ... ${OPENBMC_BASE_URI}control/bmc0/action/warmReset data=${data} |
| 367 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 368 | ${session_active}= Check If warmReset is Initiated |
| 369 | Run Keyword If '${session_active}' == '${True}' |
| 370 | ... Fail msg=warm reset didn't occur |
| 371 | |
| 372 | Sleep ${SYSTEM_SHUTDOWN_TIME}min |
| 373 | Check If BMC Is Up |
| 374 | |
| 375 | |
| 376 | Get Power State |
| 377 | [Documentation] Returns the power state as an integer. Either 0 or 1. |
| 378 | [Arguments] ${quiet}=${QUIET} |
| 379 | |
| 380 | # Description of argument(s): |
| 381 | # quiet Indicates whether this keyword should run without any output to |
| 382 | # the console. |
| 383 | |
| 384 | @{arglist}= Create List |
| 385 | ${args}= Create Dictionary data=@{arglist} |
| 386 | |
| 387 | ${resp}= Call Method ${OPENBMC_BASE_URI}control/chassis0/ getPowerState |
| 388 | ... data=${args} quiet=${quiet} |
| 389 | Should be equal as strings ${resp.status_code} ${HTTP_OK} |
| 390 | ${content}= to json ${resp.content} |
| 391 | |
| 392 | [Return] ${content["data"]} |
| 393 | |
| 394 | |
| 395 | Clear BMC Gard Record |
| 396 | [Documentation] Clear gard records from the system. |
| 397 | |
| 398 | @{arglist}= Create List |
| 399 | ${args}= Create Dictionary data=@{arglist} |
| 400 | ${resp}= Call Method |
| 401 | ... ${OPENPOWER_CONTROL}gard Reset data=${args} |
| 402 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 403 | |
| 404 | |
| 405 | Flash PNOR |
| 406 | [Documentation] Calls flash bios update method to flash PNOR image |
| 407 | [Arguments] ${pnor_image} |
| 408 | |
| 409 | # Description of argument(s): |
| 410 | # pnor_image The filename and path of the PNOR image |
| 411 | # (e.g. "/home/image/zaius.pnor"). |
| 412 | |
| 413 | @{arglist}= Create List ${pnor_image} |
| 414 | ${args}= Create Dictionary data=@{arglist} |
| 415 | ${resp}= Call Method /org/openbmc/control/flash/bios/ update |
| 416 | ... data=${args} |
| 417 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
| 418 | Wait Until Keyword Succeeds 2 min 10 sec Is PNOR Flashing |
| 419 | |
| 420 | |
| 421 | Get Flash BIOS Status |
| 422 | [Documentation] Returns the status of the flash BIOS API as a string. For |
| 423 | ... example 'Flashing', 'Flash Done', etc |
| 424 | ${data}= Read Properties /org/openbmc/control/flash/bios |
| 425 | [Return] ${data['status']} |
| 426 | |
| 427 | |
| 428 | Is PNOR Flashing |
| 429 | [Documentation] Get BIOS 'Flashing' status. This indicates that PNOR |
| 430 | ... flashing has started. |
| 431 | ${status}= Get Flash BIOS Status |
| 432 | Should Contain ${status} Flashing |
| 433 | |
| 434 | |
| 435 | Is PNOR Flash Done |
| 436 | [Documentation] Get BIOS 'Flash Done' status. This indicates that the |
| 437 | ... PNOR flashing has completed. |
| 438 | ${status}= Get Flash BIOS Status |
| 439 | should be equal as strings ${status} Flash Done |
| 440 | |
| 441 | |
| 442 | Create OS Console File Path |
| 443 | [Documentation] Create OS console file path name and return it. |
| 444 | [Arguments] ${log_file_path}=${EMPTY} |
| 445 | |
| 446 | # Description of arguments: |
| 447 | # file_path The caller's candidate value. If this value is ${EMPTY}, this |
| 448 | # keyword will compose a file path name. Otherwise, this |
| 449 | # keyword will use the caller's file_path value. In either |
| 450 | # case, the value will be returned. |
| 451 | |
| 452 | ${status}= Run Keyword And Return Status Variable Should Exist |
| 453 | ... ${TEST_NAME} |
| 454 | |
| 455 | ${default_file_path}= Set Variable If ${status} == ${TRUE} |
| 456 | ... /tmp/${OPENBMC_HOST}_${TEST_NAME.replace(' ', '')}_os_console.txt |
| 457 | ... /tmp/${OPENBMC_HOST}_os_console.txt |
| 458 | |
| 459 | ${log_file_path}= Set Variable If '${log_file_path}' == '${EMPTY}' |
| 460 | ... ${default_file_path} ${log_file_path} |
| 461 | |
| 462 | [Return] ${log_file_path} |
| 463 | |
| 464 | |
| 465 | Get Endpoint Paths |
| 466 | [Documentation] Returns all url paths ending with given endpoint |
| 467 | ... Example: |
| 468 | ... Given the following endpoint: cpu |
| 469 | ... This keyword will return: list of all urls ending with |
| 470 | ... cpu - |
| 471 | ... /org/openbmc/inventory/system/chassis/motherboard/cpu0, |
| 472 | ... /org/openbmc/inventory/system/chassis/motherboard/cpu1 |
| 473 | [Arguments] ${path} ${endpoint} |
| 474 | |
| 475 | # Description of arguments: |
| 476 | # path URL path for enumeration. |
| 477 | # endpoint Endpoint string (url path ending). |
| 478 | |
| 479 | ${resp}= Read Properties ${path}/enumerate timeout=30 |
| 480 | Log Dictionary ${resp} |
| 481 | |
| 482 | ${list}= Get Dictionary Keys ${resp} |
| 483 | # For a given string, look for prefix and suffix for matching expression. |
| 484 | # Start of string followed by zero or more of any character followed by |
| 485 | # any digit or lower case character. |
| 486 | ${resp}= Get Matches ${list} regexp=^.*[0-9a-z_].${endpoint}\[0-9a-z]*$ |
| 487 | |
| 488 | [Return] ${resp} |
| 489 | |
| 490 | |
| 491 | Set BMC Power Policy |
| 492 | [Documentation] Set the given BMC power policy. |
| 493 | [Arguments] ${policy} |
| 494 | |
| 495 | # Note that this function will translate the old style "RESTORE_LAST_STATE" |
| 496 | # policy to the new style "xyz.openbmc_project.Control.Power.RestorePolicy. |
| 497 | # Policy.Restore" for you. |
| 498 | |
| 499 | # Description of argument(s): |
| 500 | # policy Power restore policy (e.g "RESTORE_LAST_STATE", |
| 501 | # ${RESTORE_LAST_STATE}). |
| 502 | |
| 503 | # Set the bmc_power_policy_method to either 'Old' or 'New'. |
| 504 | Set Power Policy Method |
| 505 | # This translation helps bridge between old and new method for calling. |
| 506 | ${policy}= Translate Power Policy Value ${policy} |
| 507 | # Run the appropriate keyword. |
| 508 | Run Key ${bmc_power_policy_method} Set Power Policy \ ${policy} |
| 509 | ${currentPolicy}= Get System Power Policy |
| 510 | Should Be Equal ${currentPolicy} ${policy} |
| 511 | |
| 512 | |
| 513 | Delete Error Logs |
| 514 | [Documentation] Delete error logs. |
| 515 | |
| 516 | # Check if error logs entries exist, if not return. |
| 517 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}${/}list quiet=${1} |
| 518 | Return From Keyword If ${resp.status_code} == ${HTTP_NOT_FOUND} |
| 519 | |
| 520 | # Get the list of error logs entries and delete them all. |
| 521 | ${elog_entries}= Get URL List ${BMC_LOGGING_ENTRY} |
| 522 | :FOR ${entry} IN @{elog_entries} |
| 523 | \ Delete Error Log Entry ${entry} |
| 524 | |
| 525 | |
| 526 | Delete All Error Logs |
| 527 | [Documentation] Delete all error log entries using "DeleteAll" interface. |
| 528 | |
| 529 | ${data}= Create Dictionary data=@{EMPTY} |
| 530 | ${resp}= Openbmc Post Request ${BMC_LOGGING_URI}action/DeleteAll |
| 531 | ... data=${data} |
| 532 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 533 | |
| 534 | |
| 535 | Get Elog URL List |
| 536 | [Documentation] Return error log entry list of URLs. |
| 537 | |
| 538 | ${url_list}= Read Properties /xyz/openbmc_project/logging/entry/ |
| 539 | Sort List ${url_list} |
| 540 | [Return] ${url_list} |
| 541 | |
| 542 | |
| 543 | Get BMC Flash Chip Boot Side |
| 544 | [Documentation] Return the BMC flash chip boot side. |
George Keishing | 034902d | 2017-11-10 13:15:38 -0600 | [diff] [blame] | 545 | |
| 546 | # Example: |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 547 | # 0 - indicates chip select is current side. |
| 548 | # 32 - indicates chip select is alternate side. |
George Keishing | 034902d | 2017-11-10 13:15:38 -0600 | [diff] [blame] | 549 | |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 550 | ${boot_side} ${stderr} ${rc}= BMC Execute Command |
| 551 | ... cat /sys/class/watchdog/watchdog1/bootstatus |
| 552 | |
| 553 | [Return] ${boot_side} |
| 554 | |
| 555 | |
| 556 | Update Root Password |
| 557 | [Documentation] Update system "root" user password. |
| 558 | [Arguments] ${openbmc_password}=${OPENBMC_PASSWORD} |
| 559 | |
| 560 | # Description of argument(s): |
| 561 | # openbmc_password The root password for the open BMC system. |
| 562 | |
| 563 | @{password}= Create List ${openbmc_password} |
| 564 | ${data}= Create Dictionary data=@{password} |
| 565 | |
| 566 | ${headers}= Create Dictionary Content-Type=application/json |
| 567 | ${resp}= Post Request openbmc ${BMC_USER_URI}root/action/SetPassword |
| 568 | ... data=${data} headers=${headers} |
| 569 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 570 | ... msg=Updating the new root password failed, RC=${resp.status_code}. |
Sweta Potthuri | 7d3af3c | 2018-01-29 03:07:07 -0600 | [diff] [blame] | 571 | |
Sweta Potthuri | f39022d | 2018-02-06 03:40:07 -0600 | [diff] [blame] | 572 | |
Sweta Potthuri | 7d3af3c | 2018-01-29 03:07:07 -0600 | [diff] [blame] | 573 | Watchdog Object Should Exist |
| 574 | [Documentation] Check that watchdog object exists. |
| 575 | |
| 576 | ${resp}= OpenBMC Get Request ${WATCHDOG_URI}host0 |
| 577 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 578 | ... msg=Expected watchdog object does not exist. |
Sweta Potthuri | f39022d | 2018-02-06 03:40:07 -0600 | [diff] [blame] | 579 | |
| 580 | |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 581 | Get System LED State |
| 582 | [Documentation] Return the state of given system LED. |
| 583 | [Arguments] ${led_name} |
Sweta Potthuri | f39022d | 2018-02-06 03:40:07 -0600 | [diff] [blame] | 584 | |
| 585 | # Description of argument(s): |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 586 | # led_name System LED name (e.g. heartbeat, identify, beep). |
Sweta Potthuri | f39022d | 2018-02-06 03:40:07 -0600 | [diff] [blame] | 587 | |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 588 | ${state}= Read Attribute ${LED_PHYSICAL_URI}${led_name} State |
| 589 | [Return] ${state.rsplit('.', 1)[1]} |
George Keishing | b9f407b | 2018-02-20 00:07:46 -0600 | [diff] [blame] | 590 | |
| 591 | |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 592 | Verify LED State |
| 593 | [Documentation] Checks if LED is in given state. |
| 594 | [Arguments] ${led_name} ${led_state} |
| 595 | # Description of argument(s): |
| 596 | # led_name System LED name (e.g. heartbeat, identify, beep). |
| 597 | # led_state LED state to be verified (e.g. On, Off). |
George Keishing | b9f407b | 2018-02-20 00:07:46 -0600 | [diff] [blame] | 598 | |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 599 | ${state}= Get System LED State ${led_name} |
| 600 | Should Be Equal ${state} ${led_state} |
George Keishing | b9f407b | 2018-02-20 00:07:46 -0600 | [diff] [blame] | 601 | |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 602 | |
| 603 | Get LED State XYZ |
| 604 | [Documentation] Returns state of given LED. |
| 605 | [Arguments] ${led_name} |
| 606 | |
| 607 | # Description of argument(s): |
| 608 | # led_name Name of LED. |
| 609 | |
| 610 | ${state}= Read Attribute ${LED_GROUPS_URI}${led_name} Asserted |
| 611 | # Returns the state of the LED, either On or Off. |
| 612 | [Return] ${state} |
George Keishing | b9f407b | 2018-02-20 00:07:46 -0600 | [diff] [blame] | 613 | |
George Keishing | 78ce8dc | 2018-03-30 11:49:06 -0500 | [diff] [blame] | 614 | |
| 615 | Verify Identify LED State |
| 616 | [Documentation] Verify the identify LED state |
| 617 | ... matches caller's expectations. |
| 618 | [Arguments] ${expected_state} |
| 619 | |
| 620 | # Description of argument(s): |
| 621 | # expected_state The LED state expected by the caller ("Blink" or "Off"). |
| 622 | |
| 623 | ${resp}= Read Attribute ${LED_PHYSICAL_URI}/front_id State |
| 624 | Should Be Equal ${resp} |
| 625 | ... xyz.openbmc_project.Led.Physical.Action.${expected_state} |
| 626 | ... msg=Unexpected LED state. |
| 627 | |
| 628 | ${resp}= Read Attribute ${LED_PHYSICAL_URI}/rear_id State |
| 629 | Should Be Equal ${resp} |
| 630 | ... xyz.openbmc_project.Led.Physical.Action.${expected_state} |
| 631 | ... msg=Unexpected LED state. |
| 632 | |
Sweta Potthuri | 3925503 | 2018-03-28 10:12:14 -0500 | [diff] [blame] | 633 | |
| 634 | Verify The Attribute |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 635 | [Documentation] Verify the given attribute. |
Sweta Potthuri | 3925503 | 2018-03-28 10:12:14 -0500 | [diff] [blame] | 636 | [Arguments] ${uri} ${attribute_name} ${attribute_value} |
| 637 | |
| 638 | # Description of argument(s): |
| 639 | # uri URI path |
| 640 | # (e.g. "/xyz/openbmc_project/control/host0/TPMEnable"). |
| 641 | # attribute_name Name of attribute to be verified (e.g. "TPMEnable"). |
| 642 | # attribute_value The expected value of attribute (e.g. "1", "0", etc.) |
| 643 | |
| 644 | ${output}= Read Attribute ${uri} ${attribute_name} |
| 645 | Should Be Equal ${attribute_value} ${output} |
| 646 | ... msg=Attribute "${attribute_name} does not have the expected value. |
George Keishing | cf0d777 | 2018-05-04 08:22:50 -0500 | [diff] [blame] | 647 | |
| 648 | |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 649 | New Set Power Policy |
| 650 | [Documentation] Set the given BMC power policy (new method). |
| 651 | [Arguments] ${policy} |
George Keishing | b4adfc7 | 2018-10-26 09:39:32 -0500 | [diff] [blame] | 652 | |
| 653 | # Description of argument(s): |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 654 | # policy Power restore policy (e.g. ${ALWAYS_POWER_OFF}). |
George Keishing | c5fef58 | 2018-07-18 08:41:28 -0500 | [diff] [blame] | 655 | |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 656 | ${valueDict}= Create Dictionary data=${policy} |
| 657 | Write Attribute |
| 658 | ... ${POWER_RESTORE_URI} PowerRestorePolicy data=${valueDict} |
George Keishing | 216e584 | 2018-08-31 14:58:15 -0500 | [diff] [blame] | 659 | |
| 660 | |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 661 | Old Set Power Policy |
| 662 | [Documentation] Set the given BMC power policy (old method). |
| 663 | [Arguments] ${policy} |
George Keishing | 3c004dc | 2018-10-10 07:16:47 -0500 | [diff] [blame] | 664 | |
| 665 | # Description of argument(s): |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 666 | # policy Power restore policy (e.g. "ALWAYS_POWER_OFF"). |
| 667 | |
| 668 | ${valueDict}= create dictionary data=${policy} |
| 669 | Write Attribute ${HOST_SETTING} power_policy data=${valueDict} |
George Keishing | 3c004dc | 2018-10-10 07:16:47 -0500 | [diff] [blame] | 670 | |
| 671 | |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 672 | Set Auto Reboot |
| 673 | [Documentation] Set the given auto reboot setting. |
| 674 | [Arguments] ${setting} |
George Keishing | 3c004dc | 2018-10-10 07:16:47 -0500 | [diff] [blame] | 675 | |
| 676 | # Description of argument(s): |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 677 | # setting The reboot setting, 1 for enabling and 0 for disabling. |
George Keishing | 3c004dc | 2018-10-10 07:16:47 -0500 | [diff] [blame] | 678 | |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 679 | ${valueDict}= Set Variable ${setting} |
| 680 | ${data}= Create Dictionary data=${valueDict} |
| 681 | Write Attribute ${CONTROL_HOST_URI}/auto_reboot AutoReboot data=${data} |
| 682 | ${current_setting}= Get Auto Reboot |
| 683 | Should Be Equal As Integers ${current_setting} ${setting} |
George Keishing | 3c004dc | 2018-10-10 07:16:47 -0500 | [diff] [blame] | 684 | |
George Keishing | c25c55d | 2018-10-30 02:23:44 -0500 | [diff] [blame] | 685 | |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 686 | Set Control Boot Mode |
| 687 | [Documentation] Set given boot mode on the boot object path attribute. |
| 688 | [Arguments] ${boot_path} ${boot_mode} |
George Keishing | c25c55d | 2018-10-30 02:23:44 -0500 | [diff] [blame] | 689 | |
| 690 | # Description of argument(s): |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 691 | # boot_path Boot object path. |
| 692 | # Example: |
| 693 | # /xyz/openbmc_project/control/host0/boot |
| 694 | # /xyz/openbmc_project/control/host0/boot/one_time |
| 695 | # boot_mode Boot mode which need to be set. |
| 696 | # Example: |
| 697 | # "xyz.openbmc_project.Control.Boot.Mode.Modes.Regular" |
George Keishing | c25c55d | 2018-10-30 02:23:44 -0500 | [diff] [blame] | 698 | |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 699 | ${valueDict}= Create Dictionary data=${boot_mode} |
| 700 | Write Attribute ${boot_path} BootMode data=${valueDict} |
George Keishing | c25c55d | 2018-10-30 02:23:44 -0500 | [diff] [blame] | 701 | |
Steven Sombar | f60cbcf | 2018-12-07 08:12:18 -0600 | [diff] [blame] | 702 | |
| 703 | Is Power On |
| 704 | [Documentation] Verify that the BMC chassis state is on. |
| 705 | ${state}= Get Power State |
| 706 | Should be equal ${state} ${1} |
| 707 | |
| 708 | |
| 709 | Is Power Off |
| 710 | [Documentation] Verify that the BMC chassis state is off. |
| 711 | ${state}= Get Power State |
| 712 | Should be equal ${state} ${0} |