Sushma M M | 98fa877 | 2020-07-09 02:38:33 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
| 3 | Documentation Test OpenBMC GUI "SSL Certificates" sub-menu of "Access control". |
| 4 | |
| 5 | Resource ../../lib/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 | |
| 12 | |
| 13 | *** Variables *** |
| 14 | |
manashsarma | 23d4ddc | 2020-10-05 05:35:29 -0500 | [diff] [blame] | 15 | ${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'] |
| 30 | ${xpath_input_alternate_name} //input[@id='alternate-name'] |
| 31 | ${xpath_select_algorithm_button} //*[@data-test-id='modalGenerateCsr-select-keyPairAlgorithm'] |
Sushma M M | 98fa877 | 2020-07-09 02:38:33 -0500 | [diff] [blame] | 32 | |
| 33 | *** Test Cases *** |
| 34 | |
Sushma M M | 2630299 | 2020-08-31 01:15:26 -0500 | [diff] [blame] | 35 | Verify Navigation To SSL Certificate Page |
| 36 | [Documentation] Verify navigation to SSL certificate page. |
| 37 | [Tags] Verify_Navigation_To_SSL_Certificate_Page |
| 38 | |
| 39 | Page Should Contain Element ${xpath_certificate_heading} |
| 40 | |
| 41 | |
Sushma M M | 98fa877 | 2020-07-09 02:38:33 -0500 | [diff] [blame] | 42 | Verify Existence Of All Sections In Certificate Page |
| 43 | [Documentation] Verify existence of all sections in certificate page. |
| 44 | [Tags] Verify_Existence_Of_All_Sections_In_Certificate_Page |
| 45 | |
| 46 | Page should contain Certificate |
| 47 | Page should contain Valid from |
| 48 | Page should contain Valid until |
| 49 | |
| 50 | |
| 51 | Verify Existence Of Add Certificate Button |
| 52 | [Documentation] Verify existence of add certificate button. |
| 53 | [Tags] Verify_Existence_Of_Add_Certificate_Button |
| 54 | |
| 55 | Page Should Contain Element ${xpath_add_certificate_button} |
| 56 | |
manashsarma | 23d4ddc | 2020-10-05 05:35:29 -0500 | [diff] [blame] | 57 | Verify Generate CSR Certificate Button |
| 58 | [Documentation] Verify existence of all the fields of CSR generation. |
| 59 | [Tags] Verify_Generate_CSR_Certificate_Button |
| 60 | |
| 61 | Page Should Contain Element ${xpath_generate_csr_button} |
| 62 | Click Element ${xpath_generate_csr_button} |
| 63 | Wait Until Page Contains Element ${xpath_generate_csr_heading} |
| 64 | Page Should Contain Element ${xpath_select_certificate_type} |
| 65 | Page Should Contain Element ${xpath_select_country} |
| 66 | Page Should Contain Element ${xpath_input_state} |
| 67 | Page Should Contain Element ${xpath_input_city} |
| 68 | Page Should Contain Element ${xpath_input_company_name} |
| 69 | Page Should Contain Element ${xpath_input_common_name} |
| 70 | Page Should Contain Element ${xpath_input_challenge_password} |
| 71 | Page Should Contain Element ${xpath_input_contact_person} |
| 72 | Page Should Contain Element ${xpath_input_email_address} |
| 73 | Page Should Contain Element ${xpath_input_alternate_name} |
| 74 | Page Should Contain Element ${xpath_select_algorithm_button} |
| 75 | Page Should Contain Element ${xpath_generate_csr_submit} |
| 76 | |
Sushma M M | 98fa877 | 2020-07-09 02:38:33 -0500 | [diff] [blame] | 77 | |
manashsarma | b9feda7 | 2020-10-05 10:40:12 -0500 | [diff] [blame] | 78 | Verify Installed CA Certificate |
| 79 | [Documentation] Install CA certificate and verify the same via GUI. |
| 80 | [Tags] Verify_Installed_CA_Certificate |
| 81 | |
| 82 | Delete All CA Certificate Via Redfish |
| 83 | |
| 84 | # Install CA certificate via Redfish. |
| 85 | ${file_data}= Generate Certificate File Data |
| 86 | Install Certificate File On BMC ${REDFISH_CA_CERTIFICATE_URI} ok data=${file_data} |
| 87 | |
| 88 | # Verify CA certificate availability in GUI. |
| 89 | Page Should Contain CA Certificate |
| 90 | |
| 91 | |
manashsarma | e07858a | 2020-10-16 06:09:46 -0500 | [diff] [blame^] | 92 | Verify Installed HTTPS Certificate |
| 93 | [Documentation] Install HTTPS certificate via Redfish and verify it in GUI. |
| 94 | [Tags] Verify_Installed_HTTPS_Certificate |
| 95 | |
| 96 | # Install HTTPS certificate. |
| 97 | ${file_data}= Generate Certificate File Data |
| 98 | Install Certificate File On BMC ${REDFISH_HTTPS_CERTIFICATE_URI} ok data=${file_data} |
| 99 | |
| 100 | # Verify certificate is available in GUI. |
| 101 | Page Should Contain HTTPS Certificate |
| 102 | |
| 103 | |
| 104 | Verify Installed LDAP Certificate |
| 105 | [Documentation] Install LDAP certificate via Redfish and verify it in GUI. |
| 106 | [Tags] Verify_Installed_LDAP_Certificate |
| 107 | |
| 108 | Delete Certificate Via BMC CLI Client |
| 109 | |
| 110 | # Install LDAP certificate. |
| 111 | ${file_data}= Generate Certificate File Data |
| 112 | Install Certificate File On BMC ${REDFISH_LDAP_CERTIFICATE_URI} ok data=${file_data} |
| 113 | |
| 114 | # Verify certificate is available in GUI. |
| 115 | Page Should Contain LDAP Certificate |
| 116 | |
| 117 | |
Sushma M M | 98fa877 | 2020-07-09 02:38:33 -0500 | [diff] [blame] | 118 | *** Keywords *** |
| 119 | |
manashsarma | b9feda7 | 2020-10-05 10:40:12 -0500 | [diff] [blame] | 120 | Generate Certificate File Data |
| 121 | [Documentation] Generate data of certificate file. |
| 122 | |
| 123 | ${cert_file_path}= Generate Certificate File Via Openssl Valid Certificate 365 |
| 124 | ${bytes}= OperatingSystem.Get Binary File ${cert_file_path} |
| 125 | ${file_data}= Decode Bytes To String ${bytes} UTF-8 |
| 126 | |
| 127 | [return] ${file_data} |
| 128 | |
| 129 | |
Sushma M M | 98fa877 | 2020-07-09 02:38:33 -0500 | [diff] [blame] | 130 | Test Setup Execution |
| 131 | [Documentation] Do test case setup tasks. |
| 132 | |
| 133 | Click Element ${xpath_access_control_menu} |
| 134 | Click Element ${xpath_ssl_certificates_sub_menu} |
| 135 | Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain ssl-certificates |
manashsarma | b9feda7 | 2020-10-05 10:40:12 -0500 | [diff] [blame] | 136 | |
| 137 | |
| 138 | Suite Setup Execution |
| 139 | [Documentation] Do test case suite setup tasks. |
| 140 | |
| 141 | Launch Browser And Login GUI |
| 142 | Create Directory certificate_dir |