Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 3 | Documentation Test OpenBMC GUI "Network" sub-menu of "Settings". |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 4 | |
Rahul Maheshwari | 41747da | 2020-11-17 09:09:52 -0600 | [diff] [blame] | 5 | Resource ../../lib/gui_resource.robot |
Anves Kumar rayankula | 65e5ed2 | 2020-09-17 04:44:44 -0500 | [diff] [blame] | 6 | Resource ../../../lib/bmc_network_utils.robot |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 7 | |
| 8 | Suite Setup Suite Setup Execution |
| 9 | Suite Teardown Close Browser |
| 10 | |
meghagn | 1bd3928 | 2021-12-19 23:56:42 -0600 | [diff] [blame] | 11 | |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 12 | *** Variables *** |
| 13 | |
meghagn | 1bd3928 | 2021-12-19 23:56:42 -0600 | [diff] [blame] | 14 | ${xpath_network_heading} //h1[text()="Network"] |
| 15 | ${xpath_interface_settings} //h2[text()="Interface settings"] |
| 16 | ${xpath_network_settings} //h2[text()="Network settings"] |
| 17 | ${xpath_static_ipv4} //h2[text()="IPv4"] |
| 18 | ${xpath_static_dns} //h2[text()="Static DNS"] |
| 19 | ${xpath_domain_name_toggle} //*[@data-test-id="networkSettings-switch-useDomainName"] |
| 20 | ${xpath_dns_servers_toggle} //*[@data-test-id="networkSettings-switch-useDns"] |
| 21 | ${xpath_ntp_servers_toggle} //*[@data-test-id="networkSettings-switch-useNtp"] |
| 22 | ${xpath_add_static_ipv4_address_button} //button[contains(text(),"Add static IPv4 address")] |
| 23 | ${xpath_add_dns_ip_address_button} //button[contains(text(),"Add IP address")] |
meghagn | cca733c | 2021-12-20 04:34:55 -0600 | [diff] [blame] | 24 | ${xpath_hostname} //*[@title="Edit hostname"] |
| 25 | ${xpath_hostname_input} //*[@id="hostname"] |
| 26 | ${xpath_input_ip_address} //*[@id="ipAddress"] |
| 27 | ${xpath_input_gateway} //*[@id="gateway"] |
| 28 | ${xpath_input_subnetmask} //*[@id="subnetMask"] |
| 29 | ${xpath_input_static_dns} //*[@id="staticDns"] |
| 30 | ${xpath_cancel_button} //button[contains(text(),'Cancel')] |
meghagn | 2007beb | 2022-01-11 08:23:13 -0600 | [diff] [blame] | 31 | ${xpath_delete_dns_server} //*[@title="Delete DNS address"] |
meghagn | 2007beb | 2022-01-11 08:23:13 -0600 | [diff] [blame] | 32 | |
| 33 | ${dns_server} 10.10.10.10 |
meghagn | 122340d | 2022-02-01 04:57:37 -0600 | [diff] [blame] | 34 | ${test_ipv4_addr} 10.7.7.7 |
| 35 | ${test_subnet_mask} 255.255.0.0 |
| 36 | ${alpha_netmask} ff.ff.ff.ff |
| 37 | ${out_of_range_netmask} 255.256.255.0 |
| 38 | ${more_byte_netmask} 255.255.255.0.0 |
| 39 | ${lowest_netmask} 128.0.0.0 |
| 40 | ${test_gateway} 10.7.7.1 |
meghagn | 97f7eb4 | 2022-03-02 02:59:35 -0600 | [diff] [blame] | 41 | ${test_hostname} openbmc |
Anves Kumar rayankula | 4c88447 | 2020-11-24 05:03:45 -0600 | [diff] [blame] | 42 | |
Anves Kumar rayankula | ef4d34f | 2021-02-12 03:26:42 -0600 | [diff] [blame] | 43 | |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 44 | *** Test Cases *** |
| 45 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 46 | Verify Navigation To Network Page |
meghagn | 1bd3928 | 2021-12-19 23:56:42 -0600 | [diff] [blame] | 47 | [Documentation] Login to GUI and navigate to the settings sub-menu network page. |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 48 | [Tags] Verify_Navigation_To_Network_Page |
Anusha Dathatri | e11a54d | 2020-08-31 08:35:47 -0500 | [diff] [blame] | 49 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 50 | Page Should Contain Element ${xpath_network_heading} |
Anusha Dathatri | e11a54d | 2020-08-31 08:35:47 -0500 | [diff] [blame] | 51 | |
| 52 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 53 | Verify Existence Of All Sections In Network Page |
meghagn | 1bd3928 | 2021-12-19 23:56:42 -0600 | [diff] [blame] | 54 | [Documentation] Login to GUI and navigate to the settings sub-menu network page |
| 55 | ... and confirm the page contains sections that should be accessible. |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 56 | [Tags] Verify_Existence_Of_All_Sections_In_Network_Page |
Anusha Dathatri | e11a54d | 2020-08-31 08:35:47 -0500 | [diff] [blame] | 57 | |
meghagn | 1bd3928 | 2021-12-19 23:56:42 -0600 | [diff] [blame] | 58 | Wait Until Page Contains Element ${xpath_network_settings} timeout=1min |
| 59 | Page Should Contain Element ${xpath_interface_settings} |
Anusha Dathatri | e11a54d | 2020-08-31 08:35:47 -0500 | [diff] [blame] | 60 | Page Should Contain Element ${xpath_static_ipv4} |
| 61 | Page Should Contain Element ${xpath_static_dns} |
| 62 | |
| 63 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 64 | Verify Existence Of All Buttons In Network Page |
meghagn | 1bd3928 | 2021-12-19 23:56:42 -0600 | [diff] [blame] | 65 | [Documentation] Login to GUI and navigate to the settings sub-menu network page |
| 66 | ... and confirm the page contains basic features button that should be accessible. |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 67 | [Tags] Verify_Existence_Of_All_Buttons_In_Network_Page |
Anusha Dathatri | e11a54d | 2020-08-31 08:35:47 -0500 | [diff] [blame] | 68 | |
meghagn | 1bd3928 | 2021-12-19 23:56:42 -0600 | [diff] [blame] | 69 | Page Should Contain Button ${xpath_add_static_ipv4_address_button} |
| 70 | Page Should Contain Button ${xpath_add_dns_ip_address_button} |
| 71 | Page Should Contain Button ${xpath_domain_name_toggle} |
| 72 | Page Should Contain Button ${xpath_dns_servers_toggle} |
| 73 | Page Should Contain Button ${xpath_ntp_servers_toggle} |
Anves Kumar rayankula | c3a37e4 | 2021-06-17 06:56:51 -0500 | [diff] [blame] | 74 | |
| 75 | |
meghagn | cca733c | 2021-12-20 04:34:55 -0600 | [diff] [blame] | 76 | Verify Existence Of All Fields In Hostname |
| 77 | [Documentation] Login to GUI and navigate to the settings sub-menu network page |
| 78 | ... and confirm hostname contains all the fields. |
| 79 | [Tags] Verify_Existence_Of_All_Fields_In_Hostname |
| 80 | [Teardown] Run Keywords Click Button ${xpath_cancel_button} AND |
| 81 | ... Wait Until Keyword Succeeds 10 sec 5 sec |
| 82 | ... Refresh GUI And Verify Element Value ${xpath_network_heading} Network |
| 83 | |
| 84 | Click Element ${xpath_hostname} |
| 85 | Wait Until Page Contains Edit hostname timeout=1min |
| 86 | Page Should Contain Textfield ${xpath_hostname_input} |
| 87 | Page Should Contain Button ${xpath_cancel_button} |
| 88 | Page Should Contain Button ${xpath_add_button} |
| 89 | |
| 90 | |
| 91 | Verify Existence Of All Fields In Static IP Address |
| 92 | [Documentation] Login to GUI and navigate to the settings sub-menu network page |
| 93 | ... and confirm section static IPv4 contains all the fields. |
| 94 | [Tags] Verify_Existence_Of_All_Fields_In_Static_IP_Address |
| 95 | [Teardown] Run Keywords Click Button ${xpath_cancel_button} AND |
| 96 | ... Wait Until Keyword Succeeds 10 sec 5 sec |
| 97 | ... Refresh GUI And Verify Element Value ${xpath_network_heading} Network |
| 98 | |
| 99 | Wait Until Keyword Succeeds 30 sec 10 sec Click Element ${xpath_add_static_ipv4_address_button} |
| 100 | Wait Until Page Contains Add static IPv4 address timeout=15s |
| 101 | Page Should Contain Textfield ${xpath_input_ip_address} |
| 102 | Page Should Contain Textfield ${xpath_input_gateway} |
| 103 | Page Should Contain Textfield ${xpath_input_subnetmask} |
| 104 | Page Should Contain Button ${xpath_cancel_button} |
| 105 | Page Should Contain Button ${xpath_add_button} |
| 106 | |
| 107 | |
| 108 | Verify Existence Of All Fields In Static DNS |
| 109 | [Documentation] Login to GUI and navigate to the settings sub-menu network page |
| 110 | ... and confirm section static DNS contains all the fields. |
| 111 | [Tags] Verify_Existence_Of_All_Fields_In_Static_DNS |
| 112 | [Teardown] Run Keywords Click Button ${xpath_cancel_button} AND |
| 113 | ... Wait Until Keyword Succeeds 10 sec 5 sec |
| 114 | ... Refresh GUI And Verify Element Value ${xpath_network_heading} Network |
| 115 | |
| 116 | Wait Until Keyword Succeeds 30 sec 10 sec Click Element ${xpath_add_dns_ip_address_button} |
| 117 | Wait Until Page Contains Add IP address timeout=11s |
| 118 | Page Should Contain Textfield ${xpath_input_static_dns} |
| 119 | Page Should Contain Button ${xpath_cancel_button} |
| 120 | Page Should Contain Button ${xpath_add_button} |
| 121 | |
| 122 | |
meghagn | 2007beb | 2022-01-11 08:23:13 -0600 | [diff] [blame] | 123 | Configure And Verify DNS Server Via GUI |
| 124 | [Documentation] Login to GUI Network page, add DNS server IP |
| 125 | ... and verify that the page reflects server IP. |
| 126 | [Tags] Configure_And_Verify_DNS_Server_Via_GUI |
| 127 | [Teardown] Delete DNS Servers And Verify |
| 128 | |
| 129 | Add DNS Servers And Verify ${dns_server} |
| 130 | |
| 131 | |
meghagn | 122340d | 2022-02-01 04:57:37 -0600 | [diff] [blame] | 132 | Configure Static IPv4 Netmask Via GUI And Verify |
| 133 | [Documentation] Login to GUI Network page, configure static IPv4 netmask and verify. |
| 134 | [Tags] Configure_Static_IPv4_Netmask_Via_GUI_And_Verify |
| 135 | [Template] Add Static IP Address And Verify |
| 136 | |
| 137 | # ip_addresses subnet_masks gateway expected_status |
| 138 | ${test_ipv4_addr} ${lowest_netmask} ${test_gateway} Success |
| 139 | ${test_ipv4_addr} ${more_byte_netmask} ${test_gateway} Invalid format |
| 140 | ${test_ipv4_addr} ${alpha_netmask} ${test_gateway} Invalid format |
| 141 | ${test_ipv4_addr} ${out_of_range_netmask} ${test_gateway} Invalid format |
| 142 | ${test_ipv4_addr} ${test_subnet_mask} ${test_gateway} Success |
| 143 | |
| 144 | |
meghagn | 97f7eb4 | 2022-03-02 02:59:35 -0600 | [diff] [blame] | 145 | Configure Hostname Via GUI And Verify |
| 146 | [Documentation] Login to GUI Network page, configure hostname and verify. |
| 147 | [Tags] Configure_Hostname_Via_GUI_And_Verify |
| 148 | [Teardown] Configure And Verify Network Settings Via GUI |
| 149 | ... ${xpath_hostname} ${xpath_hostname_input} ${hostname} |
| 150 | |
| 151 | ${hostname}= Get BMC Hostname |
| 152 | Configure And Verify Network Settings Via GUI ${xpath_hostname} |
| 153 | ... ${xpath_hostname_input} ${test_hostname} |
| 154 | |
| 155 | ${bmc_hostname}= Get BMC Hostname |
| 156 | Should Be Equal As Strings ${bmc_hostname} ${test_hostname} |
| 157 | |
| 158 | |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 159 | *** Keywords *** |
| 160 | |
| 161 | Suite Setup Execution |
meghagn | 1bd3928 | 2021-12-19 23:56:42 -0600 | [diff] [blame] | 162 | [Documentation] Do suite setup tasks. |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 163 | |
| 164 | Launch Browser And Login GUI |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 165 | Click Element ${xpath_settings_menu} |
| 166 | Click Element ${xpath_network_sub_menu} |
| 167 | Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain network |
meghagn | 2007beb | 2022-01-11 08:23:13 -0600 | [diff] [blame] | 168 | |
| 169 | |
| 170 | Add DNS Servers And Verify |
| 171 | [Documentation] Login to GUI Network page,add DNS server on BMC |
| 172 | ... and verify it via BMC CLI. |
| 173 | [Arguments] ${dns_server} ${expected_status}=Valid format |
| 174 | |
| 175 | # Description of the argument(s): |
| 176 | # dns_server A list of static name server IPs to be |
| 177 | # configured on the BMC. |
| 178 | # expected_status Expected status while adding DNS server address |
| 179 | # ... (e.g. Invalid format / Field required). |
| 180 | |
| 181 | Wait Until Page Contains Element ${xpath_add_dns_ip_address_button} timeout=15sec |
| 182 | |
| 183 | Click Button ${xpath_add_dns_ip_address_button} |
| 184 | Input Text ${xpath_input_static_dns} ${dns_server} |
meghagn | 97f7eb4 | 2022-03-02 02:59:35 -0600 | [diff] [blame] | 185 | Click Button ${xpath_add_button} |
meghagn | 2007beb | 2022-01-11 08:23:13 -0600 | [diff] [blame] | 186 | Run keyword if '${expected_status}' != 'Valid format' |
| 187 | ... Run keywords Page Should Contain ${expected_status} AND Return From Keyword |
| 188 | |
| 189 | Wait Until Page Contains Element ${xpath_add_dns_ip_address_button} timeout=10sec |
| 190 | Wait Until Page Contains ${dns_server} timeout=40sec |
| 191 | |
| 192 | # Check if newly added DNS server is configured on BMC. |
| 193 | ${cli_name_servers}= CLI Get Nameservers |
| 194 | ${cmd_status}= Run Keyword And Return Status |
| 195 | ... List Should Contain Sub List ${cli_name_servers} ${dns_server} |
| 196 | |
| 197 | |
| 198 | Delete DNS Servers And Verify |
| 199 | [Documentation] Login to GUI Network page,delete static name servers |
George Keishing | c91aadd | 2022-02-23 09:30:48 -0600 | [diff] [blame] | 200 | ... and verify that page does not reflect static name servers. |
meghagn | 2007beb | 2022-01-11 08:23:13 -0600 | [diff] [blame] | 201 | |
| 202 | Page Should Contain Element ${xpath_delete_dns_server} |
| 203 | Wait Until Element Is Enabled ${xpath_delete_dns_server} |
| 204 | Click Button ${xpath_delete_dns_server} |
| 205 | Wait Until Page Contains Element ${xpath_add_dns_ip_address_button} timeout=15 |
| 206 | # Check if all name servers deleted on BMC. |
| 207 | ${nameservers}= CLI Get Nameservers |
| 208 | Should Be Empty ${nameservers} |
meghagn | 122340d | 2022-02-01 04:57:37 -0600 | [diff] [blame] | 209 | |
| 210 | |
| 211 | Add Static IP Address And Verify |
| 212 | [Documentation] Add static IP address, subnet mask and |
| 213 | ... gateway via GUI and verify. |
| 214 | [Arguments] ${ip_address} ${subnet_mask} ${gateway_address} ${expected_status}=error |
| 215 | |
| 216 | # Description of argument(s): |
| 217 | # ip_address IP address to be added (e.g. 10.7.7.7). |
| 218 | # subnet_mask Subnet mask for the IP to be added (e.g. 255.255.0.0). |
| 219 | # gateway_address Gateway address for the IP to be added (e.g. 10.7.7.1). |
| 220 | # expected_status Expected status while adding static ipv4 address |
| 221 | # .... (e.g. Invalid format / Field required). |
| 222 | |
| 223 | Wait Until Keyword Succeeds 30 sec 10 sec Click Element ${xpath_add_static_ipv4_address_button} |
| 224 | |
| 225 | Input Text ${xpath_input_ip_address} ${ip_address} |
| 226 | Input Text ${xpath_input_subnetmask} ${subnet_mask} |
| 227 | Input Text ${xpath_input_gateway} ${gateway_address} |
| 228 | |
meghagn | 97f7eb4 | 2022-03-02 02:59:35 -0600 | [diff] [blame] | 229 | Click Element ${xpath_add_button} |
meghagn | 122340d | 2022-02-01 04:57:37 -0600 | [diff] [blame] | 230 | Run Keyword If '${expected_status}' == 'Valid format' |
| 231 | ... Run Keywords Wait Until Page Contains ${ip_address} timeout=40sec |
| 232 | ... AND Validate Network Config On BMC |
| 233 | |
| 234 | ... ELSE IF '${expected_status}' == 'Invalid format' |
| 235 | ... Run Keywords Page Should Contain Invalid format AND |
| 236 | ... Click Button ${xpath_cancel_button} |
meghagn | 97f7eb4 | 2022-03-02 02:59:35 -0600 | [diff] [blame] | 237 | |
| 238 | |
| 239 | Configure And Verify Network Settings Via GUI |
| 240 | [Documentation] Configure and verify network settings via GUI. |
| 241 | [Arguments] ${xpath_nw_settings} ${xpath_nw_settings_input_field} ${input_value} |
| 242 | |
| 243 | # Description of argument(s): |
| 244 | # xpath_nw_settings xpath of the network settings. |
| 245 | # xpath_nw_settings_input_field xpath of the network setting's input field. |
| 246 | # input_value Input value for configuration. E.g. hostname, IP etc. |
| 247 | |
| 248 | Wait Until Keyword Succeeds 30 sec 10 sec Click Element ${xpath_nw_settings} |
| 249 | Input Text ${xpath_nw_settings_input_field} ${input_value} |
| 250 | Click Button ${xpath_add_button} |
| 251 | Wait Until Page Contains ${input_value} timeout=30sec |