Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 3 | Documentation Test OpenBMC GUI "Network" sub-menu of "Settings". |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 4 | |
Rahul Maheshwari | 41747da | 2020-11-17 09:09:52 -0600 | [diff] [blame] | 5 | Resource ../../lib/gui_resource.robot |
Anves Kumar rayankula | 65e5ed2 | 2020-09-17 04:44:44 -0500 | [diff] [blame] | 6 | Resource ../../../lib/bmc_network_utils.robot |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 7 | |
| 8 | Suite Setup Suite Setup Execution |
| 9 | Suite Teardown Close Browser |
| 10 | |
| 11 | *** Variables *** |
| 12 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 13 | ${xpath_network_heading} //h1[text()="Network"] |
Anusha Dathatri | e11a54d | 2020-08-31 08:35:47 -0500 | [diff] [blame] | 14 | ${xpath_interface} //h2[text()="Interface"] |
| 15 | ${xpath_system} //h2[text()="System"] |
Anves Kumar rayankula | bd10134 | 2021-05-06 06:36:14 -0500 | [diff] [blame] | 16 | ${xpath_static_ipv4} //h2[text()="IPV4"] |
Anusha Dathatri | e11a54d | 2020-08-31 08:35:47 -0500 | [diff] [blame] | 17 | ${xpath_static_dns} //h2[text()="Static DNS"] |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 18 | ${xpath_hostname_input} //*[@data-test-id="network-input-hostname"] |
| 19 | ${xpath_network_save_settings} //button[@data-test-id="network-button-saveNetworkSettings"] |
| 20 | ${xpath_default_gateway_input} //*[@data-test-id="network-input-gateway"] |
| 21 | ${xpath_mac_address_input} //*[@data-test-id="network-input-macAddress"] |
| 22 | ${xpath_static_input_ip0} //*[@data-test-id="network-input-staticIpv4-0"] |
| 23 | ${xpath_static_input_ip1} //*[@data-test-id="network-input-staticIpv4-1"] |
Anusha Dathatri | e11a54d | 2020-08-31 08:35:47 -0500 | [diff] [blame] | 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")] |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 27 | ${xpath_network_interface} //*[@data-test-id="network-select-interface"] |
| 28 | ${xpath_input_netmask_addr0} //*[@data-test-id="network-input-subnetMask-0"] |
| 29 | ${xpath_input_netmask_addr1} //*[@data-test-id="network-input-subnetMask-1"] |
Anves Kumar rayankula | 43d8fe8 | 2020-12-08 21:21:38 -0600 | [diff] [blame] | 30 | ${xpath_delete_static_ip} //*[@title="Delete IPv4 row"] |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 31 | ${xpath_input_dns_server} //*[@data-test-id="network-input-dnsAddress-0"] |
Anves Kumar rayankula | 4c88447 | 2020-11-24 05:03:45 -0600 | [diff] [blame] | 32 | ${xpath_delete_dns_server} //*[@title="Delete DNS row"] |
Anves Kumar rayankula | 5538ed9 | 2021-05-19 01:42:21 -0500 | [diff] [blame] | 33 | ${xpath_delete_static_ip} //*[@title="Delete IPv4 row"] |
Anves Kumar rayankula | 4c88447 | 2020-11-24 05:03:45 -0600 | [diff] [blame] | 34 | |
Anves Kumar rayankula | 4c88447 | 2020-11-24 05:03:45 -0600 | [diff] [blame] | 35 | @{static_name_servers} 10.10.10.10 |
Anves Kumar rayankula | 8926629 | 2020-12-28 01:29:23 -0600 | [diff] [blame] | 36 | @{null_value} null |
| 37 | @{empty_dictionary} {} |
| 38 | @{string_value} aa.bb.cc.dd |
| 39 | @{special_char_value} @@@.%%.44.11 |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 40 | |
Anves Kumar rayankula | b2f7377 | 2021-05-11 04:58:25 -0500 | [diff] [blame] | 41 | ${test_ipv4_addr} 10.7.7.7 |
Anves Kumar rayankula | 14a8c98 | 2021-05-25 07:31:53 -0500 | [diff] [blame] | 42 | ${test_ipv4_addr2} 10.7.7.8 |
Anves Kumar rayankula | b2f7377 | 2021-05-11 04:58:25 -0500 | [diff] [blame] | 43 | ${test_subnet_mask} 255.255.0.0 |
Anves Kumar rayankula | da39434 | 2021-01-17 23:51:16 -0600 | [diff] [blame] | 44 | |
Anves Kumar rayankula | ef4d34f | 2021-02-12 03:26:42 -0600 | [diff] [blame] | 45 | # Valid netmask is 4 bytes long and has continuous block of 1s. |
| 46 | # Maximum valid value in each octet is 255 and least value is 0. |
| 47 | # Maximum value of octet in netmask is 255. |
Anves Kumar rayankula | b2f7377 | 2021-05-11 04:58:25 -0500 | [diff] [blame] | 48 | ${alpha_netmask} ff.ff.ff.ff |
| 49 | ${out_of_range_netmask} 255.256.255.0 |
| 50 | ${more_byte_netmask} 255.255.255.0.0 |
| 51 | ${lowest_netmask} 128.0.0.0 |
Anves Kumar rayankula | c3a37e4 | 2021-06-17 06:56:51 -0500 | [diff] [blame] | 52 | ${test_hostname} openbmc |
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 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 56 | Verify Navigation To Network Page |
| 57 | [Documentation] Verify navigation to network page. |
| 58 | [Tags] Verify_Navigation_To_Network_Page |
Anusha Dathatri | e11a54d | 2020-08-31 08:35:47 -0500 | [diff] [blame] | 59 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 60 | Page Should Contain Element ${xpath_network_heading} |
Anusha Dathatri | e11a54d | 2020-08-31 08:35:47 -0500 | [diff] [blame] | 61 | |
| 62 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 63 | Verify Existence Of All Sections In Network Page |
Anusha Dathatri | e11a54d | 2020-08-31 08:35:47 -0500 | [diff] [blame] | 64 | [Documentation] Verify existence of all sections in network settings page. |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 65 | [Tags] Verify_Existence_Of_All_Sections_In_Network_Page |
Anusha Dathatri | e11a54d | 2020-08-31 08:35:47 -0500 | [diff] [blame] | 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 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 74 | Verify Existence Of All Buttons In Network Page |
| 75 | [Documentation] Verify existence of all buttons in network page. |
| 76 | [Tags] Verify_Existence_Of_All_Buttons_In_Network_Page |
Anusha Dathatri | e11a54d | 2020-08-31 08:35:47 -0500 | [diff] [blame] | 77 | |
| 78 | Page Should Contain Element ${xpath_add_static_ip} |
| 79 | Page Should Contain Element ${xpath_add_dns_server} |
| 80 | |
| 81 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 82 | Verify Network From Server Configuration |
| 83 | [Documentation] Verify ability to select "Network" sub-menu option |
| 84 | ... of "Settings". |
| 85 | [Tags] Verify_Network_From_Server_Configuration |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 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. |
Anves Kumar rayankula | da39434 | 2021-01-17 23:51:16 -0600 | [diff] [blame] | 217 | [Tags] Configure_And_Verify_Static_IP_Address |
Anves Kumar rayankula | 5538ed9 | 2021-05-19 01:42:21 -0500 | [diff] [blame] | 218 | [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] | 219 | |
| 220 | Add Static IP Address And Verify ${test_ipv4_addr} ${test_subnet_mask} |
| 221 | |
Anves Kumar rayankula | 4c88447 | 2020-11-24 05:03:45 -0600 | [diff] [blame] | 222 | |
Anves Kumar rayankula | 8926629 | 2020-12-28 01:29:23 -0600 | [diff] [blame] | 223 | Configure And Verify Invalid DNS Server |
| 224 | [Documentation] Configure invalid DNS server and verify error. |
| 225 | [Tags] Configure_And_Verify_Invalid_DNS_Server |
| 226 | [Template] Add DNS Server And Verify |
| 227 | [Setup] DNS Test Setup Execution |
Anves Kumar rayankula | 2760367 | 2021-01-21 04:26:08 -0600 | [diff] [blame] | 228 | [Teardown] Run Keywords Click Element ${xpath_refresh_button} |
| 229 | ... AND DNS Test Teardown Execution |
Anves Kumar rayankula | 8926629 | 2020-12-28 01:29:23 -0600 | [diff] [blame] | 230 | |
| 231 | # invalid_ address expected_status |
| 232 | ${string_value} Invalid format |
| 233 | ${special_char_value} Invalid format |
| 234 | ${empty_dictionary} Field required |
| 235 | ${null_value} Invalid format |
| 236 | |
Anves Kumar rayankula | ef4d34f | 2021-02-12 03:26:42 -0600 | [diff] [blame] | 237 | Modify IP Address And Verify |
| 238 | [Documentation] Modify IP address and verify. |
Anves Kumar rayankula | ef4d34f | 2021-02-12 03:26:42 -0600 | [diff] [blame] | 239 | [Tags] Modify_IP_Address_And_Verify |
Anves Kumar rayankula | 5538ed9 | 2021-05-19 01:42:21 -0500 | [diff] [blame] | 240 | [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] | 241 | |
Anves Kumar rayankula | 14a8c98 | 2021-05-25 07:31:53 -0500 | [diff] [blame] | 242 | Add Static IP Address And Verify ${test_ipv4_addr} ${test_subnet_mask} |
| 243 | Update IP Address And Verify ${test_ipv4_addr} ${test_ipv4_addr2} |
Anves Kumar rayankula | ef4d34f | 2021-02-12 03:26:42 -0600 | [diff] [blame] | 244 | |
| 245 | |
| 246 | Configure Netmask And Verify |
| 247 | [Documentation] Configure and verify netmask. |
| 248 | [Tags] Configure_And_Verify_Netmask |
Anves Kumar rayankula | ef4d34f | 2021-02-12 03:26:42 -0600 | [diff] [blame] | 249 | [Template] Add Static IP Address And Verify |
| 250 | [Teardown] Run Keywords Click Element ${xpath_refresh_button} |
Anves Kumar rayankula | 5538ed9 | 2021-05-19 01:42:21 -0500 | [diff] [blame] | 251 | ... 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] | 252 | |
| 253 | # ip_addresses subnet_masks expected_status |
| 254 | ${test_ipv4_addr} ${lowest_netmask} Valid format |
| 255 | ${test_ipv4_addr} ${more_byte_netmask} Invalid format |
| 256 | ${test_ipv4_addr} ${alpha_netmask} Invalid format |
| 257 | ${test_ipv4_addr} ${out_of_range_netmask} Invalid format |
Anves Kumar rayankula | 8926629 | 2020-12-28 01:29:23 -0600 | [diff] [blame] | 258 | |
Anves Kumar rayankula | c3a37e4 | 2021-06-17 06:56:51 -0500 | [diff] [blame] | 259 | |
| 260 | Configure Hostname And Verify |
| 261 | [Documentation] Configure hostname and verify. |
| 262 | [Tags] Configure_Hostname_And_Verify |
| 263 | [Teardown] Configure And Verify Network Settings |
| 264 | ... ${xpath_hostname_input} ${hostname} |
| 265 | |
| 266 | ${hostname}= Get Value ${xpath_hostname_input} |
| 267 | Configure And Verify Network Settings ${xpath_hostname_input} ${test_hostname} |
| 268 | |
| 269 | |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 270 | *** Keywords *** |
| 271 | |
| 272 | Suite Setup Execution |
| 273 | [Documentation] Do test case setup tasks. |
| 274 | |
| 275 | Launch Browser And Login GUI |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 276 | Click Element ${xpath_settings_menu} |
| 277 | Click Element ${xpath_network_sub_menu} |
| 278 | Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain network |
Anves Kumar rayankula | da39434 | 2021-01-17 23:51:16 -0600 | [diff] [blame] | 279 | ${host_name} ${BMC_IP}= Get Host Name IP host=${OPENBMC_HOST} |
| 280 | Set Suite Variable ${BMC_IP} |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 281 | |
Anves Kumar rayankula | 550eba9 | 2020-09-21 23:36:44 -0500 | [diff] [blame] | 282 | |
Anves Kumar rayankula | 550eba9 | 2020-09-21 23:36:44 -0500 | [diff] [blame] | 283 | Configure Invalid Network Address And Verify |
| 284 | [Documentation] Configure invalid network address And verify. |
Anves Kumar rayankula | 43d8fe8 | 2020-12-08 21:21:38 -0600 | [diff] [blame] | 285 | [Arguments] ${locator} ${invalid_address} ${expected_error}=Invalid format |
Anves Kumar rayankula | 2760367 | 2021-01-21 04:26:08 -0600 | [diff] [blame] | 286 | [Teardown] Click Element ${xpath_refresh_button} |
Anves Kumar rayankula | 550eba9 | 2020-09-21 23:36:44 -0500 | [diff] [blame] | 287 | |
| 288 | # Description of the argument(s): |
| 289 | # locator Xpath to identify an HTML element on a web page. |
| 290 | # invalid_address Invalid address to be added. |
Anves Kumar rayankula | 43d8fe8 | 2020-12-08 21:21:38 -0600 | [diff] [blame] | 291 | # expected_error Expected error optionally provided in testcase |
| 292 | # .... (e.g. Invalid format / Field required) |
Anves Kumar rayankula | 550eba9 | 2020-09-21 23:36:44 -0500 | [diff] [blame] | 293 | |
Anves Kumar rayankula | 43d8fe8 | 2020-12-08 21:21:38 -0600 | [diff] [blame] | 294 | Wait Until Element Is Enabled ${locator} |
| 295 | Clear Element Text ${locator} |
Anves Kumar rayankula | 550eba9 | 2020-09-21 23:36:44 -0500 | [diff] [blame] | 296 | Input Text ${locator} ${invalid_address} |
Anves Kumar rayankula | 5548115 | 2020-10-21 07:51:07 -0500 | [diff] [blame] | 297 | Click Element ${xpath_network_save_settings} |
Anves Kumar rayankula | 43d8fe8 | 2020-12-08 21:21:38 -0600 | [diff] [blame] | 298 | Page Should Contain ${expected_error} |
Anves Kumar rayankula | 550eba9 | 2020-09-21 23:36:44 -0500 | [diff] [blame] | 299 | |
Anves Kumar rayankula | 4c88447 | 2020-11-24 05:03:45 -0600 | [diff] [blame] | 300 | |
| 301 | Add DNS Server And Verify |
| 302 | [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] | 303 | [Arguments] ${static_name_servers} ${expected_status}=Valid format |
Anves Kumar rayankula | 4c88447 | 2020-11-24 05:03:45 -0600 | [diff] [blame] | 304 | |
| 305 | # Description of the argument(s): |
| 306 | # static_name_servers A list of static name server IPs to be |
| 307 | # configured on the BMC. |
Anves Kumar rayankula | 8926629 | 2020-12-28 01:29:23 -0600 | [diff] [blame] | 308 | # expected_status Expected status while adding DNS server address |
| 309 | # ... (e.g. Invalid format / Field required). |
Anves Kumar rayankula | 4c88447 | 2020-11-24 05:03:45 -0600 | [diff] [blame] | 310 | |
| 311 | Wait Until Page Contains Element ${xpath_add_dns_server} |
| 312 | ${length}= Get Length ${static_name_servers} |
| 313 | FOR ${i} IN RANGE ${length} |
| 314 | Click Button ${xpath_add_dns_server} |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 315 | Input Text //*[@data-test-id="network-input-dnsAddress-${i}"] |
Anves Kumar rayankula | 4c88447 | 2020-11-24 05:03:45 -0600 | [diff] [blame] | 316 | ... ${static_name_servers}[${i}] |
| 317 | END |
| 318 | |
| 319 | Click Button ${xpath_network_save_settings} |
Anves Kumar rayankula | 8926629 | 2020-12-28 01:29:23 -0600 | [diff] [blame] | 320 | Run keyword if '${expected_status}' != 'Valid format' |
| 321 | ... Run keywords Page Should Contain ${expected_status} AND Return From Keyword |
Anves Kumar rayankula | 4c88447 | 2020-11-24 05:03:45 -0600 | [diff] [blame] | 322 | |
Anves Kumar rayankula | 8926629 | 2020-12-28 01:29:23 -0600 | [diff] [blame] | 323 | Wait Until Page Contains Element ${xpath_setting_success} timeout=15 |
Anves Kumar rayankula | 4c88447 | 2020-11-24 05:03:45 -0600 | [diff] [blame] | 324 | Sleep ${NETWORK_TIMEOUT}s |
| 325 | Verify Static Name Server Details On GUI ${static_name_servers} |
| 326 | # Check if newly added DNS server is configured on BMC. |
| 327 | ${cli_name_servers}= CLI Get Nameservers |
| 328 | List Should Contain Sub List ${cli_name_servers} ${static_name_servers} |
| 329 | |
| 330 | |
| 331 | Delete DNS Server And Verify |
| 332 | [Documentation] Delete static name servers. |
| 333 | [Arguments] ${static_name_servers} |
| 334 | |
| 335 | # Description of the argument(s): |
| 336 | # static_name_servers A list of static name server IPs to be |
| 337 | # configured on the BMC. |
| 338 | |
| 339 | ${length}= Get Length ${static_name_servers} |
| 340 | FOR ${i} IN RANGE ${length} |
| 341 | ${status}= Run Keyword And Return Status |
| 342 | ... Page Should Contain Element ${xpath_delete_dns_server} |
| 343 | Exit For Loop If "${status}" == "False" |
| 344 | Wait Until Element Is Enabled ${xpath_delete_dns_server} |
| 345 | Click Button ${xpath_delete_dns_server} |
| 346 | END |
| 347 | |
| 348 | Click Button ${xpath_network_save_settings} |
| 349 | Wait Until Page Contains Element ${xpath_setting_success} timeout=15 |
| 350 | |
| 351 | Sleep ${NETWORK_TIMEOUT}s |
| 352 | Page Should Not Contain Element ${xpath_input_dns_server} |
| 353 | # Check if all name servers deleted on BMC. |
| 354 | ${nameservers}= CLI Get Nameservers |
| 355 | Should Be Empty ${nameservers} |
| 356 | |
| 357 | |
| 358 | DNS Test Setup Execution |
| 359 | [Documentation] Do DNS test setup execution. |
| 360 | |
| 361 | ${original_name_server}= CLI Get Nameservers |
| 362 | Set Suite Variable ${original_name_server} |
| 363 | Run Keyword If ${original_name_server} != @{EMPTY} |
| 364 | ... Delete DNS Server And Verify ${original_name_server} |
| 365 | |
| 366 | |
| 367 | DNS Test Teardown Execution |
| 368 | [Documentation] Do DNS test teardown execution. |
| 369 | |
| 370 | Run Keyword If ${original_name_server} != @{EMPTY} |
| 371 | ... Add DNS Server And Verify ${original_name_server} |
| 372 | |
| 373 | |
| 374 | Verify Static Name Server Details On GUI |
| 375 | [Documentation] Verify static name servers on GUI. |
| 376 | [Arguments] ${static_name_servers} |
| 377 | |
| 378 | # Description of the argument(s): |
| 379 | # static_name_servers A list of static name server IPs to be |
| 380 | # configured on the BMC. |
| 381 | |
| 382 | ${length}= Get Length ${static_name_servers} |
| 383 | FOR ${i} IN RANGE ${length} |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 384 | Page Should Contain Element //*[@data-test-id="network-input-dnsAddress-${i}"] |
| 385 | Textfield Value Should Be //*[@data-test-id="network-input-dnsAddress-${i}"] |
Anves Kumar rayankula | 4c88447 | 2020-11-24 05:03:45 -0600 | [diff] [blame] | 386 | ... ${static_name_servers}[${i}] |
| 387 | END |
| 388 | |
Anves Kumar rayankula | da39434 | 2021-01-17 23:51:16 -0600 | [diff] [blame] | 389 | Add Static IP Address And Verify |
| 390 | [Documentation] Add static IP on BMC and verify. |
Anves Kumar rayankula | b2f7377 | 2021-05-11 04:58:25 -0500 | [diff] [blame] | 391 | [Arguments] ${ip_address} ${subnet_mask} ${expected_status}=Valid format |
Anves Kumar rayankula | 8926629 | 2020-12-28 01:29:23 -0600 | [diff] [blame] | 392 | |
Anves Kumar rayankula | da39434 | 2021-01-17 23:51:16 -0600 | [diff] [blame] | 393 | # Description of argument(s): |
Anves Kumar rayankula | b2f7377 | 2021-05-11 04:58:25 -0500 | [diff] [blame] | 394 | # ip_address IP address to be added (e.g. 10.7.7.7). |
| 395 | # subnet_masks Subnet mask for the IP to be added (e.g. 255.255.0.0). |
| 396 | # expected_status Expected status while adding static ipv4 address |
Anves Kumar rayankula | da39434 | 2021-01-17 23:51:16 -0600 | [diff] [blame] | 397 | # .... (e.g. Invalid format / Field required). |
| 398 | |
Anves Kumar rayankula | b2f7377 | 2021-05-11 04:58:25 -0500 | [diff] [blame] | 399 | ${available_ip_addresses}= Get Static IPv4 Addresses From GUI |
| 400 | |
| 401 | # New IP address location is GUI is equivalent to the available IP address |
| 402 | # in Redfish. i.e. if two IP address are available in GUI then location |
| 403 | # on IP address in GUI is also 2. |
| 404 | ${location}= Get Length ${available_ip_addresses} |
| 405 | Wait Until Element Is Enabled ${xpath_add_static_ip} |
| 406 | Click Button ${xpath_add_static_ip} |
| 407 | |
| 408 | Input Text |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 409 | ... //*[@data-test-id="network-input-staticIpv4-${location}"] ${ip_address} |
Anves Kumar rayankula | b2f7377 | 2021-05-11 04:58:25 -0500 | [diff] [blame] | 410 | Input Text |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 411 | ... //*[@data-test-id="network-input-subnetMask-${location}"] ${subnet_mask} |
Anves Kumar rayankula | da39434 | 2021-01-17 23:51:16 -0600 | [diff] [blame] | 412 | |
| 413 | Click Button ${xpath_network_save_settings} |
| 414 | Run keyword if '${expected_status}' != 'Valid format' |
| 415 | ... Run keywords Page Should Contain ${expected_status} AND Return From Keyword |
| 416 | Wait Until Page Contains Element ${xpath_setting_success} timeout=15 |
Anves Kumar rayankula | da39434 | 2021-01-17 23:51:16 -0600 | [diff] [blame] | 417 | Click Element ${xpath_refresh_button} |
Anves Kumar rayankula | b2f7377 | 2021-05-11 04:58:25 -0500 | [diff] [blame] | 418 | Wait Until Page Contains Element ${xpath_static_input_ip0} |
| 419 | Validate Network Config On BMC |
| 420 | ${ip_addresses}= Get Static IPv4 Addresses From GUI |
| 421 | Should Contain ${ip_addresses} ${ip_address} |
| 422 | |
Anves Kumar rayankula | da39434 | 2021-01-17 23:51:16 -0600 | [diff] [blame] | 423 | |
| 424 | Delete And Verify Static IP Address On BMC |
| 425 | [Documentation] Delete static IP address and verify |
Anves Kumar rayankula | 5538ed9 | 2021-05-19 01:42:21 -0500 | [diff] [blame] | 426 | [Arguments] ${ip_address} |
Anves Kumar rayankula | da39434 | 2021-01-17 23:51:16 -0600 | [diff] [blame] | 427 | |
Anves Kumar rayankula | 5538ed9 | 2021-05-19 01:42:21 -0500 | [diff] [blame] | 428 | # Description of argument(s): |
| 429 | # ip_address IP address to be deleted (e.g. "10.7.7.7"). |
| 430 | |
| 431 | ${ip_addresses}= Get Static IPv4 Addresses From GUI |
| 432 | Should Contain ${ip_addresses} ${ip_address} msg=${ip_address} does not exist on BMC |
| 433 | |
George Keishing | b78bca2 | 2021-06-29 11:11:19 -0500 | [diff] [blame] | 434 | ${delete_ip_buttons}= Get WebElements ${xpath_delete_static_ip} |
Anves Kumar rayankula | 5538ed9 | 2021-05-19 01:42:21 -0500 | [diff] [blame] | 435 | FOR ${location} IN RANGE len(${ip_addresses}) |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 436 | ${gui_ip}= Get Value //*[@data-test-id="networ-input-staticIpv4-${location}"] |
Anves Kumar rayankula | 5538ed9 | 2021-05-19 01:42:21 -0500 | [diff] [blame] | 437 | Run Keyword If '${gui_ip}' == '${ip_address}' and '${gui_ip}' != '${BMC_IP}' |
| 438 | ... Run Keywords Click Element ${delete_ip_buttons}[${location}] |
| 439 | ... AND Exit For Loop |
Anves Kumar rayankula | da39434 | 2021-01-17 23:51:16 -0600 | [diff] [blame] | 440 | END |
| 441 | |
| 442 | Click Button ${xpath_network_save_settings} |
| 443 | Wait Until Page Contains Element ${xpath_setting_success} timeout=15 |
Anves Kumar rayankula | 5538ed9 | 2021-05-19 01:42:21 -0500 | [diff] [blame] | 444 | Wait Until Page Contains Element ${xpath_static_input_ip0} |
Anves Kumar rayankula | da39434 | 2021-01-17 23:51:16 -0600 | [diff] [blame] | 445 | Validate Network Config On BMC |
Anves Kumar rayankula | 5538ed9 | 2021-05-19 01:42:21 -0500 | [diff] [blame] | 446 | ${ip_addresses}= Get Static IPv4 Addresses From GUI |
| 447 | Should Not Contain ${ip_addresses} ${ip_address} |
Anves Kumar rayankula | da39434 | 2021-01-17 23:51:16 -0600 | [diff] [blame] | 448 | |
Anves Kumar rayankula | da39434 | 2021-01-17 23:51:16 -0600 | [diff] [blame] | 449 | |
Anves Kumar rayankula | ef4d34f | 2021-02-12 03:26:42 -0600 | [diff] [blame] | 450 | Update IP Address And Verify |
Anves Kumar rayankula | 14a8c98 | 2021-05-25 07:31:53 -0500 | [diff] [blame] | 451 | [Documentation] Update and verify static IP address on BMC. |
| 452 | [Arguments] ${ip} ${new_ip} |
Anves Kumar rayankula | ef4d34f | 2021-02-12 03:26:42 -0600 | [diff] [blame] | 453 | |
| 454 | # Description of argument(s): |
| 455 | # ip IP address to be replaced (e.g. "10.7.7.7"). |
| 456 | # new_ip New IP address to be configured. |
Anves Kumar rayankula | ef4d34f | 2021-02-12 03:26:42 -0600 | [diff] [blame] | 457 | |
Anves Kumar rayankula | 14a8c98 | 2021-05-25 07:31:53 -0500 | [diff] [blame] | 458 | ${ip_addresses}= Get Static IPv4 Addresses From GUI |
| 459 | 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] | 460 | |
Anves Kumar rayankula | 14a8c98 | 2021-05-25 07:31:53 -0500 | [diff] [blame] | 461 | FOR ${location} IN RANGE len(${ip_addresses}) |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 462 | ${gui_ip}= Get Value //*[@data-test-id="network-input-staticIpv4-${location}"] |
Anves Kumar rayankula | 14a8c98 | 2021-05-25 07:31:53 -0500 | [diff] [blame] | 463 | Run Keyword If '${gui_ip}' == '${ip}' |
| 464 | ... Run Keywords |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 465 | ... Clear Element Text //*[@data-test-id="network-input-staticIpv4-${location}"] |
Anves Kumar rayankula | 14a8c98 | 2021-05-25 07:31:53 -0500 | [diff] [blame] | 466 | ... AND Input Text |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 467 | ... //*[@data-test-id="network-input-staticIpv4-${location}"] ${new_ip} |
Anves Kumar rayankula | 14a8c98 | 2021-05-25 07:31:53 -0500 | [diff] [blame] | 468 | ... AND Exit For Loop |
| 469 | END |
Anves Kumar rayankula | ef4d34f | 2021-02-12 03:26:42 -0600 | [diff] [blame] | 470 | Click Button ${xpath_network_save_settings} |
| 471 | Wait Until Page Contains Element ${xpath_setting_success} timeout=15 |
Anves Kumar rayankula | ef4d34f | 2021-02-12 03:26:42 -0600 | [diff] [blame] | 472 | Click Element ${xpath_refresh_button} |
Anves Kumar rayankula | 14a8c98 | 2021-05-25 07:31:53 -0500 | [diff] [blame] | 473 | Wait Until Page Contains Element ${xpath_static_input_ip0} |
Anves Kumar rayankula | ef4d34f | 2021-02-12 03:26:42 -0600 | [diff] [blame] | 474 | Validate Network Config On BMC |
Anves Kumar rayankula | 14a8c98 | 2021-05-25 07:31:53 -0500 | [diff] [blame] | 475 | ${ip_addresses}= Get Static IPv4 Addresses From GUI |
| 476 | Should Contain ${ip_addresses} ${new_ip} |
Anves Kumar rayankula | ef4d34f | 2021-02-12 03:26:42 -0600 | [diff] [blame] | 477 | |
| 478 | |
Anves Kumar rayankula | d9b4df8 | 2021-05-09 09:07:46 -0500 | [diff] [blame] | 479 | Get Static IPv4 Addresses From GUI |
| 480 | [Documentation] Get static IPV4 addresses from GUI. |
| 481 | |
| 482 | ${availble_ip_addresses}= Get Network Configuration |
| 483 | ${static_ipv4_addresses}= Create List |
| 484 | |
| 485 | FOR ${locator} IN RANGE len(${availble_ip_addresses}) |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 486 | ${ip_address}= Get value //*[@data-test-id="network-input-staticIpv4-${locator}"] |
Anves Kumar rayankula | d9b4df8 | 2021-05-09 09:07:46 -0500 | [diff] [blame] | 487 | Append To List ${static_ipv4_addresses} ${ip_address} |
| 488 | END |
| 489 | |
| 490 | [Return] ${static_ipv4_addresses} |
Anves Kumar rayankula | c3a37e4 | 2021-06-17 06:56:51 -0500 | [diff] [blame] | 491 | |
| 492 | |
| 493 | Configure And Verify Network Settings |
| 494 | [Documentation] Configure and verify network settings. |
| 495 | [Arguments] ${xpath} ${nw_settings} |
| 496 | |
| 497 | # Description of argument(s): |
| 498 | # xpath xpath of the network settings. |
| 499 | # nw_settings The mac address, hostname etc. |
| 500 | |
| 501 | Wait Until Element Is Enabled ${xpath} |
| 502 | Input Text ${xpath} ${nw_settings} |
| 503 | Click Button ${xpath_network_save_settings} |
| 504 | Wait Until Page Contains Element ${xpath_setting_success} timeout=10 |
| 505 | Textfield Value Should Be ${xpath} ${nw_settings} |
| 506 | |