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