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 |
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 |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 8 | Library ../lib/utilities.py |
| 9 | Library String |
| 10 | Library Collections |
| 11 | |
| 12 | Variables ../data/variables.py |
| 13 | |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 14 | Suite setup Setup The Suite |
| 15 | Test Teardown FFDC On Test Case Fail |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 16 | |
George Keishing | 9aa0f65 | 2016-11-08 03:28:56 -0600 | [diff] [blame] | 17 | Force Tags chassisboot inventory |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 18 | |
| 19 | *** Test Cases *** |
| 20 | |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 21 | Minimal CPU Inventory |
| 22 | [Tags] Minimal_CPU_Inventory |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 23 | |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 24 | ${count}= Get Total Present cpu |
| 25 | Should Be True ${count}>${0} |
Rahul Maheshwari | bb20f73 | 2016-10-24 06:27:14 -0500 | [diff] [blame] | 26 | |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 27 | Minimal DIMM Inventory |
| 28 | [Tags] Minimal DIMM Inventory |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 29 | |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 30 | ${count}= Get Total Present dimm |
| 31 | Should Be True ${count}>=${2} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 32 | |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 33 | Minimal Core Inventory |
| 34 | [Tags] Minimal_Core_Inventory |
Rahul Maheshwari | f811910 | 2016-10-05 01:15:56 -0500 | [diff] [blame] | 35 | |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 36 | ${count}= Get Total Present core |
| 37 | Should Be True ${count}>${0} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 38 | |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 39 | Minimal Memory Buffer Inventory |
| 40 | [Tags] Minimal_Memory_Buffer_Inventory |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 41 | |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 42 | ${count}= Get Total Present membuf |
| 43 | Should Be True ${count}>${0} |
Rahul Maheshwari | f811910 | 2016-10-05 01:15:56 -0500 | [diff] [blame] | 44 | |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 45 | Minimal Fan Inventory |
| 46 | [Tags] Minimal_Fan_Inventory |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 47 | |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 48 | ${count}= Get Total Present fan |
| 49 | Should Be True ${count}>${2} |
Rahul Maheshwari | f811910 | 2016-10-05 01:15:56 -0500 | [diff] [blame] | 50 | |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 51 | Minimal Main Planar Inventory |
| 52 | [Tags] Minimal_Main_Planar_Inventory |
| 53 | |
| 54 | ${count}= Get Total Present motherboard |
| 55 | Should Be True ${count}>${0} |
| 56 | |
| 57 | Minimal System Inventory |
| 58 | [Tags] Minimal_System_Inventory |
| 59 | |
| 60 | ${count}= Get Total Present system |
| 61 | Should Be True ${count}>${0} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 62 | |
| 63 | Verify CPU VPD Properties |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 64 | [Tags] Verify_CPU_VPD_Properties |
| 65 | |
| 66 | Verify Properties CPU |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 67 | |
| 68 | Verify DIMM VPD Properties |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 69 | [Tags] Verify_DIMM_VPD_Properties |
Rahul Maheshwari | bb20f73 | 2016-10-24 06:27:14 -0500 | [diff] [blame] | 70 | |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 71 | Verify Properties DIMM |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 72 | |
| 73 | Verify Memory Buffer VPD Properties |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 74 | [Tags] Verify_Memory_Buffer_VPD_Properties |
| 75 | |
| 76 | Verify Properties MEMORY_BUFFER |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 77 | |
| 78 | Verify Fan VPD Properties |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 79 | [Tags] Verify_Fan_VPD_Properties |
| 80 | |
| 81 | Verify Properties FAN |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 82 | |
| 83 | Verify System VPD Properties |
George Keishing | 8c0a4e5 | 2016-09-27 11:21:50 -0500 | [diff] [blame] | 84 | [Tags] Verify_System_VPD_Properties |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 85 | |
| 86 | Verify Properties SYSTEM |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 87 | |
| 88 | |
| 89 | *** Keywords *** |
| 90 | |
Rahul Maheshwari | 4a4eb6e | 2016-09-24 01:06:36 -0500 | [diff] [blame] | 91 | Setup The Suite |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 92 | ${host_state}= Get Host State |
| 93 | Run Keyword If '${host_state}' == 'Off' Initiate Host Boot |
Rahul Maheshwari | 4a4eb6e | 2016-09-24 01:06:36 -0500 | [diff] [blame] | 94 | |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 95 | ${resp}= Read Properties ${INVENTORY_URI}enumerate |
| 96 | Set Suite Variable ${SYSTEM_INFO} ${resp} |
| 97 | Log Dictionary ${resp} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 98 | |
| 99 | Get Total Present |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 100 | [Arguments] ${type} |
| 101 | ${l}= Create List [] |
| 102 | ${resp}= Get Dictionary Keys ${SYSTEM_INFO} |
| 103 | ${list}= Get Matches ${resp} regexp=^.*[0-9a-z_].${type}[0-9]*$ |
| 104 | : FOR ${element} IN @{list} |
| 105 | \ Append To List ${l} ${SYSTEM_INFO['${element}']['present']} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 106 | |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 107 | ${sum}= Get Count ${l} True |
| 108 | [Return] ${sum} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 109 | |
| 110 | Verify Properties |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 111 | [Arguments] ${type} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 112 | |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 113 | ${list}= Get VPD Inventory List ${OPENBMC_MODEL} ${type} |
| 114 | : FOR ${element} IN @{list} |
| 115 | \ ${d}= Get From Dictionary ${SYSTEM_INFO} ${element} |
| 116 | \ Run Keyword If ${d['present']} == True Verify Present Properties ${d} ${type} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 117 | |
| 118 | Verify Present Properties |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 119 | [Arguments] ${d} ${type} |
| 120 | ${keys}= Get Dictionary Keys ${d} |
| 121 | Log List ${keys} |
| 122 | Log List ${INVENTORY_ITEMS['${type}']} |
| 123 | Lists Should Be Equal ${INVENTORY_ITEMS['${type}']} ${keys} |