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 | |
| 6 | Resource ../../lib/resource.robot |
Anves Kumar rayankula | 65e5ed2 | 2020-09-17 04:44:44 -0500 | [diff] [blame] | 7 | Resource ../../../lib/bmc_network_utils.robot |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 8 | |
| 9 | Suite Setup Suite Setup Execution |
| 10 | Suite Teardown Close Browser |
| 11 | |
| 12 | *** Variables *** |
| 13 | |
Anusha Dathatri | e11a54d | 2020-08-31 08:35:47 -0500 | [diff] [blame] | 14 | ${xpath_network_setting_heading} //h1[text()="Network settings"] |
| 15 | ${xpath_interface} //h2[text()="Interface"] |
| 16 | ${xpath_system} //h2[text()="System"] |
| 17 | ${xpath_static_ipv4} //h2[text()="Static IPv4"] |
| 18 | ${xpath_static_dns} //h2[text()="Static DNS"] |
| 19 | ${xpath_hostname_input} //*[@data-test-id="networkSettings-input-hostname"] |
| 20 | ${xpath_network_save_settings} //button[@data-test-id="networkSettings-button-saveNetworkSettings"] |
| 21 | ${xpath_default_gateway_input} //*[@data-test-id="networkSettings-input-gateway"] |
| 22 | ${xpath_mac_address_input} //*[@data-test-id="networkSettings-input-macAddress"] |
| 23 | ${xpath_static_input_ip0} //*[@data-test-id="networkSettings-input-staticIpv4-0"] |
| 24 | ${xpath_add_static_ip} //button[contains(text(),"Add static IP")] |
| 25 | ${xpath_setting_success} //*[contains(text(),"Successfully saved network settings.")] |
| 26 | ${xpath_add_dns_server} //button[contains(text(),"Add DNS server")] |
Anves Kumar rayankula | 65e5ed2 | 2020-09-17 04:44:44 -0500 | [diff] [blame] | 27 | ${xpath_network_interface} //*[@data-test-id="networkSettings-select-interface"] |
| 28 | ${xpath_input_netmask_addr0} //*[@data-test-id="networkSettings-input-subnetMask-0"] |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 29 | |
| 30 | *** Test Cases *** |
| 31 | |
Anusha Dathatri | e11a54d | 2020-08-31 08:35:47 -0500 | [diff] [blame] | 32 | Verify Navigation To Network Settings Page |
| 33 | [Documentation] Verify navigation to network settings page. |
| 34 | [Tags] Verify_Navigation_To_Network_Settings_Page |
| 35 | |
| 36 | Page Should Contain Element ${xpath_network_setting_heading} |
| 37 | |
| 38 | |
| 39 | Verify Existence Of All Sections In Network Settings Page |
| 40 | [Documentation] Verify existence of all sections in network settings page. |
| 41 | [Tags] Verify_Existence_Of_All_Sections_In_Network_Settings_Page |
| 42 | |
| 43 | Page Should Contain Element ${xpath_interface} |
| 44 | Page Should Contain Element ${xpath_system} |
| 45 | Page Should Contain Element ${xpath_static_ipv4} |
| 46 | Page Should Contain Element ${xpath_static_dns} |
| 47 | |
| 48 | |
| 49 | Verify Existence Of All Buttons In Network Settings Page |
| 50 | [Documentation] Verify existence of all buttons in network settings page. |
| 51 | [Tags] Verify_Existence_Of_All_Buttons_In_Network_Settings_Page |
| 52 | |
| 53 | Page Should Contain Element ${xpath_add_static_ip} |
| 54 | Page Should Contain Element ${xpath_add_dns_server} |
| 55 | |
| 56 | |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 57 | Verify Network Settings From Server Configuration |
| 58 | [Documentation] Verify ability to select "Network Settings" sub-menu option |
| 59 | ... of "Server Configuration". |
| 60 | [Tags] Verify_Network_Settings_From_Server_Configuration |
| 61 | |
| 62 | Page Should Contain IP address |
| 63 | |
| 64 | |
| 65 | Verify Hostname Text Configuration |
| 66 | [Documentation] Verify hostname text is configurable from "network settings" |
| 67 | ... sub-menu. |
| 68 | [Tags] Verify_Hostname_Text_Configuration |
| 69 | |
| 70 | Input Text ${xpath_hostname_input} witherspoon1 |
| 71 | Click Button ${xpath_network_save_settings} |
| 72 | Wait Until Page Contains Element ${xpath_setting_success} timeout=10 |
| 73 | Element Should Be Disabled ${xpath_network_save_settings} |
| 74 | Click Element ${xpath_select_refresh_button} |
| 75 | Wait Until Keyword Succeeds 15 sec 5 sec Textfield Should Contain ${xpath_hostname_input} |
| 76 | ... witherspoon1 |
| 77 | |
| 78 | |
| 79 | Verify Default Gateway Editable |
| 80 | [Documentation] Verify default gateway text input allowed from "network |
| 81 | ... settings". |
| 82 | [Tags] Verify_Default_Gateway_Editable |
| 83 | |
| 84 | Wait Until Page Contains Element ${xpath_default_gateway_input} |
| 85 | Input Text ${xpath_default_gateway_input} 10.6.6.7 |
| 86 | |
| 87 | |
| 88 | Verify MAC Address Editable |
| 89 | [Documentation] Verify MAC address text input allowed from "network |
| 90 | ... settings". |
| 91 | [Tags] Verify_MAC_Address_Editable |
| 92 | |
| 93 | Wait Until Page Contains Element ${xpath_mac_address_input} |
| 94 | Input Text ${xpath_mac_address_input} AA:E2:84:14:28:79 |
| 95 | |
| 96 | |
| 97 | Verify Static IP Address Editable |
| 98 | [Documentation] Verify static IP address is editable. |
| 99 | [Tags] Verify_Static_IP_Address_Editable |
| 100 | |
| 101 | ${exists}= Run Keyword And Return Status Wait Until Page Contains Element ${xpath_static_input_ip0} |
| 102 | Run Keyword If '${exists}' == '${False}' |
| 103 | ... Click Element ${xpath_add_static_ip} |
| 104 | |
| 105 | Input Text ${xpath_static_input_ip0} ${OPENBMC_HOST} |
| 106 | |
| 107 | |
Anves Kumar rayankula | 475811b | 2020-08-31 06:22:11 -0500 | [diff] [blame] | 108 | Verify System Section In Network Setting page |
| 109 | [Documentation] Verify hostname, MAC address and default gateway |
Anves Kumar rayankula | b172fbe | 2020-09-09 00:27:21 -0500 | [diff] [blame] | 110 | ... under system section of network setting page. |
Anves Kumar rayankula | 475811b | 2020-08-31 06:22:11 -0500 | [diff] [blame] | 111 | [Tags] Verify_System_Section |
| 112 | |
Anves Kumar rayankula | b172fbe | 2020-09-09 00:27:21 -0500 | [diff] [blame] | 113 | ${host_name}= Redfish_Utils.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName |
Anves Kumar rayankula | ba8a48e | 2020-10-05 06:18:09 -0500 | [diff] [blame] | 114 | Textfield Value Should Be ${xpath_hostname_input} ${host_name} |
Anves Kumar rayankula | 475811b | 2020-08-31 06:22:11 -0500 | [diff] [blame] | 115 | |
| 116 | ${mac_address}= Get BMC MAC Address |
| 117 | Textfield Value Should Be ${xpath_mac_address_input} ${mac_address} |
| 118 | |
| 119 | ${default_gateway}= Get BMC Default Gateway |
| 120 | Textfield Value Should Be ${xpath_default_gateway_input} ${default_gateway} |
| 121 | |
| 122 | |
Anves Kumar rayankula | 65e5ed2 | 2020-09-17 04:44:44 -0500 | [diff] [blame] | 123 | Verify Network Interface Details |
| 124 | [Documentation] Verify network interface name in network setting page. |
| 125 | [Tags] Verify_Network_Interface_Details |
| 126 | |
| 127 | ${active_channel_config}= Get Active Channel Config |
| 128 | ${ethernet_interface_redfish}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 129 | ${ethernet_interface_gui}= Get Text ${xpath_network_interface} |
| 130 | Should Contain ${ethernet_interface_gui} ${ethernet_interface_redfish} |
| 131 | |
| 132 | |
| 133 | Verify Network Static IPv4 Details |
| 134 | [Documentation] Verify network static IPv4 details. |
| 135 | [Tags] Verify_Network_static_IPv4_Details |
| 136 | |
| 137 | @{network_configurations}= Get Network Configuration |
| 138 | FOR ${network_configuration} IN @{network_configurations} |
| 139 | Textfield Value Should Be ${xpath_static_input_ip0} ${network_configuration["Address"]} |
| 140 | Textfield Value Should Be ${xpath_input_netmask_addr0} ${network_configuration['SubnetMask']} |
| 141 | END |
| 142 | |
| 143 | |
Anves Kumar rayankula | 550eba9 | 2020-09-21 23:36:44 -0500 | [diff] [blame] | 144 | Configure Invalid Network Addresses And Verify |
| 145 | [Documentation] Configure invalid network addresses and verify. |
| 146 | [Tags] Configure_Invalid_Network_Addresses_And_Verify |
| 147 | [Template] Configure Invalid Network Address And Verify |
| 148 | |
| 149 | # locator invalid_address |
| 150 | ${xpath_mac_address_input} A.A.A.A |
| 151 | ${xpath_default_gateway_input} a.b.c.d |
| 152 | ${xpath_static_input_ip0} a.b.c.d |
| 153 | ${xpath_input_netmask_addr0} 255.256.255.0 |
| 154 | |
| 155 | |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 156 | *** Keywords *** |
| 157 | |
| 158 | Suite Setup Execution |
| 159 | [Documentation] Do test case setup tasks. |
| 160 | |
| 161 | Launch Browser And Login GUI |
| 162 | Click Element ${xpath_server_configuration} |
| 163 | Click Element ${xpath_select_network_settings} |
| 164 | Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain network-settings |
| 165 | |
Anves Kumar rayankula | 550eba9 | 2020-09-21 23:36:44 -0500 | [diff] [blame] | 166 | |
| 167 | |
| 168 | Configure Invalid Network Address And Verify |
| 169 | [Documentation] Configure invalid network address And verify. |
| 170 | [Arguments] ${locator} ${invalid_address} |
| 171 | |
| 172 | # Description of the argument(s): |
| 173 | # locator Xpath to identify an HTML element on a web page. |
| 174 | # invalid_address Invalid address to be added. |
| 175 | |
| 176 | Wait Until Page Contains Element ${locator} |
| 177 | Input Text ${locator} ${invalid_address} |
Anves Kumar rayankula | 5548115 | 2020-10-21 07:51:07 -0500 | [diff] [blame] | 178 | Click Element ${xpath_network_save_settings} |
Anves Kumar rayankula | 550eba9 | 2020-09-21 23:36:44 -0500 | [diff] [blame] | 179 | Page Should Contain Invalid format |
| 180 | |