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, |
George Keishing | e0a8128 | 2018-06-08 10:02:30 -0500 | [diff] [blame] | 43 | # "Manufacturer": "<Manufacturer Name>", |
George Keishing | 3d73431 | 2017-07-24 04:10:25 -0500 | [diff] [blame] | 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, |
George Keishing | e0a8128 | 2018-06-08 10:02:30 -0500 | [diff] [blame] | 65 | # "Manufacturer": "<Manufacturer Name>", |
George Keishing | e4e1d27 | 2017-11-24 06:05:21 -0600 | [diff] [blame] | 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, |
George Keishing | e0a8128 | 2018-06-08 10:02:30 -0500 | [diff] [blame] | 149 | # "Manufacturer": "<Manufacturer Name>" |
George Keishing | ae35530 | 2017-03-13 04:34:58 -0500 | [diff] [blame] | 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":[ |
George Keishing | 0219da6 | 2018-03-26 03:24:40 -0500 | [diff] [blame] | 227 | # "FieldReplaceable", |
George Keishing | da0aa88 | 2017-12-05 06:44:03 -0600 | [diff] [blame] | 228 | # "PrettyName", |
| 229 | # "Present", |
| 230 | # "Functional" |
| 231 | # ] |
| 232 | # GPU inventory: |
| 233 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card2": { |
George Keishing | 0219da6 | 2018-03-26 03:24:40 -0500 | [diff] [blame] | 234 | # "FieldReplaceable": 1, |
George Keishing | da0aa88 | 2017-12-05 06:44:03 -0600 | [diff] [blame] | 235 | # "Functional": 1, |
| 236 | # "Present": 1, |
| 237 | # "PrettyName": "" |
| 238 | # }, |
| 239 | |
| 240 | |
| 241 | ${system_list}= Get Endpoint Paths |
| 242 | ... ${HOST_INVENTORY_URI}system/chassis/motherboard gv* |
| 243 | Validate FRU Properties Fields gpu @{system_list} |
| 244 | |
| 245 | |
| 246 | Verify Core Properties |
| 247 | [Documentation] Verify the core property fields. |
| 248 | [Tags] Verify_Core_Properties |
| 249 | # Example: |
| 250 | # A core property should have the following entries: |
| 251 | # "core":[ |
| 252 | # "PrettyName", |
| 253 | # "Present", |
| 254 | # "Functional" |
| 255 | # ] |
| 256 | # core inventory: |
| 257 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core0": { |
| 258 | # "Functional": 1, |
| 259 | # "Present": 1, |
| 260 | # "PrettyName": "" |
| 261 | # }, |
| 262 | |
| 263 | ${system_list}= Get Endpoint Paths |
| 264 | ... ${HOST_INVENTORY_URI}system/chassis/motherboard core* |
| 265 | Validate FRU Properties Fields core @{system_list} |
| 266 | |
George Keishing | efa9735 | 2017-03-13 07:13:03 -0500 | [diff] [blame] | 267 | |
George Keishing | ca8c61b | 2017-12-11 11:48:00 -0600 | [diff] [blame] | 268 | Verify Fan Properties |
| 269 | [Documentation] Verify the fan property fields. |
| 270 | [Tags] Verify_Fan_Properties |
| 271 | # Example: |
| 272 | # A fan property should have the following entries: |
| 273 | # "core":[ |
| 274 | # "PrettyName", |
| 275 | # "Present", |
| 276 | # "MeetsMinimumShipLevel", |
| 277 | # "Functional" |
| 278 | # ] |
| 279 | # fan inventory: |
| 280 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan0": { |
| 281 | # "Functional": 1, |
| 282 | # "MeetsMinimumShipLevel": 1, |
| 283 | # "Present": 1, |
| 284 | # "PrettyName": "fan0" |
| 285 | # }, |
| 286 | |
| 287 | ${system_list}= Get Endpoint Paths |
| 288 | ... ${HOST_INVENTORY_URI}system/chassis/motherboard fan* |
| 289 | Validate FRU Properties Fields fan @{system_list} |
| 290 | |
George Keishing | 071d8da | 2017-03-24 09:13:16 -0500 | [diff] [blame] | 291 | |
| 292 | Verify Core Functional State |
| 293 | [Documentation] Verify that "Present" core property is set if "Functional" |
| 294 | ... core property is set. |
| 295 | [Tags] Verify_Core_Functional_State |
| 296 | # Example: |
| 297 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core5":{ |
| 298 | # "Functional": 1, |
| 299 | # "Present": 1, |
| 300 | # "PrettyName": "" |
| 301 | # }, |
| 302 | ${core_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system core |
| 303 | :FOR ${core_uri} IN @{core_list} |
| 304 | \ ${status}= Run Keyword And Return Status |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 305 | ... Check URL Property Is Functional ${core_uri} |
George Keishing | c565839 | 2017-04-27 23:05:18 -0500 | [diff] [blame] | 306 | \ Continue For Loop If '${status}' == '${False}' |
George Keishing | 071d8da | 2017-03-24 09:13:16 -0500 | [diff] [blame] | 307 | \ ${present}= Read Attribute ${core_uri} Present |
| 308 | \ Should Be True ${present} |
| 309 | ... msg=${core_uri} is functional but not present. |
| 310 | |
| 311 | |
| 312 | Verify DIMM Functional State |
| 313 | [Documentation] Verify that "Present" DIMM property is set if "Functional" |
| 314 | ... DIMM property is set. |
| 315 | [Tags] Verify_DIMM_Functional_State |
| 316 | # Example: |
| 317 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0": { |
| 318 | # "BuildDate": "", |
| 319 | # "Cached": 0, |
| 320 | # "FieldReplaceable": 1, |
| 321 | # "Functional": 1, |
| 322 | # "Manufacturer": "0xce80", |
| 323 | # "Model": "M393A1G40EB1-CRC ", |
| 324 | # "PartNumber": "", |
| 325 | # "Present": 1, |
| 326 | # "PrettyName": "0x0c", |
| 327 | # "SerialNumber": "0x0300cf4f", |
| 328 | # "Version": "0x00" |
| 329 | # }, |
| 330 | |
| 331 | ${dimm_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system dimm |
| 332 | :FOR ${dimm_uri} IN @{dimm_list} |
| 333 | \ ${status}= Run Keyword And Return Status |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 334 | ... Check URL Property Is Functional ${dimm_uri} |
George Keishing | c565839 | 2017-04-27 23:05:18 -0500 | [diff] [blame] | 335 | \ Continue For Loop If '${status}' == '${False}' |
George Keishing | 071d8da | 2017-03-24 09:13:16 -0500 | [diff] [blame] | 336 | \ ${present}= Read Attribute ${dimm_uri} Present |
| 337 | \ Should Be True ${present} |
| 338 | ... msg=${dimm_uri} is functional but not present. |
| 339 | |
George Keishing | 3c205b1 | 2017-05-13 04:09:33 -0500 | [diff] [blame] | 340 | |
| 341 | Verify Fan Functional State |
| 342 | [Documentation] Verify that "Present" fan property is set if "Functional" |
| 343 | ... fan property is set. |
| 344 | [Tags] Verify_Fan_Functional_State |
| 345 | # Example: |
| 346 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan0": { |
| 347 | # "Functional": 1, |
| 348 | # "Present": 1, |
| 349 | # "PrettyName": "fan0" |
| 350 | # }, |
| 351 | |
| 352 | ${fan_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system fan* |
| 353 | Should Not Be Empty ${fan_list} |
| 354 | :FOR ${fan_uri} IN @{fan_list} |
| 355 | \ ${status}= Run Keyword And Return Status |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 356 | ... Check URL Property Is Functional ${fan_uri} |
George Keishing | 3c205b1 | 2017-05-13 04:09:33 -0500 | [diff] [blame] | 357 | \ Continue For Loop If '${status}' == '${False}' |
| 358 | \ ${present}= Read Attribute ${fan_uri} Present |
| 359 | \ Should Be True ${present} |
| 360 | ... msg=${fan_uri} is functional but "Present" is not set. |
| 361 | |
Sweta Potthuri | 56631f5 | 2017-11-10 02:19:38 -0600 | [diff] [blame] | 362 | Verify CPU Functional State |
| 363 | [Documentation] Verify that "Present" CPU property is set if "Functional" |
| 364 | ... CPU property is set. |
| 365 | [Tags] Verify_CPU_Functional_State |
| 366 | |
| 367 | # Example of cpu* endpoint data: |
| 368 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0": { |
| 369 | # "Functional": 1, |
| 370 | # "Present": 1, |
| 371 | # "PrettyName": "cpu0" |
| 372 | # }, |
| 373 | |
| 374 | ${cpu_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system cpu* |
| 375 | Should Not Be Empty ${cpu_list} |
| 376 | :FOR ${cpu_uri} IN @{cpu_list} |
| 377 | \ ${status}= Run Keyword And Return Status |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 378 | ... Check URL Property Is Functional ${cpu_uri} |
Sweta Potthuri | 56631f5 | 2017-11-10 02:19:38 -0600 | [diff] [blame] | 379 | \ Continue For Loop If '${status}' == '${False}' |
| 380 | \ ${present}= Read Attribute ${cpu_uri} Present |
| 381 | \ Should Be True ${present} |
| 382 | ... msg=${cpu_uri} is functional but "Present" is not set. |
George Keishing | 3c205b1 | 2017-05-13 04:09:33 -0500 | [diff] [blame] | 383 | |
George Keishing | 53a75f7 | 2017-11-17 12:50:30 -0600 | [diff] [blame] | 384 | |
| 385 | Verify GPU Functional State |
| 386 | [Documentation] Verify that "Functional" GPU property is set if "Present" |
| 387 | ... GPU property is set |
| 388 | [Tags] Verify_GPU_Functional_State |
| 389 | |
| 390 | # Example of gv* endpoint data: |
| 391 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card4": { |
| 392 | # "Functional": 1, |
| 393 | # "Present": 1, |
| 394 | # "PrettyName": "" |
| 395 | # }, |
| 396 | |
| 397 | |
George Keishing | c7b161b | 2017-12-01 09:58:12 -0600 | [diff] [blame] | 398 | ${gpu_list}= Get Endpoint Paths |
| 399 | ... ${HOST_INVENTORY_URI}system/chassis/motherboard gv* |
George Keishing | 53a75f7 | 2017-11-17 12:50:30 -0600 | [diff] [blame] | 400 | Should Not Be Empty ${gpu_list} |
| 401 | :FOR ${gpu_uri} IN @{gpu_list} |
| 402 | \ ${status}= Run Keyword And Return Status |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 403 | ... Check URL Property Is Functional ${gpu_uri} |
George Keishing | 53a75f7 | 2017-11-17 12:50:30 -0600 | [diff] [blame] | 404 | \ Continue For Loop If '${status}' == '${False}' |
| 405 | \ ${present}= Read Attribute ${gpu_uri} Present |
| 406 | \ Should Be True ${present} |
| 407 | ... msg=${gpu_uri} is functional but "Present" is not set. |
| 408 | |
| 409 | |
George Keishing | 04c6b2c | 2017-06-15 12:33:59 -0500 | [diff] [blame] | 410 | Check Air Or Water Cooled |
| 411 | [Documentation] Check if this system is Air or water cooled. |
| 412 | [Tags] Check_Air_Or_Water_Cooled |
| 413 | # Example: |
| 414 | # "/xyz/openbmc_project/inventory/system/chassis": { |
| 415 | # "AirCooled": 1, |
| 416 | # "WaterCooled": 0 |
| 417 | # }, |
| 418 | |
| 419 | ${air_cooled}= Read Attribute |
| 420 | ... /xyz/openbmc_project/inventory/system/chassis AirCooled |
| 421 | Log AirCooled:${air_cooled} |
| 422 | |
| 423 | ${water_cooled}= Read Attribute |
| 424 | ... /xyz/openbmc_project/inventory/system/chassis WaterCooled |
| 425 | Log WaterCooled:${water_cooled} |
| 426 | |
| 427 | Run Keyword If ${air_cooled}==${0} and ${water_cooled}==${0} |
| 428 | ... Fail Neither AirCooled or WaterCooled. |
| 429 | |
Sweta Potthuri | 1a640de | 2017-07-18 11:09:59 -0500 | [diff] [blame] | 430 | Verify Minimal CPU Inventory |
| 431 | [Documentation] Verify minimal CPU inventory. |
| 432 | [Tags] Verify_Minimal_CPU_Inventory |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 433 | [Template] Minimum Inventory |
Sweta Potthuri | 1a640de | 2017-07-18 11:09:59 -0500 | [diff] [blame] | 434 | |
| 435 | # item minimum_count |
| 436 | cpu 1 |
Sweta Potthuri | 1a640de | 2017-07-18 11:09:59 -0500 | [diff] [blame] | 437 | |
| 438 | Verify Minimal DIMM Inventory |
| 439 | [Documentation] Verify minimal DIMM inventory. |
| 440 | [Tags] Verify_Minimal_DIMM_Inventory |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 441 | [Template] Minimum Inventory |
Sweta Potthuri | 1a640de | 2017-07-18 11:09:59 -0500 | [diff] [blame] | 442 | |
| 443 | # item minimum_count |
| 444 | dimm 2 |
Sweta Potthuri | 1a640de | 2017-07-18 11:09:59 -0500 | [diff] [blame] | 445 | |
| 446 | Verify Minimal Core Inventory |
| 447 | [Documentation] Verify minimal core inventory. |
| 448 | [Tags] Verify_Minimal_Core_Inventory |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 449 | [Template] Minimum Inventory |
Sweta Potthuri | 1a640de | 2017-07-18 11:09:59 -0500 | [diff] [blame] | 450 | |
| 451 | # item minimum_count |
| 452 | core 1 |
Sweta Potthuri | 1a640de | 2017-07-18 11:09:59 -0500 | [diff] [blame] | 453 | |
| 454 | Verify Minimal Memory Buffer Inventory |
| 455 | [Documentation] Verify minimal memory buffer inventory. |
| 456 | [Tags] Verify_Minimal_Memory_Buffer_Inventory |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 457 | [Template] Minimum Inventory |
Sweta Potthuri | 1a640de | 2017-07-18 11:09:59 -0500 | [diff] [blame] | 458 | |
| 459 | # item minimum_count |
| 460 | memory_buffer 1 |
Sweta Potthuri | 1a640de | 2017-07-18 11:09:59 -0500 | [diff] [blame] | 461 | |
| 462 | Verify Minimal Fan Inventory |
| 463 | [Documentation] Verify minimal fan inventory. |
| 464 | [Tags] Verify_Minimal_Fan_Inventory |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 465 | [Template] Minimum Inventory |
Sweta Potthuri | 1a640de | 2017-07-18 11:09:59 -0500 | [diff] [blame] | 466 | |
| 467 | # item minimum_count |
| 468 | fan 2 |
Sweta Potthuri | 1a640de | 2017-07-18 11:09:59 -0500 | [diff] [blame] | 469 | |
| 470 | Verify Minimal Main Planar Inventory |
| 471 | [Documentation] Verify minimal main planar inventory. |
| 472 | [Tags] Verify_Minimal_Main_Planar_Inventory |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 473 | [Template] Minimum Inventory |
Sweta Potthuri | 1a640de | 2017-07-18 11:09:59 -0500 | [diff] [blame] | 474 | |
| 475 | # item minimum_count |
| 476 | main_planar 1 |
Sweta Potthuri | 1a640de | 2017-07-18 11:09:59 -0500 | [diff] [blame] | 477 | |
| 478 | Verify Minimal System Inventory |
| 479 | [Documentation] Verify minimal system inventory. |
| 480 | [Tags] Verify_Minimal_System_Inventory |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 481 | [Template] Minimum Inventory |
Sweta Potthuri | 1a640de | 2017-07-18 11:09:59 -0500 | [diff] [blame] | 482 | |
| 483 | # item minimum_count |
| 484 | system 1 |
George Keishing | 04c6b2c | 2017-06-15 12:33:59 -0500 | [diff] [blame] | 485 | |
George Keishing | 03ebc29 | 2017-08-02 01:22:02 -0500 | [diff] [blame] | 486 | Verify Minimal Power Supply Inventory |
| 487 | [Documentation] Verify minimal power supply inventory. |
| 488 | [Tags] Verify_Minimal_Power_Supply_Inventory |
George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 489 | [Template] Minimum Inventory |
George Keishing | 03ebc29 | 2017-08-02 01:22:02 -0500 | [diff] [blame] | 490 | # Example: |
Matt Spinler | 6a1e5ed | 2018-02-14 09:05:07 -0600 | [diff] [blame] | 491 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0", |
| 492 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1", |
George Keishing | 03ebc29 | 2017-08-02 01:22:02 -0500 | [diff] [blame] | 493 | |
| 494 | # item minimum_count |
George Keishing | 1b71f22 | 2017-11-23 14:02:49 -0600 | [diff] [blame] | 495 | powersupply 1 |
George Keishing | 03ebc29 | 2017-08-02 01:22:02 -0500 | [diff] [blame] | 496 | |
George Keishing | fafbfdb | 2017-08-30 23:51:23 -0500 | [diff] [blame] | 497 | |
| 498 | Verify Inventory List After Reboot |
| 499 | [Documentation] Verify inventory list after reboot. |
| 500 | [Tags] Verify_Inventory_List_After_Reboot |
| 501 | |
| 502 | Repeat Keyword ${LOOP_COUNT} times Choose Boot Option reboot |
| 503 | |
| 504 | |
| 505 | Verify Inventory List After Reset |
| 506 | [Documentation] Verify inventory list after reset. |
| 507 | [Tags] Verify_Inventory_List_After_Reset |
| 508 | |
| 509 | Repeat Keyword ${LOOP_COUNT} times Choose Boot Option reset |
| 510 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 511 | *** Keywords *** |
| 512 | |
George Keishing | da0aa88 | 2017-12-05 06:44:03 -0600 | [diff] [blame] | 513 | Suite Setup Execution |
George Keishing | c8166ed | 2017-02-24 03:53:38 -0600 | [diff] [blame] | 514 | [Documentation] Do the initial suite setup. |
George Keishing | 25577a2 | 2017-07-12 05:18:46 -0500 | [diff] [blame] | 515 | |
George Keishing | 4f5260b | 2017-12-14 12:28:31 -0600 | [diff] [blame] | 516 | Smart Power Off |
| 517 | REST Power On |
George Keishing | 8b13fd2 | 2018-07-20 12:28:52 -0500 | [diff] [blame] | 518 | Delete All Error Logs |
George Keishing | caac9f3 | 2017-03-09 02:14:27 -0600 | [diff] [blame] | 519 | |
George Keishing | c8166ed | 2017-02-24 03:53:38 -0600 | [diff] [blame] | 520 | Get Inventory |
| 521 | [Documentation] Get the properties of an endpoint. |
| 522 | [Arguments] ${endpoint} |
| 523 | # Description of arguments: |
| 524 | # endpoint string for which url path ending. |
| 525 | # Example: "system" is the endpoint for url |
| 526 | # /xyz/openbmc_project/inventory/system |
| 527 | ${resp}= OpenBMC Get Request ${HOST_INVENTORY_URI}${endpoint} |
| 528 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 529 | ${jsondata}= To JSON ${resp.content} |
| 530 | [Return] ${jsondata} |
George Keishing | efa9735 | 2017-03-13 07:13:03 -0500 | [diff] [blame] | 531 | |
| 532 | |
| 533 | Qualified FRU List |
| 534 | [Documentation] Build the list of valid FRUs. |
| 535 | [Arguments] @{system_list} |
| 536 | # Description of arguments: |
| 537 | # system_list List of system inventory URLs. |
| 538 | # Example: |
| 539 | # /xyz/openbmc_project/inventory/system/chassis/motherboard |
| 540 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0 |
| 541 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1 |
| 542 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0 |
| 543 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm1 |
| 544 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm2 |
| 545 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm3 |
| 546 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm4 |
| 547 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm5 |
| 548 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm6 |
| 549 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm7 |
| 550 | |
| 551 | ${fru_list}= Create List |
| 552 | :FOR ${fru_uri} IN @{system_list} |
George Keishing | df5ab12 | 2017-04-17 04:01:11 -0500 | [diff] [blame] | 553 | \ ${resp}= OpenBMC Get Request ${fru_uri}/attr/FieldReplaceable |
George Keishing | da0aa88 | 2017-12-05 06:44:03 -0600 | [diff] [blame] | 554 | ... quiet=${1} |
George Keishing | df5ab12 | 2017-04-17 04:01:11 -0500 | [diff] [blame] | 555 | \ ${jsondata}= To JSON ${resp.content} |
| 556 | \ ${status}= Run Keyword And Return Status |
| 557 | ... Should Be True ${jsondata['data']} == ${1} |
George Keishing | efa9735 | 2017-03-13 07:13:03 -0500 | [diff] [blame] | 558 | \ Run Keyword If '${status}' == '${True}' |
| 559 | ... Append To List ${fru_list} ${fru_uri} |
| 560 | |
George Keishing | 8c9efed | 2018-02-28 10:45:26 -0600 | [diff] [blame] | 561 | ${fru_valid_list}= Filter GPU FRU Entries ${fru_list} |
| 562 | |
| 563 | [Return] ${fru_valid_list} |
| 564 | |
| 565 | |
| 566 | Filter GPU FRU Entries |
| 567 | [Documentation] Remove GPU entries from FRU list and return the result. |
| 568 | [Arguments] ${fru_list} |
| 569 | |
| 570 | # Description of arguments: |
| 571 | # fru_list List of FRU system inventory URIs. |
| 572 | # Example FRUs list: |
| 573 | # [u'/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0', |
| 574 | # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1', |
| 575 | # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0', |
| 576 | # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm1', |
| 577 | # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card0', |
| 578 | # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card1', |
| 579 | # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card3', |
| 580 | # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card4'] |
| 581 | |
| 582 | # Example of the matched GPU FRUs entries: |
| 583 | # [u'/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card0', |
| 584 | # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card1', |
| 585 | # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card3', |
| 586 | # u'/xyz/openbmc_project/inventory/system/chassis/motherboard/gv100card4'] |
| 587 | |
| 588 | ${gpu_matches}= Get Matches ${fru_list} *gv* |
| 589 | |
| 590 | Remove Values From List ${fru_list} @{gpu_matches} |
George Keishing | efa9735 | 2017-03-13 07:13:03 -0500 | [diff] [blame] | 591 | [Return] ${fru_list} |
| 592 | |
| 593 | |
| 594 | Validate FRU Properties Fields |
| 595 | [Documentation] Compare valid FRUs from system vs expected FRU set. |
George Keishing | da0aa88 | 2017-12-05 06:44:03 -0600 | [diff] [blame] | 596 | [Arguments] ${fru_type} @{fru_list} |
| 597 | |
George Keishing | efa9735 | 2017-03-13 07:13:03 -0500 | [diff] [blame] | 598 | # Description of arguments: |
George Keishing | da0aa88 | 2017-12-05 06:44:03 -0600 | [diff] [blame] | 599 | # fru_type FRU type name (e.g. "gpu", "fru", "fan", etc.). |
George Keishing | efa9735 | 2017-03-13 07:13:03 -0500 | [diff] [blame] | 600 | # fru_list List of qualified FRU URLs. |
| 601 | |
| 602 | # Build the pre-defined set list from data/inventory.py derived from |
| 603 | # a group of YAML files. |
| 604 | # Example: |
| 605 | # set(['Version', 'PartNumber', 'SerialNumber', 'FieldReplaceable', |
| 606 | # 'BuildDate', 'Present', 'Manufacturer', 'PrettyName', 'Cached', 'Model']) |
George Keishing | da0aa88 | 2017-12-05 06:44:03 -0600 | [diff] [blame] | 607 | ${fru_set}= List To Set ${inventory_dict['${fru_type}']} |
George Keishing | efa9735 | 2017-03-13 07:13:03 -0500 | [diff] [blame] | 608 | |
| 609 | # Iterate through the FRU's url and compare the set dictionary keys |
| 610 | # with the pre-define inventory data. |
| 611 | :FOR ${fru_url_path} IN @{fru_list} |
| 612 | \ ${fru_field}= Read Properties ${fru_url_path} |
| 613 | # ------------------------------------------------------------ |
| 614 | # ${fru_field.viewkeys()} extracts the list of keys from the |
| 615 | # JSON dictionary as a set. |
| 616 | # ------------------------------------------------------------ |
| 617 | \ Should Be Equal ${fru_field.viewkeys()} ${fru_set} |
| 618 | |
George Keishing | 071d8da | 2017-03-24 09:13:16 -0500 | [diff] [blame] | 619 | |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 620 | Check URL Property Is Functional |
| 621 | [Documentation] Verify that the given url property is functional. |
George Keishing | 071d8da | 2017-03-24 09:13:16 -0500 | [diff] [blame] | 622 | [Arguments] ${url_path} |
| 623 | # Description of arguments: |
| 624 | # url_path Full url path of the inventory object. |
| 625 | # Example: DIMM / core property url's |
| 626 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0 |
| 627 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core0 |
| 628 | ${state}= Read Attribute ${url_path} Functional |
| 629 | Should Be True ${state} |
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 | Choose Boot Option |
| 632 | [Documentation] Choose BMC reset or host reboot. |
| 633 | [Arguments] ${option} |
Sweta Potthuri | 654cbc0 | 2017-06-15 10:10:55 -0500 | [diff] [blame] | 634 | |
George Keishing | fafbfdb | 2017-08-30 23:51:23 -0500 | [diff] [blame] | 635 | Run Keyword If '${option}' == 'reboot' |
| 636 | ... Verify Inventory List Before And After Reboot |
| 637 | ... ELSE |
| 638 | ... Verify Inventory List Before And After Reset |
| 639 | |
| 640 | |
| 641 | Verify Inventory List Before And After Reboot |
| 642 | [Documentation] Verify inventory list before and after reboot. |
| 643 | |
George Keishing | da0aa88 | 2017-12-05 06:44:03 -0600 | [diff] [blame] | 644 | REST Power On stack_mode=skip quiet=1 |
George Keishing | 32fe4e1 | 2018-07-13 05:06:47 -0500 | [diff] [blame] | 645 | Delete All Error Logs |
George Keishing | fafbfdb | 2017-08-30 23:51:23 -0500 | [diff] [blame] | 646 | ${inventory_before}= Get URL List ${HOST_INVENTORY_URI} |
George Keishing | a58775d | 2018-09-06 10:01:27 -0500 | [diff] [blame] | 647 | Host Reboot |
George Keishing | 32fe4e1 | 2018-07-13 05:06:47 -0500 | [diff] [blame] | 648 | Delete All Error Logs |
George Keishing | fafbfdb | 2017-08-30 23:51:23 -0500 | [diff] [blame] | 649 | ${inventory_after}= Get URL List ${HOST_INVENTORY_URI} |
| 650 | Lists Should Be Equal ${inventory_before} ${inventory_after} |
| 651 | |
| 652 | |
| 653 | Verify Inventory List Before And After Reset |
| 654 | [Documentation] Verify inventory list before and after BMC reset. |
| 655 | |
George Keishing | da0aa88 | 2017-12-05 06:44:03 -0600 | [diff] [blame] | 656 | REST Power On stack_mode=skip quiet=1 |
George Keishing | 32fe4e1 | 2018-07-13 05:06:47 -0500 | [diff] [blame] | 657 | Delete All Error Logs |
George Keishing | fafbfdb | 2017-08-30 23:51:23 -0500 | [diff] [blame] | 658 | ${inventory_before}= Get URL List ${HOST_INVENTORY_URI} |
| 659 | OBMC Reboot (run) |
George Keishing | 32fe4e1 | 2018-07-13 05:06:47 -0500 | [diff] [blame] | 660 | Delete All Error Logs |
George Keishing | fafbfdb | 2017-08-30 23:51:23 -0500 | [diff] [blame] | 661 | ${inventory_after}= Get URL List ${HOST_INVENTORY_URI} |
| 662 | Lists Should Be Equal ${inventory_before} ${inventory_after} |
| 663 | |
Sweta Potthuri | 1a640de | 2017-07-18 11:09:59 -0500 | [diff] [blame] | 664 | |
| 665 | Minimum Inventory |
| 666 | [Documentation] Check for minimum inventory. |
| 667 | [Arguments] ${item} ${minimum_count} |
| 668 | |
| 669 | # Description of argument(s): |
| 670 | # item Inventory name (example: "fan/cpu/dimm/etc"). |
| 671 | # minimum_count The minimum number of the given item. |
| 672 | |
| 673 | ${count}= Get Number Hardware Items ${item} |
| 674 | Should Be True ${count}>=${minimum_count} |
| 675 | |
| 676 | Get Number Hardware Items |
| 677 | [Documentation] Get the count of the total present currently on inventory. |
| 678 | [Arguments] ${item} |
| 679 | |
| 680 | # Description of argument(s): |
| 681 | # item Inventory name (example: "fan/cpu/dimm/etc"). |
| 682 | |
| 683 | ${count_inventory} Set Variable ${0} |
| 684 | ${list}= Get Endpoint Paths ${HOST_INVENTORY_URI}/system/ |
| 685 | ... ${item} |
| 686 | |
| 687 | : FOR ${element} IN @{list} |
| 688 | \ ${present}= Read Properties ${element} |
| 689 | \ ${count_inventory}= Set Variable if ${present['Present']} == 1 |
| 690 | \ ... ${count_inventory+1} ${count_inventory} |
| 691 | [return] ${count_inventory} |