Anves Kumar rayankula | d6c35b1 | 2021-07-13 00:11:47 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Test BMC multiple network interface functionalities via GUI. |
| 3 | |
| 4 | Resource ../../lib/gui_resource.robot |
| 5 | Resource ../../../lib/resource.robot |
Anves Kumar rayankula | 7933703 | 2021-07-13 00:22:36 -0500 | [diff] [blame] | 6 | Resource ../../../lib/certificate_utils.robot |
Anves Kumar rayankula | d6c35b1 | 2021-07-13 00:11:47 -0500 | [diff] [blame] | 7 | |
| 8 | Suite Setup Suite Setup Execution |
| 9 | Test Teardown FFDC On Test Case Fail |
| 10 | |
| 11 | *** Variables *** |
| 12 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 13 | ${bmc_url} https://${OPENBMC_HOST} |
| 14 | ${bmc_url_1} https://${OPENBMC_HOST_1} |
| 15 | ${LDAP_FILE_PATH} ${EMPTY} |
| 16 | ${CA_FILE_PATH} ${EMPTY} |
Anves Kumar rayankula | 7933703 | 2021-07-13 00:22:36 -0500 | [diff] [blame] | 17 | |
| 18 | ${xpath_add_new_certificate} //*[contains(text(), ' Add new certificate ')] |
| 19 | ${xpath_certificate_type} //*[@id="certificate-type"] |
| 20 | ${xpath_upload_file} //*[@id="certificate-file"] |
| 21 | ${xpath_load_certificate} //button[text()=' Add '] |
| 22 | ${xpath_close_poup} //*[@class="close ml-auto mb-1"] |
Anves Kumar rayankula | d6c35b1 | 2021-07-13 00:11:47 -0500 | [diff] [blame] | 23 | |
| 24 | *** Test Cases *** |
| 25 | |
| 26 | Verify BMC GUI Is Accessible Via Both Network Interfaces |
| 27 | [Documentation] Verify BMC GUI is accessible via both network interfaces. |
| 28 | [Tags] Verify_BMC_GUI_Is_Accessible_Via_Both_Network_Interfaces |
| 29 | [Teardown] Close All Browsers |
| 30 | |
| 31 | Start Virtual Display |
| 32 | ${browser_ID}= Open Browser ${bmc_url} alias=tab1 |
| 33 | Set Window Size 1920 1080 |
| 34 | ${browser_ID}= Open Browser ${bmc_url_1} alias=tab2 |
| 35 | Set Window Size 1920 1080 |
| 36 | Switch Browser tab1 |
| 37 | Run Keywords Login GUI AND Logout GUI |
| 38 | Switch Browser tab2 |
| 39 | Run Keywords Login GUI AND Logout GUI |
| 40 | |
Anves Kumar rayankula | 7933703 | 2021-07-13 00:22:36 -0500 | [diff] [blame] | 41 | |
| 42 | Load Certificates Via Eth1 IP Address And Verify |
| 43 | [Documentation] Verify ability to load LDAP certificate using eth1 IP address. |
| 44 | [Tags] Load_Certificates_Via_Eth1_IP_Address_And_Verify |
| 45 | [Template] Load Certificates On BMC Via GUI |
| 46 | |
| 47 | # bmc_url certificate_type file_path |
| 48 | ${bmc_url_1} Client ${LDAP_FILE_PATH} |
| 49 | ${bmc_url_1} CA ${CA_FILE_PATH} |
| 50 | |
| 51 | |
Anves Kumar rayankula | d6c35b1 | 2021-07-13 00:11:47 -0500 | [diff] [blame] | 52 | *** keywords *** |
| 53 | |
| 54 | Suite Setup Execution |
| 55 | [Documentation] Do suite setup task. |
| 56 | |
| 57 | Valid Value OPENBMC_HOST_1 |
| 58 | |
| 59 | # Check both interfaces are configured and reachable. |
| 60 | Ping Host ${OPENBMC_HOST} |
| 61 | Ping Host ${OPENBMC_HOST_1} |
Anves Kumar rayankula | 7933703 | 2021-07-13 00:22:36 -0500 | [diff] [blame] | 62 | |
| 63 | |
| 64 | Load Certificates On BMC Via GUI |
| 65 | [Documentation] Load certificate on BMC via GUI. |
| 66 | [Arguments] ${bmc_url} ${certificate_type} ${file_path} ${delete_cert}=${True} |
| 67 | [Teardown] Run Keywords Logout GUI AND Close Browser |
| 68 | |
| 69 | # Description of argument(s): |
| 70 | # bmc_url Openbmc GUI URL to be open. |
| 71 | # certificate_type Certificate type. |
| 72 | # (e.g. "LDAP Certificate" or "CA Certificate"). |
| 73 | # file_path Certificate file path (e.g. "/home/folder/file.pem"). |
| 74 | |
| 75 | ${path} ${ext}= Split Extension ${file_path} |
| 76 | Run Keyword If '${certificate_type}' == 'CA' and '${delete_cert}' == '${True}' |
| 77 | ... Delete All CA Certificate Via Redfish |
| 78 | ... ELSE IF '${certificate_type}' == 'Client' and '${delete_cert}' == '${True}' |
| 79 | ... Delete Certificate Via BMC CLI ${certificate_type} |
| 80 | |
| 81 | Set Test Variable ${obmc_gui_url} https://${OPENBMC_HOST_1} |
| 82 | Launch Browser And Login GUI |
| 83 | Navigate To SSL Certificate Page |
| 84 | Sleep 10s |
| 85 | Click Element ${xpath_add_new_certificate} |
| 86 | |
| 87 | Wait Until Page Contains Element ${xpath_certificate_type} timeout=20s |
| 88 | Run Keyword If '${certificate_type}' == 'CA' |
| 89 | ... Select From List By Label ${xpath_certificate_type} CA Certificate |
| 90 | ... ELSE IF '${certificate_type}' == 'Client' |
| 91 | ... Select From List By Label ${xpath_certificate_type} LDAP Certificate |
| 92 | |
| 93 | Choose File ${xpath_upload_file} ${file_path} |
| 94 | Click Element ${xpath_load_certificate} |
| 95 | |
| 96 | Run Keyword If '${ext}' !='pem' Wait Until Page Contains Error adding certificate. |
| 97 | |
| 98 | Run Keyword If '${certificate_type}' == 'CA' |
| 99 | ... Wait Until Page Contains Successfully added CA Certificate. |
| 100 | ... ELSE IF '${certificate_type}' == 'Client' |
| 101 | ... Wait Until Page Contains Successfully added LDAP Certificate. |
| 102 | Click Element ${xpath_close_poup} |
| 103 | |
| 104 | |
| 105 | Navigate To SSL Certificate Page |
| 106 | [Documentation] Navigate to SSL Certificate page. |
| 107 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 108 | Click Element ${xpath_secuity_and_accesss_menu} |
| 109 | Click Element ${xpath_certificates_sub_menu} |
| 110 | Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain certificates |
Anves Kumar rayankula | 7933703 | 2021-07-13 00:22:36 -0500 | [diff] [blame] | 111 | |