blob: d4b1c57735728566ee2feec98d7ff77f36f90077 [file] [log] [blame]
Anusha Dathatri21ac59f2020-07-14 13:12:58 -05001*** Settings ***
2
Rahul Maheshwari142642d2021-08-24 00:00:15 -05003Documentation Test OpenBMC GUI "Network" sub-menu of "Settings".
Anusha Dathatri21ac59f2020-07-14 13:12:58 -05004
Rahul Maheshwari41747da2020-11-17 09:09:52 -06005Resource ../../lib/gui_resource.robot
Anves Kumar rayankula65e5ed22020-09-17 04:44:44 -05006Resource ../../../lib/bmc_network_utils.robot
Anusha Dathatri21ac59f2020-07-14 13:12:58 -05007
8Suite Setup Suite Setup Execution
9Suite Teardown Close Browser
10
meghagn1bd39282021-12-19 23:56:42 -060011
Anusha Dathatri21ac59f2020-07-14 13:12:58 -050012*** Variables ***
13
meghagn1bd39282021-12-19 23:56:42 -060014${xpath_network_heading} //h1[text()="Network"]
15${xpath_interface_settings} //h2[text()="Interface settings"]
16${xpath_network_settings} //h2[text()="Network settings"]
17${xpath_static_ipv4} //h2[text()="IPv4"]
meghagn1bd39282021-12-19 23:56:42 -060018${xpath_domain_name_toggle} //*[@data-test-id="networkSettings-switch-useDomainName"]
meghagn1bd39282021-12-19 23:56:42 -060019${xpath_ntp_servers_toggle} //*[@data-test-id="networkSettings-switch-useNtp"]
20${xpath_add_static_ipv4_address_button} //button[contains(text(),"Add static IPv4 address")]
meghagncca733c2021-12-20 04:34:55 -060021${xpath_hostname} //*[@title="Edit hostname"]
22${xpath_hostname_input} //*[@id="hostname"]
23${xpath_input_ip_address} //*[@id="ipAddress"]
24${xpath_input_gateway} //*[@id="gateway"]
25${xpath_input_subnetmask} //*[@id="subnetMask"]
meghagncca733c2021-12-20 04:34:55 -060026${xpath_cancel_button} //button[contains(text(),'Cancel')]
meghagn2007beb2022-01-11 08:23:13 -060027${xpath_delete_dns_server} //*[@title="Delete DNS address"]
Sweta Potthuriec64ad02023-01-30 23:25:13 -060028${xpath_save_button} //button[contains(text(),'Save')]
meghagn2007beb2022-01-11 08:23:13 -060029
30${dns_server} 10.10.10.10
meghagn122340d2022-02-01 04:57:37 -060031${test_ipv4_addr} 10.7.7.7
Sweta Potthuria5e5e5c2022-11-22 07:50:52 -060032${test_ipv4_addr_1} 10.7.7.8
Sweta Potthuri87881412022-11-30 00:10:35 -060033${out_of_range_ip} 10.7.7.256
34${string_ip} aa.bb.cc.dd
35${negative_ip} 10.-7.-7.-7
36${less_octet_ip} 10.3.36
Sweta Potthuri5ca5c992022-12-01 06:31:25 -060037${hex_ip} 0xa.0xb.0xc.0xd
38${spl_char_ip} @@@.%%.44.11
meghagn122340d2022-02-01 04:57:37 -060039${test_subnet_mask} 255.255.0.0
40${alpha_netmask} ff.ff.ff.ff
41${out_of_range_netmask} 255.256.255.0
42${more_byte_netmask} 255.255.255.0.0
43${lowest_netmask} 128.0.0.0
meghagn97f7eb42022-03-02 02:59:35 -060044${test_hostname} openbmc
Anves Kumar rayankula4c884472020-11-24 05:03:45 -060045
Anusha Dathatri21ac59f2020-07-14 13:12:58 -050046*** Test Cases ***
47
Rahul Maheshwari142642d2021-08-24 00:00:15 -050048Verify Navigation To Network Page
meghagn1bd39282021-12-19 23:56:42 -060049 [Documentation] Login to GUI and navigate to the settings sub-menu network page.
Rahul Maheshwari142642d2021-08-24 00:00:15 -050050 [Tags] Verify_Navigation_To_Network_Page
Anusha Dathatrie11a54d2020-08-31 08:35:47 -050051
Rahul Maheshwari142642d2021-08-24 00:00:15 -050052 Page Should Contain Element ${xpath_network_heading}
Anusha Dathatrie11a54d2020-08-31 08:35:47 -050053
54
Rahul Maheshwari142642d2021-08-24 00:00:15 -050055Verify Existence Of All Sections In Network Page
meghagn1bd39282021-12-19 23:56:42 -060056 [Documentation] Login to GUI and navigate to the settings sub-menu network page
57 ... and confirm the page contains sections that should be accessible.
Rahul Maheshwari142642d2021-08-24 00:00:15 -050058 [Tags] Verify_Existence_Of_All_Sections_In_Network_Page
Anusha Dathatrie11a54d2020-08-31 08:35:47 -050059
meghagn1bd39282021-12-19 23:56:42 -060060 Wait Until Page Contains Element ${xpath_network_settings} timeout=1min
61 Page Should Contain Element ${xpath_interface_settings}
Anusha Dathatrie11a54d2020-08-31 08:35:47 -050062 Page Should Contain Element ${xpath_static_ipv4}
63 Page Should Contain Element ${xpath_static_dns}
64
65
Rahul Maheshwari142642d2021-08-24 00:00:15 -050066Verify Existence Of All Buttons In Network Page
meghagn1bd39282021-12-19 23:56:42 -060067 [Documentation] Login to GUI and navigate to the settings sub-menu network page
68 ... and confirm the page contains basic features button that should be accessible.
Rahul Maheshwari142642d2021-08-24 00:00:15 -050069 [Tags] Verify_Existence_Of_All_Buttons_In_Network_Page
Anusha Dathatrie11a54d2020-08-31 08:35:47 -050070
meghagn1bd39282021-12-19 23:56:42 -060071 Page Should Contain Button ${xpath_add_static_ipv4_address_button}
72 Page Should Contain Button ${xpath_add_dns_ip_address_button}
73 Page Should Contain Button ${xpath_domain_name_toggle}
74 Page Should Contain Button ${xpath_dns_servers_toggle}
75 Page Should Contain Button ${xpath_ntp_servers_toggle}
Anves Kumar rayankulac3a37e42021-06-17 06:56:51 -050076
77
meghagncca733c2021-12-20 04:34:55 -060078Verify Existence Of All Fields In Hostname
79 [Documentation] Login to GUI and navigate to the settings sub-menu network page
80 ... and confirm hostname contains all the fields.
81 [Tags] Verify_Existence_Of_All_Fields_In_Hostname
82 [Teardown] Run Keywords Click Button ${xpath_cancel_button} AND
83 ... Wait Until Keyword Succeeds 10 sec 5 sec
84 ... Refresh GUI And Verify Element Value ${xpath_network_heading} Network
85
86 Click Element ${xpath_hostname}
87 Wait Until Page Contains Edit hostname timeout=1min
88 Page Should Contain Textfield ${xpath_hostname_input}
89 Page Should Contain Button ${xpath_cancel_button}
Sweta Potthuriec64ad02023-01-30 23:25:13 -060090 Page Should Contain Button ${xpath_save_button}
meghagncca733c2021-12-20 04:34:55 -060091
92
93Verify Existence Of All Fields In Static IP Address
94 [Documentation] Login to GUI and navigate to the settings sub-menu network page
95 ... and confirm section static IPv4 contains all the fields.
96 [Tags] Verify_Existence_Of_All_Fields_In_Static_IP_Address
97 [Teardown] Run Keywords Click Button ${xpath_cancel_button} AND
98 ... Wait Until Keyword Succeeds 10 sec 5 sec
99 ... Refresh GUI And Verify Element Value ${xpath_network_heading} Network
100
101 Wait Until Keyword Succeeds 30 sec 10 sec Click Element ${xpath_add_static_ipv4_address_button}
102 Wait Until Page Contains Add static IPv4 address timeout=15s
103 Page Should Contain Textfield ${xpath_input_ip_address}
104 Page Should Contain Textfield ${xpath_input_gateway}
105 Page Should Contain Textfield ${xpath_input_subnetmask}
106 Page Should Contain Button ${xpath_cancel_button}
107 Page Should Contain Button ${xpath_add_button}
108
109
110Verify Existence Of All Fields In Static DNS
111 [Documentation] Login to GUI and navigate to the settings sub-menu network page
112 ... and confirm section static DNS contains all the fields.
113 [Tags] Verify_Existence_Of_All_Fields_In_Static_DNS
114 [Teardown] Run Keywords Click Button ${xpath_cancel_button} AND
115 ... Wait Until Keyword Succeeds 10 sec 5 sec
116 ... Refresh GUI And Verify Element Value ${xpath_network_heading} Network
117
118 Wait Until Keyword Succeeds 30 sec 10 sec Click Element ${xpath_add_dns_ip_address_button}
119 Wait Until Page Contains Add IP address timeout=11s
120 Page Should Contain Textfield ${xpath_input_static_dns}
121 Page Should Contain Button ${xpath_cancel_button}
122 Page Should Contain Button ${xpath_add_button}
123
124
meghagn2007beb2022-01-11 08:23:13 -0600125Configure And Verify DNS Server Via GUI
126 [Documentation] Login to GUI Network page, add DNS server IP
127 ... and verify that the page reflects server IP.
128 [Tags] Configure_And_Verify_DNS_Server_Via_GUI
129 [Teardown] Delete DNS Servers And Verify
130
131 Add DNS Servers And Verify ${dns_server}
132
133
meghagn122340d2022-02-01 04:57:37 -0600134Configure Static IPv4 Netmask Via GUI And Verify
135 [Documentation] Login to GUI Network page, configure static IPv4 netmask and verify.
136 [Tags] Configure_Static_IPv4_Netmask_Via_GUI_And_Verify
Rahul Maheshwari35182d82023-02-25 04:40:35 -0600137 [Setup] Redfish.Login
138 [Teardown] Redfish.Logout
meghagn122340d2022-02-01 04:57:37 -0600139 [Template] Add Static IP Address And Verify
140
141 # ip_addresses subnet_masks gateway expected_status
Sweta Potthuri130f3102023-01-15 23:13:54 -0600142 ${test_ipv4_addr} ${lowest_netmask} ${default_gateway} Success
143 ${test_ipv4_addr} ${more_byte_netmask} ${default_gateway} Invalid format
144 ${test_ipv4_addr} ${alpha_netmask} ${default_gateway} Invalid format
145 ${test_ipv4_addr} ${out_of_range_netmask} ${default_gateway} Invalid format
146 ${test_ipv4_addr} ${test_subnet_mask} ${default_gateway} Success
meghagn122340d2022-02-01 04:57:37 -0600147
148
meghagn97f7eb42022-03-02 02:59:35 -0600149Configure Hostname Via GUI And Verify
150 [Documentation] Login to GUI Network page, configure hostname and verify.
151 [Tags] Configure_Hostname_Via_GUI_And_Verify
152 [Teardown] Configure And Verify Network Settings Via GUI
153 ... ${xpath_hostname} ${xpath_hostname_input} ${hostname}
154
155 ${hostname}= Get BMC Hostname
156 Configure And Verify Network Settings Via GUI ${xpath_hostname}
157 ... ${xpath_hostname_input} ${test_hostname}
158
159 ${bmc_hostname}= Get BMC Hostname
160 Should Be Equal As Strings ${bmc_hostname} ${test_hostname}
161
162
meghagn5d987662022-02-17 22:47:44 -0600163Configure And Verify Static IP Address
164 [Documentation] Login to GUI Network page, configure static ip address and verify.
165 [Tags] Configure_And_Verify_Static_IP_Address
Rahul Maheshwari35182d82023-02-25 04:40:35 -0600166 [Setup] Redfish.Login
167 [Teardown] Redfish.Logout
meghagn5d987662022-02-17 22:47:44 -0600168
Sweta Potthuria5e5e5c2022-11-22 07:50:52 -0600169 Add Static IP Address And Verify ${test_ipv4_addr} ${test_subnet_mask} ${default_gateway} Success
170
171
172Configure And Verify Multiple Static IP Address
173 [Documentation] Login to GUI Network page, configure multiple static IP address and verify.
174 [Tags] Configure_And_Verify_Multiple_Static_IP_Address
175
176 Add Static IP Address And Verify ${test_ipv4_addr} ${test_subnet_mask} ${default_gateway} Success
177 Add Static IP Address And Verify ${test_ipv4_addr_1} ${test_subnet_mask} ${default_gateway} Success
meghagn5d987662022-02-17 22:47:44 -0600178
179
Sweta Potthuri87881412022-11-30 00:10:35 -0600180Configure And Verify Invalid Static IP Address
181 [Documentation] Login to GUI Network page, configure invalid static IP address and verify.
182 [Tags] Configure_And_Verify_Invalid_Static_IP_Address
183 [Template] Add Static IP Address And Verify
184
185 # ip subnet_mask gateway status
186 ${out_of_range_ip} ${test_subnet_mask} ${default_gateway} Invalid format
187 ${less_octet_ip} ${test_subnet_mask} ${default_gateway} Invalid format
188 ${string_ip} ${test_subnet_mask} ${default_gateway} Invalid format
189 ${negative_ip} ${test_subnet_mask} ${default_gateway} Invalid format
Sweta Potthuri5ca5c992022-12-01 06:31:25 -0600190 ${hex_ip} ${test_subnet_mask} ${default_gateway} Invalid format
191 ${spl_char_ip} ${test_subnet_mask} ${default_gateway} Invalid format
Sweta Potthuri87881412022-11-30 00:10:35 -0600192
Anusha Dathatri21ac59f2020-07-14 13:12:58 -0500193*** Keywords ***
194
195Suite Setup Execution
meghagn1bd39282021-12-19 23:56:42 -0600196 [Documentation] Do suite setup tasks.
Anusha Dathatri21ac59f2020-07-14 13:12:58 -0500197
198 Launch Browser And Login GUI
Sweta Potthuria5e5e5c2022-11-22 07:50:52 -0600199 Wait Until Keyword Succeeds 1 min 15 sec
rramyasr-in84ff2d82022-12-06 09:43:53 -0600200 ... Click Element ${xpath_settings_menu}
Rahul Maheshwari142642d2021-08-24 00:00:15 -0500201 Click Element ${xpath_network_sub_menu}
202 Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain network
rramyasr-in9e2c96f2023-01-24 07:59:34 -0600203 Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30
Sweta Potthuria5e5e5c2022-11-22 07:50:52 -0600204 ${default_gateway}= Get BMC Default Gateway
205 Set Suite Variable ${default_gateway}
meghagn2007beb2022-01-11 08:23:13 -0600206
207
meghagn2007beb2022-01-11 08:23:13 -0600208Delete DNS Servers And Verify
209 [Documentation] Login to GUI Network page,delete static name servers
George Keishingc91aadd2022-02-23 09:30:48 -0600210 ... and verify that page does not reflect static name servers.
meghagn2007beb2022-01-11 08:23:13 -0600211
212 Page Should Contain Element ${xpath_delete_dns_server}
213 Wait Until Element Is Enabled ${xpath_delete_dns_server}
214 Click Button ${xpath_delete_dns_server}
215 Wait Until Page Contains Element ${xpath_add_dns_ip_address_button} timeout=15
216 # Check if all name servers deleted on BMC.
217 ${nameservers}= CLI Get Nameservers
218 Should Be Empty ${nameservers}
meghagn122340d2022-02-01 04:57:37 -0600219
220
221Add Static IP Address And Verify
222 [Documentation] Add static IP address, subnet mask and
223 ... gateway via GUI and verify.
224 [Arguments] ${ip_address} ${subnet_mask} ${gateway_address} ${expected_status}=error
225
226 # Description of argument(s):
227 # ip_address IP address to be added (e.g. 10.7.7.7).
228 # subnet_mask Subnet mask for the IP to be added (e.g. 255.255.0.0).
229 # gateway_address Gateway address for the IP to be added (e.g. 10.7.7.1).
230 # expected_status Expected status while adding static ipv4 address
231 # .... (e.g. Invalid format / Field required).
232
233 Wait Until Keyword Succeeds 30 sec 10 sec Click Element ${xpath_add_static_ipv4_address_button}
234
235 Input Text ${xpath_input_ip_address} ${ip_address}
236 Input Text ${xpath_input_subnetmask} ${subnet_mask}
237 Input Text ${xpath_input_gateway} ${gateway_address}
238
meghagn97f7eb42022-03-02 02:59:35 -0600239 Click Element ${xpath_add_button}
meghagn5d987662022-02-17 22:47:44 -0600240 Run Keyword If '${expected_status}' == 'Success'
meghagn122340d2022-02-01 04:57:37 -0600241 ... Run Keywords Wait Until Page Contains ${ip_address} timeout=40sec
242 ... AND Validate Network Config On BMC
243
244 ... ELSE IF '${expected_status}' == 'Invalid format'
245 ... Run Keywords Page Should Contain Invalid format AND
246 ... Click Button ${xpath_cancel_button}
meghagn97f7eb42022-03-02 02:59:35 -0600247
248
249Configure And Verify Network Settings Via GUI
250 [Documentation] Configure and verify network settings via GUI.
251 [Arguments] ${xpath_nw_settings} ${xpath_nw_settings_input_field} ${input_value}
252
253 # Description of argument(s):
254 # xpath_nw_settings xpath of the network settings.
255 # xpath_nw_settings_input_field xpath of the network setting's input field.
256 # input_value Input value for configuration. E.g. hostname, IP etc.
257
258 Wait Until Keyword Succeeds 30 sec 10 sec Click Element ${xpath_nw_settings}
259 Input Text ${xpath_nw_settings_input_field} ${input_value}
Sweta Potthuria3e5de12023-02-06 01:46:53 -0600260 Click Button ${xpath_save_button}
meghagn97f7eb42022-03-02 02:59:35 -0600261 Wait Until Page Contains ${input_value} timeout=30sec