Added case to verify certificates location Via Redfish
Added case to verify certificates location by install a valid
certificate.
Signed-off-by: Tony Lee <tony.lee@quantatw.com>
Change-Id: Ia5bbfb3f410f764b195a6a1a3df3cddb97f4e854
diff --git a/redfish/managers/test_certificate.robot b/redfish/managers/test_certificate.robot
index 353f0fd..a8d9571 100644
--- a/redfish/managers/test_certificate.robot
+++ b/redfish/managers/test_certificate.robot
@@ -228,6 +228,30 @@
CA Not Yet Valid Certificate ok
+Verify Certificates Location Via Redfish
+ [Documentation] Verify the location of certificates via Redfish.
+ [Tags] Verify_Certificates_Location_Via_Redfish
+
+ ${cert_id}= Install And Verify Certificate Via Redfish
+ ... CA Valid Certificate ok
+
+ ${resp}= Redfish.Get /redfish/v1/CertificateService/CertificateLocations
+ ${Links}= Get From Dictionary ${resp.dict} Links
+
+ ${match_cert}= Catenate
+ ... /redfish/v1/Managers/bmc/Truststore/Certificates/${cert_id}
+ ${match}= Set Variable ${False}
+
+ FOR ${Certificates_dict} IN @{Links['Certificates']}
+ Continue For Loop If
+ ... "${Certificates_dict['@odata.id']}}" != "${match_cert}}"
+ ${match}= Set Variable ${True}
+ END
+
+ Should Be Equal ${match} ${True}
+ ... msg=Verify the location of certificates via Redfish fail.
+
+
*** Keywords ***
Install And Verify Certificate Via Redfish