Add GUI test cases for LDAP and HTTPS certificate installation

Added test cases:
- Verify Installed HTTPS Certificate
- Verify Installed LDAP Certificate

Change-Id: Ic155cd3fa89aa2d51a519ffcbe1a6dc220eb29c4
Signed-off-by: manashsarma <manashsarma@in.ibm.com>
diff --git a/gui/gui_test/access_control/test_obmc_gui_certificate.robot b/gui/gui_test/access_control/test_obmc_gui_certificate.robot
index e0c01ee..68ce941 100644
--- a/gui/gui_test/access_control/test_obmc_gui_certificate.robot
+++ b/gui/gui_test/access_control/test_obmc_gui_certificate.robot
@@ -89,6 +89,32 @@
     Page Should Contain  CA Certificate
 
 
+Verify Installed HTTPS Certificate
+    [Documentation]  Install HTTPS certificate via Redfish and verify it in GUI.
+    [Tags]  Verify_Installed_HTTPS_Certificate
+
+    # Install HTTPS certificate.
+    ${file_data}=  Generate Certificate File Data
+    Install Certificate File On BMC  ${REDFISH_HTTPS_CERTIFICATE_URI}  ok  data=${file_data}
+
+    # Verify certificate is available in GUI.
+    Page Should Contain  HTTPS Certificate
+
+
+Verify Installed LDAP Certificate
+    [Documentation]  Install LDAP certificate via Redfish and verify it in GUI.
+    [Tags]  Verify_Installed_LDAP_Certificate
+
+    Delete Certificate Via BMC CLI  Client
+
+    # Install LDAP certificate.
+    ${file_data}=  Generate Certificate File Data
+    Install Certificate File On BMC  ${REDFISH_LDAP_CERTIFICATE_URI}  ok  data=${file_data}
+
+    # Verify certificate is available in GUI.
+    Page Should Contain  LDAP Certificate
+
+
 *** Keywords ***
 
 Generate Certificate File Data
diff --git a/lib/certificate_utils.robot b/lib/certificate_utils.robot
index 6deaf6c..413deff 100755
--- a/lib/certificate_utils.robot
+++ b/lib/certificate_utils.robot
@@ -164,3 +164,29 @@
     FOR  ${cert}  IN  @{cert_list}
       Redfish.Delete  ${cert}  valid_status_codes=[${HTTP_NO_CONTENT}]
     END
+
+
+Delete Certificate Via BMC CLI
+    [Documentation]  Delete certificate via BMC CLI.
+    [Arguments]  ${cert_type}
+
+    # Description of argument(s):
+    # cert_type           Certificate type (e.g. "Client" or "CA").
+
+    ${certificate_file_path}  ${certificate_service}  ${certificate_uri}=
+    ...  Run Keyword If  '${cert_type}' == 'Client'
+    ...    Set Variable  /etc/nslcd/certs/cert.pem  phosphor-certificate-manager@nslcd.service
+    ...    ${REDFISH_LDAP_CERTIFICATE_URI}
+    ...  ELSE IF  '${cert_type}' == 'CA'
+    ...    Set Variable  ${ROOT_CA_FILE_PATH}  phosphor-certificate-manager@authority.service
+    ...    ${REDFISH_CA_CERTIFICATE_URI}
+
+    ${file_status}  ${stderr}  ${rc}=  BMC Execute Command
+    ...  [ -f ${certificate_file_path} ] && echo "Found" || echo "Not Found"
+
+    Return From Keyword If  "${file_status}" != "Found"
+    BMC Execute Command  rm ${certificate_file_path}
+    BMC Execute Command  systemctl restart ${certificate_service}
+    BMC Execute Command  systemctl daemon-reload
+    Wait Until Keyword Succeeds  1 min  10 sec  Redfish.Get  ${certificate_uri}/1
+    ...  valid_status_codes=[${HTTP_NOT_FOUND}, ${HTTP_INTERNAL_SERVER_ERROR}]
diff --git a/redfish/managers/test_certificate.robot b/redfish/managers/test_certificate.robot
index 88101c5..5adceaa 100644
--- a/redfish/managers/test_certificate.robot
+++ b/redfish/managers/test_certificate.robot
@@ -395,32 +395,6 @@
     Sleep  5s
 
 
-Delete Certificate Via BMC CLI
-    [Documentation]  Delete certificate via BMC CLI.
-    [Arguments]  ${cert_type}
-
-    # Description of argument(s):
-    # cert_type           Certificate type (e.g. "Client" or "CA").
-
-    ${certificate_file_path}  ${certificate_service}  ${certificate_uri}=
-    ...  Run Keyword If  '${cert_type}' == 'Client'
-    ...    Set Variable  /etc/nslcd/certs/cert.pem  phosphor-certificate-manager@nslcd.service
-    ...    ${REDFISH_LDAP_CERTIFICATE_URI}
-    ...  ELSE IF  '${cert_type}' == 'CA'
-    ...    Set Variable  ${ROOT_CA_FILE_PATH}  phosphor-certificate-manager@authority.service
-    ...    ${REDFISH_CA_CERTIFICATE_URI}
-
-    ${file_status}  ${stderr}  ${rc}=  BMC Execute Command
-    ...  [ -f ${certificate_file_path} ] && echo "Found" || echo "Not Found"
-
-    Return From Keyword If  "${file_status}" != "Found"
-    BMC Execute Command  rm ${certificate_file_path}
-    BMC Execute Command  systemctl restart ${certificate_service}
-    BMC Execute Command  systemctl daemon-reload
-    Wait Until Keyword Succeeds  1 min  10 sec  Redfish.Get  ${certificate_uri}/1
-    ...  valid_status_codes=[${HTTP_NOT_FOUND}, ${HTTP_INTERNAL_SERVER_ERROR}]
-
-
 Suite Setup Execution
     [Documentation]  Do suite setup tasks.