Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
| 3 | Documentation Test OpenBMC GUI "Network settings" sub-menu of |
| 4 | ... "Server configuration". |
| 5 | |
Rahul Maheshwari | 41747da | 2020-11-17 09:09:52 -0600 | [diff] [blame] | 6 | Resource ../../lib/gui_resource.robot |
Anves Kumar rayankula | 65e5ed2 | 2020-09-17 04:44:44 -0500 | [diff] [blame] | 7 | Resource ../../../lib/bmc_network_utils.robot |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 8 | |
| 9 | Suite Setup Suite Setup Execution |
| 10 | Suite Teardown Close Browser |
| 11 | |
| 12 | *** Variables *** |
| 13 | |
Anusha Dathatri | e11a54d | 2020-08-31 08:35:47 -0500 | [diff] [blame] | 14 | ${xpath_network_setting_heading} //h1[text()="Network settings"] |
| 15 | ${xpath_interface} //h2[text()="Interface"] |
| 16 | ${xpath_system} //h2[text()="System"] |
| 17 | ${xpath_static_ipv4} //h2[text()="Static IPv4"] |
| 18 | ${xpath_static_dns} //h2[text()="Static DNS"] |
| 19 | ${xpath_hostname_input} //*[@data-test-id="networkSettings-input-hostname"] |
| 20 | ${xpath_network_save_settings} //button[@data-test-id="networkSettings-button-saveNetworkSettings"] |
| 21 | ${xpath_default_gateway_input} //*[@data-test-id="networkSettings-input-gateway"] |
| 22 | ${xpath_mac_address_input} //*[@data-test-id="networkSettings-input-macAddress"] |
| 23 | ${xpath_static_input_ip0} //*[@data-test-id="networkSettings-input-staticIpv4-0"] |
| 24 | ${xpath_add_static_ip} //button[contains(text(),"Add static IP")] |
| 25 | ${xpath_setting_success} //*[contains(text(),"Successfully saved network settings.")] |
| 26 | ${xpath_add_dns_server} //button[contains(text(),"Add DNS server")] |
Anves Kumar rayankula | 65e5ed2 | 2020-09-17 04:44:44 -0500 | [diff] [blame] | 27 | ${xpath_network_interface} //*[@data-test-id="networkSettings-select-interface"] |
| 28 | ${xpath_input_netmask_addr0} //*[@data-test-id="networkSettings-input-subnetMask-0"] |
Anves Kumar rayankula | 43d8fe8 | 2020-12-08 21:21:38 -0600 | [diff] [blame] | 29 | ${xpath_delete_static_ip} //*[@title="Delete IPv4 row"] |
Anves Kumar rayankula | 4c88447 | 2020-11-24 05:03:45 -0600 | [diff] [blame] | 30 | ${xpath_input_dns_server} //*[@data-test-id="networkSettings-input-dnsAddress-0"] |
| 31 | ${xpath_delete_dns_server} //*[@title="Delete DNS row"] |
Anves Kumar rayankula | da39434 | 2021-01-17 23:51:16 -0600 | [diff] [blame] | 32 | ${xpath_ip_table} //*[@aria-colcount="3"] |
Anves Kumar rayankula | 4c88447 | 2020-11-24 05:03:45 -0600 | [diff] [blame] | 33 | |
Anves Kumar rayankula | 4c88447 | 2020-11-24 05:03:45 -0600 | [diff] [blame] | 34 | @{static_name_servers} 10.10.10.10 |
Anves Kumar rayankula | 8926629 | 2020-12-28 01:29:23 -0600 | [diff] [blame] | 35 | @{null_value} null |
| 36 | @{empty_dictionary} {} |
| 37 | @{string_value} aa.bb.cc.dd |
| 38 | @{special_char_value} @@@.%%.44.11 |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 39 | |
Anves Kumar rayankula | da39434 | 2021-01-17 23:51:16 -0600 | [diff] [blame] | 40 | @{test_ipv4_addr} 10.7.7.7 |
| 41 | @{test_subnet_mask} 255.255.0.0 |
| 42 | |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 43 | *** Test Cases *** |
| 44 | |
Anusha Dathatri | e11a54d | 2020-08-31 08:35:47 -0500 | [diff] [blame] | 45 | Verify Navigation To Network Settings Page |
| 46 | [Documentation] Verify navigation to network settings page. |
| 47 | [Tags] Verify_Navigation_To_Network_Settings_Page |
| 48 | |
| 49 | Page Should Contain Element ${xpath_network_setting_heading} |
| 50 | |
| 51 | |
| 52 | Verify Existence Of All Sections In Network Settings Page |
| 53 | [Documentation] Verify existence of all sections in network settings page. |
| 54 | [Tags] Verify_Existence_Of_All_Sections_In_Network_Settings_Page |
| 55 | |
| 56 | Page Should Contain Element ${xpath_interface} |
| 57 | Page Should Contain Element ${xpath_system} |
| 58 | Page Should Contain Element ${xpath_static_ipv4} |
| 59 | Page Should Contain Element ${xpath_static_dns} |
Anves Kumar rayankula | 43d8fe8 | 2020-12-08 21:21:38 -0600 | [diff] [blame] | 60 | Page Should Contain Button ${xpath_delete_static_ip} |
Anusha Dathatri | e11a54d | 2020-08-31 08:35:47 -0500 | [diff] [blame] | 61 | |
| 62 | |
| 63 | Verify Existence Of All Buttons In Network Settings Page |
| 64 | [Documentation] Verify existence of all buttons in network settings page. |
| 65 | [Tags] Verify_Existence_Of_All_Buttons_In_Network_Settings_Page |
| 66 | |
| 67 | Page Should Contain Element ${xpath_add_static_ip} |
| 68 | Page Should Contain Element ${xpath_add_dns_server} |
| 69 | |
| 70 | |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 71 | Verify Network Settings From Server Configuration |
| 72 | [Documentation] Verify ability to select "Network Settings" sub-menu option |
| 73 | ... of "Server Configuration". |
| 74 | [Tags] Verify_Network_Settings_From_Server_Configuration |
| 75 | |
| 76 | Page Should Contain IP address |
| 77 | |
| 78 | |
| 79 | Verify Hostname Text Configuration |
| 80 | [Documentation] Verify hostname text is configurable from "network settings" |
| 81 | ... sub-menu. |
| 82 | [Tags] Verify_Hostname_Text_Configuration |
| 83 | |
Anves Kumar rayankula | 76c0a8a | 2020-11-17 03:36:32 -0600 | [diff] [blame] | 84 | Wait Until Element Is Enabled ${xpath_hostname_input} |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 85 | Input Text ${xpath_hostname_input} witherspoon1 |
| 86 | Click Button ${xpath_network_save_settings} |
| 87 | Wait Until Page Contains Element ${xpath_setting_success} timeout=10 |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 88 | Wait Until Keyword Succeeds 15 sec 5 sec Textfield Should Contain ${xpath_hostname_input} |
| 89 | ... witherspoon1 |
| 90 | |
| 91 | |
| 92 | Verify Default Gateway Editable |
| 93 | [Documentation] Verify default gateway text input allowed from "network |
| 94 | ... settings". |
| 95 | [Tags] Verify_Default_Gateway_Editable |
Anves Kumar rayankula | 2760367 | 2021-01-21 04:26:08 -0600 | [diff] [blame] | 96 | [Teardown] Click Element ${xpath_refresh_button} |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 97 | |
| 98 | Wait Until Page Contains Element ${xpath_default_gateway_input} |
| 99 | Input Text ${xpath_default_gateway_input} 10.6.6.7 |
| 100 | |
| 101 | |
| 102 | Verify MAC Address Editable |
| 103 | [Documentation] Verify MAC address text input allowed from "network |
| 104 | ... settings". |
| 105 | [Tags] Verify_MAC_Address_Editable |
Anves Kumar rayankula | 2760367 | 2021-01-21 04:26:08 -0600 | [diff] [blame] | 106 | [Teardown] Click Element ${xpath_refresh_button} |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 107 | |
Anves Kumar rayankula | 2760367 | 2021-01-21 04:26:08 -0600 | [diff] [blame] | 108 | Wait Until Element Is Enabled ${xpath_mac_address_input} |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 109 | Input Text ${xpath_mac_address_input} AA:E2:84:14:28:79 |
| 110 | |
| 111 | |
| 112 | Verify Static IP Address Editable |
| 113 | [Documentation] Verify static IP address is editable. |
| 114 | [Tags] Verify_Static_IP_Address_Editable |
Anves Kumar rayankula | 2760367 | 2021-01-21 04:26:08 -0600 | [diff] [blame] | 115 | [Teardown] Click Element ${xpath_refresh_button} |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 116 | |
| 117 | ${exists}= Run Keyword And Return Status Wait Until Page Contains Element ${xpath_static_input_ip0} |
| 118 | Run Keyword If '${exists}' == '${False}' |
| 119 | ... Click Element ${xpath_add_static_ip} |
| 120 | |
| 121 | Input Text ${xpath_static_input_ip0} ${OPENBMC_HOST} |
| 122 | |
| 123 | |
Anves Kumar rayankula | 475811b | 2020-08-31 06:22:11 -0500 | [diff] [blame] | 124 | Verify System Section In Network Setting page |
| 125 | [Documentation] Verify hostname, MAC address and default gateway |
Anves Kumar rayankula | b172fbe | 2020-09-09 00:27:21 -0500 | [diff] [blame] | 126 | ... under system section of network setting page. |
Anves Kumar rayankula | 475811b | 2020-08-31 06:22:11 -0500 | [diff] [blame] | 127 | [Tags] Verify_System_Section |
| 128 | |
Anves Kumar rayankula | b172fbe | 2020-09-09 00:27:21 -0500 | [diff] [blame] | 129 | ${host_name}= Redfish_Utils.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName |
Anves Kumar rayankula | ba8a48e | 2020-10-05 06:18:09 -0500 | [diff] [blame] | 130 | Textfield Value Should Be ${xpath_hostname_input} ${host_name} |
Anves Kumar rayankula | 475811b | 2020-08-31 06:22:11 -0500 | [diff] [blame] | 131 | |
| 132 | ${mac_address}= Get BMC MAC Address |
| 133 | Textfield Value Should Be ${xpath_mac_address_input} ${mac_address} |
| 134 | |
| 135 | ${default_gateway}= Get BMC Default Gateway |
| 136 | Textfield Value Should Be ${xpath_default_gateway_input} ${default_gateway} |
| 137 | |
| 138 | |
Anves Kumar rayankula | 65e5ed2 | 2020-09-17 04:44:44 -0500 | [diff] [blame] | 139 | Verify Network Interface Details |
| 140 | [Documentation] Verify network interface name in network setting page. |
| 141 | [Tags] Verify_Network_Interface_Details |
| 142 | |
| 143 | ${active_channel_config}= Get Active Channel Config |
| 144 | ${ethernet_interface_redfish}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 145 | ${ethernet_interface_gui}= Get Text ${xpath_network_interface} |
| 146 | Should Contain ${ethernet_interface_gui} ${ethernet_interface_redfish} |
| 147 | |
| 148 | |
| 149 | Verify Network Static IPv4 Details |
| 150 | [Documentation] Verify network static IPv4 details. |
| 151 | [Tags] Verify_Network_static_IPv4_Details |
| 152 | |
| 153 | @{network_configurations}= Get Network Configuration |
| 154 | FOR ${network_configuration} IN @{network_configurations} |
| 155 | Textfield Value Should Be ${xpath_static_input_ip0} ${network_configuration["Address"]} |
| 156 | Textfield Value Should Be ${xpath_input_netmask_addr0} ${network_configuration['SubnetMask']} |
| 157 | END |
| 158 | |
| 159 | |
Anves Kumar rayankula | 550eba9 | 2020-09-21 23:36:44 -0500 | [diff] [blame] | 160 | Configure Invalid Network Addresses And Verify |
| 161 | [Documentation] Configure invalid network addresses and verify. |
| 162 | [Tags] Configure_Invalid_Network_Addresses_And_Verify |
| 163 | [Template] Configure Invalid Network Address And Verify |
| 164 | |
| 165 | # locator invalid_address |
| 166 | ${xpath_mac_address_input} A.A.A.A |
| 167 | ${xpath_default_gateway_input} a.b.c.d |
| 168 | ${xpath_static_input_ip0} a.b.c.d |
| 169 | ${xpath_input_netmask_addr0} 255.256.255.0 |
| 170 | |
| 171 | |
Anves Kumar rayankula | 43d8fe8 | 2020-12-08 21:21:38 -0600 | [diff] [blame] | 172 | Configure And Verify Empty Network Addresses |
| 173 | [Documentation] Configure and verify empty network addresses. |
| 174 | [Tags] Configure_And_Verify_Empty_Network_Addresses |
| 175 | [Template] Configure Invalid Network Address And Verify |
| 176 | |
| 177 | # locator invalid_address expected_error |
| 178 | ${xpath_mac_address_input} ${empty} Field required |
| 179 | ${xpath_default_gateway_input} ${empty} Field required |
| 180 | ${xpath_static_input_ip0} ${empty} Field required |
| 181 | ${xpath_input_netmask_addr0} ${empty} Field required |
| 182 | ${xpath_hostname_input} ${empty} Field required |
| 183 | |
| 184 | |
Anves Kumar rayankula | 4c88447 | 2020-11-24 05:03:45 -0600 | [diff] [blame] | 185 | Config And Verify DNS Server Via GUI |
| 186 | [Documentation] Configure DNS server and verify. |
| 187 | [Tags] Config_And_Verify_DNS_Server_Via_GUI |
| 188 | [Setup] DNS Test Setup Execution |
| 189 | [Teardown] Run Keywords Delete DNS Server And Verify ${static_name_servers} |
| 190 | ... AND DNS Test Teardown Execution |
| 191 | |
| 192 | Add DNS Server And Verify ${static_name_servers} |
| 193 | |
| 194 | |
| 195 | Delete And Verify DNS Server Via GUI |
| 196 | [Documentation] Delete DNS server and verify. |
| 197 | [Tags] Delete_And_Verify_DNS_Server_Via_GUI |
| 198 | [Setup] Run Keywords DNS Test Setup Execution AND |
| 199 | ... Add DNS Server And Verify ${static_name_servers} |
| 200 | [Teardown] DNS Test Teardown Execution |
| 201 | |
| 202 | Delete DNS Server And Verify ${static_name_servers} |
| 203 | |
Anves Kumar rayankula | da39434 | 2021-01-17 23:51:16 -0600 | [diff] [blame] | 204 | Configure And Verify Static IP Address |
| 205 | [Documentation] Configure and verify static ip addresses. |
| 206 | [Setup] Test Setup Execution |
| 207 | [Tags] Configure_And_Verify_Static_IP_Address |
| 208 | [Teardown] Run Keywords Delete And Verify Static IP Address On BMC |
| 209 | ... AND Test Teardown Execution |
| 210 | |
| 211 | Add Static IP Address And Verify ${test_ipv4_addr} ${test_subnet_mask} |
| 212 | |
Anves Kumar rayankula | 4c88447 | 2020-11-24 05:03:45 -0600 | [diff] [blame] | 213 | |
Anves Kumar rayankula | 8926629 | 2020-12-28 01:29:23 -0600 | [diff] [blame] | 214 | Configure And Verify Invalid DNS Server |
| 215 | [Documentation] Configure invalid DNS server and verify error. |
| 216 | [Tags] Configure_And_Verify_Invalid_DNS_Server |
| 217 | [Template] Add DNS Server And Verify |
| 218 | [Setup] DNS Test Setup Execution |
Anves Kumar rayankula | 2760367 | 2021-01-21 04:26:08 -0600 | [diff] [blame] | 219 | [Teardown] Run Keywords Click Element ${xpath_refresh_button} |
| 220 | ... AND DNS Test Teardown Execution |
Anves Kumar rayankula | 8926629 | 2020-12-28 01:29:23 -0600 | [diff] [blame] | 221 | |
| 222 | # invalid_ address expected_status |
| 223 | ${string_value} Invalid format |
| 224 | ${special_char_value} Invalid format |
| 225 | ${empty_dictionary} Field required |
| 226 | ${null_value} Invalid format |
| 227 | |
| 228 | |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 229 | *** Keywords *** |
| 230 | |
| 231 | Suite Setup Execution |
| 232 | [Documentation] Do test case setup tasks. |
| 233 | |
| 234 | Launch Browser And Login GUI |
| 235 | Click Element ${xpath_server_configuration} |
| 236 | Click Element ${xpath_select_network_settings} |
| 237 | Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain network-settings |
Anves Kumar rayankula | da39434 | 2021-01-17 23:51:16 -0600 | [diff] [blame] | 238 | ${host_name} ${BMC_IP}= Get Host Name IP host=${OPENBMC_HOST} |
| 239 | Set Suite Variable ${BMC_IP} |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 240 | |
Anves Kumar rayankula | 550eba9 | 2020-09-21 23:36:44 -0500 | [diff] [blame] | 241 | |
Anves Kumar rayankula | 550eba9 | 2020-09-21 23:36:44 -0500 | [diff] [blame] | 242 | Configure Invalid Network Address And Verify |
| 243 | [Documentation] Configure invalid network address And verify. |
Anves Kumar rayankula | 43d8fe8 | 2020-12-08 21:21:38 -0600 | [diff] [blame] | 244 | [Arguments] ${locator} ${invalid_address} ${expected_error}=Invalid format |
Anves Kumar rayankula | 2760367 | 2021-01-21 04:26:08 -0600 | [diff] [blame] | 245 | [Teardown] Click Element ${xpath_refresh_button} |
Anves Kumar rayankula | 550eba9 | 2020-09-21 23:36:44 -0500 | [diff] [blame] | 246 | |
| 247 | # Description of the argument(s): |
| 248 | # locator Xpath to identify an HTML element on a web page. |
| 249 | # invalid_address Invalid address to be added. |
Anves Kumar rayankula | 43d8fe8 | 2020-12-08 21:21:38 -0600 | [diff] [blame] | 250 | # expected_error Expected error optionally provided in testcase |
| 251 | # .... (e.g. Invalid format / Field required) |
Anves Kumar rayankula | 550eba9 | 2020-09-21 23:36:44 -0500 | [diff] [blame] | 252 | |
Anves Kumar rayankula | 43d8fe8 | 2020-12-08 21:21:38 -0600 | [diff] [blame] | 253 | Wait Until Element Is Enabled ${locator} |
| 254 | Clear Element Text ${locator} |
Anves Kumar rayankula | 550eba9 | 2020-09-21 23:36:44 -0500 | [diff] [blame] | 255 | Input Text ${locator} ${invalid_address} |
Anves Kumar rayankula | 5548115 | 2020-10-21 07:51:07 -0500 | [diff] [blame] | 256 | Click Element ${xpath_network_save_settings} |
Anves Kumar rayankula | 43d8fe8 | 2020-12-08 21:21:38 -0600 | [diff] [blame] | 257 | Page Should Contain ${expected_error} |
Anves Kumar rayankula | 550eba9 | 2020-09-21 23:36:44 -0500 | [diff] [blame] | 258 | |
Anves Kumar rayankula | 4c88447 | 2020-11-24 05:03:45 -0600 | [diff] [blame] | 259 | |
| 260 | Add DNS Server And Verify |
| 261 | [Documentation] Add DNS server on BMC and verify it via BMC CLI. |
Anves Kumar rayankula | 2760367 | 2021-01-21 04:26:08 -0600 | [diff] [blame] | 262 | [Arguments] ${static_name_servers} ${expected_status}=Valid format |
Anves Kumar rayankula | 4c88447 | 2020-11-24 05:03:45 -0600 | [diff] [blame] | 263 | |
| 264 | # Description of the argument(s): |
| 265 | # static_name_servers A list of static name server IPs to be |
| 266 | # configured on the BMC. |
Anves Kumar rayankula | 8926629 | 2020-12-28 01:29:23 -0600 | [diff] [blame] | 267 | # expected_status Expected status while adding DNS server address |
| 268 | # ... (e.g. Invalid format / Field required). |
Anves Kumar rayankula | 4c88447 | 2020-11-24 05:03:45 -0600 | [diff] [blame] | 269 | |
| 270 | Wait Until Page Contains Element ${xpath_add_dns_server} |
| 271 | ${length}= Get Length ${static_name_servers} |
| 272 | FOR ${i} IN RANGE ${length} |
| 273 | Click Button ${xpath_add_dns_server} |
| 274 | Input Text //*[@data-test-id="networkSettings-input-dnsAddress-${i}"] |
| 275 | ... ${static_name_servers}[${i}] |
| 276 | END |
| 277 | |
| 278 | Click Button ${xpath_network_save_settings} |
Anves Kumar rayankula | 8926629 | 2020-12-28 01:29:23 -0600 | [diff] [blame] | 279 | Run keyword if '${expected_status}' != 'Valid format' |
| 280 | ... Run keywords Page Should Contain ${expected_status} AND Return From Keyword |
Anves Kumar rayankula | 4c88447 | 2020-11-24 05:03:45 -0600 | [diff] [blame] | 281 | |
Anves Kumar rayankula | 8926629 | 2020-12-28 01:29:23 -0600 | [diff] [blame] | 282 | Wait Until Page Contains Element ${xpath_setting_success} timeout=15 |
Anves Kumar rayankula | 4c88447 | 2020-11-24 05:03:45 -0600 | [diff] [blame] | 283 | Sleep ${NETWORK_TIMEOUT}s |
| 284 | Verify Static Name Server Details On GUI ${static_name_servers} |
| 285 | # Check if newly added DNS server is configured on BMC. |
| 286 | ${cli_name_servers}= CLI Get Nameservers |
| 287 | List Should Contain Sub List ${cli_name_servers} ${static_name_servers} |
| 288 | |
| 289 | |
| 290 | Delete DNS Server And Verify |
| 291 | [Documentation] Delete static name servers. |
| 292 | [Arguments] ${static_name_servers} |
| 293 | |
| 294 | # Description of the argument(s): |
| 295 | # static_name_servers A list of static name server IPs to be |
| 296 | # configured on the BMC. |
| 297 | |
| 298 | ${length}= Get Length ${static_name_servers} |
| 299 | FOR ${i} IN RANGE ${length} |
| 300 | ${status}= Run Keyword And Return Status |
| 301 | ... Page Should Contain Element ${xpath_delete_dns_server} |
| 302 | Exit For Loop If "${status}" == "False" |
| 303 | Wait Until Element Is Enabled ${xpath_delete_dns_server} |
| 304 | Click Button ${xpath_delete_dns_server} |
| 305 | END |
| 306 | |
| 307 | Click Button ${xpath_network_save_settings} |
| 308 | Wait Until Page Contains Element ${xpath_setting_success} timeout=15 |
| 309 | |
| 310 | Sleep ${NETWORK_TIMEOUT}s |
| 311 | Page Should Not Contain Element ${xpath_input_dns_server} |
| 312 | # Check if all name servers deleted on BMC. |
| 313 | ${nameservers}= CLI Get Nameservers |
| 314 | Should Be Empty ${nameservers} |
| 315 | |
| 316 | |
| 317 | DNS Test Setup Execution |
| 318 | [Documentation] Do DNS test setup execution. |
| 319 | |
| 320 | ${original_name_server}= CLI Get Nameservers |
| 321 | Set Suite Variable ${original_name_server} |
| 322 | Run Keyword If ${original_name_server} != @{EMPTY} |
| 323 | ... Delete DNS Server And Verify ${original_name_server} |
| 324 | |
| 325 | |
| 326 | DNS Test Teardown Execution |
| 327 | [Documentation] Do DNS test teardown execution. |
| 328 | |
| 329 | Run Keyword If ${original_name_server} != @{EMPTY} |
| 330 | ... Add DNS Server And Verify ${original_name_server} |
| 331 | |
| 332 | |
| 333 | Verify Static Name Server Details On GUI |
| 334 | [Documentation] Verify static name servers on GUI. |
| 335 | [Arguments] ${static_name_servers} |
| 336 | |
| 337 | # Description of the argument(s): |
| 338 | # static_name_servers A list of static name server IPs to be |
| 339 | # configured on the BMC. |
| 340 | |
| 341 | ${length}= Get Length ${static_name_servers} |
| 342 | FOR ${i} IN RANGE ${length} |
| 343 | Page Should Contain Element //*[@data-test-id="networkSettings-input-dnsAddress-${i}"] |
| 344 | Textfield Value Should Be //*[@data-test-id="networkSettings-input-dnsAddress-${i}"] |
| 345 | ... ${static_name_servers}[${i}] |
| 346 | END |
| 347 | |
Anves Kumar rayankula | da39434 | 2021-01-17 23:51:16 -0600 | [diff] [blame] | 348 | Add Static IP Address And Verify |
| 349 | [Documentation] Add static IP on BMC and verify. |
| 350 | [Arguments] ${ip_addresses} ${subnet_masks} ${expected_status}=Valid format |
Anves Kumar rayankula | 8926629 | 2020-12-28 01:29:23 -0600 | [diff] [blame] | 351 | |
Anves Kumar rayankula | da39434 | 2021-01-17 23:51:16 -0600 | [diff] [blame] | 352 | # Description of argument(s): |
| 353 | # ip_addresses A list of IP address to be added (e.g. ["10.7.7.7"]). |
| 354 | # subnet_masks A list of Subnet mask for the IP to be added (e.g. ["255.255.0.0"]). |
| 355 | # expected_status Expected status while adding static ipv4 address |
| 356 | # .... (e.g. Invalid format / Field required). |
| 357 | |
| 358 | ${ip_count}= Get Length ${ip_addresses} |
| 359 | FOR ${i} IN RANGE ${ip_count} |
| 360 | ${ip_location}= Evaluate ${i} + ${1} |
| 361 | Wait Until Element Is Enabled ${xpath_add_static_ip} |
| 362 | Click Button ${xpath_add_static_ip} |
| 363 | Wait Until Element Is Enabled //*[@data-test-id="networkSettings-input-staticIpv4-${ip_location}"] |
| 364 | Wait Until Element Is Enabled //*[@data-test-id="networkSettings-input-subnetMask-${ip_location}"] |
| 365 | Input Text //*[@data-test-id="networkSettings-input-staticIpv4-${ip_location}"] ${ip_addresses}[${i}] |
| 366 | Input Text //*[@data-test-id="networkSettings-input-subnetMask-${ip_location}"] ${subnet_masks}[${i}] |
| 367 | END |
| 368 | |
| 369 | Click Button ${xpath_network_save_settings} |
| 370 | Run keyword if '${expected_status}' != 'Valid format' |
| 371 | ... Run keywords Page Should Contain ${expected_status} AND Return From Keyword |
| 372 | Wait Until Page Contains Element ${xpath_setting_success} timeout=15 |
| 373 | Sleep ${NETWORK_TIMEOUT}s |
| 374 | Click Element ${xpath_refresh_button} |
| 375 | Verify IP And Netmask On BMC Using GUI ${ip_addresses} ${subnet_masks} |
| 376 | |
| 377 | Delete And Verify Static IP Address On BMC |
| 378 | [Documentation] Delete static IP address and verify |
| 379 | |
| 380 | ${all_match_elements}= Get Element Count ${xpath_delete_static_ip} |
| 381 | FOR ${element} IN RANGE ${all_match_elements} |
| 382 | ${ip_location}= Evaluate ${element} + ${1} |
| 383 | Delete Static IPv4 Addresses Except BMC IP ${element} |
| 384 | ${status}= Run Keyword And Return Status Page Should Contain Textfield |
| 385 | ... //*[@data-test-id="networkSettings-input-staticIpv4-${ip_location}"] |
| 386 | Exit For Loop IF "${status}" == "${False}" |
| 387 | END |
| 388 | |
| 389 | Click Button ${xpath_network_save_settings} |
| 390 | Wait Until Page Contains Element ${xpath_setting_success} timeout=15 |
| 391 | ${all_match_elements}= Get Element Count ${xpath_delete_static_ip} |
| 392 | Should Be Equal ${all_match_elements} ${1} |
| 393 | Textfield Value Should Be ${xpath_static_input_ip0} ${BMC_IP} |
| 394 | Sleep ${NETWORK_TIMEOUT}s |
| 395 | Ping Host ${OPENBMC_HOST} |
| 396 | Validate Network Config On BMC |
| 397 | |
| 398 | Delete Static IPv4 Addresses Except BMC IP |
| 399 | [Documentation] Delete static IP addresses from IPv4 section on GUI except BMC IP. |
| 400 | [Arguments] ${element} |
| 401 | |
| 402 | # Description of argument(s): |
| 403 | # element IP address location on GUI(e.g. 0 or 1). |
| 404 | |
| 405 | ${ip_location}= Evaluate ${element} + ${1} |
| 406 | Wait Until Element Is Enabled //*[@data-test-id="networkSettings-input-staticIpv4-${element}"] |
| 407 | ${input_ip}= Get Value //*[@data-test-id="networkSettings-input-staticIpv4-${element}"] |
| 408 | Run Keyword If "${BMC_IP}" != "${input_ip}" |
| 409 | ... Click Button ${xpath_ip_table}/tbody/tr[${ip_location}]/td[3]/span/button |
| 410 | |
| 411 | # Get delete ip elements. |
| 412 | ${delete_ip_elements}= Get Element Count ${xpath_delete_static_ip} |
| 413 | |
| 414 | # Delete IP Address on BMC if avilable more than 1. |
| 415 | Run Keyword If ${delete_ip_elements} != ${1} |
| 416 | ... Delete Static IPv4 Addresses Except BMC IP ${element} |
| 417 | |
| 418 | Test Setup Execution |
| 419 | [Documentation] Get and delete existing IPv4 addresses and netmask if any.. |
| 420 | |
| 421 | ${ip_data}= Create List |
| 422 | ${netmask_data}= Create List |
| 423 | |
| 424 | # Get all IPv4 addresses and netmask on BMC. |
| 425 | ${network_configurations}= Get Network Configuration |
| 426 | FOR ${network_configuration} IN @{network_configurations} |
| 427 | Continue For Loop If '${BMC_IP}' == '${network_configuration['Address']}' |
| 428 | Append To List ${ip_data} ${network_configuration['Address']} |
| 429 | Append To List ${netmask_data} ${network_configuration['SubnetMask']} |
| 430 | END |
| 431 | Set Suite Variable ${ip_data} |
| 432 | Set Suite Variable ${netmask_data} |
| 433 | |
| 434 | # Delete existing static IPv4 addresses and netmask if avilable. |
| 435 | Run keyword if ${ip_data} == @{empty} and ${netmask_data} == @{empty} |
| 436 | ... Delete And Verify Static IP Address On BMC |
| 437 | |
| 438 | |
| 439 | Test Teardown Execution |
| 440 | [Documentation] Restore existing IPv4 addresses and netmasks. |
| 441 | |
| 442 | ${ip_length}= Get Length ${ip_data} |
| 443 | ${netmask_length}= Get Length ${netmask_data} |
| 444 | |
| 445 | # Restore existing IPv4 addresses and netmasks if any.. |
| 446 | Run keyword If ${ip_length} == ${0} and ${netmask_length} == ${0} |
| 447 | ... Add Static IP Address And Verify ${ip_data} ${netmask_data} |
| 448 | |
| 449 | |
| 450 | Verify IP And Netmask On BMC Using GUI |
| 451 | [Documentation] Verify IP and netmask on GUI. |
| 452 | [Arguments] ${ip_addresses} ${subnet_masks} |
| 453 | |
| 454 | # Description of argument(s): |
| 455 | # ip_addresses A list of IP address to be added (e.g. ["10.7.7.7"]). |
| 456 | # subnet_masks A list of Subnet mask for the IP to be added (e.g. ["255.255.0.0]"). |
| 457 | |
| 458 | ${ip_count}= Get Length ${ip_addresses} |
| 459 | FOR ${i} IN RANGE ${ip_count} |
| 460 | ${input_ip}= Get Value //*[@data-test-id="networkSettings-input-staticIpv4-${i}"] |
| 461 | Continue For Loop If '${BMC_IP}' == '${input_ip}' |
| 462 | Textfield Value Should Be //*[@data-test-id="networkSettings-input-staticIpv4-${i}"] |
| 463 | ... ${ip_addresses}[${i}] |
| 464 | Textfield Value Should Be //*[@data-test-id="networkSettings-input-subnetMask-${i}"] |
| 465 | ... ${subnet_masks}[${i}] |
| 466 | END |
| 467 | Validate Network Config On BMC |