blob: b125e9730aa23d709369c206986b1228bf3180d8 [file] [log] [blame]
Steven Sombarc90c8e22019-05-21 11:28:48 -05001*** Settings ***
Steven Sombarbccfd512019-06-05 15:50:35 -05002Documentation Inventory of hardware FRUs under redfish/systems.
Steven Sombarc90c8e22019-05-21 11:28:48 -05003
4Resource ../../lib/bmc_redfish_resource.robot
5Resource ../../lib/bmc_redfish_utils.robot
6Resource ../../lib/openbmc_ffdc.robot
Steven Sombarbccfd512019-06-05 15:50:35 -05007Library ../../lib/gen_robot_valid.py
Steven Sombarc90c8e22019-05-21 11:28:48 -05008
9Suite Setup Suite Setup Execution
10Suite Teardown Suite Teardown Execution
11Test Teardown Test Teardown Execution
12
13*** Variables ***
14
15# The passing criteria. Must have at least this many.
Steven Sombarbccfd512019-06-05 15:50:35 -050016${min_num_dimms} 2
17${min_num_cpus} 1
Steven Sombarc90c8e22019-05-21 11:28:48 -050018
19
20*** Test Cases ***
21
22Get 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 Sombarbccfd512019-06-05 15:50:35 -050026 Verify FRU Inventory Minimums Processors ${min_num_cpus}
Steven Sombarc90c8e22019-05-21 11:28:48 -050027
28
29Get 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 Sombarbccfd512019-06-05 15:50:35 -050033 Verify FRU Inventory Minimums Memory ${min_num_dimms}
34
35
36Get 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
45Get 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 Sombarc90c8e22019-05-21 11:28:48 -050052
53
54*** Keywords ***
55
56
Steven Sombarbccfd512019-06-05 15:50:35 -050057Verify FRU Inventory Minimums
58 [Documentation] Verify a minimun number of FRUs.
59 [Arguments] ${fru_type} ${min_num_frus}
Steven Sombarc90c8e22019-05-21 11:28:48 -050060
61 # Description of Argument(s):
Steven Sombarbccfd512019-06-05 15:50:35 -050062 # fru_type The type of FRU (e.g. "Processors", "Memory", etc.).
63 # min_num_frus The minimum acceptable number of FRUs found.
Steven Sombarc90c8e22019-05-21 11:28:48 -050064
Steven Sombarbccfd512019-06-05 15:50:35 -050065 # A valid FRU will have a "State" key of "Enabled" and a "Health" key
66 # of "OK".
Steven Sombarc90c8e22019-05-21 11:28:48 -050067
Steven Sombarbccfd512019-06-05 15:50:35 -050068 ${status} ${num_valid_frus}= Run Key U Get Num Valid FRUs \ ${fru_type}
Steven Sombarc90c8e22019-05-21 11:28:48 -050069
Steven Sombarbccfd512019-06-05 15:50:35 -050070 Return From Keyword If ${num_valid_frus} >= ${min_num_frus}
71 Fail Too few "${fru_type}" FRUs found, found only ${num_valid_frus}.
Steven Sombarc90c8e22019-05-21 11:28:48 -050072
73
74Suite Teardown Execution
75 [Documentation] Do the post suite teardown.
76
77 Redfish.Logout
78
79
80Suite Setup Execution
81 [Documentation] Do test case setup tasks.
82
83 Redfish.Login
Steven Sombarbccfd512019-06-05 15:50:35 -050084 Printn
Steven Sombarc90c8e22019-05-21 11:28:48 -050085
86
87Test Teardown Execution
88 [Documentation] Do the post test teardown.
89
90 FFDC On Test Case Fail