blob: 73fc5701fc1d54653e1feccfe98041aed2c47e93 [file] [log] [blame]
Rahul Maheshwarib940e192020-07-07 01:52:24 -05001*** Settings ***
2
3Documentation Test OpenBMC GUI "Overview" menu.
4
Rahul Maheshwari41747da2020-11-17 09:09:52 -06005Resource ../../lib/gui_resource.robot
manashsarma2544cb12020-08-23 14:25:08 -05006Resource ../../../lib/logging_utils.robot
manashsarmafb353662020-08-27 05:12:04 -05007Resource ../../../lib/list_utils.robot
manashsarma6d584de2020-08-30 02:33:07 -05008Resource ../../../lib/bmc_network_utils.robot
9
10Library String
Rahul Maheshwarib940e192020-07-07 01:52:24 -050011
rramyasr-in13242572022-11-08 01:44:52 -060012Suite Setup Run Keywords Launch Browser And Login GUI AND Redfish.Login
13Suite Teardown Run Keywords Close Browser AND Redfish.Logout
Rahul Maheshwarib940e192020-07-07 01:52:24 -050014Test Setup Test Setup Execution
15
16
17*** Variables ***
18
rramyasr-in5f280c02022-11-11 06:41:00 -060019${xpath_overview_page_header} //h1[contains(text(), "Overview")]
20${xpath_server_information_view_more_button} (//*[text()="View more"])[1]
21${xpath_firmware_information_view_more_button} (//*[text()="View more"])[2]
22${xpath_edit_network_settings_button} (//*[text()="View more"])[3]
23${xpath_power_information_view_more_button} (//*[text()="View more"])[4]
24${xpath_event_logs_view_more_button} (//*[text()="View more"])[5]
25${xpath_inventory_and_leds_view_more_button} (//*[text()="View more"])[6]
26${xpath_launch_host_console} //*[@data-test-id='overviewQuickLinks-button-solConsole']
27${xpath_led_button} //*[@data-test-id='overviewInventory-checkbox-identifyLed']
28${view_all_Dumps} (//*[text()="View more"])[7]
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -050029
Rahul Maheshwarib940e192020-07-07 01:52:24 -050030*** Test Cases ***
31
32Verify Existence Of All Sections In Overview Page
33 [Documentation] Verify existence of all sections in Overview page.
34 [Tags] Verify_Existence_Of_All_Sections_In_Overview_Page
35
rramyasr-in1a79b662022-06-13 00:25:50 -050036 Page Should Contain BMC date and time
Ashwini Chandrappa516f70d2021-12-14 01:21:29 -060037 Page Should Contain Firmware information
Rahul Maheshwarib940e192020-07-07 01:52:24 -050038 Page Should Contain Server information
Ashwini Chandrappa516f70d2021-12-14 01:21:29 -060039 Wait Until Page Contains Network information timeout=10
rramyasr-in532c37f2021-12-03 03:39:14 -060040 Page Should Contain Power information
41 Page Should Contain Event logs
42 Page Should Contain Inventory and LEDs
rramyasr-ine6818d12022-01-13 07:23:40 -060043 Page Should Contain Dumps
Rahul Maheshwarib940e192020-07-07 01:52:24 -050044
rramyasr-in19e553c2022-10-27 02:17:41 -050045
manashsarma6d584de2020-08-30 02:33:07 -050046Verify Network Information In Overview Page
47 [Documentation] Verify values under network information section.
George Keishingf9248952021-05-28 07:52:37 -050048 [Tags] Verify_Network_Information_In_Overview_Page
manashsarma6d584de2020-08-30 02:33:07 -050049
50 ${hostname}= Get BMC Hostname
51 Page Should Contain ${hostname}
52
53 # Get all IP addresses and prefix lengths on system.
54
rramyasr-in690fcd42022-10-27 03:25:39 -050055 ${resp}= Redfish.Get Attribute /redfish/v1/Managers/bmc/EthernetInterfaces/eth0 IPv4StaticAddresses
56 ${ip_addr}= Set Variable ${resp[0]['Address']}
57 Page Should Contain ${ip_addr}
manashsarma6d584de2020-08-30 02:33:07 -050058
manashsarma6d584de2020-08-30 02:33:07 -050059
manashsarmae18f99e2020-08-28 10:12:57 -050060Verify Server Information Section
61 [Documentation] Verify values under server information section in overview page.
62 [Tags] Verify_Server_Information_Section
63
64 ${redfish_machine_model}= Redfish.Get Attribute /redfish/v1/Systems/system/ Model
65 Page Should Contain ${redfish_machine_model}
66
67 ${redfish_serial_number}= Redfish.Get Attribute /redfish/v1/Systems/system/ SerialNumber
68 Page Should Contain ${redfish_serial_number}
69
70 ${redfish_motherboard_manufacturer}= Redfish.Get Attribute
manashsarma58de7d72020-09-07 21:05:21 -050071 ... /redfish/v1/Systems/system/ Manufacturer
manashsarmae18f99e2020-08-28 10:12:57 -050072
73 Page Should Contain ${redfish_motherboard_manufacturer}
74
75
manashsarma554ddec2020-08-26 00:46:02 -050076Verify BMC Information Section
77 [Documentation] Verify BMC information section in overview page.
78 [Tags] Verify_BMC_Information_Section
79
80 ${firmware_version}= Redfish Get BMC Version
81 Page Should Contain ${firmware_version}
82
83
manashsarma43568c22020-08-19 12:16:24 -050084Verify Edit Network Setting Button
85 [Documentation] Verify navigation to network setting page after clicking the button in overview page.
86 [Tags] Verify_Edit_Network_Setting_Button
87
88 Click Element ${xpath_edit_network_settings_button}
rramyasr-in732cc3f2022-11-16 05:30:57 -060089 Wait Until Page Contains Element ${xpath_network_heading}
manashsarma43568c22020-08-19 12:16:24 -050090
91
manashsarmafb353662020-08-27 05:12:04 -050092Verify Event Under High Priority Events Section
93 [Documentation] Verify event under high priority events section in case of any event.
94 [Tags] Verify_Event_Under_High_Priority_Events_Section
95
96 Redfish Purge Event Log
97 Click Element ${xpath_refresh_button}
98 Generate Test Error Log
Ashwini Chandrappa243a1f22021-07-26 01:10:04 -050099 Click Element ${xpath_refresh_button}
manashsarmafb353662020-08-27 05:12:04 -0500100 Wait Until Page Contains xyz.openbmc_project.Common.Error.InternalFailure timeout=30s
101
102
manashsarma7d0a4122020-08-23 13:41:03 -0500103Verify View All Event Logs Button
104 [Documentation] Verify view all event log button in overview page.
105 [Tags] Verify_View_All_Event_Logs_Button
106
107 Generate Test Error Log
108 Page Should Contain Element ${view_all_event_logs} timeout=30
109 Click Element ${view_all_event_logs}
rramyasr-in5f280c02022-11-11 06:41:00 -0600110 Wait Until Page Contains Element ${xpath_event_logs_heading} timeout=30
manashsarma7d0a4122020-08-23 13:41:03 -0500111
112
rramyasr-inb18e15e2022-08-11 05:22:20 -0500113Verify Host Console Button In Overview Page
114 [Documentation] Click host console button and verify page navigation to host console page.
115 [Tags] Verify_Host_Console_Button_In_Overview_Page
manashsarmaa3a25362020-08-23 09:23:28 -0500116
rramyasr-inb18e15e2022-08-11 05:22:20 -0500117 Click Element ${xpath_launch_host_console}
118 Wait Until Page Contains Element ${xpath_host_console_heading}
manashsarmaa3a25362020-08-23 09:23:28 -0500119
120
manashsarmaffb30932020-08-24 07:31:54 -0500121Verify Server LED Turn On
122 [Documentation] Turn on server LED via GUI and verify its status via Redfish.
123 [Tags] Verify_Server_LED_Turn_On
124
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500125 # Turn Off the server LED via Redfish and refresh GUI.
George Keishing52eb7c22022-03-11 10:58:53 -0600126 Set IndicatorLED State Off
127
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500128 Refresh GUI
manashsarmaffb30932020-08-24 07:31:54 -0500129
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500130 # Turn ON the LED via GUI.
manashsarmaffb30932020-08-24 07:31:54 -0500131 Click Element At Coordinates ${xpath_led_button} 0 0
132
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500133 # Cross check that server LED ON state via Redfish.
George Keishing52eb7c22022-03-11 10:58:53 -0600134 Verify Identify LED State Via Redfish Lit
manashsarmaffb30932020-08-24 07:31:54 -0500135
136
137Verify Server LED Turn Off
138 [Documentation] Turn off server LED via GUI and verify its status via Redfish.
139 [Tags] Verify_Server_LED_Turn_Off
140
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500141 # Turn On the server LED via Redfish and refresh GUI.
George Keishing52eb7c22022-03-11 10:58:53 -0600142 Set IndicatorLED State Lit
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500143 Refresh GUI
manashsarmaffb30932020-08-24 07:31:54 -0500144
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500145 # Turn OFF the LED via GUI.
manashsarmaffb30932020-08-24 07:31:54 -0500146 Click Element At Coordinates ${xpath_led_button} 0 0
147
148 # Cross check that server LED off state via Redfish.
George Keishing52eb7c22022-03-11 10:58:53 -0600149 Verify Identify LED State Via Redfish Off
manashsarmaffb30932020-08-24 07:31:54 -0500150
151
manashsarma65c9e142020-08-23 07:27:52 -0500152Verify BMC Time In Overview Page
153 [Documentation] Verify that BMC date from GUI matches with BMC time via Redfish.
154 [Tags] Verify_BMC_Time_In_Overview_Page
155
156 ${date_time}= Redfish.Get Attribute ${REDFISH_BASE_URI}Managers/bmc DateTime
157 ${converted_date}= Convert Date ${date_time} result_format=%Y-%m-%d
158
159 Page Should Contain ${converted_date}
160
161
manashsarma43458ff2021-08-17 05:42:47 -0500162Verify BMC Information At Host Power Off State
163 [Documentation] Verify that BMC information is displayed at host power off state.
164 [Tags] Verify_BMC_Information_At_Host_Power_Off_State
165
166 Redfish Power Off stack_mode=skip
167 ${firmware_version}= Redfish Get BMC Version
168 Page Should Contain ${firmware_version}
169
170
rramyasr-in305d23a2022-01-19 01:32:04 -0600171Verify View More Button For Dumps
172 [Documentation] Verify view more button for dumps button in overview page.
173 [Tags] Verify_View_More_Button_For_Dumps
174
175 Wait Until Page Contains Element ${view_all_Dumps} timeout=30
176 Click Element ${view_all_Dumps}
rramyasr-in5f280c02022-11-11 06:41:00 -0600177 Wait Until Page Contains Element ${xpath_dumps_header} timeout=30
178
179
180Verify View More Button Under Server Information Section
181 [Documentation] Verify view more button under server information section in overview page.
182 [Tags] Verify_View_More_Button_Under_Server_Information_Section
183
184 Wait Until Page Contains Element ${xpath_server_information} timeout=30
185 Click Element ${xpath_server_information}
186 Wait Until Page Contains Element ${xpath_inventory_and_leds_heading} timeout=30
187
188
189Verify View More Button Under Firmware Information Section
190 [Documentation] Verify view more button under firmware information section in overview page.
191 [Tags] Verify_View_More_Button_Under_Firmware_Information_Section
192
193 Wait Until Page Contains Element ${xpath_firmware_information_view_more_button} timeout=30
194 Click Element ${xpath_firmware_information_view_more_button}
195 Wait Until Page Contains Element ${xpath_firmware_heading} timeout=30
196
197
198Verify View More Button Under Network Information Section
199 [Documentation] Verify view more button under network information section in overview page.
200 [Tags] Verify_View_More_Button_Under_Network_information_Section
201
202 Wait Until Page Contains Element ${xpath_inventory_and_leds_view_more_button} timeout=30
203 Click Element ${xpath_inventory_and_leds_view_more_button}
204 Wait Until Page Contains Element ${xpath_network_heading} timeout=30
205
206
207Verify View More Button Under Power Information Section
208 [Documentation] Verify view more button under power information section in overview page.
209 [Tags] Verify_View_More_Button_Under_Power_information_Section
210
211 Wait Until Page Contains Element ${xpath_power_information_view_more_button} timeout=30
212 Click Element ${xpath_power_information_view_more_button}
213 Wait Until Page Contains Element ${xpath_power_heading} timeout=30
214
215
216Verify View More Button Under Event Logs Section
217 [Documentation] Verify view more button under event logs section in overview page.
218 [Tags] Verify_View_More_Button_Under_Event_Logs_Section
219
220 Wait Until Page Contains Element ${xpath_event_logs_view_more_button} timeout=30
221 Click Element ${xpath_event_logs_view_more_button}
222 Wait Until Page Contains Element ${xpath_event_logs_heading} timeout=30
223
224
225Verify View More Button Under Inventory And LEDs Section
226 [Documentation] Verify view more button under inventory and leds section in overview page.
227 [Tags] Verify_View_More_Button_Under_Inventory_And_LEDs_Section
228
229 Wait Until Page Contains Element ${xpath_inventory_and_leds_view_more_button} timeout=30
230 Click Element ${xpath_inventory_and_leds_view_more_button}
231 Wait Until Page Contains Element ${xpath_inventory_and_leds_heading} timeout=30
232
rramyasr-in305d23a2022-01-19 01:32:04 -0600233
Rahul Maheshwarib940e192020-07-07 01:52:24 -0500234*** Keywords ***
235
236Test Setup Execution
237 [Documentation] Do test case setup tasks.
238
239 Click Element ${xpath_overview_menu}
240 Wait Until Page Contains Element ${xpath_overview_page_header}
rramyasr-in7776e322022-10-10 11:01:13 -0500241 Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30
George Keishing52eb7c22022-03-11 10:58:53 -0600242
rramyasr-in13242572022-11-08 01:44:52 -0600243
George Keishing52eb7c22022-03-11 10:58:53 -0600244Verify Identify LED State Via Redfish
245 [Documentation] Verify that Redfish identify LED system with given state.
246 [Arguments] ${expected_state}
247 # Description of argument(s):
248 # expected_state Expected value of Identify LED.
249
250 # Python module: get_member_list(resource_path)
251 ${systems}= Redfish_Utils.Get Member List /redfish/v1/Systems
252 FOR ${system} IN @{systems}
253 ${led_value}= Redfish.Get Attribute ${system} IndicatorLED
254 Should Be True '${led_value}' == '${expected_state}'
255 END
256
257
258Set IndicatorLED State
George Keishinge23afb52022-03-17 08:25:49 -0500259 [Documentation] Perform redfish PATCH operation.
George Keishing52eb7c22022-03-11 10:58:53 -0600260 [Arguments] ${led_state} ${expect_resp_code}=[200, 204]
261 # Description of argument(s):
262 # led_state IndicatorLED state to "off", "Lit" etc.
263 # expect_resp_code Expected HTTPS response code. Default [200, 204]
264
265 # Python module: get_member_list(resource_path)
266 ${systems}= Redfish_Utils.Get Member List /redfish/v1/Systems
267 FOR ${system} IN @{systems}
268 Redfish.Patch ${system} body={"IndicatorLED":${led_state}} valid_status_codes=${expect_resp_code}
269 END