blob: ec226b98cfb1eaa6f3c1e1d426a100759ab9e898 [file] [log] [blame]
Anusha Dathatri21ac59f2020-07-14 13:12:58 -05001*** Settings ***
2
3Documentation Test OpenBMC GUI "Network settings" sub-menu of
4... "Server configuration".
5
Rahul Maheshwari41747da2020-11-17 09:09:52 -06006Resource ../../lib/gui_resource.robot
Anves Kumar rayankula65e5ed22020-09-17 04:44:44 -05007Resource ../../../lib/bmc_network_utils.robot
Anusha Dathatri21ac59f2020-07-14 13:12:58 -05008
9Suite Setup Suite Setup Execution
10Suite Teardown Close Browser
11
12*** Variables ***
13
Anusha Dathatrie11a54d2020-08-31 08:35:47 -050014${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 rayankula65e5ed22020-09-17 04:44:44 -050027${xpath_network_interface} //*[@data-test-id="networkSettings-select-interface"]
28${xpath_input_netmask_addr0} //*[@data-test-id="networkSettings-input-subnetMask-0"]
Anves Kumar rayankula43d8fe82020-12-08 21:21:38 -060029${xpath_delete_static_ip} //*[@title="Delete IPv4 row"]
Anusha Dathatri21ac59f2020-07-14 13:12:58 -050030
31*** Test Cases ***
32
Anusha Dathatrie11a54d2020-08-31 08:35:47 -050033Verify Navigation To Network Settings Page
34 [Documentation] Verify navigation to network settings page.
35 [Tags] Verify_Navigation_To_Network_Settings_Page
36
37 Page Should Contain Element ${xpath_network_setting_heading}
38
39
40Verify Existence Of All Sections In Network Settings Page
41 [Documentation] Verify existence of all sections in network settings page.
42 [Tags] Verify_Existence_Of_All_Sections_In_Network_Settings_Page
43
44 Page Should Contain Element ${xpath_interface}
45 Page Should Contain Element ${xpath_system}
46 Page Should Contain Element ${xpath_static_ipv4}
47 Page Should Contain Element ${xpath_static_dns}
Anves Kumar rayankula43d8fe82020-12-08 21:21:38 -060048 Page Should Contain Button ${xpath_delete_static_ip}
Anusha Dathatrie11a54d2020-08-31 08:35:47 -050049
50
51Verify Existence Of All Buttons In Network Settings Page
52 [Documentation] Verify existence of all buttons in network settings page.
53 [Tags] Verify_Existence_Of_All_Buttons_In_Network_Settings_Page
54
55 Page Should Contain Element ${xpath_add_static_ip}
56 Page Should Contain Element ${xpath_add_dns_server}
57
58
Anusha Dathatri21ac59f2020-07-14 13:12:58 -050059Verify Network Settings From Server Configuration
60 [Documentation] Verify ability to select "Network Settings" sub-menu option
61 ... of "Server Configuration".
62 [Tags] Verify_Network_Settings_From_Server_Configuration
63
64 Page Should Contain IP address
65
66
67Verify Hostname Text Configuration
68 [Documentation] Verify hostname text is configurable from "network settings"
69 ... sub-menu.
70 [Tags] Verify_Hostname_Text_Configuration
71
Anves Kumar rayankula76c0a8a2020-11-17 03:36:32 -060072 Wait Until Element Is Enabled ${xpath_hostname_input}
Anusha Dathatri21ac59f2020-07-14 13:12:58 -050073 Input Text ${xpath_hostname_input} witherspoon1
74 Click Button ${xpath_network_save_settings}
75 Wait Until Page Contains Element ${xpath_setting_success} timeout=10
Anusha Dathatri21ac59f2020-07-14 13:12:58 -050076 Wait Until Keyword Succeeds 15 sec 5 sec Textfield Should Contain ${xpath_hostname_input}
77 ... witherspoon1
78
79
80Verify Default Gateway Editable
81 [Documentation] Verify default gateway text input allowed from "network
82 ... settings".
83 [Tags] Verify_Default_Gateway_Editable
84
85 Wait Until Page Contains Element ${xpath_default_gateway_input}
86 Input Text ${xpath_default_gateway_input} 10.6.6.7
87
88
89Verify MAC Address Editable
90 [Documentation] Verify MAC address text input allowed from "network
91 ... settings".
92 [Tags] Verify_MAC_Address_Editable
93
94 Wait Until Page Contains Element ${xpath_mac_address_input}
95 Input Text ${xpath_mac_address_input} AA:E2:84:14:28:79
96
97
98Verify Static IP Address Editable
99 [Documentation] Verify static IP address is editable.
100 [Tags] Verify_Static_IP_Address_Editable
101
102 ${exists}= Run Keyword And Return Status Wait Until Page Contains Element ${xpath_static_input_ip0}
103 Run Keyword If '${exists}' == '${False}'
104 ... Click Element ${xpath_add_static_ip}
105
106 Input Text ${xpath_static_input_ip0} ${OPENBMC_HOST}
107
108
Anves Kumar rayankula475811b2020-08-31 06:22:11 -0500109Verify System Section In Network Setting page
110 [Documentation] Verify hostname, MAC address and default gateway
Anves Kumar rayankulab172fbe2020-09-09 00:27:21 -0500111 ... under system section of network setting page.
Anves Kumar rayankula475811b2020-08-31 06:22:11 -0500112 [Tags] Verify_System_Section
113
Anves Kumar rayankulab172fbe2020-09-09 00:27:21 -0500114 ${host_name}= Redfish_Utils.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName
Anves Kumar rayankulaba8a48e2020-10-05 06:18:09 -0500115 Textfield Value Should Be ${xpath_hostname_input} ${host_name}
Anves Kumar rayankula475811b2020-08-31 06:22:11 -0500116
117 ${mac_address}= Get BMC MAC Address
118 Textfield Value Should Be ${xpath_mac_address_input} ${mac_address}
119
120 ${default_gateway}= Get BMC Default Gateway
121 Textfield Value Should Be ${xpath_default_gateway_input} ${default_gateway}
122
123
Anves Kumar rayankula65e5ed22020-09-17 04:44:44 -0500124Verify Network Interface Details
125 [Documentation] Verify network interface name in network setting page.
126 [Tags] Verify_Network_Interface_Details
127
128 ${active_channel_config}= Get Active Channel Config
129 ${ethernet_interface_redfish}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
130 ${ethernet_interface_gui}= Get Text ${xpath_network_interface}
131 Should Contain ${ethernet_interface_gui} ${ethernet_interface_redfish}
132
133
134Verify Network Static IPv4 Details
135 [Documentation] Verify network static IPv4 details.
136 [Tags] Verify_Network_static_IPv4_Details
137
138 @{network_configurations}= Get Network Configuration
139 FOR ${network_configuration} IN @{network_configurations}
140 Textfield Value Should Be ${xpath_static_input_ip0} ${network_configuration["Address"]}
141 Textfield Value Should Be ${xpath_input_netmask_addr0} ${network_configuration['SubnetMask']}
142 END
143
144
Anves Kumar rayankula550eba92020-09-21 23:36:44 -0500145Configure Invalid Network Addresses And Verify
146 [Documentation] Configure invalid network addresses and verify.
147 [Tags] Configure_Invalid_Network_Addresses_And_Verify
148 [Template] Configure Invalid Network Address And Verify
149
150 # locator invalid_address
151 ${xpath_mac_address_input} A.A.A.A
152 ${xpath_default_gateway_input} a.b.c.d
153 ${xpath_static_input_ip0} a.b.c.d
154 ${xpath_input_netmask_addr0} 255.256.255.0
155
156
Anves Kumar rayankula43d8fe82020-12-08 21:21:38 -0600157Configure And Verify Empty Network Addresses
158 [Documentation] Configure and verify empty network addresses.
159 [Tags] Configure_And_Verify_Empty_Network_Addresses
160 [Template] Configure Invalid Network Address And Verify
161
162 # locator invalid_address expected_error
163 ${xpath_mac_address_input} ${empty} Field required
164 ${xpath_default_gateway_input} ${empty} Field required
165 ${xpath_static_input_ip0} ${empty} Field required
166 ${xpath_input_netmask_addr0} ${empty} Field required
167 ${xpath_hostname_input} ${empty} Field required
168
169
Anusha Dathatri21ac59f2020-07-14 13:12:58 -0500170*** Keywords ***
171
172Suite Setup Execution
173 [Documentation] Do test case setup tasks.
174
175 Launch Browser And Login GUI
176 Click Element ${xpath_server_configuration}
177 Click Element ${xpath_select_network_settings}
178 Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain network-settings
179
Anves Kumar rayankula550eba92020-09-21 23:36:44 -0500180
Anves Kumar rayankula550eba92020-09-21 23:36:44 -0500181Configure Invalid Network Address And Verify
182 [Documentation] Configure invalid network address And verify.
Anves Kumar rayankula43d8fe82020-12-08 21:21:38 -0600183 [Arguments] ${locator} ${invalid_address} ${expected_error}=Invalid format
Anves Kumar rayankula550eba92020-09-21 23:36:44 -0500184
185 # Description of the argument(s):
186 # locator Xpath to identify an HTML element on a web page.
187 # invalid_address Invalid address to be added.
Anves Kumar rayankula43d8fe82020-12-08 21:21:38 -0600188 # expected_error Expected error optionally provided in testcase
189 # .... (e.g. Invalid format / Field required)
Anves Kumar rayankula550eba92020-09-21 23:36:44 -0500190
Anves Kumar rayankula43d8fe82020-12-08 21:21:38 -0600191 Wait Until Element Is Enabled ${locator}
192 Clear Element Text ${locator}
Anves Kumar rayankula550eba92020-09-21 23:36:44 -0500193 Input Text ${locator} ${invalid_address}
Anves Kumar rayankula55481152020-10-21 07:51:07 -0500194 Click Element ${xpath_network_save_settings}
Anves Kumar rayankula43d8fe82020-12-08 21:21:38 -0600195 Page Should Contain ${expected_error}
Anves Kumar rayankula550eba92020-09-21 23:36:44 -0500196