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