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