Sushma M M | 98fa877 | 2020-07-09 02:38:33 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 3 | Documentation Test OpenBMC GUI "Certificates" sub-menu of "Security and access". |
Sushma M M | 98fa877 | 2020-07-09 02:38:33 -0500 | [diff] [blame] | 4 | |
Rahul Maheshwari | 41747da | 2020-11-17 09:09:52 -0600 | [diff] [blame] | 5 | Resource ../../lib/gui_resource.robot |
manashsarma | b9feda7 | 2020-10-05 10:40:12 -0500 | [diff] [blame] | 6 | Resource ../../../lib/certificate_utils.robot |
Sushma M M | 98fa877 | 2020-07-09 02:38:33 -0500 | [diff] [blame] | 7 | |
Rahul Maheshwari | 612f8dc | 2020-10-28 21:34:43 -0500 | [diff] [blame] | 8 | Suite Setup Suite Setup Execution |
Sushma M M | 98fa877 | 2020-07-09 02:38:33 -0500 | [diff] [blame] | 9 | Suite Teardown Close Browser |
| 10 | Test Setup Test Setup Execution |
| 11 | |
George Keishing | 0302e9a | 2023-10-12 21:48:35 +0530 | [diff] [blame] | 12 | Force Tags Certificates_Sub_Menu |
Sushma M M | 98fa877 | 2020-07-09 02:38:33 -0500 | [diff] [blame] | 13 | |
| 14 | *** Variables *** |
| 15 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 16 | ${xpath_certificate_heading} //h1[text()="Certificates"] |
manashsarma | 23d4ddc | 2020-10-05 05:35:29 -0500 | [diff] [blame] | 17 | ${xpath_add_certificate_button} //button[contains(text(),"Add new certificate")] |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 18 | ${xpath_generate_csr_button} //*[@data-test-id='certificates-button-generateCsr'] |
manashsarma | 23d4ddc | 2020-10-05 05:35:29 -0500 | [diff] [blame] | 19 | ${xpath_generate_csr_heading} //h5[contains(text(), "Generate a Certificate Signing Request")] |
| 20 | ${xpath_select_certificate_type} //*[@data-test-id='modalGenerateCsr-select-certificateType'] |
| 21 | ${xpath_select_country} //*[@data-test-id='modalGenerateCsr-select-country'] |
| 22 | ${xpath_input_state} //*[@data-test-id='modalGenerateCsr-input-state'] |
| 23 | ${xpath_input_city} //*[@data-test-id='modalGenerateCsr-input-city'] |
| 24 | ${xpath_input_company_name} //*[@data-test-id='modalGenerateCsr-input-companyName'] |
| 25 | ${xpath_input_company_unit} //*[@data-test-id='modalGenerateCsr-input-companyUnit'] |
| 26 | ${xpath_input_common_name} //*[@data-test-id='modalGenerateCsr-input-commonName'] |
| 27 | ${xpath_input_challenge_password} //*[@data-test-id='modalGenerateCsr-input-challengePassword'] |
| 28 | ${xpath_input_contact_person} //*[@data-test-id='modalGenerateCsr-input-contactPerson'] |
| 29 | ${xpath_input_email_address} //*[@data-test-id='modalGenerateCsr-input-emailAddress'] |
| 30 | ${xpath_generate_csr_submit} //*[@data-test-id='modalGenerateCsr-button-ok'] |
manashsarma | 4e02bfc | 2020-11-02 03:03:29 -0600 | [diff] [blame] | 31 | ${xpath_csr_cancel_button} //button[contains(text(),"Cancel")] |
manashsarma | 23d4ddc | 2020-10-05 05:35:29 -0500 | [diff] [blame] | 32 | ${xpath_input_alternate_name} //input[@id='alternate-name'] |
| 33 | ${xpath_select_algorithm_button} //*[@data-test-id='modalGenerateCsr-select-keyPairAlgorithm'] |
Sushma M M | 98fa877 | 2020-07-09 02:38:33 -0500 | [diff] [blame] | 34 | |
| 35 | *** Test Cases *** |
| 36 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 37 | Verify Navigation To Certificate Page |
| 38 | [Documentation] Verify navigation to certificate page. |
| 39 | [Tags] Verify_Navigation_To_Certificate_Page |
Sushma M M | 2630299 | 2020-08-31 01:15:26 -0500 | [diff] [blame] | 40 | |
| 41 | Page Should Contain Element ${xpath_certificate_heading} |
| 42 | |
| 43 | |
Sushma M M | 98fa877 | 2020-07-09 02:38:33 -0500 | [diff] [blame] | 44 | Verify Existence Of All Sections In Certificate Page |
| 45 | [Documentation] Verify existence of all sections in certificate page. |
| 46 | [Tags] Verify_Existence_Of_All_Sections_In_Certificate_Page |
| 47 | |
| 48 | Page should contain Certificate |
rramyasr-in | 281ab89 | 2023-10-25 06:15:51 -0500 | [diff] [blame] | 49 | Page should contain Issued by |
| 50 | Page should contain Issued to |
Sushma M M | 98fa877 | 2020-07-09 02:38:33 -0500 | [diff] [blame] | 51 | Page should contain Valid from |
| 52 | Page should contain Valid until |
| 53 | |
| 54 | |
| 55 | Verify Existence Of Add Certificate Button |
| 56 | [Documentation] Verify existence of add certificate button. |
| 57 | [Tags] Verify_Existence_Of_Add_Certificate_Button |
| 58 | |
| 59 | Page Should Contain Element ${xpath_add_certificate_button} |
| 60 | |
manashsarma | 23d4ddc | 2020-10-05 05:35:29 -0500 | [diff] [blame] | 61 | Verify Generate CSR Certificate Button |
| 62 | [Documentation] Verify existence of all the fields of CSR generation. |
| 63 | [Tags] Verify_Generate_CSR_Certificate_Button |
manashsarma | 4e02bfc | 2020-11-02 03:03:29 -0600 | [diff] [blame] | 64 | [Teardown] Click Element ${xpath_csr_cancel_button} |
manashsarma | 23d4ddc | 2020-10-05 05:35:29 -0500 | [diff] [blame] | 65 | |
manashsarma | 4e02bfc | 2020-11-02 03:03:29 -0600 | [diff] [blame] | 66 | Page Should Contain Element ${xpath_generate_csr_button} |
| 67 | Click Element ${xpath_generate_csr_button} |
| 68 | Wait Until Page Contains Element ${xpath_generate_csr_heading} |
| 69 | Page Should Contain Element ${xpath_select_certificate_type} |
| 70 | Page Should Contain Element ${xpath_select_country} |
| 71 | Page Should Contain Element ${xpath_input_state} |
| 72 | Page Should Contain Element ${xpath_input_city} |
| 73 | Page Should Contain Element ${xpath_input_company_name} |
| 74 | Page Should Contain Element ${xpath_input_common_name} |
| 75 | Page Should Contain Element ${xpath_input_challenge_password} |
| 76 | Page Should Contain Element ${xpath_input_contact_person} |
| 77 | Page Should Contain Element ${xpath_input_email_address} |
| 78 | Page Should Contain Element ${xpath_input_alternate_name} |
| 79 | Page Should Contain Element ${xpath_select_algorithm_button} |
| 80 | Page Should Contain Element ${xpath_generate_csr_submit} |
manashsarma | 23d4ddc | 2020-10-05 05:35:29 -0500 | [diff] [blame] | 81 | |
Sushma M M | 98fa877 | 2020-07-09 02:38:33 -0500 | [diff] [blame] | 82 | |
manashsarma | b9feda7 | 2020-10-05 10:40:12 -0500 | [diff] [blame] | 83 | Verify Installed CA Certificate |
| 84 | [Documentation] Install CA certificate and verify the same via GUI. |
| 85 | [Tags] Verify_Installed_CA_Certificate |
| 86 | |
| 87 | Delete All CA Certificate Via Redfish |
| 88 | |
| 89 | # Install CA certificate via Redfish. |
manashsarma | b56a253 | 2020-11-17 06:17:40 -0600 | [diff] [blame] | 90 | ${file_data}= Generate Certificate File Data CA |
rramyasr-in | 10e4f10 | 2023-03-17 00:13:06 -0500 | [diff] [blame] | 91 | Install And Verify Certificate Via Redfish CA Valid Certificate ok |
manashsarma | b9feda7 | 2020-10-05 10:40:12 -0500 | [diff] [blame] | 92 | |
Ashwini Chandrappa | 8dcd93d | 2021-09-22 08:41:45 -0500 | [diff] [blame] | 93 | # Refresh GUI and verify CA certificate availability in GUI. |
| 94 | Refresh GUI |
manashsarma | d237644 | 2020-12-16 05:14:10 -0600 | [diff] [blame] | 95 | Wait Until Page Contains CA Certificate timeout=10 |
manashsarma | b9feda7 | 2020-10-05 10:40:12 -0500 | [diff] [blame] | 96 | |
| 97 | |
manashsarma | e07858a | 2020-10-16 06:09:46 -0500 | [diff] [blame] | 98 | Verify Installed HTTPS Certificate |
| 99 | [Documentation] Install HTTPS certificate via Redfish and verify it in GUI. |
| 100 | [Tags] Verify_Installed_HTTPS_Certificate |
| 101 | |
Ashwini Chandrappa | 6b20ffa | 2021-08-04 03:18:37 -0500 | [diff] [blame] | 102 | # Replace HTTPS certificate. |
rramyasr-in | 8fa81a9 | 2022-12-06 10:45:25 -0600 | [diff] [blame] | 103 | Redfish.Login |
Ashwini Chandrappa | 6b20ffa | 2021-08-04 03:18:37 -0500 | [diff] [blame] | 104 | Replace Certificate Via Redfish Server Valid Certificate Valid Privatekey ok |
rramyasr-in | 8fa81a9 | 2022-12-06 10:45:25 -0600 | [diff] [blame] | 105 | Redfish.Logout |
manashsarma | e07858a | 2020-10-16 06:09:46 -0500 | [diff] [blame] | 106 | |
| 107 | # Verify certificate is available in GUI. |
manashsarma | d237644 | 2020-12-16 05:14:10 -0600 | [diff] [blame] | 108 | Wait Until Page Contains HTTPS Certificate timeout=10 |
manashsarma | e07858a | 2020-10-16 06:09:46 -0500 | [diff] [blame] | 109 | |
| 110 | |
| 111 | Verify Installed LDAP Certificate |
| 112 | [Documentation] Install LDAP certificate via Redfish and verify it in GUI. |
| 113 | [Tags] Verify_Installed_LDAP_Certificate |
| 114 | |
rramyasr-in | 0b058b5 | 2023-04-04 05:03:29 -0500 | [diff] [blame] | 115 | Redfish.Login |
manashsarma | e07858a | 2020-10-16 06:09:46 -0500 | [diff] [blame] | 116 | Delete Certificate Via BMC CLI Client |
| 117 | |
| 118 | # Install LDAP certificate. |
manashsarma | b56a253 | 2020-11-17 06:17:40 -0600 | [diff] [blame] | 119 | ${file_data}= Generate Certificate File Data Client |
rramyasr-in | 10e4f10 | 2023-03-17 00:13:06 -0500 | [diff] [blame] | 120 | Install And Verify Certificate Via Redfish Client Valid Certificate Valid Privatekey ok |
rramyasr-in | 0b058b5 | 2023-04-04 05:03:29 -0500 | [diff] [blame] | 121 | Redfish.Logout |
manashsarma | e07858a | 2020-10-16 06:09:46 -0500 | [diff] [blame] | 122 | |
Ashwini Chandrappa | 8dcd93d | 2021-09-22 08:41:45 -0500 | [diff] [blame] | 123 | # Refresh GUI and verify certificate is available in GUI. |
| 124 | Refresh GUI |
manashsarma | d237644 | 2020-12-16 05:14:10 -0600 | [diff] [blame] | 125 | Wait Until Page Contains LDAP Certificate timeout=10 |
manashsarma | e07858a | 2020-10-16 06:09:46 -0500 | [diff] [blame] | 126 | |
| 127 | |
Sushma M M | 98fa877 | 2020-07-09 02:38:33 -0500 | [diff] [blame] | 128 | *** Keywords *** |
| 129 | |
manashsarma | b9feda7 | 2020-10-05 10:40:12 -0500 | [diff] [blame] | 130 | Generate Certificate File Data |
| 131 | [Documentation] Generate data of certificate file. |
| 132 | |
manashsarma | b56a253 | 2020-11-17 06:17:40 -0600 | [diff] [blame] | 133 | [Arguments] ${cert_type} |
| 134 | |
| 135 | # Description of Arguments(s): |
| 136 | # cert_type Certificate type (e.g. "Client" or "CA"). |
| 137 | |
| 138 | ${cert_file_path}= Run Keyword If '${cert_type}' == 'Client' or 'Server' |
| 139 | ... Generate Certificate File Via Openssl Valid Certificate Valid Privatekey |
| 140 | ... ELSE IF '${cert_type}' == 'CA' |
| 141 | ... Generate Certificate File Via Openssl Valid Certificate |
manashsarma | b9feda7 | 2020-10-05 10:40:12 -0500 | [diff] [blame] | 142 | ${bytes}= OperatingSystem.Get Binary File ${cert_file_path} |
| 143 | ${file_data}= Decode Bytes To String ${bytes} UTF-8 |
| 144 | |
| 145 | [return] ${file_data} |
| 146 | |
| 147 | |
Sushma M M | 98fa877 | 2020-07-09 02:38:33 -0500 | [diff] [blame] | 148 | Test Setup Execution |
| 149 | [Documentation] Do test case setup tasks. |
| 150 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 151 | Click Element ${xpath_secuity_and_accesss_menu} |
| 152 | Click Element ${xpath_certificates_sub_menu} |
| 153 | Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain certificates |
rramyasr-in | 9e2c96f | 2023-01-24 07:59:34 -0600 | [diff] [blame] | 154 | Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30 |
manashsarma | b9feda7 | 2020-10-05 10:40:12 -0500 | [diff] [blame] | 155 | |
| 156 | |
| 157 | Suite Setup Execution |
| 158 | [Documentation] Do test case suite setup tasks. |
| 159 | |
| 160 | Launch Browser And Login GUI |
| 161 | Create Directory certificate_dir |