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