Steven Sombar | c90c8e2 | 2019-05-21 11:28:48 -0500 | [diff] [blame] | 1 | *** Settings *** |
Steven Sombar | bccfd51 | 2019-06-05 15:50:35 -0500 | [diff] [blame] | 2 | Documentation Inventory of hardware FRUs under redfish/systems. |
Steven Sombar | c90c8e2 | 2019-05-21 11:28:48 -0500 | [diff] [blame] | 3 | |
| 4 | Resource ../../lib/bmc_redfish_resource.robot |
| 5 | Resource ../../lib/bmc_redfish_utils.robot |
| 6 | Resource ../../lib/openbmc_ffdc.robot |
Steven Sombar | bccfd51 | 2019-06-05 15:50:35 -0500 | [diff] [blame] | 7 | Library ../../lib/gen_robot_valid.py |
Steven Sombar | c90c8e2 | 2019-05-21 11:28:48 -0500 | [diff] [blame] | 8 | |
| 9 | Suite Setup Suite Setup Execution |
| 10 | Suite Teardown Suite Teardown Execution |
| 11 | Test Teardown Test Teardown Execution |
| 12 | |
| 13 | *** Variables *** |
| 14 | |
| 15 | # The passing criteria. Must have at least this many. |
Steven Sombar | bccfd51 | 2019-06-05 15:50:35 -0500 | [diff] [blame] | 16 | ${min_num_dimms} 2 |
| 17 | ${min_num_cpus} 1 |
Steven Sombar | c90c8e2 | 2019-05-21 11:28:48 -0500 | [diff] [blame] | 18 | |
| 19 | |
| 20 | *** Test Cases *** |
| 21 | |
| 22 | Get Processor Inventory Via Redfish And Verify |
| 23 | [Documentation] Get the number of CPUs that are functional and enabled. |
| 24 | [Tags] Get_Processor_Inventory_Via_Redfish_And_Verify |
| 25 | |
Steven Sombar | bccfd51 | 2019-06-05 15:50:35 -0500 | [diff] [blame] | 26 | Verify FRU Inventory Minimums Processors ${min_num_cpus} |
Steven Sombar | c90c8e2 | 2019-05-21 11:28:48 -0500 | [diff] [blame] | 27 | |
| 28 | |
| 29 | Get Memory Inventory Via Redfish And Verify |
| 30 | [Documentation] Get the number of DIMMs that are functional and enabled. |
| 31 | [Tags] Get_Memory_Inventory_Via_Redfish_And_Verify |
| 32 | |
Steven Sombar | bccfd51 | 2019-06-05 15:50:35 -0500 | [diff] [blame] | 33 | Verify FRU Inventory Minimums Memory ${min_num_dimms} |
| 34 | |
| 35 | |
| 36 | Get Serial And Verify Populated |
| 37 | [Documentation] Check that the SerialNumber is non-blank. |
| 38 | [Tags] Get_Serial_And_Verify_Populated |
| 39 | |
| 40 | ${serial_number}= Redfish.Get Attribute ${SYSTEM_BASE_URI} SerialNumber |
| 41 | Rvalid Value serial_number |
| 42 | Rprint Vars serial_number |
| 43 | |
| 44 | |
| 45 | Get Model And Verify Populated |
| 46 | [Documentation] Check that the Model is non-blank. |
| 47 | [Tags] Get_Model_And_Verify_Populated |
| 48 | |
| 49 | ${model}= Redfish.Get Attribute ${SYSTEM_BASE_URI} Model |
| 50 | Rvalid Value model |
| 51 | Rprint Vars model |
Steven Sombar | c90c8e2 | 2019-05-21 11:28:48 -0500 | [diff] [blame] | 52 | |
| 53 | |
| 54 | *** Keywords *** |
| 55 | |
| 56 | |
Steven Sombar | bccfd51 | 2019-06-05 15:50:35 -0500 | [diff] [blame] | 57 | Verify FRU Inventory Minimums |
George Keishing | 3292d4a | 2019-06-19 02:04:53 -0500 | [diff] [blame] | 58 | [Documentation] Verify a minimum number of FRUs. |
Steven Sombar | bccfd51 | 2019-06-05 15:50:35 -0500 | [diff] [blame] | 59 | [Arguments] ${fru_type} ${min_num_frus} |
Steven Sombar | c90c8e2 | 2019-05-21 11:28:48 -0500 | [diff] [blame] | 60 | |
| 61 | # Description of Argument(s): |
Steven Sombar | bccfd51 | 2019-06-05 15:50:35 -0500 | [diff] [blame] | 62 | # fru_type The type of FRU (e.g. "Processors", "Memory", etc.). |
| 63 | # min_num_frus The minimum acceptable number of FRUs found. |
Steven Sombar | c90c8e2 | 2019-05-21 11:28:48 -0500 | [diff] [blame] | 64 | |
Steven Sombar | bccfd51 | 2019-06-05 15:50:35 -0500 | [diff] [blame] | 65 | # A valid FRU will have a "State" key of "Enabled" and a "Health" key |
| 66 | # of "OK". |
Steven Sombar | c90c8e2 | 2019-05-21 11:28:48 -0500 | [diff] [blame] | 67 | |
Steven Sombar | bccfd51 | 2019-06-05 15:50:35 -0500 | [diff] [blame] | 68 | ${status} ${num_valid_frus}= Run Key U Get Num Valid FRUs \ ${fru_type} |
Steven Sombar | c90c8e2 | 2019-05-21 11:28:48 -0500 | [diff] [blame] | 69 | |
Steven Sombar | bccfd51 | 2019-06-05 15:50:35 -0500 | [diff] [blame] | 70 | Return From Keyword If ${num_valid_frus} >= ${min_num_frus} |
| 71 | Fail Too few "${fru_type}" FRUs found, found only ${num_valid_frus}. |
Steven Sombar | c90c8e2 | 2019-05-21 11:28:48 -0500 | [diff] [blame] | 72 | |
| 73 | |
| 74 | Suite Teardown Execution |
| 75 | [Documentation] Do the post suite teardown. |
| 76 | |
| 77 | Redfish.Logout |
| 78 | |
| 79 | |
| 80 | Suite Setup Execution |
| 81 | [Documentation] Do test case setup tasks. |
| 82 | |
| 83 | Redfish.Login |
Steven Sombar | bccfd51 | 2019-06-05 15:50:35 -0500 | [diff] [blame] | 84 | Printn |
Steven Sombar | c90c8e2 | 2019-05-21 11:28:48 -0500 | [diff] [blame] | 85 | |
| 86 | |
| 87 | Test Teardown Execution |
| 88 | [Documentation] Do the post test teardown. |
| 89 | |
| 90 | FFDC On Test Case Fail |