blob: f62b3ae1fc629a92875f682f22204ddee5e54235 [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
6Resource ../../lib/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
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
79Verify 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
88Verify 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
97Verify 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 rayankula475811b2020-08-31 06:22:11 -0500108Verify System Section In Network Setting page
109 [Documentation] Verify hostname, MAC address and default gateway
Anves Kumar rayankulab172fbe2020-09-09 00:27:21 -0500110 ... under system section of network setting page.
Anves Kumar rayankula475811b2020-08-31 06:22:11 -0500111 [Tags] Verify_System_Section
112
Anves Kumar rayankulab172fbe2020-09-09 00:27:21 -0500113 ${host_name}= Redfish_Utils.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName
Anves Kumar rayankulaba8a48e2020-10-05 06:18:09 -0500114 Textfield Value Should Be ${xpath_hostname_input} ${host_name}
Anves Kumar rayankula475811b2020-08-31 06:22:11 -0500115
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 rayankula65e5ed22020-09-17 04:44:44 -0500123Verify 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
133Verify 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
Anusha Dathatri21ac59f2020-07-14 13:12:58 -0500144*** Keywords ***
145
146Suite Setup Execution
147 [Documentation] Do test case setup tasks.
148
149 Launch Browser And Login GUI
150 Click Element ${xpath_server_configuration}
151 Click Element ${xpath_select_network_settings}
152 Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain network-settings
153