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