Added test to verify installed CA certificate
Added testcases:
- Verify Installed CA Certificate
Change-Id: I2e8fb36c3ebbde167b1aa2dcc3611ba05cbb9024
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 40e62b6..111bcc2 100644
--- a/gui/gui_test/access_control/test_obmc_gui_certificate.robot
+++ b/gui/gui_test/access_control/test_obmc_gui_certificate.robot
@@ -3,8 +3,8 @@
Documentation Test OpenBMC GUI "SSL Certificates" sub-menu of "Access control".
Resource ../../lib/resource.robot
+Resource ../../../lib/certificate_utils.robot
-Suite Setup Launch Browser And Login GUI
Suite Teardown Close Browser
Test Setup Test Setup Execution
@@ -74,11 +74,42 @@
Page Should Contain Element ${xpath_generate_csr_submit}
+Verify Installed CA Certificate
+ [Documentation] Install CA certificate and verify the same via GUI.
+ [Tags] Verify_Installed_CA_Certificate
+
+ Delete All CA Certificate Via Redfish
+
+ # Install CA certificate via Redfish.
+ ${file_data}= Generate Certificate File Data
+ Install Certificate File On BMC ${REDFISH_CA_CERTIFICATE_URI} ok data=${file_data}
+
+ # Verify CA certificate availability in GUI.
+ Page Should Contain CA Certificate
+
+
*** Keywords ***
+Generate Certificate File Data
+ [Documentation] Generate data of certificate file.
+
+ ${cert_file_path}= Generate Certificate File Via Openssl Valid Certificate 365
+ ${bytes}= OperatingSystem.Get Binary File ${cert_file_path}
+ ${file_data}= Decode Bytes To String ${bytes} UTF-8
+
+ [return] ${file_data}
+
+
Test Setup Execution
[Documentation] Do test case setup tasks.
Click Element ${xpath_access_control_menu}
Click Element ${xpath_ssl_certificates_sub_menu}
Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain ssl-certificates
+
+
+Suite Setup Execution
+ [Documentation] Do test case suite setup tasks.
+
+ Launch Browser And Login GUI
+ Create Directory certificate_dir