blob: 10e6947836bdbb78029ae2abc1f46c786b51faa2 [file] [log] [blame]
Sushma M M98fa8772020-07-09 02:38:33 -05001*** Settings ***
2
3Documentation Test OpenBMC GUI "SSL Certificates" sub-menu of "Access control".
4
Rahul Maheshwari41747da2020-11-17 09:09:52 -06005Resource ../../lib/gui_resource.robot
manashsarmab9feda72020-10-05 10:40:12 -05006Resource ../../../lib/certificate_utils.robot
Sushma M M98fa8772020-07-09 02:38:33 -05007
Rahul Maheshwari612f8dc2020-10-28 21:34:43 -05008Suite Setup Suite Setup Execution
Sushma M M98fa8772020-07-09 02:38:33 -05009Suite Teardown Close Browser
10Test Setup Test Setup Execution
11
12
13*** Variables ***
14
manashsarma23d4ddc2020-10-05 05:35:29 -050015${xpath_certificate_heading} //h1[text()="SSL certificates"]
16${xpath_add_certificate_button} //button[contains(text(),"Add new certificate")]
17${xpath_generate_csr_button} //*[@data-test-id='sslCertificates-button-generateCsr']
18${xpath_generate_csr_heading} //h5[contains(text(), "Generate a Certificate Signing Request")]
19${xpath_select_certificate_type} //*[@data-test-id='modalGenerateCsr-select-certificateType']
20${xpath_select_country} //*[@data-test-id='modalGenerateCsr-select-country']
21${xpath_input_state} //*[@data-test-id='modalGenerateCsr-input-state']
22${xpath_input_city} //*[@data-test-id='modalGenerateCsr-input-city']
23${xpath_input_company_name} //*[@data-test-id='modalGenerateCsr-input-companyName']
24${xpath_input_company_unit} //*[@data-test-id='modalGenerateCsr-input-companyUnit']
25${xpath_input_common_name} //*[@data-test-id='modalGenerateCsr-input-commonName']
26${xpath_input_challenge_password} //*[@data-test-id='modalGenerateCsr-input-challengePassword']
27${xpath_input_contact_person} //*[@data-test-id='modalGenerateCsr-input-contactPerson']
28${xpath_input_email_address} //*[@data-test-id='modalGenerateCsr-input-emailAddress']
29${xpath_generate_csr_submit} //*[@data-test-id='modalGenerateCsr-button-ok']
manashsarma4e02bfc2020-11-02 03:03:29 -060030${xpath_csr_cancel_button} //button[contains(text(),"Cancel")]
manashsarma23d4ddc2020-10-05 05:35:29 -050031${xpath_input_alternate_name} //input[@id='alternate-name']
32${xpath_select_algorithm_button} //*[@data-test-id='modalGenerateCsr-select-keyPairAlgorithm']
Sushma M M98fa8772020-07-09 02:38:33 -050033
34*** Test Cases ***
35
Sushma M M26302992020-08-31 01:15:26 -050036Verify Navigation To SSL Certificate Page
37 [Documentation] Verify navigation to SSL certificate page.
38 [Tags] Verify_Navigation_To_SSL_Certificate_Page
39
40 Page Should Contain Element ${xpath_certificate_heading}
41
42
Sushma M M98fa8772020-07-09 02:38:33 -050043Verify Existence Of All Sections In Certificate Page
44 [Documentation] Verify existence of all sections in certificate page.
45 [Tags] Verify_Existence_Of_All_Sections_In_Certificate_Page
46
47 Page should contain Certificate
48 Page should contain Valid from
49 Page should contain Valid until
50
51
52Verify Existence Of Add Certificate Button
53 [Documentation] Verify existence of add certificate button.
54 [Tags] Verify_Existence_Of_Add_Certificate_Button
55
56 Page Should Contain Element ${xpath_add_certificate_button}
57
manashsarma23d4ddc2020-10-05 05:35:29 -050058Verify Generate CSR Certificate Button
59 [Documentation] Verify existence of all the fields of CSR generation.
60 [Tags] Verify_Generate_CSR_Certificate_Button
manashsarma4e02bfc2020-11-02 03:03:29 -060061 [Teardown] Click Element ${xpath_csr_cancel_button}
manashsarma23d4ddc2020-10-05 05:35:29 -050062
manashsarma4e02bfc2020-11-02 03:03:29 -060063 Page Should Contain Element ${xpath_generate_csr_button}
64 Click Element ${xpath_generate_csr_button}
65 Wait Until Page Contains Element ${xpath_generate_csr_heading}
66 Page Should Contain Element ${xpath_select_certificate_type}
67 Page Should Contain Element ${xpath_select_country}
68 Page Should Contain Element ${xpath_input_state}
69 Page Should Contain Element ${xpath_input_city}
70 Page Should Contain Element ${xpath_input_company_name}
71 Page Should Contain Element ${xpath_input_common_name}
72 Page Should Contain Element ${xpath_input_challenge_password}
73 Page Should Contain Element ${xpath_input_contact_person}
74 Page Should Contain Element ${xpath_input_email_address}
75 Page Should Contain Element ${xpath_input_alternate_name}
76 Page Should Contain Element ${xpath_select_algorithm_button}
77 Page Should Contain Element ${xpath_generate_csr_submit}
manashsarma23d4ddc2020-10-05 05:35:29 -050078
Sushma M M98fa8772020-07-09 02:38:33 -050079
manashsarmab9feda72020-10-05 10:40:12 -050080Verify Installed CA Certificate
81 [Documentation] Install CA certificate and verify the same via GUI.
82 [Tags] Verify_Installed_CA_Certificate
83
84 Delete All CA Certificate Via Redfish
85
86 # Install CA certificate via Redfish.
manashsarmab56a2532020-11-17 06:17:40 -060087 ${file_data}= Generate Certificate File Data CA
manashsarmab9feda72020-10-05 10:40:12 -050088 Install Certificate File On BMC ${REDFISH_CA_CERTIFICATE_URI} ok data=${file_data}
89
90 # Verify CA certificate availability in GUI.
manashsarmad2376442020-12-16 05:14:10 -060091 Wait Until Page Contains CA Certificate timeout=10
manashsarmab9feda72020-10-05 10:40:12 -050092
93
manashsarmae07858a2020-10-16 06:09:46 -050094Verify Installed HTTPS Certificate
95 [Documentation] Install HTTPS certificate via Redfish and verify it in GUI.
96 [Tags] Verify_Installed_HTTPS_Certificate
97
Ashwini Chandrappa6b20ffa2021-08-04 03:18:37 -050098 # Replace HTTPS certificate.
99 Replace Certificate Via Redfish Server Valid Certificate Valid Privatekey ok
manashsarmae07858a2020-10-16 06:09:46 -0500100
101 # Verify certificate is available in GUI.
manashsarmad2376442020-12-16 05:14:10 -0600102 Wait Until Page Contains HTTPS Certificate timeout=10
manashsarmae07858a2020-10-16 06:09:46 -0500103
104
105Verify Installed LDAP Certificate
106 [Documentation] Install LDAP certificate via Redfish and verify it in GUI.
107 [Tags] Verify_Installed_LDAP_Certificate
108
109 Delete Certificate Via BMC CLI Client
110
111 # Install LDAP certificate.
manashsarmab56a2532020-11-17 06:17:40 -0600112 ${file_data}= Generate Certificate File Data Client
manashsarmae07858a2020-10-16 06:09:46 -0500113 Install Certificate File On BMC ${REDFISH_LDAP_CERTIFICATE_URI} ok data=${file_data}
114
115 # Verify certificate is available in GUI.
manashsarmad2376442020-12-16 05:14:10 -0600116 Wait Until Page Contains LDAP Certificate timeout=10
manashsarmae07858a2020-10-16 06:09:46 -0500117
118
Sushma M M98fa8772020-07-09 02:38:33 -0500119*** Keywords ***
120
manashsarmab9feda72020-10-05 10:40:12 -0500121Generate Certificate File Data
122 [Documentation] Generate data of certificate file.
123
manashsarmab56a2532020-11-17 06:17:40 -0600124 [Arguments] ${cert_type}
125
126 # Description of Arguments(s):
127 # cert_type Certificate type (e.g. "Client" or "CA").
128
129 ${cert_file_path}= Run Keyword If '${cert_type}' == 'Client' or 'Server'
130 ... Generate Certificate File Via Openssl Valid Certificate Valid Privatekey
131 ... ELSE IF '${cert_type}' == 'CA'
132 ... Generate Certificate File Via Openssl Valid Certificate
manashsarmab9feda72020-10-05 10:40:12 -0500133 ${bytes}= OperatingSystem.Get Binary File ${cert_file_path}
134 ${file_data}= Decode Bytes To String ${bytes} UTF-8
135
136 [return] ${file_data}
137
138
Sushma M M98fa8772020-07-09 02:38:33 -0500139Test Setup Execution
140 [Documentation] Do test case setup tasks.
141
142 Click Element ${xpath_access_control_menu}
143 Click Element ${xpath_ssl_certificates_sub_menu}
144 Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain ssl-certificates
manashsarmab9feda72020-10-05 10:40:12 -0500145
146
147Suite Setup Execution
148 [Documentation] Do test case suite setup tasks.
149
150 Launch Browser And Login GUI
151 Create Directory certificate_dir