Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
George Keishing | c8166ed | 2017-02-24 03:53:38 -0600 | [diff] [blame] | 2 | Documentation System inventory related test. |
| 3 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 4 | Resource ../lib/rest_client.robot |
| 5 | Resource ../lib/utils.robot |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 6 | Resource ../lib/state_manager.robot |
George Keishing | d55a4be | 2016-08-26 03:28:17 -0500 | [diff] [blame] | 7 | Resource ../lib/openbmc_ffdc.robot |
Sweta Potthuri | 654cbc0 | 2017-06-15 10:10:55 -0500 | [diff] [blame] | 8 | Resource ../lib/list_utils.robot |
Sweta Potthuri | af741cb | 2017-07-04 09:41:17 -0500 | [diff] [blame] | 9 | Resource ../lib/boot_utils.robot |
George Keishing | efa9735 | 2017-03-13 07:13:03 -0500 | [diff] [blame] | 10 | Library ../lib/utilities.py |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 11 | |
| 12 | Variables ../data/variables.py |
George Keishing | c8166ed | 2017-02-24 03:53:38 -0600 | [diff] [blame] | 13 | Variables ../data/inventory.py |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 14 | |
George Keishing | da0aa88 | 2017-12-05 06:44:03 -0600 | [diff] [blame] | 15 | Suite Setup Suite Setup Execution |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 16 | Test Teardown FFDC On Test Case Fail |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 17 | |
Rahul Maheshwari | 3e9b0de | 2017-03-20 06:25:44 -0500 | [diff] [blame] | 18 | Force Tags Inventory |
| 19 | |
Sweta Potthuri | 654cbc0 | 2017-06-15 10:10:55 -0500 | [diff] [blame] | 20 | ***Variables*** |
| 21 | |
| 22 | ${LOOP_COUNT} ${1} |
| 23 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 24 | *** Test Cases *** |
| 25 | |
George Keishing | c8166ed | 2017-02-24 03:53:38 -0600 | [diff] [blame] | 26 | Verify System Inventory Path |
| 27 | [Documentation] Check if system inventory path exist. |
| 28 | [Tags] Verify_System_Inventory_Path |
| 29 | # When the host is booted, system inventory path should exist. |
| 30 | # Example: /xyz/openbmc_project/inventory/system |
| 31 | Get Inventory system |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 32 | |
Rahul Maheshwari | bb20f73 | 2016-10-24 06:27:14 -0500 | [diff] [blame] | 33 | |
George Keishing | 3d73431 | 2017-07-24 04:10:25 -0500 | [diff] [blame] | 34 | Verify Boxelder Present Property |
| 35 | [Documentation] Boxelder should be present by default. |
George Keishing | 01b59ac | 2017-11-24 10:43:58 -0600 | [diff] [blame] | 36 | [Tags] Verify_Boxelder_Present_Property |
George Keishing | 3d73431 | 2017-07-24 04:10:25 -0500 | [diff] [blame] | 37 | # Example: |
| 38 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/boxelder/bmc": |
| 39 | # { |
| 40 | # "BuildDate": "", |
| 41 | # "FieldReplaceable": 0, |
| 42 | # "Manufacturer": "IBM", |
| 43 | # "Model": "", |
| 44 | # "PartNumber": "01DH051", |
| 45 | # "Present": 1, |
| 46 | # "PrettyName": "BMC PLANAR ", |
| 47 | # "SerialNumber": "000000000000" |
| 48 | # }, |
| 49 | ${json_data}= Get Inventory system/chassis/motherboard/boxelder/bmc |
| 50 | Should Be True ${json_data["data"]["Present"]} |
George Keishing | 33dd443 | 2017-09-13 01:48:26 -0500 | [diff] [blame] | 51 | Should Not Be Equal As Strings |
| 52 | ... ${json_data["data"]["SerialNumber"]} 000000000000 |
| 53 | ... msg=BMC planar serial number invalid. |
George Keishing | 3d73431 | 2017-07-24 04:10:25 -0500 | [diff] [blame] | 54 | |
| 55 | |
George Keishing | e4e1d27 | 2017-11-24 06:05:21 -0600 | [diff] [blame] | 56 | Verify UUID Entry |
| 57 | [Documentation] UUID entry should exist in BMC planar property. |
| 58 | [Tags] Verify_UUID_Entry |
| 59 | # Example: |
| 60 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/boxelder/bmc": |
| 61 | # { |
| 62 | # "BuildDate": "", |
| 63 | # "FieldReplaceable": 0, |
| 64 | # "Manufacturer": "IBM", |
| 65 | # "Model": "", |
| 66 | # "PartNumber": "01DH051", |
| 67 | # "Present": 1, |
| 68 | # "PrettyName": "BMC PLANAR ", |
| 69 | # "SerialNumber": "000000000000" |
| 70 | # "UUID": "" |
| 71 | # }, |
George Keishing | fa23997 | 2017-12-11 06:45:05 -0600 | [diff] [blame] | 72 | ${resp}= OpenBMC Get Request |
| 73 | ... ${HOST_INVENTORY_URI}system/chassis/motherboard/boxelder/bmc/attr/UUID |
| 74 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
George Keishing | e4e1d27 | 2017-11-24 06:05:21 -0600 | [diff] [blame] | 75 | |
| 76 | |
George Keishing | 3d73431 | 2017-07-24 04:10:25 -0500 | [diff] [blame] | 77 | Verify Boxelder MAC Address Property Is Populated |
| 78 | [Documentation] Boxelder should be present by default. |
| 79 | [Tags] Verify_Boxelder_MAC_Address_Property_Is_Populated |
| 80 | # Example: |
| 81 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/boxelder/bmc/ethernet |
| 82 | # { |
| 83 | # "FieldReplaceable": 0, |
| 84 | # "MACAddress": "00:00:00:00:00:00", |
| 85 | # "Present": 1, |
| 86 | # "PrettyName": "" |
| 87 | # } |
| 88 | |
| 89 | ${json_data}= Get Inventory |
| 90 | ... system/chassis/motherboard/boxelder/bmc/ethernet |
| 91 | Should Be True ${json_data["data"]["Present"]} |
| 92 | Should Not Be Equal As Strings |
| 93 | ... ${json_data["data"]["MACAddress"]} 00:00:00:00:00:00 |
| 94 | |
| 95 | # eth0 Link encap:Ethernet HWaddr 70:E2:84:14:23:F9 |
| 96 | ${mac_addr} ${stderr} ${rc}= BMC Execute Command |
| 97 | ... /sbin/ifconfig -a | grep HWaddr | awk -F'HWaddr ' '{print $2}' |
| 98 | ... return_stderr=True |
| 99 | Should Be Empty ${stderr} |
Rahul Maheshwari | 844dbe7 | 2017-09-18 00:24:23 -0500 | [diff] [blame] | 100 | Should Be Equal As Strings ${json_data["data"]["MACAddress"]} |
| 101 | ... ${mac_addr.strip()} msg=MAC address configured incorrectly. |
| 102 | ... ignore_case=True |
George Keishing | 3d73431 | 2017-07-24 04:10:25 -0500 | [diff] [blame] | 103 | |
| 104 | |
George Keishing | c8166ed | 2017-02-24 03:53:38 -0600 | [diff] [blame] | 105 | Verify Chassis Motherboard Properties |
| 106 | [Documentation] Check if chassis motherboard properties are |
| 107 | ... populated valid. |
| 108 | [Tags] Verify_Chassis_Motherboard_Properties |
| 109 | # When the host is booted, the following properties should |
| 110 | # be populated Manufacturer, PartNumber, SerialNumber and |
| 111 | # it should not be zero's. |
| 112 | # Example: |
| 113 | # "data": { |
| 114 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard": { |
| 115 | # "BuildDate": "", |
| 116 | # "Manufacturer": "0000000000000000", |
| 117 | # "Model": "", |
| 118 | # "PartNumber": "0000000", |
| 119 | # "Present": 0, |
| 120 | # "PrettyName": "SYSTEM PLANAR ", |
| 121 | # "SerialNumber": "000000000000" |
| 122 | # } |
| 123 | ${properties}= Get Inventory system/chassis/motherboard |
| 124 | Should Not Be Equal As Strings |
George Keishing | c8166ed | 2017-02-24 03:53:38 -0600 | [diff] [blame] | 125 | ... ${properties["data"]["PartNumber"]} 0000000 |
| 126 | ... msg=motherboard part number invalid. |
| 127 | Should Not Be Equal As Strings |
| 128 | ... ${properties["data"]["SerialNumber"]} 000000000000 |
| 129 | ... msg=motherboard serial number invalid. |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 130 | |
George Keishing | ae35530 | 2017-03-13 04:34:58 -0500 | [diff] [blame] | 131 | Verify CPU Present |
| 132 | [Documentation] Check if the FRU "Present" is set for CPU's. |
| 133 | [Tags] Verify_CPU_Present |
| 134 | # System inventory cpu list: |
| 135 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0 |
| 136 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1 |
| 137 | # Example: |
| 138 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0": { |
| 139 | # "FieldReplaceable": 1, |
| 140 | # "BuildDate": "", |
| 141 | # "Cached": 0, |
| 142 | # "SerialNumber": "YA3933741574", |
| 143 | # "Version": "10", |
| 144 | # "Model": "", |
| 145 | # "PrettyName": "PROCESSOR MODULE", |
| 146 | # "PartNumber": "01HL322", |
| 147 | # "Present": 1, |
| 148 | # "Manufacturer": "IBM" |
| 149 | # }, |
| 150 | # The CPU properties "Present" should be boolean 1. |
| 151 | |
| 152 | ${cpu_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system cpu |
| 153 | :FOR ${cpu_uri} IN @{cpu_list} |
| 154 | \ ${present}= Read Attribute ${cpu_uri} Present |
| 155 | \ Should Be True ${present} |
| 156 | |
| 157 | |
| 158 | Verify DIMM Present |
| 159 | [Documentation] Check if the FRU "Present" is set for DIMM's. |
| 160 | [Tags] Verify_DIMM_Present |
| 161 | # Example: |
| 162 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0": { |
| 163 | # "FieldReplaceable": 1, |
| 164 | # "BuildDate": "", |
| 165 | # "Cached": 0, |
| 166 | # "SerialNumber": "0x0300cf4f", |
| 167 | # "Version": "0x00", |
| 168 | # "Model": "M393A1G40EB1-CRC ", |
| 169 | # "PrettyName": "0x0c", |
| 170 | # "PartNumber": "", |
| 171 | # "Present": 1, |
| 172 | # "Manufacturer": "0xce80" |
| 173 | # }, |
| 174 | |
| 175 | # The DIMM properties "Present" should be boolean 1. |
| 176 | |
| 177 | ${dimm_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system dimm |
| 178 | :FOR ${dimm_uri} IN @{dimm_list} |
| 179 | \ ${present}= Read Attribute ${dimm_uri} Present |
| 180 | \ Should Be True ${present} |
| 181 | |
| 182 | |
George Keishing | efa9735 | 2017-03-13 07:13:03 -0500 | [diff] [blame] | 183 | Verify FRU Properties |
| 184 | [Documentation] Verify the FRU properties fields. |
| 185 | [Tags] Verify_FRU_Properties |
| 186 | # Example: |
| 187 | # A FRU would have "FieldReplaceable" set to boolean 1 and should have |
| 188 | # the following entries |
| 189 | # "fru": [ |
| 190 | # "FieldReplaceable" |
| 191 | # "BuildDate", |
| 192 | # "Cached" |
| 193 | # "SerialNumber", |
| 194 | # "Version", |
| 195 | # "Model", |
| 196 | # "PrettyName", |
| 197 | # "PartNumber", |
| 198 | # "Present", |
| 199 | # "Manufacturer", |
| 200 | # ] |
| 201 | # and FRU which doesn't have one of this fields is an error. |
| 202 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0": { |
| 203 | # "FieldReplaceable": 1, |
| 204 | # "BuildDate": "", |
| 205 | # "Cached": 0, |
| 206 | # "SerialNumber": "0x0300cf4f", |
| 207 | # "Version": "0x00", |
| 208 | # "Model": "M393A1G40EB1-CRC ", |
| 209 | # "PrettyName": "0x0c", |
| 210 | # "PartNumber": "", |
| 211 | # "Present": 1, |
| 212 | # "Manufacturer": "0xce80" |
| 213 | # }, |
| 214 | |
| 215 | ${system_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system * |
| 216 | ${fru_list}= Qualified FRU List @{system_list} |
George Keishing | da0aa88 | 2017-12-05 06:44:03 -0600 | [diff] [blame] | 217 | Validate FRU Properties Fields fru @{fru_list} |
| 218 | |
| 219 | |
| 220 | Verify GPU Properties |
| 221 | [Documentation] Verify the GPU properties fields. |
| 222 | [Tags] Verify_GPU_Properties |
| 223 | # Example: |
| 224 | # A GPU property should have the following entries: |
| 225 | # "gpu":[ |
| 226 | # "PrettyName", |
| 227 | # "Present", |
| 228 | # "Functional" |
| 229 | # ] |
| 230 | # GPU inventory: |
| 231 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card2": { |
| 232 | # "Functional": 1, |
| 233 | # "Present": 1, |
| 234 | # "PrettyName": "" |
| 235 | # }, |
| 236 | |
| 237 | |
| 238 | ${system_list}= Get Endpoint Paths |
| 239 | ... ${HOST_INVENTORY_URI}system/chassis/motherboard gv* |
| 240 | Validate FRU Properties Fields gpu @{system_list} |
| 241 | |
| 242 | |
| 243 | Verify Core Properties |
| 244 | [Documentation] Verify the core property fields. |
| 245 | [Tags] Verify_Core_Properties |
| 246 | # Example: |
| 247 | # A core property should have the following entries: |
| 248 | # "core":[ |
| 249 | # "PrettyName", |
| 250 | # "Present", |
| 251 | # "Functional" |
| 252 | # ] |
| 253 | # core inventory: |
| 254 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core0": { |
| 255 | # "Functional": 1, |
| 256 | # "Present": 1, |
| 257 | # "PrettyName": "" |
| 258 | # }, |
| 259 | |
| 260 | ${system_list}= Get Endpoint Paths |
| 261 | ... ${HOST_INVENTORY_URI}system/chassis/motherboard core* |
| 262 | Validate FRU Properties Fields core @{system_list} |
| 263 | |
George Keishing | efa9735 | 2017-03-13 07:13:03 -0500 | [diff] [blame] | 264 | |
George Keishing | ca8c61b | 2017-12-11 11:48:00 -0600 | [diff] [blame] | 265 | Verify Fan Properties |
| 266 | [Documentation] Verify the fan property fields. |
| 267 | [Tags] Verify_Fan_Properties |
| 268 | # Example: |
| 269 | # A fan property should have the following entries: |
| 270 | # "core":[ |
| 271 | # "PrettyName", |
| 272 | # "Present", |
| 273 | # "MeetsMinimumShipLevel", |
| 274 | # "Functional" |
| 275 | # ] |
| 276 | # fan inventory: |
| 277 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan0": { |
| 278 | # "Functional": 1, |
| 279 | # "MeetsMinimumShipLevel": 1, |
| 280 | # "Present": 1, |
| 281 | # "PrettyName": "fan0" |
| 282 | # }, |
| 283 | |
| 284 | ${system_list}= Get Endpoint Paths |
| 285 | ... ${HOST_INVENTORY_URI}system/chassis/motherboard fan* |
| 286 | Validate FRU Properties Fields fan @{system_list} |
| 287 | |
George Keishing | 071d8da | 2017-03-24 09:13:16 -0500 | [diff] [blame] | 288 | |
| 289 | Verify Core Functional State |
| 290 | [Documentation] Verify that "Present" core property is set if "Functional" |
| 291 | ... core property is set. |
| 292 | [Tags] Verify_Core_Functional_State |
| 293 | # Example: |
| 294 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core5":{ |
| 295 | # "Functional": 1, |
| 296 | # "Present": 1, |
| 297 | # "PrettyName": "" |
| 298 | # }, |
| 299 | ${core_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system core |
| 300 | :FOR ${core_uri} IN @{core_list} |
| 301 | \ ${status}= Run Keyword And Return Status |
| 302 | ... Check URL Property If Functional ${core_uri} |
George Keishing | c565839 | 2017-04-27 23:05:18 -0500 | [diff] [blame] | 303 | \ Continue For Loop If '${status}' == '${False}' |
George Keishing | 071d8da | 2017-03-24 09:13:16 -0500 | [diff] [blame] | 304 | \ ${present}= Read Attribute ${core_uri} Present |
| 305 | \ Should Be True ${present} |
| 306 | ... msg=${core_uri} is functional but not present. |
| 307 | |
| 308 | |
| 309 | Verify DIMM Functional State |
| 310 | [Documentation] Verify that "Present" DIMM property is set if "Functional" |
| 311 | ... DIMM property is set. |
| 312 | [Tags] Verify_DIMM_Functional_State |
| 313 | # Example: |
| 314 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0": { |
| 315 | # "BuildDate": "", |
| 316 | # "Cached": 0, |
| 317 | # "FieldReplaceable": 1, |
| 318 | # "Functional": 1, |
| 319 | # "Manufacturer": "0xce80", |
| 320 | # "Model": "M393A1G40EB1-CRC ", |
| 321 | # "PartNumber": "", |
| 322 | # "Present": 1, |
| 323 | # "PrettyName": "0x0c", |
| 324 | # "SerialNumber": "0x0300cf4f", |
| 325 | # "Version": "0x00" |
| 326 | # }, |
| 327 | |
| 328 | ${dimm_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system dimm |
| 329 | :FOR ${dimm_uri} IN @{dimm_list} |
| 330 | \ ${status}= Run Keyword And Return Status |
| 331 | ... Check URL Property If Functional ${dimm_uri} |
George Keishing | c565839 | 2017-04-27 23:05:18 -0500 | [diff] [blame] | 332 | \ Continue For Loop If '${status}' == '${False}' |
George Keishing | 071d8da | 2017-03-24 09:13:16 -0500 | [diff] [blame] | 333 | \ ${present}= Read Attribute ${dimm_uri} Present |
| 334 | \ Should Be True ${present} |
| 335 | ... msg=${dimm_uri} is functional but not present. |
| 336 | |
George Keishing | 3c205b1 | 2017-05-13 04:09:33 -0500 | [diff] [blame] | 337 | |
| 338 | Verify Fan Functional State |
| 339 | [Documentation] Verify that "Present" fan property is set if "Functional" |
| 340 | ... fan property is set. |
| 341 | [Tags] Verify_Fan_Functional_State |
| 342 | # Example: |
| 343 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan0": { |
| 344 | # "Functional": 1, |
| 345 | # "Present": 1, |
| 346 | # "PrettyName": "fan0" |
| 347 | # }, |
| 348 | |
| 349 | ${fan_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system fan* |
| 350 | Should Not Be Empty ${fan_list} |
| 351 | :FOR ${fan_uri} IN @{fan_list} |
| 352 | \ ${status}= Run Keyword And Return Status |
| 353 | ... Check URL Property If Functional ${fan_uri} |
| 354 | \ Continue For Loop If '${status}' == '${False}' |
| 355 | \ ${present}= Read Attribute ${fan_uri} Present |
| 356 | \ Should Be True ${present} |
| 357 | ... msg=${fan_uri} is functional but "Present" is not set. |
| 358 | |
Sweta Potthuri | 56631f5 | 2017-11-10 02:19:38 -0600 | [diff] [blame] | 359 | Verify CPU Functional State |
| 360 | [Documentation] Verify that "Present" CPU property is set if "Functional" |
| 361 | ... CPU property is set. |
| 362 | [Tags] Verify_CPU_Functional_State |
| 363 | |
| 364 | # Example of cpu* endpoint data: |
| 365 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0": { |
| 366 | # "Functional": 1, |
| 367 | # "Present": 1, |
| 368 | # "PrettyName": "cpu0" |
| 369 | # }, |
| 370 | |
| 371 | ${cpu_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system cpu* |
| 372 | Should Not Be Empty ${cpu_list} |
| 373 | :FOR ${cpu_uri} IN @{cpu_list} |
| 374 | \ ${status}= Run Keyword And Return Status |
| 375 | ... Check URL Property If Functional ${cpu_uri} |
| 376 | \ Continue For Loop If '${status}' == '${False}' |
| 377 | \ ${present}= Read Attribute ${cpu_uri} Present |
| 378 | \ Should Be True ${present} |
| 379 | ... msg=${cpu_uri} is functional but "Present" is not set. |
George Keishing | 3c205b1 | 2017-05-13 04:09:33 -0500 | [diff] [blame] | 380 | |
George Keishing | 53a75f7 | 2017-11-17 12:50:30 -0600 | [diff] [blame] | 381 | |
| 382 | Verify GPU Functional State |
| 383 | [Documentation] Verify that "Functional" GPU property is set if "Present" |
| 384 | ... GPU property is set |
| 385 | [Tags] Verify_GPU_Functional_State |
| 386 | |
| 387 | # Example of gv* endpoint data: |
| 388 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card4": { |
| 389 | # "Functional": 1, |
| 390 | # "Present": 1, |
| 391 | # "PrettyName": "" |
| 392 | # }, |
| 393 | |
| 394 | |
George Keishing | c7b161b | 2017-12-01 09:58:12 -0600 | [diff] [blame] | 395 | ${gpu_list}= Get Endpoint Paths |
| 396 | ... ${HOST_INVENTORY_URI}system/chassis/motherboard gv* |
George Keishing | 53a75f7 | 2017-11-17 12:50:30 -0600 | [diff] [blame] | 397 | Should Not Be Empty ${gpu_list} |
| 398 | :FOR ${gpu_uri} IN @{gpu_list} |
| 399 | \ ${status}= Run Keyword And Return Status |
| 400 | ... Check URL Property If Functional ${gpu_uri} |
| 401 | \ Continue For Loop If '${status}' == '${False}' |
| 402 | \ ${present}= Read Attribute ${gpu_uri} Present |
| 403 | \ Should Be True ${present} |
| 404 | ... msg=${gpu_uri} is functional but "Present" is not set. |
| 405 | |
| 406 | |
George Keishing | 04c6b2c | 2017-06-15 12:33:59 -0500 | [diff] [blame] | 407 | Check Air Or Water Cooled |
| 408 | [Documentation] Check if this system is Air or water cooled. |
| 409 | [Tags] Check_Air_Or_Water_Cooled |
| 410 | # Example: |
| 411 | # "/xyz/openbmc_project/inventory/system/chassis": { |
| 412 | # "AirCooled": 1, |
| 413 | # "WaterCooled": 0 |
| 414 | # }, |
| 415 | |
| 416 | ${air_cooled}= Read Attribute |
| 417 | ... /xyz/openbmc_project/inventory/system/chassis AirCooled |
| 418 | Log AirCooled:${air_cooled} |
| 419 | |
| 420 | ${water_cooled}= Read Attribute |
| 421 | ... /xyz/openbmc_project/inventory/system/chassis WaterCooled |
| 422 | Log WaterCooled:${water_cooled} |
| 423 | |
| 424 | Run Keyword If ${air_cooled}==${0} and ${water_cooled}==${0} |
| 425 | ... Fail Neither AirCooled or WaterCooled. |
| 426 | |
Sweta Potthuri | 1a640de | 2017-07-18 11:09:59 -0500 | [diff] [blame] | 427 | Verify Minimal CPU Inventory |
| 428 | [Documentation] Verify minimal CPU inventory. |
| 429 | [Tags] Verify_Minimal_CPU_Inventory |
| 430 | |
| 431 | # item minimum_count |
| 432 | cpu 1 |
| 433 | [Template] Minimum Inventory |
| 434 | |
| 435 | Verify Minimal DIMM Inventory |
| 436 | [Documentation] Verify minimal DIMM inventory. |
| 437 | [Tags] Verify_Minimal_DIMM_Inventory |
| 438 | |
| 439 | # item minimum_count |
| 440 | dimm 2 |
| 441 | [Template] Minimum Inventory |
| 442 | |
| 443 | Verify Minimal Core Inventory |
| 444 | [Documentation] Verify minimal core inventory. |
| 445 | [Tags] Verify_Minimal_Core_Inventory |
| 446 | |
| 447 | # item minimum_count |
| 448 | core 1 |
| 449 | [Template] Minimum Inventory |
| 450 | |
| 451 | Verify Minimal Memory Buffer Inventory |
| 452 | [Documentation] Verify minimal memory buffer inventory. |
| 453 | [Tags] Verify_Minimal_Memory_Buffer_Inventory |
| 454 | |
| 455 | # item minimum_count |
| 456 | memory_buffer 1 |
| 457 | [Template] Minimum Inventory |
| 458 | |
| 459 | Verify Minimal Fan Inventory |
| 460 | [Documentation] Verify minimal fan inventory. |
| 461 | [Tags] Verify_Minimal_Fan_Inventory |
| 462 | |
| 463 | # item minimum_count |
| 464 | fan 2 |
| 465 | [Template] Minimum Inventory |
| 466 | |
| 467 | Verify Minimal Main Planar Inventory |
| 468 | [Documentation] Verify minimal main planar inventory. |
| 469 | [Tags] Verify_Minimal_Main_Planar_Inventory |
| 470 | |
| 471 | # item minimum_count |
| 472 | main_planar 1 |
| 473 | [Template] Minimum Inventory |
| 474 | |
| 475 | Verify Minimal System Inventory |
| 476 | [Documentation] Verify minimal system inventory. |
| 477 | [Tags] Verify_Minimal_System_Inventory |
| 478 | |
| 479 | # item minimum_count |
| 480 | system 1 |
| 481 | [Template] Minimum Inventory |
George Keishing | 04c6b2c | 2017-06-15 12:33:59 -0500 | [diff] [blame] | 482 | |
George Keishing | 03ebc29 | 2017-08-02 01:22:02 -0500 | [diff] [blame] | 483 | Verify Minimal Power Supply Inventory |
| 484 | [Documentation] Verify minimal power supply inventory. |
| 485 | [Tags] Verify_Minimal_Power_Supply_Inventory |
| 486 | # Example: |
George Keishing | 1b71f22 | 2017-11-23 14:02:49 -0600 | [diff] [blame] | 487 | # "/xyz/openbmc_project/inventory/system/chassis/powersupply0", |
| 488 | # "/xyz/openbmc_project/inventory/system/chassis/powersupply1", |
George Keishing | 03ebc29 | 2017-08-02 01:22:02 -0500 | [diff] [blame] | 489 | |
| 490 | # item minimum_count |
George Keishing | 1b71f22 | 2017-11-23 14:02:49 -0600 | [diff] [blame] | 491 | powersupply 1 |
George Keishing | 03ebc29 | 2017-08-02 01:22:02 -0500 | [diff] [blame] | 492 | [Template] Minimum Inventory |
| 493 | |
George Keishing | fafbfdb | 2017-08-30 23:51:23 -0500 | [diff] [blame] | 494 | |
| 495 | Verify Inventory List After Reboot |
| 496 | [Documentation] Verify inventory list after reboot. |
| 497 | [Tags] Verify_Inventory_List_After_Reboot |
| 498 | |
| 499 | Repeat Keyword ${LOOP_COUNT} times Choose Boot Option reboot |
| 500 | |
| 501 | |
| 502 | Verify Inventory List After Reset |
| 503 | [Documentation] Verify inventory list after reset. |
| 504 | [Tags] Verify_Inventory_List_After_Reset |
| 505 | |
| 506 | Repeat Keyword ${LOOP_COUNT} times Choose Boot Option reset |
| 507 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 508 | *** Keywords *** |
| 509 | |
George Keishing | da0aa88 | 2017-12-05 06:44:03 -0600 | [diff] [blame] | 510 | Suite Setup Execution |
George Keishing | c8166ed | 2017-02-24 03:53:38 -0600 | [diff] [blame] | 511 | [Documentation] Do the initial suite setup. |
George Keishing | 25577a2 | 2017-07-12 05:18:46 -0500 | [diff] [blame] | 512 | |
George Keishing | 4f5260b | 2017-12-14 12:28:31 -0600 | [diff] [blame] | 513 | Smart Power Off |
| 514 | REST Power On |
George Keishing | caac9f3 | 2017-03-09 02:14:27 -0600 | [diff] [blame] | 515 | |
George Keishing | c8166ed | 2017-02-24 03:53:38 -0600 | [diff] [blame] | 516 | Get Inventory |
| 517 | [Documentation] Get the properties of an endpoint. |
| 518 | [Arguments] ${endpoint} |
| 519 | # Description of arguments: |
| 520 | # endpoint string for which url path ending. |
| 521 | # Example: "system" is the endpoint for url |
| 522 | # /xyz/openbmc_project/inventory/system |
| 523 | ${resp}= OpenBMC Get Request ${HOST_INVENTORY_URI}${endpoint} |
| 524 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 525 | ${jsondata}= To JSON ${resp.content} |
| 526 | [Return] ${jsondata} |
George Keishing | efa9735 | 2017-03-13 07:13:03 -0500 | [diff] [blame] | 527 | |
| 528 | |
| 529 | Qualified FRU List |
| 530 | [Documentation] Build the list of valid FRUs. |
| 531 | [Arguments] @{system_list} |
| 532 | # Description of arguments: |
| 533 | # system_list List of system inventory URLs. |
| 534 | # Example: |
| 535 | # /xyz/openbmc_project/inventory/system/chassis/motherboard |
| 536 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0 |
| 537 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1 |
| 538 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0 |
| 539 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm1 |
| 540 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm2 |
| 541 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm3 |
| 542 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm4 |
| 543 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm5 |
| 544 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm6 |
| 545 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm7 |
| 546 | |
| 547 | ${fru_list}= Create List |
| 548 | :FOR ${fru_uri} IN @{system_list} |
George Keishing | df5ab12 | 2017-04-17 04:01:11 -0500 | [diff] [blame] | 549 | \ ${resp}= OpenBMC Get Request ${fru_uri}/attr/FieldReplaceable |
George Keishing | da0aa88 | 2017-12-05 06:44:03 -0600 | [diff] [blame] | 550 | ... quiet=${1} |
George Keishing | df5ab12 | 2017-04-17 04:01:11 -0500 | [diff] [blame] | 551 | \ ${jsondata}= To JSON ${resp.content} |
| 552 | \ ${status}= Run Keyword And Return Status |
| 553 | ... Should Be True ${jsondata['data']} == ${1} |
George Keishing | efa9735 | 2017-03-13 07:13:03 -0500 | [diff] [blame] | 554 | \ Run Keyword If '${status}' == '${True}' |
| 555 | ... Append To List ${fru_list} ${fru_uri} |
| 556 | |
| 557 | [Return] ${fru_list} |
| 558 | |
| 559 | |
| 560 | Validate FRU Properties Fields |
| 561 | [Documentation] Compare valid FRUs from system vs expected FRU set. |
George Keishing | da0aa88 | 2017-12-05 06:44:03 -0600 | [diff] [blame] | 562 | [Arguments] ${fru_type} @{fru_list} |
| 563 | |
George Keishing | efa9735 | 2017-03-13 07:13:03 -0500 | [diff] [blame] | 564 | # Description of arguments: |
George Keishing | da0aa88 | 2017-12-05 06:44:03 -0600 | [diff] [blame] | 565 | # fru_type FRU type name (e.g. "gpu", "fru", "fan", etc.). |
George Keishing | efa9735 | 2017-03-13 07:13:03 -0500 | [diff] [blame] | 566 | # fru_list List of qualified FRU URLs. |
| 567 | |
| 568 | # Build the pre-defined set list from data/inventory.py derived from |
| 569 | # a group of YAML files. |
| 570 | # Example: |
| 571 | # set(['Version', 'PartNumber', 'SerialNumber', 'FieldReplaceable', |
| 572 | # 'BuildDate', 'Present', 'Manufacturer', 'PrettyName', 'Cached', 'Model']) |
George Keishing | da0aa88 | 2017-12-05 06:44:03 -0600 | [diff] [blame] | 573 | ${fru_set}= List To Set ${inventory_dict['${fru_type}']} |
George Keishing | efa9735 | 2017-03-13 07:13:03 -0500 | [diff] [blame] | 574 | |
| 575 | # Iterate through the FRU's url and compare the set dictionary keys |
| 576 | # with the pre-define inventory data. |
| 577 | :FOR ${fru_url_path} IN @{fru_list} |
| 578 | \ ${fru_field}= Read Properties ${fru_url_path} |
| 579 | # ------------------------------------------------------------ |
| 580 | # ${fru_field.viewkeys()} extracts the list of keys from the |
| 581 | # JSON dictionary as a set. |
| 582 | # ------------------------------------------------------------ |
| 583 | \ Should Be Equal ${fru_field.viewkeys()} ${fru_set} |
| 584 | |
George Keishing | 071d8da | 2017-03-24 09:13:16 -0500 | [diff] [blame] | 585 | |
| 586 | Check URL Property If Functional |
| 587 | [Arguments] ${url_path} |
| 588 | # Description of arguments: |
| 589 | # url_path Full url path of the inventory object. |
| 590 | # Example: DIMM / core property url's |
| 591 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0 |
| 592 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core0 |
| 593 | ${state}= Read Attribute ${url_path} Functional |
| 594 | Should Be True ${state} |
Sweta Potthuri | 654cbc0 | 2017-06-15 10:10:55 -0500 | [diff] [blame] | 595 | |
George Keishing | fafbfdb | 2017-08-30 23:51:23 -0500 | [diff] [blame] | 596 | Choose Boot Option |
| 597 | [Documentation] Choose BMC reset or host reboot. |
| 598 | [Arguments] ${option} |
Sweta Potthuri | 654cbc0 | 2017-06-15 10:10:55 -0500 | [diff] [blame] | 599 | |
George Keishing | fafbfdb | 2017-08-30 23:51:23 -0500 | [diff] [blame] | 600 | Run Keyword If '${option}' == 'reboot' |
| 601 | ... Verify Inventory List Before And After Reboot |
| 602 | ... ELSE |
| 603 | ... Verify Inventory List Before And After Reset |
| 604 | |
| 605 | |
| 606 | Verify Inventory List Before And After Reboot |
| 607 | [Documentation] Verify inventory list before and after reboot. |
| 608 | |
George Keishing | da0aa88 | 2017-12-05 06:44:03 -0600 | [diff] [blame] | 609 | REST Power On stack_mode=skip quiet=1 |
George Keishing | fafbfdb | 2017-08-30 23:51:23 -0500 | [diff] [blame] | 610 | Delete Error Logs |
| 611 | ${inventory_before}= Get URL List ${HOST_INVENTORY_URI} |
Sweta Potthuri | 654cbc0 | 2017-06-15 10:10:55 -0500 | [diff] [blame] | 612 | Initiate Host Reboot |
George Keishing | f0680ee | 2017-08-19 15:22:53 -0500 | [diff] [blame] | 613 | Wait Until Keyword Succeeds 10 min 10 sec Is OS Booted |
George Keishing | fafbfdb | 2017-08-30 23:51:23 -0500 | [diff] [blame] | 614 | Delete Error Logs |
| 615 | ${inventory_after}= Get URL List ${HOST_INVENTORY_URI} |
| 616 | Lists Should Be Equal ${inventory_before} ${inventory_after} |
| 617 | |
| 618 | |
| 619 | Verify Inventory List Before And After Reset |
| 620 | [Documentation] Verify inventory list before and after BMC reset. |
| 621 | |
George Keishing | da0aa88 | 2017-12-05 06:44:03 -0600 | [diff] [blame] | 622 | REST Power On stack_mode=skip quiet=1 |
George Keishing | fafbfdb | 2017-08-30 23:51:23 -0500 | [diff] [blame] | 623 | Delete Error Logs |
| 624 | ${inventory_before}= Get URL List ${HOST_INVENTORY_URI} |
| 625 | OBMC Reboot (run) |
| 626 | Delete Error Logs |
| 627 | ${inventory_after}= Get URL List ${HOST_INVENTORY_URI} |
| 628 | Lists Should Be Equal ${inventory_before} ${inventory_after} |
| 629 | |
Sweta Potthuri | 1a640de | 2017-07-18 11:09:59 -0500 | [diff] [blame] | 630 | |
| 631 | Minimum Inventory |
| 632 | [Documentation] Check for minimum inventory. |
| 633 | [Arguments] ${item} ${minimum_count} |
| 634 | |
| 635 | # Description of argument(s): |
| 636 | # item Inventory name (example: "fan/cpu/dimm/etc"). |
| 637 | # minimum_count The minimum number of the given item. |
| 638 | |
| 639 | ${count}= Get Number Hardware Items ${item} |
| 640 | Should Be True ${count}>=${minimum_count} |
| 641 | |
| 642 | Get Number Hardware Items |
| 643 | [Documentation] Get the count of the total present currently on inventory. |
| 644 | [Arguments] ${item} |
| 645 | |
| 646 | # Description of argument(s): |
| 647 | # item Inventory name (example: "fan/cpu/dimm/etc"). |
| 648 | |
| 649 | ${count_inventory} Set Variable ${0} |
| 650 | ${list}= Get Endpoint Paths ${HOST_INVENTORY_URI}/system/ |
| 651 | ... ${item} |
| 652 | |
| 653 | : FOR ${element} IN @{list} |
| 654 | \ ${present}= Read Properties ${element} |
| 655 | \ ${count_inventory}= Set Variable if ${present['Present']} == 1 |
| 656 | \ ... ${count_inventory+1} ${count_inventory} |
| 657 | [return] ${count_inventory} |