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