blob: d6f9c704c29db81934103bd27ee57a408bc194b9 [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"]
Anusha Dathatri21ac59f2020-07-14 13:12:58 -050029
30*** Test Cases ***
31
Anusha Dathatrie11a54d2020-08-31 08:35:47 -050032Verify 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
39Verify 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
49Verify 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 Dathatri21ac59f2020-07-14 13:12:58 -050057Verify 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
65Verify Hostname Text Configuration
66 [Documentation] Verify hostname text is configurable from "network settings"
67 ... sub-menu.
68 [Tags] Verify_Hostname_Text_Configuration
69
Anves Kumar rayankula76c0a8a2020-11-17 03:36:32 -060070 Wait Until Element Is Enabled ${xpath_hostname_input}
Anusha Dathatri21ac59f2020-07-14 13:12:58 -050071 Input Text ${xpath_hostname_input} witherspoon1
72 Click Button ${xpath_network_save_settings}
73 Wait Until Page Contains Element ${xpath_setting_success} timeout=10
Anusha Dathatri21ac59f2020-07-14 13:12:58 -050074 Wait Until Keyword Succeeds 15 sec 5 sec Textfield Should Contain ${xpath_hostname_input}
75 ... witherspoon1
76
77
78Verify Default Gateway Editable
79 [Documentation] Verify default gateway text input allowed from "network
80 ... settings".
81 [Tags] Verify_Default_Gateway_Editable
82
83 Wait Until Page Contains Element ${xpath_default_gateway_input}
84 Input Text ${xpath_default_gateway_input} 10.6.6.7
85
86
87Verify MAC Address Editable
88 [Documentation] Verify MAC address text input allowed from "network
89 ... settings".
90 [Tags] Verify_MAC_Address_Editable
91
92 Wait Until Page Contains Element ${xpath_mac_address_input}
93 Input Text ${xpath_mac_address_input} AA:E2:84:14:28:79
94
95
96Verify Static IP Address Editable
97 [Documentation] Verify static IP address is editable.
98 [Tags] Verify_Static_IP_Address_Editable
99
100 ${exists}= Run Keyword And Return Status Wait Until Page Contains Element ${xpath_static_input_ip0}
101 Run Keyword If '${exists}' == '${False}'
102 ... Click Element ${xpath_add_static_ip}
103
104 Input Text ${xpath_static_input_ip0} ${OPENBMC_HOST}
105
106
Anves Kumar rayankula475811b2020-08-31 06:22:11 -0500107Verify System Section In Network Setting page
108 [Documentation] Verify hostname, MAC address and default gateway
Anves Kumar rayankulab172fbe2020-09-09 00:27:21 -0500109 ... under system section of network setting page.
Anves Kumar rayankula475811b2020-08-31 06:22:11 -0500110 [Tags] Verify_System_Section
111
Anves Kumar rayankulab172fbe2020-09-09 00:27:21 -0500112 ${host_name}= Redfish_Utils.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName
Anves Kumar rayankulaba8a48e2020-10-05 06:18:09 -0500113 Textfield Value Should Be ${xpath_hostname_input} ${host_name}
Anves Kumar rayankula475811b2020-08-31 06:22:11 -0500114
115 ${mac_address}= Get BMC MAC Address
116 Textfield Value Should Be ${xpath_mac_address_input} ${mac_address}
117
118 ${default_gateway}= Get BMC Default Gateway
119 Textfield Value Should Be ${xpath_default_gateway_input} ${default_gateway}
120
121
Anves Kumar rayankula65e5ed22020-09-17 04:44:44 -0500122Verify Network Interface Details
123 [Documentation] Verify network interface name in network setting page.
124 [Tags] Verify_Network_Interface_Details
125
126 ${active_channel_config}= Get Active Channel Config
127 ${ethernet_interface_redfish}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
128 ${ethernet_interface_gui}= Get Text ${xpath_network_interface}
129 Should Contain ${ethernet_interface_gui} ${ethernet_interface_redfish}
130
131
132Verify Network Static IPv4 Details
133 [Documentation] Verify network static IPv4 details.
134 [Tags] Verify_Network_static_IPv4_Details
135
136 @{network_configurations}= Get Network Configuration
137 FOR ${network_configuration} IN @{network_configurations}
138 Textfield Value Should Be ${xpath_static_input_ip0} ${network_configuration["Address"]}
139 Textfield Value Should Be ${xpath_input_netmask_addr0} ${network_configuration['SubnetMask']}
140 END
141
142
Anves Kumar rayankula550eba92020-09-21 23:36:44 -0500143Configure Invalid Network Addresses And Verify
144 [Documentation] Configure invalid network addresses and verify.
145 [Tags] Configure_Invalid_Network_Addresses_And_Verify
146 [Template] Configure Invalid Network Address And Verify
147
148 # locator invalid_address
149 ${xpath_mac_address_input} A.A.A.A
150 ${xpath_default_gateway_input} a.b.c.d
151 ${xpath_static_input_ip0} a.b.c.d
152 ${xpath_input_netmask_addr0} 255.256.255.0
153
154
Anusha Dathatri21ac59f2020-07-14 13:12:58 -0500155*** Keywords ***
156
157Suite Setup Execution
158 [Documentation] Do test case setup tasks.
159
160 Launch Browser And Login GUI
161 Click Element ${xpath_server_configuration}
162 Click Element ${xpath_select_network_settings}
163 Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain network-settings
164
Anves Kumar rayankula550eba92020-09-21 23:36:44 -0500165
Anves Kumar rayankula550eba92020-09-21 23:36:44 -0500166Configure Invalid Network Address And Verify
167 [Documentation] Configure invalid network address And verify.
168 [Arguments] ${locator} ${invalid_address}
169
170 # Description of the argument(s):
171 # locator Xpath to identify an HTML element on a web page.
172 # invalid_address Invalid address to be added.
173
174 Wait Until Page Contains Element ${locator}
175 Input Text ${locator} ${invalid_address}
Anves Kumar rayankula55481152020-10-21 07:51:07 -0500176 Click Element ${xpath_network_save_settings}
Anves Kumar rayankula550eba92020-09-21 23:36:44 -0500177 Page Should Contain Invalid format
178