blob: 24eb73e0fe1eb4e1b75ce108ced7929cc9a22d17 [file] [log] [blame]
Rahul Maheshwari77ab1602018-02-28 07:21:55 -06001*** Settings ***
2Documentation Test IPMI sensor IDs.
3
George Keishingd6bc1c12019-03-08 12:59:29 -06004Resource ../lib/rest_client.robot
5Resource ../lib/ipmi_client.robot
6Resource ../lib/openbmc_ffdc.robot
7Resource ../lib/boot_utils.robot
8Resource ../lib/bmc_redfish_resource.robot
Rahul Maheshwari77ab1602018-02-28 07:21:55 -06009
10Suite setup Suite Setup Execution
11Test Teardown Test Teardown Execution
12
13Force Tags SDR_Test
14
15
16*** Test Cases ***
17
18
19Test CPU Core SDR Info At Power On
George Keishingd6bc1c12019-03-08 12:59:29 -060020 [Documentation] Verify CPU core SDR info via IPMI and Redfish at power on.
Rahul Maheshwari77ab1602018-02-28 07:21:55 -060021
22 [Tags] Test_CPU_Core_SDR_Info_At_Power_On
23
George Keishingd6bc1c12019-03-08 12:59:29 -060024 Redfish Power On stack_mode=skip quiet=1
Rahul Maheshwari77ab1602018-02-28 07:21:55 -060025 Test SDR Info core
26
27
28Test DIMM SDR Info At Power On
George Keishingd6bc1c12019-03-08 12:59:29 -060029 [Documentation] Verify DIMM SDR info via IPMI and Redfish at power on.
Rahul Maheshwari77ab1602018-02-28 07:21:55 -060030
31 [Tags] Test_DIMM_SDR_Info_At_Power_On
32
George Keishingd6bc1c12019-03-08 12:59:29 -060033 Redfish Power On stack_mode=skip quiet=1
Rahul Maheshwari77ab1602018-02-28 07:21:55 -060034 Test SDR Info dimm
35
Rahul Maheshwaricd7b19c2018-04-10 07:35:56 -050036
37Test GPU SDR Info At Power On
George Keishingd6bc1c12019-03-08 12:59:29 -060038 [Documentation] Verify GPU SDR info via IPMI and Redfish at power on.
Rahul Maheshwaricd7b19c2018-04-10 07:35:56 -050039
40 [Tags] Test_GPU_SDR_Info_At_Power_On
41
George Keishingd6bc1c12019-03-08 12:59:29 -060042 Redfish Power On stack_mode=skip quiet=1
Rahul Maheshwaricd7b19c2018-04-10 07:35:56 -050043 Test SDR Info gv100card
44
45
Rahul Maheshwari77ab1602018-02-28 07:21:55 -060046Test CPU Core SDR Info At Power Off
George Keishingd6bc1c12019-03-08 12:59:29 -060047 [Documentation] Verify CPU core SDR info via IPMI and Redfish at power off.
Rahul Maheshwari77ab1602018-02-28 07:21:55 -060048
49 [Tags] Test_CPU_Core_SDR_Info_At_Power_Off
50
George Keishingd6bc1c12019-03-08 12:59:29 -060051 Redfish Hard Power Off stack_mode=skip quiet=1
Rahul Maheshwari77ab1602018-02-28 07:21:55 -060052 Test SDR Info core
53
54
55Test DIMM SDR Info At Power Off
George Keishingd6bc1c12019-03-08 12:59:29 -060056 [Documentation] Verify DIMM SDR info via IPMI and Redfish at power off.
Rahul Maheshwari77ab1602018-02-28 07:21:55 -060057
58 [Tags] Test_DIMM_SDR_Info_At_Power_Off
59
George Keishingd6bc1c12019-03-08 12:59:29 -060060 Redfish Hard Power Off stack_mode=skip quiet=1
Rahul Maheshwari77ab1602018-02-28 07:21:55 -060061 Test SDR Info dimm
62
63
Rahul Maheshwaricd7b19c2018-04-10 07:35:56 -050064Test Turbo Allowed SDR Info
George Keishingd6bc1c12019-03-08 12:59:29 -060065 [Documentation] Verify turbo allowed SDR info via IPMI and Redfish.
Rahul Maheshwaricd7b19c2018-04-10 07:35:56 -050066 [Tags] Test_Turbo_Allowed_SDR_Info
67
68 ${component_uri_list}= Get Component URIs turbo_allowed
69 ${component_uri}= Get From List ${component_uri_list} 0
70 ${state_rest}= Read Attribute ${component_uri} TurboAllowed
71
72 ${state_ipmi}= Get SDR Presence Via IPMI turbo_allowed${SPACE}
73
74 Run Keyword If '${state_ipmi}' == 'Disabled'
75 ... Should Be True ${state_rest} == 0
76 ... ELSE IF '${state_ipmi}' == 'State Asserted'
77 ... Should Be True ${state_rest} == 1
78
79
80Test Auto Reboot SDR Info
George Keishingd6bc1c12019-03-08 12:59:29 -060081 [Documentation] Verify auto reboot SDR info via IPMI and Redfish.
Rahul Maheshwaricd7b19c2018-04-10 07:35:56 -050082 [Tags] Test_Auto_Reboot_SDR_Info
83
84
85 ${component_uri_list}= Get Component URIs auto_reboot
86 ${component_uri}= Get From List ${component_uri_list} 0
87 ${state_rest}= Read Attribute ${component_uri} AutoReboot
88
89 ${state_ipmi}= Get SDR Presence Via IPMI auto_reboot${SPACE}
90
91 Run Keyword If '${state_ipmi}' == 'Disabled'
92 ... Should Be True ${state_rest} == 0
93 ... ELSE IF '${state_ipmi}' == 'State Asserted'
94 ... Should Be True ${state_rest} == 1
95
96
97Test TPM Enable SDR Info
George Keishingd6bc1c12019-03-08 12:59:29 -060098 [Documentation] Verify auto reboot SDR info via IPMI and Redfish.
Rahul Maheshwaricd7b19c2018-04-10 07:35:56 -050099 [Tags] Test_TPM_Enable_SDR_Info
100
101
102 ${component_uri_list}= Get Component URIs TPMEnable
103 ${component_uri}= Get From List ${component_uri_list} 0
104 ${state_rest}= Read Attribute ${component_uri} TPMEnable
105
106 ${state_ipmi}= Get SDR Presence Via IPMI auto_reboot${SPACE}
107
108 Run Keyword If '${state_ipmi}' == 'Disabled'
109 ... Should Be True ${state_rest} == 0
110 ... ELSE IF '${state_ipmi}' == 'State Asserted'
111 ... Should Be True ${state_rest} == 1
112
113
Rahul Maheshwari77ab1602018-02-28 07:21:55 -0600114*** Keywords ***
115
116Get Component URIs
117 [Documentation] Get URIs for given component from given URIs
118 ... and return as a list.
119 [Arguments] ${component_name} ${uri_list}=${SYSTEM_URI}
120
121 # A sample result returned for the "core" component:
122 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core0
123 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core1
124 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core10
125 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core11
126 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core12
127 # (etc.)
128
129 # Description of argument(s):
130 # component_name Component name (e.g. "core", "dimm", etc.).
131 # uri_list URI list.
132
133 ${component_uris}= Get Matches ${uri_list}
Michael Walshd917c6e2018-12-11 10:09:09 -0600134 ... regexp=^.*[0-9a-z_].${component_name}\[0-9]*$
Rahul Maheshwari77ab1602018-02-28 07:21:55 -0600135 [Return] ${component_uris}
136
137
138Get SDR Presence Via IPMI
139 [Documentation] Return presence info from IPMI sensor data record.
140 [Arguments] ${component_name}
141
142 # Description of argument(s):
143 # component_name Component name (e.g. "cpu0_core0", "dimm0", etc.).
144
145 # Example of IPMI SDR elist output.
146 # BootProgress | 03h | ok | 34.2 |
147 # OperatingSystemS | 05h | ok | 35.1 | boot completed - device not specified
148 # AttemptsLeft | 07h | ok | 34.1 |
149 # occ0 | 08h | ok | 210.1 | Device Disabled
150 # occ1 | 09h | ok | 210.2 | Device Disabled
151 # cpu0_core0 | 12h | ok | 208.1 | Presence detected
152 # cpu0_core1 | 15h | ok | 208.2 | Disabled
153 # cpu0_core2 | 18h | ok | 208.3 | Presence detected
154 # dimm0 | A6h | ok | 32.1 | Presence Detected
155 # dimm1 | A8h | ok | 32.2 | Presence Detected
156 # dimm2 | AAh | ok | 32.9 | Presence Detected
157 # gv100card0 | C5h | ok | 216.1 | 0 unspecified
158 # gv100card1 | C8h | ok | 216.2 | 0 unspecified
159 # TPMEnable | D7h | ok | 3.3 | State Asserted
160 # auto_reboot | DAh | ok | 33.2 | State Asserted
161 # volatile | DBh | ok | 33.1 | State Deasserted
162
163 ${sdr_elist_output}= Run IPMI Standard Command sdr elist
164 ${sdr_component_line}=
165 ... Get Lines Containing String ${sdr_elist_output} ${component_name}
166 ... case-insensitive
167
168 ${presence_ipmi}= Fetch From Right ${sdr_component_line} |
169 ${presence_ipmi}= Strip String ${presence_ipmi}
170 [Return] ${presence_ipmi}
171
172
173Verify SDR
174 [Documentation] Verify IPMI sensor data record for given component
George Keishingd6bc1c12019-03-08 12:59:29 -0600175 ... with Redfish.
Rahul Maheshwari77ab1602018-02-28 07:21:55 -0600176 [Arguments] ${component_name}
177
178 # Description of argument(s):
179 # component_name Component name (e.g. "cpu0/core0", "dimm0", etc.).
180
181 ${presence_rest}= Read Attribute
182 ... ${HOST_INVENTORY_URI}system/chassis/motherboard/${component_name}
183 ... Present
184 ${functional_rest}= Read Attribute
185 ... ${HOST_INVENTORY_URI}system/chassis/motherboard/${component_name}
186 ... Functional
187
188 # Replace "/" with "_" if there is any "/" in component name.
189 # e.g. cpu0/core0 to cpu0_core0
190 ${component_name}= Replace String ${component_name} / _
191 ${presence_ipmi}= Get SDR Presence Via IPMI ${component_name}${SPACE}
192
193 Run Keyword If '${presence_ipmi}' == 'Disabled'
194 ... Should Be True ${presence_rest} == 0 and ${functional_rest} == 0
195 ... ELSE IF '${presence_ipmi}' == 'Presence Detected' or '${presence_ipmi}' == 'Presence detected'
196 ... Should Be True ${presence_rest} == 1 and ${functional_rest} == 1
197 ... ELSE IF '${presence_ipmi}' == 'State Asserted'
198 ... Should Be True ${presence_rest} == 1 and ${functional_rest} == 1
199 ... ELSE IF '${presence_ipmi}' == 'State Deasserted'
200 ... Should Be True ${presence_rest} == 1 and ${functional_rest} == 0
201 ... ELSE Fail msg=Invalid Presence${presence_ipmi}
202
203
204Test SDR Info
205 [Documentation] Test SDR info for given component.
206 [Arguments] ${component_name}
207
208 # Description of argument(s):
209 # component_name Component name (e.g. "core", "dimm", etc.).
210
211 ${component_uri_list}= Get Component URIs ${component_name}
212 : FOR ${uri} IN @{component_uri_list}
213 \ ${component_name}= Fetch From Right ${uri} motherboard/
214 \ Log To Console ${component_name}
215 \ Verify SDR ${component_name}
216
217
218Suite Setup Execution
219 [Documentation] Do the initial suite setup.
220
Rahul Maheshwarib6ebe4c2019-07-17 02:02:17 -0500221 Redfish Power On stack_mode=skip quiet=1
Rahul Maheshwari77ab1602018-02-28 07:21:55 -0600222
223 ${uri_list}= Read Properties ${OPENBMC_BASE_URI}list
224 Set Suite Variable ${SYSTEM_URI} ${uri_list}
225 Log ${uri_list}
226
227
228Test Teardown Execution
229 [Documentation] Do the post test teardown.
230
231 FFDC On Test Case Fail