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