Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation This testsuite is for testing inventory |
| 3 | Suite Teardown Delete All Sessions |
| 4 | Resource ../lib/rest_client.robot |
| 5 | Resource ../lib/utils.robot |
George Keishing | d55a4be | 2016-08-26 03:28:17 -0500 | [diff] [blame] | 6 | Resource ../lib/openbmc_ffdc.robot |
George Keishing | 1d5ec74 | 2016-09-02 05:29:14 -0500 | [diff] [blame] | 7 | Resource ../lib/boot/boot_resource_master.robot |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 8 | Library ../lib/utilities.py |
| 9 | Library String |
| 10 | Library Collections |
George Keishing | d55a4be | 2016-08-26 03:28:17 -0500 | [diff] [blame] | 11 | Test Teardown Log FFDC |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 12 | |
| 13 | Variables ../data/variables.py |
| 14 | |
| 15 | |
| 16 | Suite setup setup the suite |
| 17 | |
causten | 147f575 | 2016-08-11 16:24:45 -0500 | [diff] [blame] | 18 | Force Tags chassisboot |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 19 | |
| 20 | *** Test Cases *** |
| 21 | |
| 22 | minimal cpu inventory |
| 23 | ${count} = Get Total Present CPU |
| 24 | Should Be True ${count}>${0} |
| 25 | |
| 26 | minimal dimm inventory |
| 27 | ${count} = Get Total Present DIMM |
| 28 | Should Be True ${count}>=${2} |
| 29 | |
| 30 | minimal core inventory |
| 31 | ${count} = Get Total Present CORE |
| 32 | Should Be True ${count}>${0} |
| 33 | |
| 34 | minimal memory buffer inventory |
| 35 | ${count} = Get Total Present MEMORY_BUFFER |
| 36 | Should Be True ${count}>${0} |
| 37 | |
| 38 | minimal fan inventory |
| 39 | ${count} = Get Total Present FAN |
| 40 | Should Be True ${count}>${2} |
| 41 | |
| 42 | minimal main planar inventory |
| 43 | ${count} = Get Total Present MAIN_PLANAR |
| 44 | Should Be True ${count}>${0} |
| 45 | |
| 46 | minimal system inventory |
| 47 | ${count} = Get Total Present SYSTEM |
| 48 | Should Be True ${count}>${0} |
| 49 | |
| 50 | Verify CPU VPD Properties |
| 51 | Verify Properties CPU |
| 52 | |
| 53 | Verify DIMM VPD Properties |
| 54 | Verify Properties DIMM |
| 55 | |
| 56 | Verify Memory Buffer VPD Properties |
| 57 | Verify Properties MEMORY_BUFFER |
| 58 | |
| 59 | Verify Fan VPD Properties |
| 60 | Verify Properties FAN |
| 61 | |
| 62 | Verify System VPD Properties |
| 63 | Verify Properties SYSTEM |
| 64 | |
| 65 | |
| 66 | *** Keywords *** |
| 67 | |
| 68 | Setup The Suite |
George Keishing | 1d5ec74 | 2016-09-02 05:29:14 -0500 | [diff] [blame] | 69 | BMC Power On |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 70 | |
| 71 | @{ret} = Get Inventory List ${OPENBMC_MODEL} |
| 72 | Set Suite Variable @{sys_inv} @{ret} |
| 73 | ${resp} = Read Properties /org/openbmc/inventory/enumerate |
| 74 | Set Suite Variable ${SYSTEM_INFO} ${resp} |
| 75 | log Dictionary ${resp} |
| 76 | |
| 77 | Get Total Present |
| 78 | [arguments] ${type} |
| 79 | |
| 80 | ${l} = Create List [] |
| 81 | ${list} = Get Inventory Fru Type List ${OPENBMC_MODEL} ${type} |
| 82 | : FOR ${element} IN @{list} |
| 83 | \ Append To List ${l} ${SYSTEM_INFO['${element}']['present']} |
| 84 | |
| 85 | ${sum} = Get Count ${l} True |
| 86 | [return] ${sum} |
| 87 | |
| 88 | Verify Properties |
| 89 | [arguments] ${type} |
| 90 | |
| 91 | ${list} = Get VPD Inventory List ${OPENBMC_MODEL} ${type} |
| 92 | : FOR ${element} IN @{list} |
| 93 | \ ${d} = Get From Dictionary ${SYSTEM_INFO} ${element} |
| 94 | \ Run Keyword If ${d['present']} == True Verify Present Properties ${d} ${type} |
| 95 | |
| 96 | Verify Present Properties |
| 97 | [arguments] ${d} ${type} |
| 98 | ${keys} = Get Dictionary Keys ${d} |
| 99 | Log List ${keys} |
| 100 | Log List ${INVENTORY_ITEMS['${type}']} |
| 101 | Lists Should Be Equal ${INVENTORY_ITEMS['${type}']} ${keys} |