Added support to delete CA certificate via Redfish

Change-Id: I516ef5b22e785ddcd4dd06f048930ad3377b8f98
Signed-off-by: Rahul Maheshwari <rahulmaheshwari@in.ibm.com>
diff --git a/redfish/managers/test_certificate.robot b/redfish/managers/test_certificate.robot
index 382ef88..83906a0 100644
--- a/redfish/managers/test_certificate.robot
+++ b/redfish/managers/test_certificate.robot
@@ -157,7 +157,8 @@
     #                     request (i.e. "ok" or "error").
 
     redfish.Login
-    Delete Certificate Via BMC CLI  ${cert_type}
+    Run Keyword If  '${cert_type}' == 'CA'  Delete All CA Certificate Via Redfish
+    ...  ELSE IF  '${cert_type}' == 'Client'  Delete Certificate Via BMC CLI  ${cert_type}
 
     ${time}=  Set Variable If  '${cert_format}' == 'Expired Certificate'  -10  365
     ${cert_file_path}=  Generate Certificate File Via Openssl  ${cert_format}  ${time}
@@ -323,6 +324,15 @@
     ...  valid_status_codes=[${HTTP_NOT_FOUND}, ${HTTP_INTERNAL_SERVER_ERROR}]
 
 
+Delete All CA Certificate Via Redfish
+    [Documentation]  Delete all CA certificate via Redfish.
+
+    ${cert_list}=  Redfish_Utils.Get Member List  /redfish/v1/Managers/bmc/Truststore/Certificates
+    FOR  ${cert}  IN  @{cert_list}
+      Redfish.Delete  ${cert}  valid_status_codes=[${HTTP_NO_CONTENT}]
+    END
+
+
 Suite Setup Execution
     [Documentation]  Do suite setup tasks.