openbmc / openbmc-test-automation

Apache License 2.0
100 stars 92 forks source link

[Redfish]CertificateService: Enhance error handling for ReplaceCertificate #2199

Closed MickDaDa closed 10 months ago

MickDaDa commented 1 year ago

https://github.com/openbmc/openbmc-test-automation/blob/468d85faee9fcd558926ab0e26132fdea1be0937/redfish/dmtf_tools/test_redfishtool_certificate.robot#L383 Keyword: Verify Redfishtool Replace Certificate

Hi, Seems this case need to change \${HTTP_NOT_FOUND} to \${HTTP_INTERNAL_SERVER_ERROR} ?? follow: https://github.com/openbmc/bmcweb/commit/90d2d1e887e68c70f8e5923eb69c3c9356dae547

Tested:

gkeishin commented 1 year ago

@rahulmah @manashsarma can u handle this

manashsarma commented 1 year ago

I am looking. shall update

manashsarma commented 1 year ago

We have tested 'replace certificate' with following error scenarios :

  1. Empty Certificate, Empty Privatekey
  2. Empty Certificate, Valid Privatekey
  3. Valid Certificate, Empty Privatekey

For each of above case, response of Redfishtool Post ${payload} /redfish/v1/CertificateService/Actions/CertificateService.ReplaceCertificate comes as:

redfishtool: Transport: Response Error: status_code: 404 -- Not Found redfishtool: raw: Error sending POST to resource, aborting

so, expected_resp in such error cases is kept as ${HTTP_NOT_FOUND} in the code:

* code snippet *** ${expected_resp}= Set Variable If '${expected_status}' == 'ok' ${HTTP_OK} ... '${expected_status}' == 'error' ${HTTP_NOTFOUND}

${response}=  Redfishtool Post
...  ${payload}  /redfish/v1/CertificateService/Actions/CertificateService.ReplaceCertificate
...  expected_error=${expected_resp}

*****_

Please feel free if you have additional query / comment. Or you can share with us your test scenario.

gkeishin commented 1 year ago

@MickDaDa See if the above response answers your query.

MickDaDa commented 1 year ago

Please see the information below: https://github.com/openbmc/bmcweb/commit/90d2d1e887e68c70f8e5923eb69c3c9356dae547

I am not sure if the version is the same.

Tested:

manashsarma commented 1 year ago

@MickDaDa I checked. Still the same result (NotFound). Can you please confirm if you are getting 'InternalError' in two testcases below while passing : 'Valid Certificate 'and 'Empty Privatekey' . I understand this is same as 'CertificateString not containing privatekey' as you mention.

Verify Redfishtool Replace Server Certificate Errors Verify Redfishtool Replace Client Certificate Errors

manashsarma commented 1 year ago

@MickDaDa the redfishtool version used for verifying this is 1.1.5.

redfishtool -V redfishtool Version: 1.1.5

Which version you are using ?

gkeishin commented 1 year ago

@MickDaDa @manashsarma all good here ?

gkeishin commented 10 months ago

I believe we have no further query on this. Thank you for reaching out to us. Feel free to leave a note if more information is needed. Thank you for your contribution.

Closing the ticket.