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 | |
| 15 | |
| 16 | *** Test Cases *** |
| 17 | |
| 18 | minimal cpu inventory |
| 19 | ${count} = Get Total Present CPU |
| 20 | Should Be True ${count}>${0} |
| 21 | |
| 22 | minimal dimm inventory |
| 23 | ${count} = Get Total Present DIMM |
| 24 | Should Be True ${count}>=${2} |
| 25 | |
| 26 | minimal core inventory |
| 27 | ${count} = Get Total Present CORE |
| 28 | Should Be True ${count}>${0} |
| 29 | |
| 30 | minimal memory buffer inventory |
| 31 | ${count} = Get Total Present MEMORY_BUFFER |
| 32 | Should Be True ${count}>${0} |
| 33 | |
| 34 | minimal fan inventory |
| 35 | ${count} = Get Total Present FAN |
| 36 | Should Be True ${count}>${2} |
| 37 | |
| 38 | minimal main planar inventory |
| 39 | ${count} = Get Total Present MAIN_PLANAR |
| 40 | Should Be True ${count}>${0} |
| 41 | |
| 42 | minimal system inventory |
| 43 | ${count} = Get Total Present SYSTEM |
| 44 | Should Be True ${count}>${0} |
| 45 | |
| 46 | Verify CPU VPD Properties |
| 47 | Verify Properties CPU |
| 48 | |
| 49 | Verify DIMM VPD Properties |
| 50 | Verify Properties DIMM |
| 51 | |
| 52 | Verify Memory Buffer VPD Properties |
| 53 | Verify Properties MEMORY_BUFFER |
| 54 | |
| 55 | Verify Fan VPD Properties |
| 56 | Verify Properties FAN |
| 57 | |
| 58 | Verify System VPD Properties |
| 59 | Verify Properties SYSTEM |
| 60 | |
| 61 | |
| 62 | *** Keywords *** |
| 63 | |
| 64 | Setup The Suite |
| 65 | Power On Host |
| 66 | |
| 67 | @{ret} = Get Inventory List ${OPENBMC_MODEL} |
| 68 | Set Suite Variable @{sys_inv} @{ret} |
| 69 | ${resp} = Read Properties /org/openbmc/inventory/enumerate |
| 70 | Set Suite Variable ${SYSTEM_INFO} ${resp} |
| 71 | log Dictionary ${resp} |
| 72 | |
| 73 | Get Total Present |
| 74 | [arguments] ${type} |
| 75 | |
| 76 | ${l} = Create List [] |
| 77 | ${list} = Get Inventory Fru Type List ${OPENBMC_MODEL} ${type} |
| 78 | : FOR ${element} IN @{list} |
| 79 | \ Append To List ${l} ${SYSTEM_INFO['${element}']['present']} |
| 80 | |
| 81 | ${sum} = Get Count ${l} True |
| 82 | [return] ${sum} |
| 83 | |
| 84 | Verify Properties |
| 85 | [arguments] ${type} |
| 86 | |
| 87 | ${list} = Get VPD Inventory List ${OPENBMC_MODEL} ${type} |
| 88 | : FOR ${element} IN @{list} |
| 89 | \ ${d} = Get From Dictionary ${SYSTEM_INFO} ${element} |
| 90 | \ Run Keyword If ${d['present']} == True Verify Present Properties ${d} ${type} |
| 91 | |
| 92 | Verify Present Properties |
| 93 | [arguments] ${d} ${type} |
| 94 | ${keys} = Get Dictionary Keys ${d} |
| 95 | Log List ${keys} |
| 96 | Log List ${INVENTORY_ITEMS['${type}']} |
| 97 | Lists Should Be Equal ${INVENTORY_ITEMS['${type}']} ${keys} |