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