blob: e45a96cc0ee12c7e4c90ce75487582615013def7 [file] [log] [blame]
Rahul Maheshwarib4b8bb62019-03-04 23:56:10 -06001*** Settings ***
2Documentation Test certificate in OpenBMC.
3
4Resource ../../lib/resource.robot
5Resource ../../lib/bmc_redfish_resource.robot
6Resource ../../lib/openbmc_ffdc.robot
7Resource ../../lib/certificate_utils.robot
George Keishingbf17fab2019-06-13 09:22:22 -05008Library String
Rahul Maheshwarib4b8bb62019-03-04 23:56:10 -06009
Rahul Maheshwarie48fd3e2019-07-22 02:28:58 -050010Force Tags Certificate_Test
11
Rahul Maheshwarib4b8bb62019-03-04 23:56:10 -060012Suite Setup Suite Setup Execution
Anusha Dathatri109c2ce2020-06-03 22:19:05 -050013Suite Teardown Suite Teardown
Rahul Maheshwarib4b8bb62019-03-04 23:56:10 -060014Test Teardown Test Teardown Execution
15
16
Rahul Maheshwari1e0f6a82019-08-29 01:33:23 -050017*** Variables ***
18
19${invalid_value} abc
Zbigniew Kurzynski84ae0d32019-10-11 15:51:59 +020020${ROOT_CA_FILE_PATH} /etc/ssl/certs/authority/*
Rahul Maheshwari1e0f6a82019-08-29 01:33:23 -050021
22
Rahul Maheshwarib4b8bb62019-03-04 23:56:10 -060023** Test Cases **
24
25Verify Server Certificate Replace
26 [Documentation] Verify server certificate replace.
27 [Tags] Verify_Server_Certificate_Replace
28 [Template] Replace Certificate Via Redfish
29
Rahul Maheshwari3ecd1a62019-06-03 01:44:34 -050030 # cert_type cert_format expected_status
31 Server Valid Certificate Valid Privatekey ok
32 Server Empty Certificate Valid Privatekey error
33 Server Valid Certificate Empty Privatekey error
34 Server Empty Certificate Empty Privatekey error
Rahul Maheshwarib4b8bb62019-03-04 23:56:10 -060035
36
37Verify Client Certificate Replace
38 [Documentation] Verify client certificate replace.
39 [Tags] Verify_Client_Certificate_Replace
40 [Template] Replace Certificate Via Redfish
41
Rahul Maheshwari3ecd1a62019-06-03 01:44:34 -050042 # cert_type cert_format expected_status
43 Client Valid Certificate Valid Privatekey ok
44 Client Empty Certificate Valid Privatekey error
45 Client Valid Certificate Empty Privatekey error
46 Client Empty Certificate Empty Privatekey error
Rahul Maheshwarib4b8bb62019-03-04 23:56:10 -060047
48
Rahul Maheshwaric1f43ed2019-06-03 01:00:16 -050049Verify CA Certificate Replace
50 [Documentation] Verify CA certificate replace.
51 [Tags] Verify_CA_Certificate_Replace
52 [Template] Replace Certificate Via Redfish
53
54 # cert_type cert_format expected_status
55 CA Valid Certificate ok
56 CA Empty Certificate error
57
58
Rahul Maheshwari037a3432019-05-23 00:55:40 -050059Verify Client Certificate Install
60 [Documentation] Verify client certificate install.
61 [Tags] Verify_Client_Certificate_Install
Rahul Maheshwari3ecd1a62019-06-03 01:44:34 -050062 [Template] Install And Verify Certificate Via Redfish
Rahul Maheshwari037a3432019-05-23 00:55:40 -050063
Rahul Maheshwari3ecd1a62019-06-03 01:44:34 -050064 # cert_type cert_format expected_status
65 Client Valid Certificate Valid Privatekey ok
66 Client Empty Certificate Valid Privatekey error
67 Client Valid Certificate Empty Privatekey error
68 Client Empty Certificate Empty Privatekey error
Rahul Maheshwari037a3432019-05-23 00:55:40 -050069
70
Rahul Maheshwari479c9c52019-06-03 01:23:12 -050071Verify CA Certificate Install
72 [Documentation] Verify CA certificate install.
73 [Tags] Verify_CA_Certificate_Install
74 [Template] Install And Verify Certificate Via Redfish
75
76 # cert_type cert_format expected_status
77 CA Valid Certificate ok
78 CA Empty Certificate error
79
80
Rahul Maheshwarid35e6872020-02-11 03:16:46 -060081Verify Maximum CA Certificate Install
82 [Documentation] Verify maximum CA certificate install.
83 [Tags] Verify_Maximum_CA_Certificate_Install
84 [Teardown] Run Keywords FFDC On Test Case Fail AND Delete All CA Certificate Via Redfish
85
86 # Get CA certificate count from BMC.
Rahul Maheshwarid35e6872020-02-11 03:16:46 -060087 ${cert_list}= Redfish_Utils.Get Member List /redfish/v1/Managers/bmc/Truststore/Certificates
88 ${cert_count}= Get Length ${cert_list}
89
90 # Install CA certificate to reach maximum count of 10.
91 FOR ${INDEX} IN RANGE ${cert_count} 10
92 Install And Verify Certificate Via Redfish CA Valid Certificate ok ${FALSE}
93 ${cert_count}= Evaluate ${cert_count} + 1
94 END
95
96 # Verify error while installing 11th CA certificate.
97 Install And Verify Certificate Via Redfish CA Valid Certificate error ${FALSE}
98
99
Rahul Maheshwari8ba1ebd2020-02-12 03:40:03 -0600100Verify Error While Uploding Same CA Certificate
101 [Documentation] Verify error while uploading same CA certificate two times.
102 [Tags] Verify_Error_While_Uploding_Same_CA_Certificate
103
104 # Create certificate file for uploading.
105 ${cert_file_path}= Generate Certificate File Via Openssl Valid Certificate 365
106 ${bytes}= OperatingSystem.Get Binary File ${cert_file_path}
107 ${file_data}= Decode Bytes To String ${bytes} UTF-8
108
109 # Install CA certificate.
110 Install Certificate File On BMC ${REDFISH_CA_CERTIFICATE_URI} ok data=${file_data}
111
112 # Adding delay after certificate installation.
113 Sleep 30s
114
115 # Check error while uploading same certificate.
116 Install Certificate File On BMC ${REDFISH_CA_CERTIFICATE_URI} error data=${file_data}
117
118
Rahul Maheshwarifa95b092019-05-22 05:10:59 -0500119Verify Server Certificate View Via Openssl
120 [Documentation] Verify server certificate via openssl command.
121 [Tags] Verify_Server_Certificate_View_Via_Openssl
122
Rahul Maheshwarifa95b092019-05-22 05:10:59 -0500123 ${cert_file_path}= Generate Certificate File Via Openssl Valid Certificate Valid Privatekey
George Keishingbf17fab2019-06-13 09:22:22 -0500124 ${bytes}= OperatingSystem.Get Binary File ${cert_file_path}
125 ${file_data}= Decode Bytes To String ${bytes} UTF-8
Rahul Maheshwarifa95b092019-05-22 05:10:59 -0500126
127 ${certificate_dict}= Create Dictionary
128 ... @odata.id=/redfish/v1/Managers/bmc/NetworkProtocol/HTTPS/Certificates/1
129 ${payload}= Create Dictionary CertificateString=${file_data}
130 ... CertificateType=PEM CertificateUri=${certificate_dict}
131
132 ${resp}= redfish.Post /redfish/v1/CertificateService/Actions/CertificateService.ReplaceCertificate
133 ... body=${payload}
134
135 Wait Until Keyword Succeeds 2 mins 15 secs Verify Certificate Visible Via OpenSSL ${cert_file_path}
136
137
Rahul Maheshwari1e0f6a82019-08-29 01:33:23 -0500138Verify CSR Generation For Server Certificate
139 [Documentation] Verify CSR generation for server certificate.
140 [Tags] Verify_CSR_Generation_For_Server_Certificate
141 [Template] Generate CSR Via Redfish
142
143 # csr_type key_pair_algorithm key_bit_length key_curv_id expected_status
144 Server RSA ${2048} ${EMPTY} ok
145 Server EC ${EMPTY} prime256v1 ok
146 Server EC ${EMPTY} secp521r1 ok
147 Server EC ${EMPTY} secp384r1 ok
148
149
150Verify CSR Generation For Client Certificate
151 [Documentation] Verify CSR generation for client certificate.
152 [Tags] Verify_CSR_Generation_For_Client_Certificate
153 [Template] Generate CSR Via Redfish
154
155 # csr_type key_pair_algorithm key_bit_length key_curv_id expected_status
156 Client RSA ${2048} ${EMPTY} ok
157 Client EC ${EMPTY} prime256v1 ok
158 Client EC ${EMPTY} secp521r1 ok
159 Client EC ${EMPTY} secp384r1 ok
160
161
162Verify CSR Generation For Server Certificate With Invalid Value
163 [Documentation] Verify error while generating CSR for server certificate with invalid value.
164 [Tags] Verify_CSR_Generation_For_Server_Certificate_With_Invalid_Value
165 [Template] Generate CSR Via Redfish
166
167 # csr_type key_pair_algorithm key_bit_length key_curv_id expected_status
168 Server ${invalid_value} ${2048} prime256v1 error
169 Server RAS ${invalid_value} ${EMPTY} error
170 Server EC ${EMPTY} ${invalid_value} error
171
172
173Verify CSR Generation For Client Certificate With Invalid Value
174 [Documentation] Verify error while generating CSR for client certificate with invalid value.
175 [Tags] Verify_CSR_Generation_For_Client_Certificate_With_Invalid_Value
176 [Template] Generate CSR Via Redfish
177
178 Client ${invalid_value} ${2048} prime256v1 error
179 Client RSA ${invalid_value} ${EMPTY} error
180 Client EC ${EMPTY} ${invalid_value} error
181
182
Anusha Dathatrie20d18d2020-05-07 04:02:30 -0500183Verify Expired Client Certificate Install
184 [Documentation] Verify installation of expired CA certificate.
185 [Tags] Verify_Expired_Client_Certificate_Install
Anusha Dathatri109c2ce2020-06-03 22:19:05 -0500186 [Setup] Get Current BMC Date
187 [Teardown] Run Keywords FFDC On Test Case Fail AND
188 ... Restore BMC Date
Anusha Dathatrie20d18d2020-05-07 04:02:30 -0500189
190 Install And Verify Certificate Via Redfish Client Expired Certificate error
191
192
193Verify Expired CA Certificate Install
194 [Documentation] Verify installation of expired CA certificate.
195 [Tags] Verify_Expired_CA_Certificate_Install
Anusha Dathatri109c2ce2020-06-03 22:19:05 -0500196 [Setup] Get Current BMC Date
197 [Teardown] Run Keywords FFDC On Test Case Fail AND
198 ... Restore BMC Date
Anusha Dathatrie20d18d2020-05-07 04:02:30 -0500199
200 Install And Verify Certificate Via Redfish CA Expired Certificate error
201
202
Rahul Maheshwarib4b8bb62019-03-04 23:56:10 -0600203*** Keywords ***
204
Rahul Maheshwari3ecd1a62019-06-03 01:44:34 -0500205Install And Verify Certificate Via Redfish
206 [Documentation] Install and verify certificate using Redfish.
Rahul Maheshwarid35e6872020-02-11 03:16:46 -0600207 [Arguments] ${cert_type} ${cert_format} ${expected_status} ${delete_cert}=${True}
Rahul Maheshwari037a3432019-05-23 00:55:40 -0500208
209 # Description of argument(s):
Rahul Maheshwari3ecd1a62019-06-03 01:44:34 -0500210 # cert_type Certificate type (e.g. "Client" or "CA").
Rahul Maheshwari037a3432019-05-23 00:55:40 -0500211 # cert_format Certificate file format
212 # (e.g. "Valid_Certificate_Valid_Privatekey").
213 # expected_status Expected status of certificate replace Redfish
214 # request (i.e. "ok" or "error").
Rahul Maheshwarid35e6872020-02-11 03:16:46 -0600215 # delete_cert Certificate will be deleted before installing if this True.
Rahul Maheshwari037a3432019-05-23 00:55:40 -0500216
Rahul Maheshwarid35e6872020-02-11 03:16:46 -0600217 Run Keyword If '${cert_type}' == 'CA' and '${delete_cert}' == '${True}'
218 ... Delete All CA Certificate Via Redfish
219 ... ELSE IF '${cert_type}' == 'Client' and '${delete_cert}' == '${True}'
220 ... Delete Certificate Via BMC CLI ${cert_type}
Rahul Maheshwari3ecd1a62019-06-03 01:44:34 -0500221
Anusha Dathatri109c2ce2020-06-03 22:19:05 -0500222 ${cert_file_path}= Generate Certificate File Via Openssl ${cert_format}
George Keishingbf17fab2019-06-13 09:22:22 -0500223 ${bytes}= OperatingSystem.Get Binary File ${cert_file_path}
224 ${file_data}= Decode Bytes To String ${bytes} UTF-8
Rahul Maheshwari037a3432019-05-23 00:55:40 -0500225
Rahul Maheshwari479c9c52019-06-03 01:23:12 -0500226 ${certificate_uri}= Set Variable If
227 ... '${cert_type}' == 'Client' ${REDFISH_LDAP_CERTIFICATE_URI}
228 ... '${cert_type}' == 'CA' ${REDFISH_CA_CERTIFICATE_URI}
229
Anusha Dathatri109c2ce2020-06-03 22:19:05 -0500230 Run Keyword If '${cert_format}' == 'Expired Certificate' Modify BMC Date
231
Zbigniew Kurzynski84ae0d32019-10-11 15:51:59 +0200232 ${cert_id}= Install Certificate File On BMC ${certificate_uri} ${expected_status} data=${file_data}
233 Logging Installed certificate id: ${cert_id}
Rahul Maheshwari037a3432019-05-23 00:55:40 -0500234
235 # Adding delay after certificate installation.
Rahul Maheshwaric1f43ed2019-06-03 01:00:16 -0500236 Sleep 30s
Rahul Maheshwari037a3432019-05-23 00:55:40 -0500237
238 ${cert_file_content}= OperatingSystem.Get File ${cert_file_path}
239 ${bmc_cert_content}= Run Keyword If '${expected_status}' == 'ok' redfish_utils.Get Attribute
Zbigniew Kurzynski84ae0d32019-10-11 15:51:59 +0200240 ... ${certificate_uri}/${cert_id} CertificateString
Rahul Maheshwari037a3432019-05-23 00:55:40 -0500241
242 Run Keyword If '${expected_status}' == 'ok' Should Contain ${cert_file_content} ${bmc_cert_content}
Rahul Maheshwarice6e1a52020-02-11 04:09:19 -0600243 [Return] ${cert_id}
Rahul Maheshwari037a3432019-05-23 00:55:40 -0500244
Anusha Dathatri109c2ce2020-06-03 22:19:05 -0500245Modify BMC Date
246 [Documentation] Modify date in BMC.
247 [Arguments] ${date_set_type}=future
248
249 # Description of argument(s):
250 # date_set_type Set BMC date to a future or old date by 375 days.
251
252 Redfish Power Off stack_mode=skip
253 ${new_time}= Run Keyword If '${date_set_type}' == 'future'
254 ... Add Time To Date ${cli_date_time} 375 days
255 ... ELSE Subtract Time From Date ${cli_date_time} 375 days
256 # Enable manaual mode.
257 Redfish.Patch ${REDFISH_NW_PROTOCOL_URI}
258 ... body={'NTP':{'ProtocolEnabled': ${False}}}
259 ... valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
260 Redfish.Patch ${REDFISH_BASE_URI}Managers/bmc body={'DateTime': '${new_time}'}
261 ... valid_status_codes=[${HTTP_OK}]
262
263Get Current BMC Date
264 [Documentation] Get current BMC date.
265
266 ${cli_date_time}= CLI Get BMC DateTime
267 Set Test Variable ${cli_date_time}
268
269Restore BMC Date
270 [Documentation] Restore BMC date to its prior value.
271
272 Redfish.Patch ${REDFISH_BASE_URI}Managers/bmc body={'DateTime': '${cli_date_time}'}
273 ... valid_status_codes=[${HTTP_OK}]
Rahul Maheshwari037a3432019-05-23 00:55:40 -0500274
Rahul Maheshwarib4b8bb62019-03-04 23:56:10 -0600275Replace Certificate Via Redfish
276 [Documentation] Test 'replace certificate' operation in the BMC via Redfish.
277 [Arguments] ${cert_type} ${cert_format} ${expected_status}
278
279 # Description of argument(s):
280 # cert_type Certificate type (e.g. "Server" or "Client").
281 # cert_format Certificate file format
282 # (e.g. Valid_Certificate_Valid_Privatekey).
283 # expected_status Expected status of certificate replace Redfish
284 # request (i.e. "ok" or "error").
285
Rahul Maheshwaric1f43ed2019-06-03 01:00:16 -0500286 # Install certificate before replacing client or CA certificate.
Rahul Maheshwarice6e1a52020-02-11 04:09:19 -0600287 ${cert_id}= Run Keyword If '${cert_type}' == 'Client'
Rahul Maheshwaric1f43ed2019-06-03 01:00:16 -0500288 ... Install And Verify Certificate Via Redfish ${cert_type} Valid Certificate Valid Privatekey ok
289 ... ELSE IF '${cert_type}' == 'CA'
290 ... Install And Verify Certificate Via Redfish ${cert_type} Valid Certificate ok
Rahul Maheshwari9862eb52019-05-31 04:04:42 -0500291
Rahul Maheshwarib4b8bb62019-03-04 23:56:10 -0600292 ${time}= Set Variable If '${cert_format}' == 'Expired Certificate' -10 365
293 ${cert_file_path}= Generate Certificate File Via Openssl ${cert_format} ${time}
294
George Keishingbf17fab2019-06-13 09:22:22 -0500295 ${bytes}= OperatingSystem.Get Binary File ${cert_file_path}
296 ${file_data}= Decode Bytes To String ${bytes} UTF-8
Rahul Maheshwarib4b8bb62019-03-04 23:56:10 -0600297
Rahul Maheshwaric1f43ed2019-06-03 01:00:16 -0500298 ${certificate_uri}= Set Variable If
Rahul Maheshwaric142c092019-06-13 00:42:35 -0500299 ... '${cert_type}' == 'Server' ${REDFISH_HTTPS_CERTIFICATE_URI}/1
Rahul Maheshwaric1f43ed2019-06-03 01:00:16 -0500300 ... '${cert_type}' == 'Client' ${REDFISH_LDAP_CERTIFICATE_URI}/1
Rahul Maheshwarice6e1a52020-02-11 04:09:19 -0600301 ... '${cert_type}' == 'CA' ${REDFISH_CA_CERTIFICATE_URI}/${cert_id}
Rahul Maheshwarib4b8bb62019-03-04 23:56:10 -0600302
303 ${certificate_dict}= Create Dictionary @odata.id=${certificate_uri}
304 ${payload}= Create Dictionary CertificateString=${file_data}
305 ... CertificateType=PEM CertificateUri=${certificate_dict}
Rahul Maheshwari19e6e442019-06-03 00:22:45 -0500306
307 ${expected_resp}= Set Variable If '${expected_status}' == 'ok' ${HTTP_OK}
George Keishingd2251802020-01-24 00:23:12 -0600308 ... '${expected_status}' == 'error' ${HTTP_NOT_FOUND}, ${HTTP_INTERNAL_SERVER_ERROR}
Rahul Maheshwari9862eb52019-05-31 04:04:42 -0500309 ${resp}= redfish.Post /redfish/v1/CertificateService/Actions/CertificateService.ReplaceCertificate
Rahul Maheshwari19e6e442019-06-03 00:22:45 -0500310 ... body=${payload} valid_status_codes=[${expected_resp}]
Rahul Maheshwarib4b8bb62019-03-04 23:56:10 -0600311
312 ${cert_file_content}= OperatingSystem.Get File ${cert_file_path}
313 ${bmc_cert_content}= redfish_utils.Get Attribute ${certificate_uri} CertificateString
314
315 Run Keyword If '${expected_status}' == 'ok'
316 ... Should Contain ${cert_file_content} ${bmc_cert_content}
317 ... ELSE
318 ... Should Not Contain ${cert_file_content} ${bmc_cert_content}
319
320
Rahul Maheshwari1e0f6a82019-08-29 01:33:23 -0500321Generate CSR Via Redfish
322 [Documentation] Generate CSR using Redfish.
323 [Arguments] ${cert_type} ${key_pair_algorithm} ${key_bit_length} ${key_curv_id} ${expected_status}
324
325 # Description of argument(s):
326 # cert_type Certificate type ("Server" or "Client").
327 # key_pair_algorithm CSR key pair algorithm ("EC" or "RSA")
328 # key_bit_length CSR key bit length ("2048").
329 # key_curv_id CSR key curv id ("prime256v1" or "secp521r1" or "secp384r1").
330 # expected_status Expected status of certificate replace Redfish
331 # request ("ok" or "error").
332
Rahul Maheshwari1e0f6a82019-08-29 01:33:23 -0500333 ${certificate_uri}= Set Variable If
334 ... '${cert_type}' == 'Server' ${REDFISH_HTTPS_CERTIFICATE_URI}/
335 ... '${cert_type}' == 'Client' ${REDFISH_LDAP_CERTIFICATE_URI}/
336
337 ${certificate_dict}= Create Dictionary @odata.id=${certificate_uri}
338 ${payload}= Create Dictionary City=Austin CertificateCollection=${certificate_dict}
339 ... CommonName=${OPENBMC_HOST} Country=US Organization=IBM
340 ... OrganizationalUnit=ISL State=AU KeyBitLength=${key_bit_length}
341 ... KeyPairAlgorithm=${key_pair_algorithm} KeyCurveId=${key_curv_id}
342
343 # Remove not applicable field for CSR generation.
344 Run Keyword If '${key_pair_algorithm}' == 'EC' Remove From Dictionary ${payload} KeyBitLength
345 ... ELSE IF '${key_pair_algorithm}' == 'RSA' Remove From Dictionary ${payload} KeyCurveId
346
347 ${expected_resp}= Set Variable If '${expected_status}' == 'ok' ${HTTP_OK}
348 ... '${expected_status}' == 'error' ${HTTP_INTERNAL_SERVER_ERROR}, ${HTTP_BAD_REQUEST}
349 ${resp}= redfish.Post /redfish/v1/CertificateService/Actions/CertificateService.GenerateCSR
350 ... body=${payload} valid_status_codes=[${expected_resp}]
351
352 # Delay added between two CSR generation request.
353 Sleep 5s
354
355
Rahul Maheshwari3ecd1a62019-06-03 01:44:34 -0500356Delete Certificate Via BMC CLI
357 [Documentation] Delete certificate via BMC CLI.
358 [Arguments] ${cert_type}
359
360 # Description of argument(s):
361 # cert_type Certificate type (e.g. "Client" or "CA").
362
363 ${certificate_file_path} ${certificate_service} ${certificate_uri}=
364 ... Run Keyword If '${cert_type}' == 'Client'
365 ... Set Variable /etc/nslcd/certs/cert.pem phosphor-certificate-manager@nslcd.service
366 ... ${REDFISH_LDAP_CERTIFICATE_URI}
367 ... ELSE IF '${cert_type}' == 'CA'
Zbigniew Kurzynski84ae0d32019-10-11 15:51:59 +0200368 ... Set Variable ${ROOT_CA_FILE_PATH} phosphor-certificate-manager@authority.service
Rahul Maheshwari3ecd1a62019-06-03 01:44:34 -0500369 ... ${REDFISH_CA_CERTIFICATE_URI}
Rahul Maheshwaria5b17672019-05-30 11:08:30 -0500370
371 ${file_status} ${stderr} ${rc}= BMC Execute Command
Rahul Maheshwari3ecd1a62019-06-03 01:44:34 -0500372 ... [ -f ${certificate_file_path} ] && echo "Found" || echo "Not Found"
Rahul Maheshwaria5b17672019-05-30 11:08:30 -0500373
Rahul Maheshwari3ecd1a62019-06-03 01:44:34 -0500374 Return From Keyword If "${file_status}" != "Found"
375 BMC Execute Command rm ${certificate_file_path}
376 BMC Execute Command systemctl restart ${certificate_service}
Zbigniew Kurzynski84ae0d32019-10-11 15:51:59 +0200377 BMC Execute Command systemctl daemon-reload
George Keishing2d0804e2019-12-12 22:27:05 -0600378 Wait Until Keyword Succeeds 1 min 10 sec Redfish.Get ${certificate_uri}/1
379 ... valid_status_codes=[${HTTP_NOT_FOUND}, ${HTTP_INTERNAL_SERVER_ERROR}]
Rahul Maheshwaria5b17672019-05-30 11:08:30 -0500380
381
Rahul Maheshwari382c4dc2020-02-09 23:50:54 -0600382Delete All CA Certificate Via Redfish
383 [Documentation] Delete all CA certificate via Redfish.
384
385 ${cert_list}= Redfish_Utils.Get Member List /redfish/v1/Managers/bmc/Truststore/Certificates
386 FOR ${cert} IN @{cert_list}
387 Redfish.Delete ${cert} valid_status_codes=[${HTTP_NO_CONTENT}]
388 END
389
390
Rahul Maheshwarib4b8bb62019-03-04 23:56:10 -0600391Suite Setup Execution
392 [Documentation] Do suite setup tasks.
393
394 # Create certificate sub-directory in current working directory.
395 Create Directory certificate_dir
Anusha Dathatri109c2ce2020-06-03 22:19:05 -0500396 Redfish.Login
Rahul Maheshwarib4b8bb62019-03-04 23:56:10 -0600397
398
399Test Teardown Execution
400 [Documentation] Do the post test teardown.
401
402 FFDC On Test Case Fail
Anusha Dathatri109c2ce2020-06-03 22:19:05 -0500403
404Suite Teardown
405 [Documentation] Do suite teardown tasks.
406
407 Redfish.Logout