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