Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Resource ../lib/resource.txt |
| 3 | Resource ../lib/rest_client.robot |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 4 | Resource ../lib/connection_client.robot |
George Keishing | 30c12ff | 2016-09-02 10:25:29 -0500 | [diff] [blame] | 5 | Library DateTime |
| 6 | Library Process |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 7 | Library OperatingSystem |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 8 | Library gen_print.py |
| 9 | Library gen_robot_print.py |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 10 | |
| 11 | *** Variables *** |
| 12 | ${SYSTEM_SHUTDOWN_TIME} ${5} |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 13 | ${dbuscmdBase} |
George Keishing | 85ca05e | 2016-11-30 09:47:18 -0600 | [diff] [blame] | 14 | ... dbus-send --system --print-reply --dest=${OPENBMC_BASE_DBUS}.settings.Host |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 15 | ${dbuscmdGet} |
George Keishing | 9485af9 | 2017-01-04 10:21:43 -0600 | [diff] [blame] | 16 | ... ${SETTINGS_URI}host0 org.freedesktop.DBus.Properties.Get |
George Keishing | 85ca05e | 2016-11-30 09:47:18 -0600 | [diff] [blame] | 17 | # Enable when ready with openbmc/openbmc-test-automation#203 |
| 18 | #${dbuscmdString}= string:"xyz.openbmc_project.settings.Host" string: |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 19 | ${dbuscmdString}= string:"org.openbmc.settings.Host" string: |
| 20 | |
| 21 | # Assign default value to QUIET for programs which may not define it. |
| 22 | ${QUIET} ${0} |
Sivas SRR | ea85d1f | 2016-11-13 22:44:28 -0600 | [diff] [blame] | 23 | ${bmc_mem_free_cmd}= free | tr -s ' ' | sed '/^Mem/!d' | cut -d" " -f4 |
| 24 | ${bmc_mem_total_cmd}= free | tr -s ' ' | sed '/^Mem/!d' | cut -d" " -f2 |
| 25 | ${bmc_cpu_usage_cmd}= top -n 1 | grep CPU: | cut -c 7-9 |
Sridevi Ramesh | 1699d37 | 2016-12-06 00:20:22 -0600 | [diff] [blame] | 26 | ${HOST_SETTING} ${SETTINGS_URI}host0 |
Sivas SRR | aca5571 | 2016-12-21 04:32:35 -0600 | [diff] [blame] | 27 | # /dev/mtdblock5 filesystem should be 100% full always |
| 28 | ${bmc_file_system_usage_cmd}= |
| 29 | ... df -h | grep -v /dev/mtdblock5 | cut -c 52-54 | grep 100 | wc -l |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 30 | |
George Keishing | cce9df2 | 2017-01-24 06:19:33 -0600 | [diff] [blame] | 31 | ${BOOT_TIME} ${0} |
| 32 | ${BOOT_COUNT} ${0} |
| 33 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 34 | *** Keywords *** |
Sridevi Ramesh | 1699d37 | 2016-12-06 00:20:22 -0600 | [diff] [blame] | 35 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 36 | Wait For Host To Ping |
root | 442f0ef | 2016-08-04 20:23:05 +0000 | [diff] [blame] | 37 | [Arguments] ${host} ${timeout}=${OPENBMC_REBOOT_TIMEOUT}min |
| 38 | ... ${interval}=5 sec |
| 39 | |
| 40 | # host The DNS name or IP of the host to ping. |
| 41 | # timeout The amount of time after which attempts to ping cease. |
| 42 | # interval The amount of time in between attempts to ping. |
| 43 | |
| 44 | Wait Until Keyword Succeeds ${timeout} ${interval} Ping Host ${host} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 45 | |
| 46 | Ping Host |
| 47 | [Arguments] ${host} |
George Keishing | 8a84f95 | 2016-08-25 04:54:53 -0500 | [diff] [blame] | 48 | Should Not Be Empty ${host} msg=No host provided |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 49 | ${RC} ${output}= Run and return RC and Output ping -c 4 ${host} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 50 | Log RC: ${RC}\nOutput:\n${output} |
| 51 | Should be equal ${RC} ${0} |
| 52 | |
| 53 | Get Boot Progress |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 54 | [Arguments] ${quiet}=${QUIET} |
| 55 | |
George Keishing | 85ca05e | 2016-11-30 09:47:18 -0600 | [diff] [blame] | 56 | ${state}= Read Attribute ${OPENBMC_BASE_URI}sensors/host/BootProgress |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 57 | ... value quiet=${quiet} |
Gunnar Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 58 | [Return] ${state} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 59 | |
| 60 | Is Power On |
root | 442f0ef | 2016-08-04 20:23:05 +0000 | [diff] [blame] | 61 | ${state}= Get Power State |
| 62 | Should be equal ${state} ${1} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 63 | |
| 64 | Is Power Off |
root | 442f0ef | 2016-08-04 20:23:05 +0000 | [diff] [blame] | 65 | ${state}= Get Power State |
| 66 | Should be equal ${state} ${0} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 67 | |
root | 442f0ef | 2016-08-04 20:23:05 +0000 | [diff] [blame] | 68 | Initiate Power On |
| 69 | [Documentation] Initiates the power on and waits until the Is Power On |
| 70 | ... keyword returns that the power state has switched to on. |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 71 | [Arguments] ${wait}=${1} |
| 72 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 73 | @{arglist}= Create List |
| 74 | ${args}= Create Dictionary data=@{arglist} |
George Keishing | 85ca05e | 2016-11-30 09:47:18 -0600 | [diff] [blame] | 75 | ${resp}= Call Method ${OPENBMC_BASE_URI}control/chassis0/ powerOn |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 76 | ... data=${args} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 77 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 78 | |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 79 | # Does caller want to wait for power on status? |
| 80 | Run Keyword If '${wait}' == '${0}' Return From Keyword |
| 81 | Wait Until Keyword Succeeds 3 min 10 sec Is Power On |
Rahul Maheshwari | f684ba7 | 2016-10-25 07:24:41 -0500 | [diff] [blame] | 82 | |
root | 442f0ef | 2016-08-04 20:23:05 +0000 | [diff] [blame] | 83 | Initiate Power Off |
| 84 | [Documentation] Initiates the power off and waits until the Is Power Off |
| 85 | ... keyword returns that the power state has switched to off. |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 86 | @{arglist}= Create List |
| 87 | ${args}= Create Dictionary data=@{arglist} |
George Keishing | 85ca05e | 2016-11-30 09:47:18 -0600 | [diff] [blame] | 88 | ${resp}= Call Method ${OPENBMC_BASE_URI}control/chassis0/ powerOff |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 89 | ... data=${args} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 90 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 91 | Wait Until Keyword Succeeds 1 min 10 sec Is Power Off |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 92 | |
| 93 | Trigger Warm Reset |
| 94 | log to console "Triggering warm reset" |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 95 | ${data}= create dictionary data=@{EMPTY} |
George Keishing | 85ca05e | 2016-11-30 09:47:18 -0600 | [diff] [blame] | 96 | ${resp}= openbmc post request |
| 97 | ... ${OPENBMC_BASE_URI}control/bmc0/action/warmReset data=${data} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 98 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
George Keishing | b370081 | 2016-08-31 03:03:30 -0500 | [diff] [blame] | 99 | ${session_active}= Check If warmReset is Initiated |
| 100 | Run Keyword If '${session_active}' == '${True}' |
| 101 | ... Fail msg=warm reset didn't occur |
| 102 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 103 | Sleep ${SYSTEM_SHUTDOWN_TIME}min |
Rahul Maheshwari | 5f253c4 | 2017-01-30 05:19:51 -0600 | [diff] [blame] | 104 | Check If BMC Is Up |
Michael Walsh | 49ab0f4 | 2016-07-20 11:44:33 -0500 | [diff] [blame] | 105 | |
| 106 | Check OS |
root | 442f0ef | 2016-08-04 20:23:05 +0000 | [diff] [blame] | 107 | [Documentation] Attempts to ping the host OS and then checks that the host |
| 108 | ... OS is up by running an SSH command. |
Michael Walsh | 49ab0f4 | 2016-07-20 11:44:33 -0500 | [diff] [blame] | 109 | |
| 110 | [Arguments] ${os_host}=${OS_HOST} ${os_username}=${OS_USERNAME} |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 111 | ... ${os_password}=${OS_PASSWORD} ${quiet}=${QUIET} |
| 112 | ... ${print_string}=${EMPTY} |
Michael Walsh | 49ab0f4 | 2016-07-20 11:44:33 -0500 | [diff] [blame] | 113 | [Teardown] Close Connection |
| 114 | |
| 115 | # os_host The DNS name/IP of the OS host associated with our BMC. |
| 116 | # os_username The username to be used to sign on to the OS host. |
| 117 | # os_password The password to be used to sign on to the OS host. |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 118 | # quiet Indicates whether this keyword should write to console. |
| 119 | # print_string A string to be printed before checking the OS. |
| 120 | |
| 121 | rprint ${print_string} |
Michael Walsh | 49ab0f4 | 2016-07-20 11:44:33 -0500 | [diff] [blame] | 122 | |
root | 442f0ef | 2016-08-04 20:23:05 +0000 | [diff] [blame] | 123 | # Attempt to ping the OS. Store the return code to check later. |
| 124 | ${ping_rc}= Run Keyword and Return Status Ping Host ${os_host} |
| 125 | |
Michael Walsh | 49ab0f4 | 2016-07-20 11:44:33 -0500 | [diff] [blame] | 126 | Open connection ${os_host} |
Michael Walsh | 49ab0f4 | 2016-07-20 11:44:33 -0500 | [diff] [blame] | 127 | |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 128 | ${status} ${msg}= Run Keyword And Ignore Error Login ${os_username} |
| 129 | ... ${os_password} |
| 130 | ${err_msg1}= Sprint Error ${msg} |
| 131 | ${err_msg}= Catenate SEPARATOR= \n ${err_msg1} |
| 132 | Run Keyword If '${status}' == 'FAIL' Fail msg=${err_msg} |
Michael Walsh | 49ab0f4 | 2016-07-20 11:44:33 -0500 | [diff] [blame] | 133 | ${output} ${stderr} ${rc}= Execute Command uptime return_stderr=True |
| 134 | ... return_rc=True |
| 135 | |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 136 | ${temp_msg}= Catenate Could not execute a command on the operating |
| 137 | ... system.\n |
| 138 | ${err_msg1}= Sprint Error ${temp_msg} |
| 139 | ${err_msg}= Catenate SEPARATOR= \n ${err_msg1} |
| 140 | |
| 141 | # If the return code returned by "Execute Command" is non-zero, this |
| 142 | # keyword will fail. |
| 143 | Should Be Equal ${rc} ${0} msg=${err_msg} |
Michael Walsh | 49ab0f4 | 2016-07-20 11:44:33 -0500 | [diff] [blame] | 144 | # We will likewise fail if there is any stderr data. |
| 145 | Should Be Empty ${stderr} |
| 146 | |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 147 | ${temp_msg}= Set Variable Could not ping the operating system.\n |
| 148 | ${err_msg1}= Sprint Error ${temp_msg} |
| 149 | ${err_msg}= Catenate SEPARATOR= \n ${err_msg1} |
| 150 | # We will likewise fail if the OS did not ping, as we could SSH but not |
| 151 | # ping |
| 152 | Should Be Equal As Strings ${ping_rc} ${TRUE} msg=${err_msg} |
root | 442f0ef | 2016-08-04 20:23:05 +0000 | [diff] [blame] | 153 | |
Michael Walsh | 49ab0f4 | 2016-07-20 11:44:33 -0500 | [diff] [blame] | 154 | Wait for OS |
| 155 | [Documentation] Waits for the host OS to come up via calls to "Check OS". |
| 156 | [Arguments] ${os_host}=${OS_HOST} ${os_username}=${OS_USERNAME} |
| 157 | ... ${os_password}=${OS_PASSWORD} ${timeout}=${OS_WAIT_TIMEOUT} |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 158 | ... ${quiet}=${0} |
| 159 | [Teardown] rprintn |
Michael Walsh | 49ab0f4 | 2016-07-20 11:44:33 -0500 | [diff] [blame] | 160 | |
| 161 | # os_host The DNS name or IP of the OS host associated with our |
| 162 | # BMC. |
| 163 | # os_username The username to be used to sign on to the OS host. |
| 164 | # os_password The password to be used to sign on to the OS host. |
| 165 | # timeout The timeout in seconds indicating how long you're |
| 166 | # willing to wait for the OS to respond. |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 167 | # quiet Indicates whether this keyword should write to console. |
Michael Walsh | 49ab0f4 | 2016-07-20 11:44:33 -0500 | [diff] [blame] | 168 | |
| 169 | # The interval to be used between calls to "Check OS". |
| 170 | ${interval}= Set Variable 5 |
| 171 | |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 172 | ${message}= Catenate Checking every ${interval} seconds for up to |
| 173 | ... ${timeout} seconds for the operating system to communicate. |
| 174 | rqprint_timen ${message} |
| 175 | |
Michael Walsh | 49ab0f4 | 2016-07-20 11:44:33 -0500 | [diff] [blame] | 176 | Wait Until Keyword Succeeds ${timeout} sec ${interval} Check OS |
| 177 | ... ${os_host} ${os_username} ${os_password} |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 178 | ... print_string=\# |
| 179 | |
| 180 | rqprintn |
| 181 | |
| 182 | rqprint_timen The operating system is now communicating. |
root | 442f0ef | 2016-08-04 20:23:05 +0000 | [diff] [blame] | 183 | |
Rahul Maheshwari | 2c72504 | 2017-01-29 22:55:28 -0600 | [diff] [blame] | 184 | Get BMC State Deprecated |
root | 442f0ef | 2016-08-04 20:23:05 +0000 | [diff] [blame] | 185 | [Documentation] Returns the state of the BMC as a string. (i.e: BMC_READY) |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 186 | [Arguments] ${quiet}=${QUIET} |
| 187 | |
root | 442f0ef | 2016-08-04 20:23:05 +0000 | [diff] [blame] | 188 | @{arglist}= Create List |
| 189 | ${args}= Create Dictionary data=@{arglist} |
George Keishing | 85ca05e | 2016-11-30 09:47:18 -0600 | [diff] [blame] | 190 | ${resp}= Call Method ${OPENBMC_BASE_URI}managers/System/ getSystemState |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 191 | ... data=${args} quiet=${quiet} |
root | 442f0ef | 2016-08-04 20:23:05 +0000 | [diff] [blame] | 192 | Should be equal as strings ${resp.status_code} ${HTTP_OK} |
| 193 | ${content}= to json ${resp.content} |
Gunnar Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 194 | [Return] ${content["data"]} |
root | 442f0ef | 2016-08-04 20:23:05 +0000 | [diff] [blame] | 195 | |
| 196 | Get Power State |
| 197 | [Documentation] Returns the power state as an integer. Either 0 or 1. |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 198 | [Arguments] ${quiet}=${QUIET} |
| 199 | |
root | 442f0ef | 2016-08-04 20:23:05 +0000 | [diff] [blame] | 200 | @{arglist}= Create List |
| 201 | ${args}= Create Dictionary data=@{arglist} |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 202 | |
George Keishing | 85ca05e | 2016-11-30 09:47:18 -0600 | [diff] [blame] | 203 | ${resp}= Call Method ${OPENBMC_BASE_URI}control/chassis0/ getPowerState |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 204 | ... data=${args} quiet=${quiet} |
root | 442f0ef | 2016-08-04 20:23:05 +0000 | [diff] [blame] | 205 | Should be equal as strings ${resp.status_code} ${HTTP_OK} |
| 206 | ${content}= to json ${resp.content} |
Gunnar Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 207 | [Return] ${content["data"]} |
Jay Azurin | e4c52eb | 2016-08-16 20:51:10 -0500 | [diff] [blame] | 208 | |
| 209 | Clear BMC Record Log |
| 210 | [Documentation] Clears all the event logs on the BMC. This would be |
| 211 | ... equivalent to ipmitool sel clear. |
| 212 | @{arglist}= Create List |
| 213 | ${args}= Create Dictionary data=@{arglist} |
George Keishing | 85ca05e | 2016-11-30 09:47:18 -0600 | [diff] [blame] | 214 | ${resp}= Call Method |
| 215 | ... ${OPENBMC_BASE_URI}records/events/ clear data=${args} |
Jay Azurin | e4c52eb | 2016-08-16 20:51:10 -0500 | [diff] [blame] | 216 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
| 217 | |
| 218 | Copy PNOR to BMC |
| 219 | Import Library SCPLibrary WITH NAME scp |
| 220 | Open Connection for SCP |
| 221 | Log Copying ${PNOR_IMAGE_PATH} to /tmp |
| 222 | scp.Put File ${PNOR_IMAGE_PATH} /tmp |
| 223 | |
| 224 | Flash PNOR |
| 225 | [Documentation] Calls flash bios update method to flash PNOR image |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 226 | [Arguments] ${pnor_image} |
Jay Azurin | e4c52eb | 2016-08-16 20:51:10 -0500 | [diff] [blame] | 227 | @{arglist}= Create List ${pnor_image} |
| 228 | ${args}= Create Dictionary data=@{arglist} |
George Keishing | 85ca05e | 2016-11-30 09:47:18 -0600 | [diff] [blame] | 229 | ${resp}= Call Method ${OPENBMC_BASE_URI}control/flash/bios/ update |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 230 | ... data=${args} |
Jay Azurin | e4c52eb | 2016-08-16 20:51:10 -0500 | [diff] [blame] | 231 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
| 232 | Wait Until Keyword Succeeds 2 min 10 sec Is PNOR Flashing |
| 233 | |
| 234 | Get Flash BIOS Status |
| 235 | [Documentation] Returns the status of the flash BIOS API as a string. For |
| 236 | ... example 'Flashing', 'Flash Done', etc |
George Keishing | 85ca05e | 2016-11-30 09:47:18 -0600 | [diff] [blame] | 237 | ${data}= Read Properties ${OPENBMC_BASE_URI}control/flash/bios |
Gunnar Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 238 | [Return] ${data['status']} |
Jay Azurin | e4c52eb | 2016-08-16 20:51:10 -0500 | [diff] [blame] | 239 | |
| 240 | Is PNOR Flashing |
| 241 | [Documentation] Get BIOS 'Flashing' status. This indicates that PNOR |
| 242 | ... flashing has started. |
| 243 | ${status}= Get Flash BIOS Status |
| 244 | should be equal as strings ${status} Flashing |
| 245 | |
| 246 | Is PNOR Flash Done |
| 247 | [Documentation] Get BIOS 'Flash Done' status. This indicates that the |
| 248 | ... PNOR flashing has completed. |
Leah McNutt | 9ba3227 | 2016-11-17 15:48:39 +0000 | [diff] [blame] | 249 | ${status}= Get Flash BIOS Status |
Jay Azurin | e4c52eb | 2016-08-16 20:51:10 -0500 | [diff] [blame] | 250 | should be equal as strings ${status} Flash Done |
| 251 | |
| 252 | Is System State Host Booted |
| 253 | [Documentation] Checks whether system state is HOST_BOOTED. |
Rahul Maheshwari | 2c72504 | 2017-01-29 22:55:28 -0600 | [diff] [blame] | 254 | ${state}= Get BMC State Deprecated |
Jay Azurin | e4c52eb | 2016-08-16 20:51:10 -0500 | [diff] [blame] | 255 | should be equal as strings ${state} HOST_BOOTED |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 256 | |
Rahul Maheshwari | 2c72504 | 2017-01-29 22:55:28 -0600 | [diff] [blame] | 257 | Is OS Starting |
| 258 | [Documentation] Check if boot progress is OS starting. |
| 259 | ${boot_progress}= Get Boot Progress |
| 260 | Should Be Equal ${boot_progress} FW Progress, Starting OS |
| 261 | |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 262 | Verify Ping and REST Authentication |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 263 | ${l_ping}= Run Keyword And Return Status |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 264 | ... Ping Host ${OPENBMC_HOST} |
George Keishing | c4d3dc0 | 2016-09-19 03:45:55 -0500 | [diff] [blame] | 265 | Run Keyword If '${l_ping}' == '${False}' |
| 266 | ... Fail msg=Ping Failed |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 267 | |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 268 | ${l_rest}= Run Keyword And Return Status |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 269 | ... Initialize OpenBMC |
George Keishing | c4d3dc0 | 2016-09-19 03:45:55 -0500 | [diff] [blame] | 270 | Run Keyword If '${l_rest}' == '${False}' |
| 271 | ... Fail msg=REST Authentication Failed |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 272 | |
| 273 | # Just to make sure the SSH is working for SCP |
| 274 | Open Connection And Log In |
| 275 | ${system} ${stderr}= Execute Command hostname return_stderr=True |
| 276 | Should Be Empty ${stderr} |
| 277 | |
George Keishing | c4d3dc0 | 2016-09-19 03:45:55 -0500 | [diff] [blame] | 278 | Check If BMC is Up |
| 279 | [Documentation] Wait for Host to be online. Checks every X seconds |
| 280 | ... interval for Y minutes and fails if timed out. |
| 281 | ... Default MAX timedout is 10 min, interval 10 seconds. |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 282 | [Arguments] ${max_timeout}=${OPENBMC_REBOOT_TIMEOUT} min |
George Keishing | c4d3dc0 | 2016-09-19 03:45:55 -0500 | [diff] [blame] | 283 | ... ${interval}=10 sec |
| 284 | |
| 285 | Wait Until Keyword Succeeds |
| 286 | ... ${max_timeout} ${interval} Verify Ping and REST Authentication |
| 287 | |
George Keishing | b370081 | 2016-08-31 03:03:30 -0500 | [diff] [blame] | 288 | |
| 289 | Check If warmReset is Initiated |
| 290 | [Documentation] Ping would be still alive, so try SSH to connect |
| 291 | ... if fails the ports are down indicating reboot |
| 292 | ... is in progress |
George Keishing | 3c05d35 | 2016-12-13 06:54:50 -0600 | [diff] [blame] | 293 | |
| 294 | # Warm reset adds 3 seconds delay before forcing reboot |
| 295 | # To minimize race conditions, we wait for 7 seconds |
| 296 | Sleep 7s |
George Keishing | b370081 | 2016-08-31 03:03:30 -0500 | [diff] [blame] | 297 | ${alive}= Run Keyword and Return Status |
| 298 | ... Open Connection And Log In |
| 299 | Return From Keyword If '${alive}' == '${False}' ${False} |
Gunnar Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 300 | [Return] ${True} |
George Keishing | b370081 | 2016-08-31 03:03:30 -0500 | [diff] [blame] | 301 | |
George Keishing | 06ae4aa | 2016-08-30 01:41:28 -0500 | [diff] [blame] | 302 | Flush REST Sessions |
| 303 | [Documentation] Removes all the active session objects |
| 304 | Delete All Sessions |
George Keishing | b370081 | 2016-08-31 03:03:30 -0500 | [diff] [blame] | 305 | |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 306 | Initialize DBUS cmd |
| 307 | [Documentation] Initialize dbus string with property string to extract |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 308 | [Arguments] ${boot_property} |
Michael Walsh | a6723f2 | 2016-11-22 11:12:01 -0600 | [diff] [blame] | 309 | ${cmd}= Catenate ${dbuscmdBase} ${dbuscmdGet} ${dbuscmdString} |
| 310 | ${cmd}= Catenate ${cmd}${boot_property} |
Sivas SRR | e1143ae | 2016-08-26 22:31:02 -0500 | [diff] [blame] | 311 | Set Global Variable ${dbuscmd} ${cmd} |
| 312 | |
George Keishing | 30c12ff | 2016-09-02 10:25:29 -0500 | [diff] [blame] | 313 | |
Gunnar Mills | 9c76034 | 2016-12-08 10:12:06 -0600 | [diff] [blame] | 314 | Stop OBMC Console Client |
| 315 | [Documentation] Stop any running obmc_console_client |
| 316 | ... writing to file_path. |
| 317 | [Arguments] ${file_path}=/tmp/obmc-console.log |
| 318 | |
Michael Walsh | 01bd368 | 2017-01-10 11:21:05 -0600 | [diff] [blame] | 319 | ${cmd_buf}= Catenate SEPARATOR=${SPACE} |
| 320 | ... ps ax | grep obmc-console-client | grep ${file_path} | grep -v grep |
| 321 | ... | awk '{print $1}' |
| 322 | |
Gunnar Mills | 9c76034 | 2016-12-08 10:12:06 -0600 | [diff] [blame] | 323 | ${pid}= |
Michael Walsh | 01bd368 | 2017-01-10 11:21:05 -0600 | [diff] [blame] | 324 | ... Execute Command ${cmd_buf} |
Gunnar Mills | 9c76034 | 2016-12-08 10:12:06 -0600 | [diff] [blame] | 325 | |
| 326 | Run Keyword If '${pid}' != '${EMPTY}' |
| 327 | ... Execute Command kill -s KILL ${pid} |
| 328 | ... ELSE Log "No obmc-console-client process running" |
| 329 | |
| 330 | |
George Keishing | 30c12ff | 2016-09-02 10:25:29 -0500 | [diff] [blame] | 331 | Start SOL Console Logging |
Gunnar Mills | 9c76034 | 2016-12-08 10:12:06 -0600 | [diff] [blame] | 332 | [Documentation] Start a new obmc_console_client process and direct |
| 333 | ... output to a file. |
| 334 | [Arguments] ${file_path}=/tmp/obmc-console.log |
George Keishing | 30c12ff | 2016-09-02 10:25:29 -0500 | [diff] [blame] | 335 | |
| 336 | Open Connection And Log In |
| 337 | |
Gunnar Mills | 9c76034 | 2016-12-08 10:12:06 -0600 | [diff] [blame] | 338 | Stop OBMC Console Client ${file_path} |
| 339 | |
George Keishing | 30c12ff | 2016-09-02 10:25:29 -0500 | [diff] [blame] | 340 | Start Command |
Gunnar Mills | 9c76034 | 2016-12-08 10:12:06 -0600 | [diff] [blame] | 341 | ... obmc-console-client > ${file_path} |
George Keishing | 30c12ff | 2016-09-02 10:25:29 -0500 | [diff] [blame] | 342 | |
| 343 | |
| 344 | Stop SOL Console Logging |
Michael Walsh | 01bd368 | 2017-01-10 11:21:05 -0600 | [diff] [blame] | 345 | [Documentation] Stop obmc_console_client process, if any, and |
| 346 | ... return the console output as a string. |
| 347 | [Arguments] ${file_path}=/tmp/obmc-console.log ${targ_file_path}=${EMPTY} |
| 348 | |
| 349 | # Description of arguments: |
| 350 | # file_path The path on the obmc system where SOL output may be |
| 351 | # found. |
| 352 | # targ_file_path If specified, the file path to which SOL data should be |
| 353 | # written. |
George Keishing | 30c12ff | 2016-09-02 10:25:29 -0500 | [diff] [blame] | 354 | |
| 355 | Open Connection And Log In |
| 356 | |
Gunnar Mills | 9c76034 | 2016-12-08 10:12:06 -0600 | [diff] [blame] | 357 | Stop OBMC Console Client ${file_path} |
George Keishing | 30c12ff | 2016-09-02 10:25:29 -0500 | [diff] [blame] | 358 | |
Michael Walsh | 01bd368 | 2017-01-10 11:21:05 -0600 | [diff] [blame] | 359 | ${cmd_buf}= Set Variable cat ${file_path} |
| 360 | |
George Keishing | 30c12ff | 2016-09-02 10:25:29 -0500 | [diff] [blame] | 361 | ${console} ${stderr}= |
| 362 | ... Execute Command |
Michael Walsh | 01bd368 | 2017-01-10 11:21:05 -0600 | [diff] [blame] | 363 | ... if [ -f ${file_path} ] ; then cat ${file_path} ; fi |
George Keishing | 30c12ff | 2016-09-02 10:25:29 -0500 | [diff] [blame] | 364 | ... return_stderr=True |
Gunnar Mills | 9c76034 | 2016-12-08 10:12:06 -0600 | [diff] [blame] | 365 | Should Be Empty ${stderr} |
George Keishing | 30c12ff | 2016-09-02 10:25:29 -0500 | [diff] [blame] | 366 | |
Michael Walsh | 01bd368 | 2017-01-10 11:21:05 -0600 | [diff] [blame] | 367 | Run Keyword If '${targ_file_path}' != '${EMPTY}' |
| 368 | ... Append To File ${targ_file_path} ${console} |
George Keishing | 30c12ff | 2016-09-02 10:25:29 -0500 | [diff] [blame] | 369 | |
Michael Walsh | 01bd368 | 2017-01-10 11:21:05 -0600 | [diff] [blame] | 370 | [Return] ${console} |
George Keishing | 30c12ff | 2016-09-02 10:25:29 -0500 | [diff] [blame] | 371 | |
| 372 | Get Time Stamp |
| 373 | [Documentation] Get the current time stamp data |
| 374 | ${cur_time}= Get Current Date result_format=%Y%m%d%H%M%S%f |
Sridevi Ramesh | b96a0c3 | 2016-10-19 05:09:52 -0500 | [diff] [blame] | 375 | [Return] ${cur_time} |
George Keishing | 30c12ff | 2016-09-02 10:25:29 -0500 | [diff] [blame] | 376 | |
George Keishing | 1b15020 | 2016-09-29 08:51:58 -0500 | [diff] [blame] | 377 | |
| 378 | Verify BMC State |
| 379 | [Documentation] Get the BMC state and verify if the current |
| 380 | ... BMC state is as expected. |
| 381 | [Arguments] ${expected} |
| 382 | |
Rahul Maheshwari | 2c72504 | 2017-01-29 22:55:28 -0600 | [diff] [blame] | 383 | ${current}= Get BMC State Deprecated |
George Keishing | 8db0e1b | 2016-10-20 13:46:54 -0500 | [diff] [blame] | 384 | Should Contain ${expected} ${current} |
George Keishing | 1b15020 | 2016-09-29 08:51:58 -0500 | [diff] [blame] | 385 | |
Rahul Maheshwari | f684ba7 | 2016-10-25 07:24:41 -0500 | [diff] [blame] | 386 | Start Journal Log |
| 387 | [Documentation] Start capturing journal log to a file in /tmp using |
| 388 | ... journalctl command. By default journal log is collected |
| 389 | ... at /tmp/journal_log else user input location. |
| 390 | ... The File is appended with datetime. |
| 391 | [Arguments] ${file_path}=/tmp/journal_log |
| 392 | |
| 393 | Open Connection And Log In |
| 394 | |
| 395 | ${cur_time}= Get Time Stamp |
| 396 | Set Global Variable ${LOG_TIME} ${cur_time} |
| 397 | Start Command |
| 398 | ... journalctl -f > ${file_path}-${LOG_TIME} |
| 399 | Log Journal Log Started: ${file_path}-${LOG_TIME} |
| 400 | |
| 401 | Stop Journal Log |
| 402 | [Documentation] Stop journalctl process if its running. |
| 403 | ... By default return log from /tmp/journal_log else |
| 404 | ... user input location. |
| 405 | [Arguments] ${file_path}=/tmp/journal_log |
| 406 | |
| 407 | Open Connection And Log In |
| 408 | |
| 409 | ${rc}= |
| 410 | ... Execute Command |
| 411 | ... ps ax | grep journalctl | grep -v grep |
| 412 | ... return_stdout=False return_rc=True |
| 413 | |
| 414 | Return From Keyword If '${rc}' == '${1}' |
| 415 | ... No journal log process running |
| 416 | |
| 417 | ${output} ${stderr}= |
| 418 | ... Execute Command killall journalctl |
| 419 | ... return_stderr=True |
| 420 | Should Be Empty ${stderr} |
| 421 | |
| 422 | ${journal_log} ${stderr}= |
| 423 | ... Execute Command |
| 424 | ... cat ${file_path}-${LOG_TIME} |
| 425 | ... return_stderr=True |
| 426 | Should Be Empty ${stderr} |
| 427 | |
| 428 | Log ${journal_log} |
| 429 | |
| 430 | Execute Command rm ${file_path}-${LOG_TIME} |
| 431 | |
| 432 | [Return] ${journal_log} |
Rahul Maheshwari | 757d80c | 2016-10-17 01:09:55 -0500 | [diff] [blame] | 433 | |
| 434 | Mac Address To Hex String |
| 435 | [Documentation] Converts MAC address into hex format. |
| 436 | ... Example |
| 437 | ... Given the following MAC: 00:01:6C:80:02:78 |
| 438 | ... This keyword will return: 0x00 0x01 0x6C 0x80 0x02 0x78 |
| 439 | ... Description of arguments: |
Michael Walsh | 01bd368 | 2017-01-10 11:21:05 -0600 | [diff] [blame] | 440 | ... i_macaddress MAC address in the following format |
| 441 | ... 00:01:6C:80:02:78 |
Rahul Maheshwari | 757d80c | 2016-10-17 01:09:55 -0500 | [diff] [blame] | 442 | [Arguments] ${i_macaddress} |
| 443 | |
| 444 | ${mac_hex}= Catenate 0x${i_macaddress.replace(':', ' 0x')} |
Gunnar Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 445 | [Return] ${mac_hex} |
Rahul Maheshwari | 757d80c | 2016-10-17 01:09:55 -0500 | [diff] [blame] | 446 | |
| 447 | IP Address To Hex String |
| 448 | [Documentation] Converts IP address into hex format. |
| 449 | ... Example: |
| 450 | ... Given the following IP: 10.3.164.100 |
| 451 | ... This keyword will return: 0xa 0x3 0xa4 0xa0 |
| 452 | ... Description of arguments: |
Michael Walsh | 01bd368 | 2017-01-10 11:21:05 -0600 | [diff] [blame] | 453 | ... i_ipaddress IP address in the following format |
| 454 | ... 10.10.10.10 |
Rahul Maheshwari | 757d80c | 2016-10-17 01:09:55 -0500 | [diff] [blame] | 455 | [Arguments] ${i_ipaddress} |
| 456 | |
| 457 | @{ip}= Split String ${i_ipaddress} . |
| 458 | ${index}= Set Variable ${0} |
| 459 | |
| 460 | :FOR ${item} IN @{ip} |
| 461 | \ ${hex}= Convert To Hex ${item} prefix=0x lowercase=yes |
| 462 | \ Set List Value ${ip} ${index} ${hex} |
| 463 | \ ${index}= Set Variable ${index + 1} |
| 464 | ${ip_hex}= Catenate @{ip} |
Gunnar Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 465 | [Return] ${ip_hex} |
Sivas SRR | ea85d1f | 2016-11-13 22:44:28 -0600 | [diff] [blame] | 466 | |
| 467 | BMC CPU Performance Check |
| 468 | [Documentation] Minimal 10% of proc should be free in this instance |
| 469 | |
| 470 | ${bmc_cpu_usage_output} ${stderr}= Execute Command ${bmc_cpu_usage_cmd} |
| 471 | ... return_stderr=True |
| 472 | Should be empty ${stderr} |
| 473 | ${bmc_cpu_percentage}= Fetch From Left ${bmc_cpu_usage_output} % |
| 474 | Should be true ${bmc_cpu_percentage} < 90 |
| 475 | |
| 476 | BMC Mem Performance Check |
| 477 | [Documentation] Minimal 10% of memory should be free in this instance |
| 478 | |
| 479 | ${bmc_mem_free_output} ${stderr}= Execute Command ${bmc_mem_free_cmd} |
| 480 | ... return_stderr=True |
| 481 | Should be empty ${stderr} |
| 482 | |
| 483 | ${bmc_mem_total_output} ${stderr}= Execute Command ${bmc_mem_total_cmd} |
| 484 | ... return_stderr=True |
| 485 | Should be empty ${stderr} |
| 486 | |
| 487 | ${bmc_mem_percentage}= Evaluate ${bmc_mem_free_output}*100 |
| 488 | ${bmc_mem_percentage}= Evaluate |
| 489 | ... ${bmc_mem_percentage}/${bmc_mem_total_output} |
| 490 | Should be true ${bmc_mem_percentage} > 10 |
| 491 | |
Sivas SRR | aca5571 | 2016-12-21 04:32:35 -0600 | [diff] [blame] | 492 | BMC File System Usage Check |
| 493 | [Documentation] Check the file system space. None should be 100% full |
| 494 | ... except /dev/mtdblock5 |
| 495 | ${bmc_fs_usage_output} ${stderr}= Execute Command |
| 496 | ... ${bmc_file_system_usage_cmd} return_stderr=True |
| 497 | Should Be Empty ${stderr} |
| 498 | Should Be True ${bmc_fs_usage_output}==0 |
| 499 | |
Sivas SRR | ea85d1f | 2016-11-13 22:44:28 -0600 | [diff] [blame] | 500 | Check BMC CPU Performance |
| 501 | [Documentation] Minimal 10% of proc should be free in 3 sample |
| 502 | :FOR ${var} IN Range 1 4 |
| 503 | \ BMC CPU Performance check |
| 504 | |
| 505 | Check BMC Mem Performance |
| 506 | [Documentation] Minimal 10% of memory should be free |
| 507 | |
| 508 | :FOR ${var} IN Range 1 4 |
| 509 | \ BMC Mem Performance check |
| 510 | |
Sivas SRR | aca5571 | 2016-12-21 04:32:35 -0600 | [diff] [blame] | 511 | Check BMC File System Performance |
| 512 | [Documentation] Check for file system usage for 4 times |
| 513 | |
| 514 | :FOR ${var} IN Range 1 4 |
| 515 | \ BMC File System Usage check |
| 516 | |
Rahul Maheshwari | 9a8d3b1 | 2016-12-05 04:06:16 -0600 | [diff] [blame] | 517 | Get Endpoint Paths |
| 518 | [Documentation] Returns all url paths ending with given endpoint |
| 519 | ... Example: |
| 520 | ... Given the following endpoint: cpu |
Michael Walsh | 01bd368 | 2017-01-10 11:21:05 -0600 | [diff] [blame] | 521 | ... This keyword will return: list of all urls ending with |
| 522 | ... cpu - |
Rahul Maheshwari | 9a8d3b1 | 2016-12-05 04:06:16 -0600 | [diff] [blame] | 523 | ... /org/openbmc/inventory/system/chassis/motherboard/cpu0, |
| 524 | ... /org/openbmc/inventory/system/chassis/motherboard/cpu1 |
| 525 | ... Description of arguments: |
| 526 | ... path URL path for enumeration |
| 527 | ... endpoint string for which url path ending |
| 528 | [Arguments] ${path} ${endpoint} |
| 529 | |
| 530 | ${resp}= Read Properties ${path}/enumerate timeout=30 |
| 531 | log Dictionary ${resp} |
| 532 | |
| 533 | ${list}= Get Dictionary Keys ${resp} |
| 534 | ${resp}= Get Matches ${list} regexp=^.*[0-9a-z_].${endpoint}[0-9]*$ |
Gunnar Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 535 | [Return] ${resp} |
Sridevi Ramesh | b96a0c3 | 2016-10-19 05:09:52 -0500 | [diff] [blame] | 536 | |
Sridevi Ramesh | 1699d37 | 2016-12-06 00:20:22 -0600 | [diff] [blame] | 537 | |
Sridevi Ramesh | b96a0c3 | 2016-10-19 05:09:52 -0500 | [diff] [blame] | 538 | Check Zombie Process |
| 539 | [Documentation] Check if any defunct process exist or not on BMC |
Michael Walsh | 01bd368 | 2017-01-10 11:21:05 -0600 | [diff] [blame] | 540 | ${count} ${stderr} ${rc}= Execute Command ps -o stat | grep Z | wc -l |
Sridevi Ramesh | b96a0c3 | 2016-10-19 05:09:52 -0500 | [diff] [blame] | 541 | ... return_stderr=True return_rc=True |
| 542 | Should Be True ${count}==0 |
| 543 | Should Be Empty ${stderr} |
George Keishing | 5327d01 | 2016-12-08 08:43:29 -0600 | [diff] [blame] | 544 | |
| 545 | Prune Journal Log |
| 546 | [Documentation] Prune archived journal logs. |
| 547 | [Arguments] ${vacuum_size}=1M |
| 548 | |
| 549 | # This keyword can be used to prevent the journal |
| 550 | # log from filling up the /run filesystem. |
| 551 | # This command will retain only the latest logs |
| 552 | # of the user specified size. |
| 553 | |
| 554 | Open Connection And Log In |
| 555 | ${output} ${stderr} ${rc}= |
| 556 | ... Execute Command |
| 557 | ... journalctl --vacuum-size=${vacuum_size} |
| 558 | ... return_stderr=True return_rc=True |
| 559 | |
| 560 | Should Be Equal ${rc} ${0} msg=${stderr} |
| 561 | Should Contain ${stderr} Vacuuming done |
Sridevi Ramesh | 1699d37 | 2016-12-06 00:20:22 -0600 | [diff] [blame] | 562 | |
| 563 | Set BMC Power Policy |
| 564 | [Documentation] Set the given BMC power policy. |
| 565 | [arguments] ${policy} |
| 566 | |
| 567 | ${valueDict}= create dictionary data=${policy} |
| 568 | Write Attribute ${HOST_SETTING} power_policy data=${valueDict} |
| 569 | ${currentPolicy}= Read Attribute ${HOST_SETTING} power_policy |
| 570 | Should Be Equal ${currentPolicy} ${policy} |
George Keishing | cce9df2 | 2017-01-24 06:19:33 -0600 | [diff] [blame] | 571 | |
George Keishing | 4d6f3d6 | 2017-02-06 09:50:41 -0600 | [diff] [blame] | 572 | Get System Power Policy |
| 573 | [Documentation] Get the BMC power policy. |
| 574 | ${currentPolicy}= Read Attribute ${HOST_SETTING} power_policy |
| 575 | [Return] ${currentPolicy} |
George Keishing | cce9df2 | 2017-01-24 06:19:33 -0600 | [diff] [blame] | 576 | |
| 577 | Set BMC Reset Reference Time |
| 578 | [Documentation] Set current boot time as a reference and increment |
| 579 | ... boot count. |
| 580 | |
| 581 | ${cur_btime}= Get BMC Boot Time |
| 582 | Run Keyword If ${cur_btime} > ${BOOT_TIME} |
| 583 | ... Run Keywords |
| 584 | ... Set Global Variable ${BOOT_TIME} ${cur_btime} |
| 585 | ... AND |
| 586 | ... Set Global Variable ${BOOT_COUNT} ${BOOT_COUNT + 1} |
| 587 | |
| 588 | |
| 589 | Get BMC Boot Time |
| 590 | [Documentation] Get boot time from /proc/stat. |
| 591 | |
| 592 | Open Connection And Log In |
| 593 | ${output} ${stderr}= |
| 594 | ... Execute Command egrep '^btime ' /proc/stat | cut -f 2 -d ' ' |
| 595 | ... return_stderr=True |
| 596 | Should Be Empty ${stderr} |
| 597 | ${btime}= Convert To Integer ${output} |
| 598 | [Return] ${btime} |