Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation This example demonstrates executing commands on a remote machine |
| 3 | ... and getting their output and the return code. |
| 4 | ... |
| 5 | ... Notice how connections are handled as part of the suite setup and |
| 6 | ... teardown. This saves some time when executing several test cases. |
| 7 | |
| 8 | Resource ../lib/rest_client.robot |
| 9 | Resource ../lib/ipmi_client.robot |
George Keishing | d55a4be | 2016-08-26 03:28:17 -0500 | [diff] [blame] | 10 | Resource ../lib/openbmc_ffdc.robot |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 11 | Library ../data/model.py |
| 12 | |
| 13 | Suite Setup Open Connection And Log In |
| 14 | Suite Teardown Close All Connections |
George Keishing | d55a4be | 2016-08-26 03:28:17 -0500 | [diff] [blame] | 15 | Test Teardown Log FFDC |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 16 | |
| 17 | |
| 18 | *** Variables *** |
| 19 | ${model} = ${OPENBMC_MODEL} |
| 20 | |
| 21 | *** Test Cases *** |
| 22 | Verify connection |
| 23 | Execute new Command echo "hello" |
| 24 | Response Should Be Equal "hello" |
| 25 | |
| 26 | Execute ipmi BT capabilities command |
George Keishing | cac24c7 | 2016-09-23 04:44:19 -0500 | [diff] [blame^] | 27 | [Tags] Execute_ipmi_BT_capabilities_command |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 28 | Run IPMI command 0x06 0x36 |
| 29 | response Should Be Equal " 01 40 40 0a 01" |
| 30 | |
| 31 | Execute Set Sensor boot count |
| 32 | ${uri} = Set Variable /org/openbmc/sensors/host/BootCount |
| 33 | ${x} = Get Sensor Number ${uri} |
| 34 | |
| 35 | Run IPMI command 0x04 0x30 ${x} 0x01 0x00 0x35 0x00 0x00 0x00 0x00 0x00 0x00 |
| 36 | Read the Attribute ${uri} value |
| 37 | ${val} = convert to integer 53 |
| 38 | Response Should Be Equal ${val} |
| 39 | |
| 40 | Set Sensor Boot progress |
| 41 | ${uri} = Set Variable /org/openbmc/sensors/host/BootProgress |
| 42 | ${x} = Get Sensor Number ${uri} |
| 43 | |
| 44 | Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x04 0x00 0x00 0x00 0x00 0x14 0x00 |
| 45 | Read the Attribute ${uri} value |
| 46 | Response Should Be Equal FW Progress, Baseboard Init |
| 47 | |
| 48 | Set Sensor Boot progress Longest string |
| 49 | ${uri} = Set Variable /org/openbmc/sensors/host/BootProgress |
| 50 | ${x} = Get Sensor Number ${uri} |
| 51 | |
| 52 | Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x04 0x00 0x00 0x00 0x00 0x0e 0x00 |
| 53 | Read The Attribute ${uri} value |
| 54 | Response Should Be Equal FW Progress, Docking station attachment |
| 55 | |
| 56 | BootProgress sensor FW Hang unspecified Error |
| 57 | ${uri} = Set Variable /org/openbmc/sensors/host/BootProgress |
| 58 | ${x} = Get Sensor Number ${uri} |
| 59 | |
| 60 | Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x00 |
| 61 | Read The Attribute ${uri} value |
| 62 | Response Should Be Equal FW Hang, Unspecified |
| 63 | |
| 64 | BootProgress fw hang state |
| 65 | ${uri} = Set Variable /org/openbmc/sensors/host/BootProgress |
| 66 | ${x} = Get Sensor Number ${uri} |
| 67 | |
| 68 | Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x01 0x00 0x00 0x00 0x00 0x20 0x00 |
| 69 | Read The Attribute ${uri} value |
| 70 | Response Should Be Equal POST Error, unknown |
| 71 | |
| 72 | OperatingSystemStatus Sensor boot completed progress |
| 73 | ${uri} = Set Variable /org/openbmc/sensors/host/OperatingSystemStatus |
| 74 | ${x} = Get Sensor Number ${uri} |
| 75 | |
| 76 | Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x20 0x00 |
| 77 | Read The Attribute ${uri} value |
| 78 | Response Should Be Equal Boot completed (00) |
| 79 | |
| 80 | OperatingSystemStatus Sensor progress |
| 81 | ${uri} = Set Variable /org/openbmc/sensors/host/OperatingSystemStatus |
| 82 | ${x} = Get Sensor Number ${uri} |
| 83 | |
| 84 | Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x04 0x00 0x00 0x00 0x00 0x20 0x00 |
| 85 | Read The Attribute ${uri} value |
| 86 | Response Should Be Equal PXE boot completed |
| 87 | |
| 88 | OCC Active sensor on enabled |
| 89 | ${uri} = Set Variable /org/openbmc/sensors/host/cpu0/OccStatus |
| 90 | ${x} = Get Sensor Number ${uri} |
| 91 | |
| 92 | Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x20 0x00 |
| 93 | Read The Attribute ${uri} value |
| 94 | Response Should Be Equal Enabled |
| 95 | |
| 96 | OCC Active sensor on disabled |
| 97 | ${uri} = Set Variable /org/openbmc/sensors/host/cpu0/OccStatus |
| 98 | ${x} = Get Sensor Number ${uri} |
| 99 | |
| 100 | Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x20 0x00 |
| 101 | Read The Attribute ${uri} value |
| 102 | Response Should Be Equal Disabled |
| 103 | |
| 104 | CPU Present |
| 105 | ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/cpu0 |
| 106 | ${x} = Get Inventory Sensor Number ${uri} |
| 107 | |
| 108 | Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x80 0x00 0x00 0x00 0x00 0x20 0x00 |
| 109 | Read The Attribute ${uri} present |
| 110 | Response Should Be Equal True |
| 111 | |
| 112 | CPU not Present |
| 113 | ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/cpu0 |
| 114 | ${x} = Get Inventory Sensor Number ${uri} |
| 115 | |
| 116 | Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x00 0x00 0x80 0x00 0x00 0x20 0x00 |
| 117 | Read The Attribute ${uri} present |
| 118 | Response Should Be Equal False |
| 119 | |
| 120 | CPU fault |
| 121 | ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/cpu0 |
| 122 | ${x} = Get Inventory Sensor Number ${uri} |
| 123 | |
| 124 | Run IPMI command 0x04 0x30 ${x} 0xa9 0xff 0x00 0x01 0x00 0x00 0x00 0x20 0x00 |
| 125 | Read The Attribute ${uri} fault |
| 126 | Response Should Be Equal True |
| 127 | |
| 128 | CPU no fault |
| 129 | ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/cpu0 |
| 130 | ${x} = Get Inventory Sensor Number ${uri} |
| 131 | |
| 132 | Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x20 0x00 |
| 133 | Read The Attribute ${uri} fault |
| 134 | Response Should Be Equal False |
| 135 | |
| 136 | core Present |
| 137 | ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/cpu0/core11 |
| 138 | ${x} = Get Inventory Sensor Number ${uri} |
| 139 | |
| 140 | Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x80 0x00 0x00 0x00 0x00 0x20 0x00 |
| 141 | Read The Attribute ${uri} present |
| 142 | Response Should Be Equal True |
| 143 | |
| 144 | core not Present |
| 145 | ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/cpu0/core11 |
| 146 | ${x} = Get Inventory Sensor Number ${uri} |
| 147 | |
| 148 | Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x00 0x00 0x80 0x00 0x00 0x20 0x00 |
| 149 | Read The Attribute ${uri} present |
| 150 | Response Should Be Equal False |
| 151 | |
| 152 | core fault |
| 153 | ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/cpu0/core11 |
| 154 | ${x} = Get Inventory Sensor Number ${uri} |
| 155 | |
| 156 | Run IPMI command 0x04 0x30 ${x} 0xa9 0xff 0x00 0x01 0x00 0x00 0x00 0x20 0x00 |
| 157 | Read The Attribute ${uri} fault |
| 158 | Response Should Be Equal True |
| 159 | |
| 160 | core no fault |
| 161 | ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/cpu0/core11 |
| 162 | ${x} = Get Inventory Sensor Number ${uri} |
| 163 | |
| 164 | Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x20 0x00 |
| 165 | Read The Attribute ${uri} fault |
| 166 | Response Should Be Equal False |
| 167 | |
| 168 | DIMM3 Present |
| 169 | ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/dimm3 |
| 170 | ${x} = Get Inventory Sensor Number ${uri} |
| 171 | |
| 172 | Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x40 0x00 0x00 0x00 0x00 0x20 0x00 |
| 173 | Read The Attribute ${uri} present |
| 174 | Response Should Be Equal True |
| 175 | |
| 176 | DIMM3 not Present |
| 177 | ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/dimm3 |
| 178 | ${x} = Get Inventory Sensor Number ${uri} |
| 179 | |
| 180 | Run IPMI command 0x04 0x30 ${x} 0xa9 0xff 0x00 0x00 0x40 0x00 0x00 0x20 0x00 |
| 181 | Read The Attribute ${uri} present |
| 182 | Response Should Be Equal False |
| 183 | |
| 184 | DIMM0 fault |
| 185 | ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/dimm0 |
| 186 | ${x} = Get Inventory Sensor Number ${uri} |
| 187 | |
| 188 | Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x10 0x00 0x00 0x00 0x00 0x20 0x00 |
| 189 | Read The Attribute ${uri} fault |
| 190 | Response Should Be Equal True |
| 191 | |
| 192 | DIMM0 no fault |
| 193 | ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/dimm0 |
| 194 | ${x} = Get Inventory Sensor Number ${uri} |
| 195 | |
| 196 | Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x10 0x00 0x00 0x20 0x00 |
| 197 | Read The Attribute ${uri} fault |
| 198 | Response Should Be Equal False |
| 199 | |
| 200 | Centaur0 Present |
| 201 | ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/membuf0 |
| 202 | ${x} = Get Inventory Sensor Number ${uri} |
| 203 | |
| 204 | Run IPMI command 0x04 0x30 ${x} 0xa9 0x00 0x40 0x00 0x00 0x00 0x00 0x20 0x00 |
| 205 | Read The Attribute ${uri} present |
| 206 | Response Should Be Equal True |
| 207 | |
| 208 | Centaur0 not Present |
| 209 | ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/membuf0 |
| 210 | ${x} = Get Inventory Sensor Number ${uri} |
| 211 | |
| 212 | Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x40 0x00 0x00 0x20 0x00 |
| 213 | Read The Attribute ${uri} present |
| 214 | Response Should Be Equal False |
| 215 | |
| 216 | Centaur0 fault |
| 217 | ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/membuf0 |
| 218 | ${x} = Get Inventory Sensor Number ${uri} |
| 219 | |
| 220 | Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x10 0x00 0x00 0x00 0x00 0x20 0x00 |
| 221 | Read The Attribute ${uri} fault |
| 222 | Response Should Be Equal True |
| 223 | |
| 224 | Centaur0 no fault |
| 225 | ${uri} = Set Variable /org/openbmc/inventory/system/chassis/motherboard/membuf0 |
| 226 | ${x} = Get Inventory Sensor Number ${uri} |
| 227 | |
| 228 | Run IPMI command 0x04 0x30 ${x} 0x00 0x00 0x00 0x00 0x10 0x00 0x00 0x20 0x00 |
| 229 | Read The Attribute ${uri} fault |
| 230 | Response Should Be Equal False |
| 231 | |
| 232 | System Present |
| 233 | Read The Attribute /org/openbmc/inventory/system present |
| 234 | Response Should Be Equal True |
| 235 | |
| 236 | System Fault |
| 237 | Read The Attribute /org/openbmc/inventory/system fault |
| 238 | Response Should Be Equal False |
| 239 | |
| 240 | Chassis Present |
| 241 | Read The Attribute /org/openbmc/inventory/system/chassis present |
| 242 | Response Should Be Equal True |
| 243 | |
| 244 | Chassis Fault |
| 245 | Read The Attribute /org/openbmc/inventory/system/chassis fault |
| 246 | Response Should Be Equal False |
| 247 | |
| 248 | io_board Present |
| 249 | Read The Attribute /org/openbmc/inventory/system/chassis/io_board present |
| 250 | Response Should Be Equal True |
| 251 | |
| 252 | io_board Fault |
| 253 | Read The Attribute /org/openbmc/inventory/system/chassis/io_board fault |
| 254 | Response Should Be Equal False |
| 255 | |
| 256 | |
| 257 | |
| 258 | *** Keywords *** |
| 259 | Execute new Command |
| 260 | [arguments] ${args} |
| 261 | ${output}= Execute Command ${args} |
| 262 | set test variable ${OUTPUT} "${output}" |
| 263 | |
| 264 | response Should Be Equal |
| 265 | [arguments] ${args} |
| 266 | Should Be Equal ${OUTPUT} ${args} |
| 267 | |
| 268 | Response Should Be Empty |
| 269 | Should Be Empty ${OUTPUT} |
| 270 | |
| 271 | Read the Attribute |
| 272 | [arguments] ${uri} ${parm} |
| 273 | ${output} = Read Attribute ${uri} ${parm} |
| 274 | set test variable ${OUTPUT} ${output} |
| 275 | |
| 276 | Get Sensor Number |
| 277 | [arguments] ${name} |
| 278 | ${x} = get sensor ${OPENBMC_MODEL} ${name} |
| 279 | [return] ${x} |
| 280 | |
| 281 | Get Inventory Sensor Number |
| 282 | [arguments] ${name} |
| 283 | ${x} = get inventory sensor ${OPENBMC_MODEL} ${name} |
| 284 | [return] ${x} |