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