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