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 | c8166ed | 2017-02-24 03:53:38 -0600 | [diff] [blame] | 15 | Suite setup Test Suite Setup |
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} |
| 216 | Validate FRU Properties Fields @{fru_list} |
| 217 | |
George Keishing | 071d8da | 2017-03-24 09:13:16 -0500 | [diff] [blame] | 218 | |
| 219 | Verify Core Functional State |
| 220 | [Documentation] Verify that "Present" core property is set if "Functional" |
| 221 | ... core property is set. |
| 222 | [Tags] Verify_Core_Functional_State |
| 223 | # Example: |
| 224 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core5":{ |
| 225 | # "Functional": 1, |
| 226 | # "Present": 1, |
| 227 | # "PrettyName": "" |
| 228 | # }, |
| 229 | ${core_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system core |
| 230 | :FOR ${core_uri} IN @{core_list} |
| 231 | \ ${status}= Run Keyword And Return Status |
| 232 | ... Check URL Property If Functional ${core_uri} |
George Keishing | c565839 | 2017-04-27 23:05:18 -0500 | [diff] [blame] | 233 | \ Continue For Loop If '${status}' == '${False}' |
George Keishing | 071d8da | 2017-03-24 09:13:16 -0500 | [diff] [blame] | 234 | \ ${present}= Read Attribute ${core_uri} Present |
| 235 | \ Should Be True ${present} |
| 236 | ... msg=${core_uri} is functional but not present. |
| 237 | |
| 238 | |
| 239 | Verify DIMM Functional State |
| 240 | [Documentation] Verify that "Present" DIMM property is set if "Functional" |
| 241 | ... DIMM property is set. |
| 242 | [Tags] Verify_DIMM_Functional_State |
| 243 | # Example: |
| 244 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0": { |
| 245 | # "BuildDate": "", |
| 246 | # "Cached": 0, |
| 247 | # "FieldReplaceable": 1, |
| 248 | # "Functional": 1, |
| 249 | # "Manufacturer": "0xce80", |
| 250 | # "Model": "M393A1G40EB1-CRC ", |
| 251 | # "PartNumber": "", |
| 252 | # "Present": 1, |
| 253 | # "PrettyName": "0x0c", |
| 254 | # "SerialNumber": "0x0300cf4f", |
| 255 | # "Version": "0x00" |
| 256 | # }, |
| 257 | |
| 258 | ${dimm_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system dimm |
| 259 | :FOR ${dimm_uri} IN @{dimm_list} |
| 260 | \ ${status}= Run Keyword And Return Status |
| 261 | ... Check URL Property If Functional ${dimm_uri} |
George Keishing | c565839 | 2017-04-27 23:05:18 -0500 | [diff] [blame] | 262 | \ Continue For Loop If '${status}' == '${False}' |
George Keishing | 071d8da | 2017-03-24 09:13:16 -0500 | [diff] [blame] | 263 | \ ${present}= Read Attribute ${dimm_uri} Present |
| 264 | \ Should Be True ${present} |
| 265 | ... msg=${dimm_uri} is functional but not present. |
| 266 | |
George Keishing | 3c205b1 | 2017-05-13 04:09:33 -0500 | [diff] [blame] | 267 | |
| 268 | Verify Fan Functional State |
| 269 | [Documentation] Verify that "Present" fan property is set if "Functional" |
| 270 | ... fan property is set. |
| 271 | [Tags] Verify_Fan_Functional_State |
| 272 | # Example: |
| 273 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan0": { |
| 274 | # "Functional": 1, |
| 275 | # "Present": 1, |
| 276 | # "PrettyName": "fan0" |
| 277 | # }, |
| 278 | |
| 279 | ${fan_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system fan* |
| 280 | Should Not Be Empty ${fan_list} |
| 281 | :FOR ${fan_uri} IN @{fan_list} |
| 282 | \ ${status}= Run Keyword And Return Status |
| 283 | ... Check URL Property If Functional ${fan_uri} |
| 284 | \ Continue For Loop If '${status}' == '${False}' |
| 285 | \ ${present}= Read Attribute ${fan_uri} Present |
| 286 | \ Should Be True ${present} |
| 287 | ... msg=${fan_uri} is functional but "Present" is not set. |
| 288 | |
Sweta Potthuri | 56631f5 | 2017-11-10 02:19:38 -0600 | [diff] [blame] | 289 | Verify CPU Functional State |
| 290 | [Documentation] Verify that "Present" CPU property is set if "Functional" |
| 291 | ... CPU property is set. |
| 292 | [Tags] Verify_CPU_Functional_State |
| 293 | |
| 294 | # Example of cpu* endpoint data: |
| 295 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0": { |
| 296 | # "Functional": 1, |
| 297 | # "Present": 1, |
| 298 | # "PrettyName": "cpu0" |
| 299 | # }, |
| 300 | |
| 301 | ${cpu_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system cpu* |
| 302 | Should Not Be Empty ${cpu_list} |
| 303 | :FOR ${cpu_uri} IN @{cpu_list} |
| 304 | \ ${status}= Run Keyword And Return Status |
| 305 | ... Check URL Property If Functional ${cpu_uri} |
| 306 | \ Continue For Loop If '${status}' == '${False}' |
| 307 | \ ${present}= Read Attribute ${cpu_uri} Present |
| 308 | \ Should Be True ${present} |
| 309 | ... msg=${cpu_uri} is functional but "Present" is not set. |
George Keishing | 3c205b1 | 2017-05-13 04:09:33 -0500 | [diff] [blame] | 310 | |
George Keishing | 53a75f7 | 2017-11-17 12:50:30 -0600 | [diff] [blame] | 311 | |
| 312 | Verify GPU Functional State |
| 313 | [Documentation] Verify that "Functional" GPU property is set if "Present" |
| 314 | ... GPU property is set |
| 315 | [Tags] Verify_GPU_Functional_State |
| 316 | |
| 317 | # Example of gv* endpoint data: |
| 318 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card4": { |
| 319 | # "Functional": 1, |
| 320 | # "Present": 1, |
| 321 | # "PrettyName": "" |
| 322 | # }, |
| 323 | |
| 324 | |
George Keishing | c7b161b | 2017-12-01 09:58:12 -0600 | [diff] [blame] | 325 | ${gpu_list}= Get Endpoint Paths |
| 326 | ... ${HOST_INVENTORY_URI}system/chassis/motherboard gv* |
George Keishing | 53a75f7 | 2017-11-17 12:50:30 -0600 | [diff] [blame] | 327 | Should Not Be Empty ${gpu_list} |
| 328 | :FOR ${gpu_uri} IN @{gpu_list} |
| 329 | \ ${status}= Run Keyword And Return Status |
| 330 | ... Check URL Property If Functional ${gpu_uri} |
| 331 | \ Continue For Loop If '${status}' == '${False}' |
| 332 | \ ${present}= Read Attribute ${gpu_uri} Present |
| 333 | \ Should Be True ${present} |
| 334 | ... msg=${gpu_uri} is functional but "Present" is not set. |
| 335 | |
| 336 | |
George Keishing | 04c6b2c | 2017-06-15 12:33:59 -0500 | [diff] [blame] | 337 | Check Air Or Water Cooled |
| 338 | [Documentation] Check if this system is Air or water cooled. |
| 339 | [Tags] Check_Air_Or_Water_Cooled |
| 340 | # Example: |
| 341 | # "/xyz/openbmc_project/inventory/system/chassis": { |
| 342 | # "AirCooled": 1, |
| 343 | # "WaterCooled": 0 |
| 344 | # }, |
| 345 | |
| 346 | ${air_cooled}= Read Attribute |
| 347 | ... /xyz/openbmc_project/inventory/system/chassis AirCooled |
| 348 | Log AirCooled:${air_cooled} |
| 349 | |
| 350 | ${water_cooled}= Read Attribute |
| 351 | ... /xyz/openbmc_project/inventory/system/chassis WaterCooled |
| 352 | Log WaterCooled:${water_cooled} |
| 353 | |
| 354 | Run Keyword If ${air_cooled}==${0} and ${water_cooled}==${0} |
| 355 | ... Fail Neither AirCooled or WaterCooled. |
| 356 | |
Sweta Potthuri | 1a640de | 2017-07-18 11:09:59 -0500 | [diff] [blame] | 357 | Verify Minimal CPU Inventory |
| 358 | [Documentation] Verify minimal CPU inventory. |
| 359 | [Tags] Verify_Minimal_CPU_Inventory |
| 360 | |
| 361 | # item minimum_count |
| 362 | cpu 1 |
| 363 | [Template] Minimum Inventory |
| 364 | |
| 365 | Verify Minimal DIMM Inventory |
| 366 | [Documentation] Verify minimal DIMM inventory. |
| 367 | [Tags] Verify_Minimal_DIMM_Inventory |
| 368 | |
| 369 | # item minimum_count |
| 370 | dimm 2 |
| 371 | [Template] Minimum Inventory |
| 372 | |
| 373 | Verify Minimal Core Inventory |
| 374 | [Documentation] Verify minimal core inventory. |
| 375 | [Tags] Verify_Minimal_Core_Inventory |
| 376 | |
| 377 | # item minimum_count |
| 378 | core 1 |
| 379 | [Template] Minimum Inventory |
| 380 | |
| 381 | Verify Minimal Memory Buffer Inventory |
| 382 | [Documentation] Verify minimal memory buffer inventory. |
| 383 | [Tags] Verify_Minimal_Memory_Buffer_Inventory |
| 384 | |
| 385 | # item minimum_count |
| 386 | memory_buffer 1 |
| 387 | [Template] Minimum Inventory |
| 388 | |
| 389 | Verify Minimal Fan Inventory |
| 390 | [Documentation] Verify minimal fan inventory. |
| 391 | [Tags] Verify_Minimal_Fan_Inventory |
| 392 | |
| 393 | # item minimum_count |
| 394 | fan 2 |
| 395 | [Template] Minimum Inventory |
| 396 | |
| 397 | Verify Minimal Main Planar Inventory |
| 398 | [Documentation] Verify minimal main planar inventory. |
| 399 | [Tags] Verify_Minimal_Main_Planar_Inventory |
| 400 | |
| 401 | # item minimum_count |
| 402 | main_planar 1 |
| 403 | [Template] Minimum Inventory |
| 404 | |
| 405 | Verify Minimal System Inventory |
| 406 | [Documentation] Verify minimal system inventory. |
| 407 | [Tags] Verify_Minimal_System_Inventory |
| 408 | |
| 409 | # item minimum_count |
| 410 | system 1 |
| 411 | [Template] Minimum Inventory |
George Keishing | 04c6b2c | 2017-06-15 12:33:59 -0500 | [diff] [blame] | 412 | |
George Keishing | 03ebc29 | 2017-08-02 01:22:02 -0500 | [diff] [blame] | 413 | Verify Minimal Power Supply Inventory |
| 414 | [Documentation] Verify minimal power supply inventory. |
| 415 | [Tags] Verify_Minimal_Power_Supply_Inventory |
| 416 | # Example: |
George Keishing | 1b71f22 | 2017-11-23 14:02:49 -0600 | [diff] [blame] | 417 | # "/xyz/openbmc_project/inventory/system/chassis/powersupply0", |
| 418 | # "/xyz/openbmc_project/inventory/system/chassis/powersupply1", |
George Keishing | 03ebc29 | 2017-08-02 01:22:02 -0500 | [diff] [blame] | 419 | |
| 420 | # item minimum_count |
George Keishing | 1b71f22 | 2017-11-23 14:02:49 -0600 | [diff] [blame] | 421 | powersupply 1 |
George Keishing | 03ebc29 | 2017-08-02 01:22:02 -0500 | [diff] [blame] | 422 | [Template] Minimum Inventory |
| 423 | |
George Keishing | fafbfdb | 2017-08-30 23:51:23 -0500 | [diff] [blame] | 424 | |
| 425 | Verify Inventory List After Reboot |
| 426 | [Documentation] Verify inventory list after reboot. |
| 427 | [Tags] Verify_Inventory_List_After_Reboot |
| 428 | |
| 429 | Repeat Keyword ${LOOP_COUNT} times Choose Boot Option reboot |
| 430 | |
| 431 | |
| 432 | Verify Inventory List After Reset |
| 433 | [Documentation] Verify inventory list after reset. |
| 434 | [Tags] Verify_Inventory_List_After_Reset |
| 435 | |
| 436 | Repeat Keyword ${LOOP_COUNT} times Choose Boot Option reset |
| 437 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 438 | *** Keywords *** |
| 439 | |
George Keishing | c8166ed | 2017-02-24 03:53:38 -0600 | [diff] [blame] | 440 | Test Suite Setup |
| 441 | [Documentation] Do the initial suite setup. |
George Keishing | 25577a2 | 2017-07-12 05:18:46 -0500 | [diff] [blame] | 442 | |
Sweta Potthuri | af741cb | 2017-07-04 09:41:17 -0500 | [diff] [blame] | 443 | # Boot Host. |
| 444 | REST Power On |
George Keishing | caac9f3 | 2017-03-09 02:14:27 -0600 | [diff] [blame] | 445 | |
George Keishing | c8166ed | 2017-02-24 03:53:38 -0600 | [diff] [blame] | 446 | Get Inventory |
| 447 | [Documentation] Get the properties of an endpoint. |
| 448 | [Arguments] ${endpoint} |
| 449 | # Description of arguments: |
| 450 | # endpoint string for which url path ending. |
| 451 | # Example: "system" is the endpoint for url |
| 452 | # /xyz/openbmc_project/inventory/system |
| 453 | ${resp}= OpenBMC Get Request ${HOST_INVENTORY_URI}${endpoint} |
| 454 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 455 | ${jsondata}= To JSON ${resp.content} |
| 456 | [Return] ${jsondata} |
George Keishing | efa9735 | 2017-03-13 07:13:03 -0500 | [diff] [blame] | 457 | |
| 458 | |
| 459 | Qualified FRU List |
| 460 | [Documentation] Build the list of valid FRUs. |
| 461 | [Arguments] @{system_list} |
| 462 | # Description of arguments: |
| 463 | # system_list List of system inventory URLs. |
| 464 | # Example: |
| 465 | # /xyz/openbmc_project/inventory/system/chassis/motherboard |
| 466 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0 |
| 467 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1 |
| 468 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0 |
| 469 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm1 |
| 470 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm2 |
| 471 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm3 |
| 472 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm4 |
| 473 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm5 |
| 474 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm6 |
| 475 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm7 |
| 476 | |
| 477 | ${fru_list}= Create List |
| 478 | :FOR ${fru_uri} IN @{system_list} |
George Keishing | df5ab12 | 2017-04-17 04:01:11 -0500 | [diff] [blame] | 479 | \ ${resp}= OpenBMC Get Request ${fru_uri}/attr/FieldReplaceable |
| 480 | \ ${jsondata}= To JSON ${resp.content} |
| 481 | \ ${status}= Run Keyword And Return Status |
| 482 | ... Should Be True ${jsondata['data']} == ${1} |
George Keishing | efa9735 | 2017-03-13 07:13:03 -0500 | [diff] [blame] | 483 | \ Run Keyword If '${status}' == '${True}' |
| 484 | ... Append To List ${fru_list} ${fru_uri} |
| 485 | |
| 486 | [Return] ${fru_list} |
| 487 | |
| 488 | |
| 489 | Validate FRU Properties Fields |
| 490 | [Documentation] Compare valid FRUs from system vs expected FRU set. |
| 491 | [Arguments] @{fru_list} |
| 492 | # Description of arguments: |
| 493 | # fru_list List of qualified FRU URLs. |
| 494 | |
| 495 | # Build the pre-defined set list from data/inventory.py derived from |
| 496 | # a group of YAML files. |
| 497 | # Example: |
| 498 | # set(['Version', 'PartNumber', 'SerialNumber', 'FieldReplaceable', |
| 499 | # 'BuildDate', 'Present', 'Manufacturer', 'PrettyName', 'Cached', 'Model']) |
| 500 | ${fru_set}= List To Set ${inventory_dict['fru']} |
| 501 | |
| 502 | # Iterate through the FRU's url and compare the set dictionary keys |
| 503 | # with the pre-define inventory data. |
| 504 | :FOR ${fru_url_path} IN @{fru_list} |
| 505 | \ ${fru_field}= Read Properties ${fru_url_path} |
| 506 | # ------------------------------------------------------------ |
| 507 | # ${fru_field.viewkeys()} extracts the list of keys from the |
| 508 | # JSON dictionary as a set. |
| 509 | # ------------------------------------------------------------ |
| 510 | \ Should Be Equal ${fru_field.viewkeys()} ${fru_set} |
| 511 | |
George Keishing | 071d8da | 2017-03-24 09:13:16 -0500 | [diff] [blame] | 512 | |
| 513 | Check URL Property If Functional |
| 514 | [Arguments] ${url_path} |
| 515 | # Description of arguments: |
| 516 | # url_path Full url path of the inventory object. |
| 517 | # Example: DIMM / core property url's |
| 518 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0 |
| 519 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core0 |
| 520 | ${state}= Read Attribute ${url_path} Functional |
| 521 | Should Be True ${state} |
Sweta Potthuri | 654cbc0 | 2017-06-15 10:10:55 -0500 | [diff] [blame] | 522 | |
George Keishing | fafbfdb | 2017-08-30 23:51:23 -0500 | [diff] [blame] | 523 | Choose Boot Option |
| 524 | [Documentation] Choose BMC reset or host reboot. |
| 525 | [Arguments] ${option} |
Sweta Potthuri | 654cbc0 | 2017-06-15 10:10:55 -0500 | [diff] [blame] | 526 | |
George Keishing | fafbfdb | 2017-08-30 23:51:23 -0500 | [diff] [blame] | 527 | Run Keyword If '${option}' == 'reboot' |
| 528 | ... Verify Inventory List Before And After Reboot |
| 529 | ... ELSE |
| 530 | ... Verify Inventory List Before And After Reset |
| 531 | |
| 532 | |
| 533 | Verify Inventory List Before And After Reboot |
| 534 | [Documentation] Verify inventory list before and after reboot. |
| 535 | |
| 536 | REST Power On |
| 537 | Delete Error Logs |
| 538 | ${inventory_before}= Get URL List ${HOST_INVENTORY_URI} |
Sweta Potthuri | 654cbc0 | 2017-06-15 10:10:55 -0500 | [diff] [blame] | 539 | Initiate Host Reboot |
George Keishing | f0680ee | 2017-08-19 15:22:53 -0500 | [diff] [blame] | 540 | Wait Until Keyword Succeeds 10 min 10 sec Is OS Booted |
George Keishing | fafbfdb | 2017-08-30 23:51:23 -0500 | [diff] [blame] | 541 | Delete Error Logs |
| 542 | ${inventory_after}= Get URL List ${HOST_INVENTORY_URI} |
| 543 | Lists Should Be Equal ${inventory_before} ${inventory_after} |
| 544 | |
| 545 | |
| 546 | Verify Inventory List Before And After Reset |
| 547 | [Documentation] Verify inventory list before and after BMC reset. |
| 548 | |
| 549 | REST Power On |
| 550 | Delete Error Logs |
| 551 | ${inventory_before}= Get URL List ${HOST_INVENTORY_URI} |
| 552 | OBMC Reboot (run) |
| 553 | Delete Error Logs |
| 554 | ${inventory_after}= Get URL List ${HOST_INVENTORY_URI} |
| 555 | Lists Should Be Equal ${inventory_before} ${inventory_after} |
| 556 | |
Sweta Potthuri | 1a640de | 2017-07-18 11:09:59 -0500 | [diff] [blame] | 557 | |
| 558 | Minimum Inventory |
| 559 | [Documentation] Check for minimum inventory. |
| 560 | [Arguments] ${item} ${minimum_count} |
| 561 | |
| 562 | # Description of argument(s): |
| 563 | # item Inventory name (example: "fan/cpu/dimm/etc"). |
| 564 | # minimum_count The minimum number of the given item. |
| 565 | |
| 566 | ${count}= Get Number Hardware Items ${item} |
| 567 | Should Be True ${count}>=${minimum_count} |
| 568 | |
| 569 | Get Number Hardware Items |
| 570 | [Documentation] Get the count of the total present currently on inventory. |
| 571 | [Arguments] ${item} |
| 572 | |
| 573 | # Description of argument(s): |
| 574 | # item Inventory name (example: "fan/cpu/dimm/etc"). |
| 575 | |
| 576 | ${count_inventory} Set Variable ${0} |
| 577 | ${list}= Get Endpoint Paths ${HOST_INVENTORY_URI}/system/ |
| 578 | ... ${item} |
| 579 | |
| 580 | : FOR ${element} IN @{list} |
| 581 | \ ${present}= Read Properties ${element} |
| 582 | \ ${count_inventory}= Set Variable if ${present['Present']} == 1 |
| 583 | \ ... ${count_inventory+1} ${count_inventory} |
| 584 | [return] ${count_inventory} |