Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
George Keishing | 4d6c1da | 2016-07-15 05:51:22 -0500 | [diff] [blame] | 2 | Documentation This module is for IPMI client for copying ipmitool to |
Sivas SRR | a2dab3c | 2016-07-25 05:08:18 -0500 | [diff] [blame] | 3 | ... openbmc box and execute ipmitool IPMI standard |
| 4 | ... command. IPMI raw command will use dbus-send command |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 5 | Resource ../lib/resource.txt |
George Keishing | 4d6c1da | 2016-07-15 05:51:22 -0500 | [diff] [blame] | 6 | Resource ../lib/connection_client.robot |
Prashanth Katti | ae7c228 | 2017-03-15 07:43:46 -0500 | [diff] [blame] | 7 | Resource ../lib/utils.robot |
| 8 | Resource ../lib/state_manager.robot |
| 9 | |
Sivas SRR | a2dab3c | 2016-07-25 05:08:18 -0500 | [diff] [blame] | 10 | Library String |
| 11 | |
| 12 | *** Variables *** |
George Keishing | d7f11f7 | 2017-01-04 10:58:19 -0600 | [diff] [blame] | 13 | ${dbusHostIpmicmd1}= dbus-send --system ${OPENBMC_BASE_URI}HostIpmi/1 |
| 14 | ${dbusHostIpmiCmdReceivedMsg}= ${OPENBMC_BASE_DBUS}.HostIpmi.ReceivedMessage |
Gunnar Mills | 59204d2 | 2016-12-06 11:05:19 -0600 | [diff] [blame] | 15 | ${netfnByte}= ${EMPTY} |
George Keishing | d7f11f7 | 2017-01-04 10:58:19 -0600 | [diff] [blame] | 16 | ${cmdByte}= ${EMPTY} |
Gunnar Mills | 59204d2 | 2016-12-06 11:05:19 -0600 | [diff] [blame] | 17 | ${arrayByte}= array:byte: |
George Keishing | 39967eb | 2018-04-30 11:36:23 -0500 | [diff] [blame] | 18 | ${IPMI_EXT_CMD}= ipmitool -I lanplus -C ${IPMI_CIPHER_LEVEL} |
Michael Walsh | a791389 | 2017-04-20 16:29:01 -0500 | [diff] [blame] | 19 | ${IPMI_USER_OPTIONS} ${EMPTY} |
George Keishing | 39967eb | 2018-04-30 11:36:23 -0500 | [diff] [blame] | 20 | ${IPMI_INBAND_CMD}= ipmitool -C ${IPMI_CIPHER_LEVEL} |
Gunnar Mills | 59204d2 | 2016-12-06 11:05:19 -0600 | [diff] [blame] | 21 | ${HOST}= -H |
| 22 | ${RAW}= raw |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 23 | |
| 24 | *** Keywords *** |
Rahul Maheshwari | 7a212a0 | 2016-09-05 21:17:30 -0500 | [diff] [blame] | 25 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 26 | Run IPMI Command |
Prashanth Katti | ae7c228 | 2017-03-15 07:43:46 -0500 | [diff] [blame] | 27 | [Arguments] ${args} |
| 28 | ${resp}= Run Keyword If '${IPMI_COMMAND}' == 'External' |
| 29 | ... Run External IPMI RAW Command ${args} |
| 30 | ... ELSE IF '${IPMI_COMMAND}' == 'Inband' |
| 31 | ... Run Inband IPMI RAW Command ${args} |
| 32 | ... ELSE IF '${IPMI_COMMAND}' == 'Dbus' |
| 33 | ... Run Dbus IPMI RAW Command ${args} |
| 34 | ... ELSE Fail msg=Invalid IPMI Command type provided : ${IPMI_COMMAND} |
| 35 | [Return] ${resp} |
Rahul Maheshwari | 7a212a0 | 2016-09-05 21:17:30 -0500 | [diff] [blame] | 36 | |
| 37 | Run IPMI Standard Command |
Prashanth Katti | ae7c228 | 2017-03-15 07:43:46 -0500 | [diff] [blame] | 38 | [Arguments] ${args} |
| 39 | ${resp}= Run Keyword If '${IPMI_COMMAND}' == 'External' |
| 40 | ... Run External IPMI Standard Command ${args} |
| 41 | ... ELSE IF '${IPMI_COMMAND}' == 'Inband' |
| 42 | ... Run Inband IPMI Standard Command ${args} |
| 43 | ... ELSE IF '${IPMI_COMMAND}' == 'Dbus' |
| 44 | ... Run Dbus IPMI Standard Command ${args} |
| 45 | ... ELSE Fail msg=Invalid IPMI Command type provided : ${IPMI_COMMAND} |
Rahul Maheshwari | 7a212a0 | 2016-09-05 21:17:30 -0500 | [diff] [blame] | 46 | |
Prashanth Katti | ae7c228 | 2017-03-15 07:43:46 -0500 | [diff] [blame] | 47 | [Return] ${resp} |
Rahul Maheshwari | 7a212a0 | 2016-09-05 21:17:30 -0500 | [diff] [blame] | 48 | |
| 49 | Run Dbus IPMI RAW Command |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 50 | [Arguments] ${args} |
Gunnar Mills | 59204d2 | 2016-12-06 11:05:19 -0600 | [diff] [blame] | 51 | ${valueinBytes}= Byte Conversion ${args} |
| 52 | ${cmd}= Catenate ${dbushostipmicmd1} ${dbusHostIpmiCmdReceivedMsg} |
| 53 | ${cmd}= Catenate ${cmd} ${valueinBytes} |
Sivas SRR | a2dab3c | 2016-07-25 05:08:18 -0500 | [diff] [blame] | 54 | ${output} ${stderr}= Execute Command ${cmd} return_stderr=True |
| 55 | Should Be Empty ${stderr} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 56 | set test variable ${OUTPUT} "${output}" |
| 57 | |
Rahul Maheshwari | 7a212a0 | 2016-09-05 21:17:30 -0500 | [diff] [blame] | 58 | Run Dbus IPMI Standard Command |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 59 | [Arguments] ${args} |
George Keishing | 4d6c1da | 2016-07-15 05:51:22 -0500 | [diff] [blame] | 60 | Copy ipmitool |
Rahul Maheshwari | 7a212a0 | 2016-09-05 21:17:30 -0500 | [diff] [blame] | 61 | ${stdout} ${stderr} ${output}= Execute Command |
| 62 | ... /tmp/ipmitool -I dbus ${args} return_stdout=True |
| 63 | ... return_stderr= True return_rc=True |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 64 | Should Be Equal ${output} ${0} msg=${stderr} |
Gunnar Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 65 | [Return] ${stdout} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 66 | |
Prashanth Katti | ae7c228 | 2017-03-15 07:43:46 -0500 | [diff] [blame] | 67 | Run Inband IPMI Raw Command |
| 68 | [Documentation] Run Inband IPMI raw command. |
| 69 | [Arguments] ${args} ${os_host}=${OS_HOST} ${os_username}=${OS_USERNAME} |
| 70 | ... ${os_password}=${OS_PASSWORD} |
| 71 | |
Gunnar Mills | 28e403b | 2017-10-25 16:16:38 -0500 | [diff] [blame] | 72 | # Description of arguments: |
Prashanth Katti | ae7c228 | 2017-03-15 07:43:46 -0500 | [diff] [blame] | 73 | # ${args} parameters to IPMI command. |
| 74 | # ${os_host} IP address of the OS Host. |
| 75 | # ${os_username} OS Host Login user name. |
| 76 | # ${os_password} OS Host Login passwrd. |
| 77 | |
| 78 | Login To OS Host ${os_host} ${os_username} ${os_password} |
| 79 | Check If IPMI Tool Exist |
| 80 | |
| 81 | ${inband_raw_cmd}= Catenate ${IPMI_INBAND_CMD} ${RAW} ${args} |
| 82 | ${stdout} ${stderr}= Execute Command ${inband_raw_cmd} return_stderr=True |
| 83 | Should Be Empty ${stderr} msg=${stdout} |
| 84 | [Return] ${stdout} |
| 85 | |
| 86 | Run Inband IPMI Standard Command |
| 87 | [Documentation] Run Inband IPMI standard command. |
| 88 | [Arguments] ${args} ${os_host}=${OS_HOST} ${os_username}=${OS_USERNAME} |
| 89 | ... ${os_password}=${OS_PASSWORD} |
| 90 | |
Gunnar Mills | 28e403b | 2017-10-25 16:16:38 -0500 | [diff] [blame] | 91 | # Description of arguments: |
Prashanth Katti | ae7c228 | 2017-03-15 07:43:46 -0500 | [diff] [blame] | 92 | # ${args} parameters to IPMI command. |
| 93 | # ${os_host} IP address of the OS Host. |
| 94 | # ${os_username} OS Host Login user name. |
| 95 | # ${os_password} OS Host Login passwrd. |
| 96 | |
| 97 | Login To OS Host ${os_host} ${os_username} ${os_password} |
| 98 | Check If IPMI Tool Exist |
| 99 | |
| 100 | ${inband_std_cmd}= Catenate ${IPMI_INBAND_CMD} ${args} |
| 101 | ${stdout} ${stderr}= Execute Command ${inband_std_cmd} return_stderr=True |
| 102 | Should Be Empty ${stderr} msg=${stdout} |
| 103 | [Return] ${stdout} |
| 104 | |
Rahul Maheshwari | 7a212a0 | 2016-09-05 21:17:30 -0500 | [diff] [blame] | 105 | Run External IPMI RAW Command |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 106 | [Arguments] ${args} |
Rahul Maheshwari | 7a212a0 | 2016-09-05 21:17:30 -0500 | [diff] [blame] | 107 | ${ipmi_raw_cmd}= Catenate SEPARATOR= |
Michael Walsh | a791389 | 2017-04-20 16:29:01 -0500 | [diff] [blame] | 108 | ... ${IPMI_EXT_CMD} -P${SPACE}${IPMI_PASSWORD}${SPACE} |
Rahul Maheshwari | 7a212a0 | 2016-09-05 21:17:30 -0500 | [diff] [blame] | 109 | ... ${HOST}${SPACE}${OPENBMC_HOST}${SPACE}${RAW}${SPACE}${args} |
| 110 | ${rc} ${output}= Run and Return RC and Output ${ipmi_raw_cmd} |
| 111 | Should Be Equal ${rc} ${0} msg=${output} |
Gunnar Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 112 | [Return] ${output} |
Rahul Maheshwari | 7a212a0 | 2016-09-05 21:17:30 -0500 | [diff] [blame] | 113 | |
| 114 | Run External IPMI Standard Command |
George Keishing | 02651f0 | 2018-04-11 02:07:16 -0500 | [diff] [blame] | 115 | [Arguments] ${args} ${fail_on_err}=${1} |
| 116 | |
| 117 | # Description of argument(s): |
| 118 | # args IPMI command to be executed. |
| 119 | # fail_on_err Fail if keyword the IPMI command fails |
Michael Walsh | a791389 | 2017-04-20 16:29:01 -0500 | [diff] [blame] | 120 | |
| 121 | ${ipmi_cmd}= Catenate SEPARATOR= |
| 122 | ... ${IPMI_EXT_CMD} ${IPMI_USER_OPTIONS} -P${SPACE}${IPMI_PASSWORD} |
| 123 | ... ${SPACE}${HOST}${SPACE}${OPENBMC_HOST}${SPACE}${args} |
Rahul Maheshwari | 04a2204 | 2017-05-02 01:54:31 -0500 | [diff] [blame] | 124 | ${rc} ${output}= Run And Return RC and Output ${ipmi_cmd} |
George Keishing | 02651f0 | 2018-04-11 02:07:16 -0500 | [diff] [blame] | 125 | Return From Keyword If ${fail_on_err} == ${0} ${output} |
Michael Walsh | a791389 | 2017-04-20 16:29:01 -0500 | [diff] [blame] | 126 | Should Be Equal ${rc} ${0} msg=${output} |
| 127 | [Return] ${output} |
Rahul Maheshwari | 7a212a0 | 2016-09-05 21:17:30 -0500 | [diff] [blame] | 128 | |
Prashanth Katti | ae7c228 | 2017-03-15 07:43:46 -0500 | [diff] [blame] | 129 | Check If IPMI Tool Exist |
| 130 | [Documentation] Check if IPMI Tool installed or not. |
| 131 | ${output}= Execute Command which ipmitool |
| 132 | Should Not Be Empty ${output} msg=ipmitool not installed. |
Rahul Maheshwari | 7a212a0 | 2016-09-05 21:17:30 -0500 | [diff] [blame] | 133 | |
Rahul Maheshwari | 04a2204 | 2017-05-02 01:54:31 -0500 | [diff] [blame] | 134 | |
| 135 | Activate SOL Via IPMI |
| 136 | [Documentation] Start SOL using IPMI and route output to a file. |
| 137 | [Arguments] ${file_path}=/tmp/sol_${OPENBMC_HOST} |
| 138 | # Description of argument(s): |
| 139 | # file_path The file path on the local machine (vs OBMC) to collect SOL |
| 140 | # output. By default SOL output is collected at |
| 141 | # /tmp/sol_<BMC_IP> else user input location. |
| 142 | |
| 143 | ${ipmi_cmd}= Catenate SEPARATOR= |
Rahul Maheshwari | c847088 | 2017-08-30 05:41:16 -0500 | [diff] [blame] | 144 | ... ${IPMI_EXT_CMD} -P${SPACE}${IPMI_PASSWORD}${SPACE}${HOST} |
| 145 | ... ${SPACE}${OPENBMC_HOST}${SPACE}sol activate usesolkeepalive |
Rahul Maheshwari | 04a2204 | 2017-05-02 01:54:31 -0500 | [diff] [blame] | 146 | |
George Keishing | 2102f6b | 2017-06-06 08:30:10 -0500 | [diff] [blame] | 147 | Start Process ${ipmi_cmd} shell=True stdout=${file_path} |
Rahul Maheshwari | 4f36084 | 2017-06-06 15:05:01 -0500 | [diff] [blame] | 148 | ... alias=sol_proc |
Rahul Maheshwari | 04a2204 | 2017-05-02 01:54:31 -0500 | [diff] [blame] | 149 | |
| 150 | |
| 151 | Deactivate SOL Via IPMI |
| 152 | [Documentation] Stop SOL using IPMI and return SOL output. |
| 153 | [Arguments] ${file_path}=/tmp/sol_${OPENBMC_HOST} |
| 154 | # Description of argument(s): |
| 155 | # file_path The file path on the local machine to copy SOL output |
| 156 | # collected by above "Activate SOL Via IPMI" keyword. |
| 157 | # By default it copies log from /tmp/sol_<BMC_IP>. |
| 158 | |
| 159 | ${ipmi_cmd}= Catenate SEPARATOR= |
| 160 | ... ${IPMI_EXT_CMD} -P${SPACE}${IPMI_PASSWORD}${SPACE} |
| 161 | ... ${HOST}${SPACE}${OPENBMC_HOST}${SPACE}sol deactivate |
| 162 | |
| 163 | ${rc} ${output}= Run and Return RC and Output ${ipmi_cmd} |
Rahul Maheshwari | 4f36084 | 2017-06-06 15:05:01 -0500 | [diff] [blame] | 164 | Run Keyword If ${rc} > 0 Run Keywords |
Rahul Maheshwari | 7f48a2c | 2017-06-16 04:00:26 -0500 | [diff] [blame] | 165 | ... Run Keyword And Ignore Error Terminate Process sol_proc |
| 166 | ... AND Return From Keyword ${output} |
Rahul Maheshwari | 04a2204 | 2017-05-02 01:54:31 -0500 | [diff] [blame] | 167 | |
| 168 | ${rc} ${output}= Run and Return RC and Output cat ${file_path} |
| 169 | Should Be Equal ${rc} ${0} msg=${output} |
| 170 | |
| 171 | # Logging SOL output for debug purpose. |
| 172 | Log ${output} |
| 173 | |
| 174 | [Return] ${output} |
| 175 | |
| 176 | |
Sivas SRR | a2dab3c | 2016-07-25 05:08:18 -0500 | [diff] [blame] | 177 | Byte Conversion |
| 178 | [Documentation] Byte Conversion method receives IPMI RAW commands as |
| 179 | ... argument in string format. |
| 180 | ... Sample argument is as follows |
| 181 | ... "0x04 0x30 9 0x01 0x00 0x35 0x00 0x00 0x00 0x00 0x00 |
| 182 | ... 0x00" |
| 183 | ... IPMI RAW command format is as follows |
| 184 | ... <netfn Byte> <cmd Byte> <Data Bytes..> |
| 185 | ... This method converts IPMI command format into |
| 186 | ... dbus command format as follows |
| 187 | ... <byte:seq-id> <byte:netfn> <byte:lun> <byte:cmd> |
| 188 | ... <array:byte:data> |
| 189 | ... Sample dbus Host IPMI Received Message argument |
| 190 | ... byte:0x00 byte:0x04 byte:0x00 byte:0x30 |
| 191 | ... array:byte:9,0x01,0x00,0x35,0x00,0x00,0x00,0x00,0x00,0x00 |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 192 | [Arguments] ${args} |
Gunnar Mills | 59204d2 | 2016-12-06 11:05:19 -0600 | [diff] [blame] | 193 | ${argLength}= Get Length ${args} |
Sivas SRR | a2dab3c | 2016-07-25 05:08:18 -0500 | [diff] [blame] | 194 | Set Global Variable ${arrayByte} array:byte: |
Gunnar Mills | 59204d2 | 2016-12-06 11:05:19 -0600 | [diff] [blame] | 195 | @{listargs}= Split String ${args} |
| 196 | ${index}= Set Variable ${0} |
Sivas SRR | a2dab3c | 2016-07-25 05:08:18 -0500 | [diff] [blame] | 197 | :FOR ${word} in @{listargs} |
| 198 | \ Run Keyword if ${index} == 0 Set NetFn Byte ${word} |
| 199 | \ Run Keyword if ${index} == 1 Set Cmd Byte ${word} |
| 200 | \ Run Keyword if ${index} > 1 Set Array Byte ${word} |
Gunnar Mills | 59204d2 | 2016-12-06 11:05:19 -0600 | [diff] [blame] | 201 | \ ${index}= Set Variable ${index + 1} |
| 202 | ${length}= Get Length ${arrayByte} |
| 203 | ${length}= Evaluate ${length} - 1 |
| 204 | ${arrayByteLocal}= Get Substring ${arrayByte} 0 ${length} |
Sivas SRR | a2dab3c | 2016-07-25 05:08:18 -0500 | [diff] [blame] | 205 | Set Global Variable ${arrayByte} ${arrayByteLocal} |
Gunnar Mills | 59204d2 | 2016-12-06 11:05:19 -0600 | [diff] [blame] | 206 | ${valueinBytesWithArray}= Catenate byte:0x00 ${netfnByte} byte:0x00 |
| 207 | ${valueinBytesWithArray}= Catenate ${valueinBytesWithArray} ${cmdByte} |
| 208 | ${valueinBytesWithArray}= Catenate ${valueinBytesWithArray} ${arrayByte} |
| 209 | ${valueinBytesWithoutArray}= Catenate byte:0x00 ${netfnByte} byte:0x00 |
| 210 | ${valueinBytesWithoutArray}= Catenate ${valueinBytesWithoutArray} ${cmdByte} |
Sivas SRR | a2dab3c | 2016-07-25 05:08:18 -0500 | [diff] [blame] | 211 | # To Check scenario for smaller IPMI raw commands with only 2 arguments |
| 212 | # instead of usual 12 arguments. |
| 213 | # Sample small IPMI raw command: Run IPMI command 0x06 0x36 |
| 214 | # If IPMI raw argument length is only 9 then return value in bytes without |
| 215 | # array population. |
| 216 | # Equivalent dbus-send argument for smaller IPMI raw command: |
| 217 | # byte:0x00 byte:0x06 byte:0x00 byte:0x36 |
| 218 | Run Keyword if ${argLength} == 9 Return from Keyword ${valueinBytesWithoutArray} |
Gunnar Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 219 | [Return] ${valueinBytesWithArray} |
Sivas SRR | a2dab3c | 2016-07-25 05:08:18 -0500 | [diff] [blame] | 220 | |
| 221 | |
| 222 | Set NetFn Byte |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 223 | [Arguments] ${word} |
Gunnar Mills | 59204d2 | 2016-12-06 11:05:19 -0600 | [diff] [blame] | 224 | ${netfnByteLocal}= Catenate byte:${word} |
Sivas SRR | a2dab3c | 2016-07-25 05:08:18 -0500 | [diff] [blame] | 225 | Set Global Variable ${netfnByte} ${netfnByteLocal} |
| 226 | |
| 227 | Set Cmd Byte |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 228 | [Arguments] ${word} |
Gunnar Mills | 59204d2 | 2016-12-06 11:05:19 -0600 | [diff] [blame] | 229 | ${cmdByteLocal}= Catenate byte:${word} |
Sivas SRR | a2dab3c | 2016-07-25 05:08:18 -0500 | [diff] [blame] | 230 | Set Global Variable ${cmdByte} ${cmdByteLocal} |
| 231 | |
| 232 | Set Array Byte |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 233 | [Arguments] ${word} |
Gunnar Mills | 59204d2 | 2016-12-06 11:05:19 -0600 | [diff] [blame] | 234 | ${arrayByteLocal}= Catenate SEPARATOR= ${arrayByte} ${word} |
| 235 | ${arrayByteLocal}= Catenate SEPARATOR= ${arrayByteLocal} , |
Sivas SRR | a2dab3c | 2016-07-25 05:08:18 -0500 | [diff] [blame] | 236 | Set Global Variable ${arrayByte} ${arrayByteLocal} |
| 237 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 238 | Copy ipmitool |
| 239 | OperatingSystem.File Should Exist tools/ipmitool msg=The ipmitool program could not be found in the tools directory. It is not part of the automation code by default. You must manually copy or link the correct openbmc version of the tool in to the tools directory in order to run this test suite. |
| 240 | |
| 241 | Import Library SCPLibrary WITH NAME scp |
| 242 | scp.Open connection ${OPENBMC_HOST} username=${OPENBMC_USERNAME} password=${OPENBMC_PASSWORD} |
| 243 | scp.Put File tools/ipmitool /tmp |
| 244 | SSHLibrary.Open Connection ${OPENBMC_HOST} |
| 245 | Login ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} |
| 246 | Execute Command chmod +x /tmp/ipmitool |
Sridevi Ramesh | 0c34f69 | 2017-04-25 02:40:32 -0500 | [diff] [blame] | 247 | |
| 248 | Initiate Host Boot Via External IPMI |
| 249 | [Documentation] Initiate host power on using external IPMI. |
Rahul Maheshwari | 982fee4 | 2017-05-03 00:33:15 -0500 | [diff] [blame] | 250 | [Arguments] ${wait}=${1} |
| 251 | # Description of argument(s): |
| 252 | # wait Indicates that this keyword should wait for host running state. |
| 253 | |
Sridevi Ramesh | 0c34f69 | 2017-04-25 02:40:32 -0500 | [diff] [blame] | 254 | ${output}= Run External IPMI Standard Command chassis power on |
| 255 | Should Not Contain ${output} Error |
Rahul Maheshwari | 982fee4 | 2017-05-03 00:33:15 -0500 | [diff] [blame] | 256 | |
| 257 | Run Keyword If '${wait}' == '${0}' Return From Keyword |
| 258 | Wait Until Keyword Succeeds 10 min 10 sec Is Host Running |
Sridevi Ramesh | 0c34f69 | 2017-04-25 02:40:32 -0500 | [diff] [blame] | 259 | |
| 260 | Initiate Host PowerOff Via External IPMI |
| 261 | [Documentation] Initiate host power off using external IPMI. |
Rahul Maheshwari | 982fee4 | 2017-05-03 00:33:15 -0500 | [diff] [blame] | 262 | [Arguments] ${wait}=${1} |
| 263 | # Description of argument(s): |
| 264 | # wait Indicates that this keyword should wait for host off state. |
| 265 | |
Sridevi Ramesh | 0c34f69 | 2017-04-25 02:40:32 -0500 | [diff] [blame] | 266 | ${output}= Run External IPMI Standard Command chassis power off |
| 267 | Should Not Contain ${output} Error |
Rahul Maheshwari | 982fee4 | 2017-05-03 00:33:15 -0500 | [diff] [blame] | 268 | |
| 269 | Run Keyword If '${wait}' == '${0}' Return From Keyword |
| 270 | Wait Until Keyword Succeeds 3 min 10 sec Is Host Off |
| 271 | |
| 272 | Get Host State Via External IPMI |
| 273 | [Documentation] Returns host state using external IPMI. |
| 274 | |
| 275 | ${output}= Run External IPMI Standard Command chassis power status |
| 276 | Should Not Contain ${output} Error |
| 277 | ${output}= Fetch From Right ${output} ${SPACE} |
| 278 | |
| 279 | [Return] ${output} |