blob: 9d26a862cdb8621b95d63813eb41198840fc921b [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]
rramyasr-in40334392022-11-21 10:14:51 -060022${xpath_network_information_view_more_button} (//*[text()="View more"])[3]
rramyasr-in5f280c02022-11-11 06:41:00 -060023${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']
rramyasr-inb3442ed2023-03-01 10:48:52 -060028${xpath_dumps_view_more_button} (//*[text()="View more"])[7]
29${xpath_critical_logs_count} //dt[contains(text(),'Critical')]/following-sibling::dd[1]
rramyasr-ind99803f2023-03-21 07:08:01 -050030${xpath_warning_logs_count} //dt[contains(text(),'Warning')]/following-sibling::dd[1]
rramyasr-in07d10042023-04-24 07:05:02 -050031${xpath_asset_tag} //dt[contains(text(),'Asset tag')]/following-sibling::dd[1]
32${xpath_operating_mode} //dt[contains(text(),'Operating mode')]/following-sibling::dd[1]
33${xpath_machine_model} //dt[contains(text(),'Model')]/following-sibling::dd[1]
34${xpath_serial_number} //dt[contains(text(),'Serial number')]/following-sibling::dd[1]
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -050035
Rahul Maheshwarib940e192020-07-07 01:52:24 -050036*** Test Cases ***
37
38Verify Existence Of All Sections In Overview Page
39 [Documentation] Verify existence of all sections in Overview page.
40 [Tags] Verify_Existence_Of_All_Sections_In_Overview_Page
41
rramyasr-in1a79b662022-06-13 00:25:50 -050042 Page Should Contain BMC date and time
Ashwini Chandrappa516f70d2021-12-14 01:21:29 -060043 Page Should Contain Firmware information
Rahul Maheshwarib940e192020-07-07 01:52:24 -050044 Page Should Contain Server information
Ashwini Chandrappa516f70d2021-12-14 01:21:29 -060045 Wait Until Page Contains Network information timeout=10
rramyasr-in532c37f2021-12-03 03:39:14 -060046 Page Should Contain Power information
47 Page Should Contain Event logs
48 Page Should Contain Inventory and LEDs
rramyasr-ine6818d12022-01-13 07:23:40 -060049 Page Should Contain Dumps
Rahul Maheshwarib940e192020-07-07 01:52:24 -050050
rramyasr-in19e553c2022-10-27 02:17:41 -050051
manashsarma6d584de2020-08-30 02:33:07 -050052Verify Network Information In Overview Page
53 [Documentation] Verify values under network information section.
George Keishingf9248952021-05-28 07:52:37 -050054 [Tags] Verify_Network_Information_In_Overview_Page
manashsarma6d584de2020-08-30 02:33:07 -050055
56 ${hostname}= Get BMC Hostname
57 Page Should Contain ${hostname}
58
59 # Get all IP addresses and prefix lengths on system.
60
ganesanb4d430282023-04-27 14:33:23 +000061 ${resp}= Redfish.Get Attribute /redfish/v1/Managers/${MANAGER_ID}/EthernetInterfaces/eth0 IPv4StaticAddresses
rramyasr-in690fcd42022-10-27 03:25:39 -050062 ${ip_addr}= Set Variable ${resp[0]['Address']}
63 Page Should Contain ${ip_addr}
manashsarma6d584de2020-08-30 02:33:07 -050064
manashsarma6d584de2020-08-30 02:33:07 -050065
manashsarmae18f99e2020-08-28 10:12:57 -050066Verify Server Information Section
67 [Documentation] Verify values under server information section in overview page.
68 [Tags] Verify_Server_Information_Section
69
rramyasr-in07d10042023-04-24 07:05:02 -050070 # Model.
71 ${redfish_machine_model}= Redfish.Get Attribute ${SYSTEM_BASE_URI} Model
72 Element Should Contain ${xpath_machine_model} ${redfish_machine_model}
manashsarmae18f99e2020-08-28 10:12:57 -050073
rramyasr-in07d10042023-04-24 07:05:02 -050074 # Serial Number.
75 ${redfish_serial_number}= Redfish.Get Attribute ${SYSTEM_BASE_URI} SerialNumber
76 Element Should Contain ${xpath_serial_number} ${redfish_serial_number}
manashsarmae18f99e2020-08-28 10:12:57 -050077
rramyasr-in07d10042023-04-24 07:05:02 -050078 # Asset Tag.
79 ${redfish_asset_tag}= Redfish.Get Attribute ${SYSTEM_BASE_URI} AssetTag
80 Element Should Contain ${xpath_asset_tag} ${redfish_asset_tag}
manashsarmae18f99e2020-08-28 10:12:57 -050081
rramyasr-in07d10042023-04-24 07:05:02 -050082 # Operating mode.
83 ${redfish_operating_mode}= Redfish.Get Attribute ${BIOS_ATTR_URI} Attributes
84 Element Should Contain ${xpath_operating_mode} ${redfish_operating_mode['pvm_system_operating_mode']}
manashsarmae18f99e2020-08-28 10:12:57 -050085
86
manashsarma554ddec2020-08-26 00:46:02 -050087Verify BMC Information Section
88 [Documentation] Verify BMC information section in overview page.
89 [Tags] Verify_BMC_Information_Section
90
91 ${firmware_version}= Redfish Get BMC Version
92 Page Should Contain ${firmware_version}
93
94
manashsarma43568c22020-08-19 12:16:24 -050095Verify Edit Network Setting Button
96 [Documentation] Verify navigation to network setting page after clicking the button in overview page.
97 [Tags] Verify_Edit_Network_Setting_Button
98
rramyasr-in40334392022-11-21 10:14:51 -060099 Click Element ${xpath_network_information_view_more_button}
rramyasr-in732cc3f2022-11-16 05:30:57 -0600100 Wait Until Page Contains Element ${xpath_network_heading}
manashsarma43568c22020-08-19 12:16:24 -0500101
102
rramyasr-inb3442ed2023-03-01 10:48:52 -0600103Verify Event Under Critical Event Logs Section
104 [Documentation] Verify event under critical event logs section in case of any event.
105 [Tags] Verify_Event_Under_Critical_Event_Logs_Section
106 [Teardown] Redfish Purge Event Log
manashsarmafb353662020-08-27 05:12:04 -0500107
108 Redfish Purge Event Log
109 Click Element ${xpath_refresh_button}
110 Generate Test Error Log
Ashwini Chandrappa243a1f22021-07-26 01:10:04 -0500111 Click Element ${xpath_refresh_button}
rramyasr-inbee71fa2023-08-04 02:01:31 -0500112 Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30
rramyasr-inb3442ed2023-03-01 10:48:52 -0600113 ${log_count}= Get Text ${xpath_critical_logs_count}
114 Should Be True '${log_count}' == '${1}'
manashsarmafb353662020-08-27 05:12:04 -0500115
116
rramyasr-ind99803f2023-03-21 07:08:01 -0500117Verify Event Under Warning Event Logs Section
118 [Documentation] Verify event under warning event logs section in case of any event.
119 [Tags] Verify_Event_Under_Warning_Event_Logs_Section
120 [Teardown] Redfish Purge Event Log
121
122 Redfish Purge Event Log
123 Click Element ${xpath_refresh_button}
124
125 # Generate a predictable error for testing purpose.
126 BMC Execute Command ${CMD_PREDICTIVE_ERROR}
127
128 Click Element ${xpath_refresh_button}
rramyasr-inaf2226e2023-09-05 01:43:36 -0500129 Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30
rramyasr-ind99803f2023-03-21 07:08:01 -0500130
131 ${log_count}= Get Text ${xpath_warning_logs_count}
132 Should Be Equal As Integers ${log_count} 1
133
134
rramyasr-in40334392022-11-21 10:14:51 -0600135Verify View More Event Logs Button
136 [Documentation] Verify view more event log button in overview page.
137 [Tags] Verify_View_More_Event_Logs_Button
manashsarma7d0a4122020-08-23 13:41:03 -0500138
139 Generate Test Error Log
rramyasr-in40334392022-11-21 10:14:51 -0600140 Page Should Contain Element ${xpath_event_logs_view_more_button} timeout=30
141 Click Element ${xpath_event_logs_view_more_button}
rramyasr-in5f280c02022-11-11 06:41:00 -0600142 Wait Until Page Contains Element ${xpath_event_logs_heading} timeout=30
manashsarma7d0a4122020-08-23 13:41:03 -0500143
144
rramyasr-inb18e15e2022-08-11 05:22:20 -0500145Verify Host Console Button In Overview Page
146 [Documentation] Click host console button and verify page navigation to host console page.
147 [Tags] Verify_Host_Console_Button_In_Overview_Page
manashsarmaa3a25362020-08-23 09:23:28 -0500148
rramyasr-inb18e15e2022-08-11 05:22:20 -0500149 Click Element ${xpath_launch_host_console}
150 Wait Until Page Contains Element ${xpath_host_console_heading}
manashsarmaa3a25362020-08-23 09:23:28 -0500151
152
manashsarmaffb30932020-08-24 07:31:54 -0500153Verify Server LED Turn On
154 [Documentation] Turn on server LED via GUI and verify its status via Redfish.
155 [Tags] Verify_Server_LED_Turn_On
156
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500157 # Turn Off the server LED via Redfish and refresh GUI.
George Keishing52eb7c22022-03-11 10:58:53 -0600158 Set IndicatorLED State Off
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500159 Refresh GUI
manashsarmaffb30932020-08-24 07:31:54 -0500160
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500161 # Turn ON the LED via GUI.
rramyasr-in436de602023-03-03 03:13:10 -0600162 Click Element ${xpath_led_button}
manashsarmaffb30932020-08-24 07:31:54 -0500163
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500164 # Cross check that server LED ON state via Redfish.
George Keishing52eb7c22022-03-11 10:58:53 -0600165 Verify Identify LED State Via Redfish Lit
manashsarmaffb30932020-08-24 07:31:54 -0500166
167
168Verify Server LED Turn Off
169 [Documentation] Turn off server LED via GUI and verify its status via Redfish.
170 [Tags] Verify_Server_LED_Turn_Off
171
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500172 # Turn On the server LED via Redfish and refresh GUI.
George Keishing52eb7c22022-03-11 10:58:53 -0600173 Set IndicatorLED State Lit
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500174 Refresh GUI
manashsarmaffb30932020-08-24 07:31:54 -0500175
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500176 # Turn OFF the LED via GUI.
manashsarmaffb30932020-08-24 07:31:54 -0500177 Click Element At Coordinates ${xpath_led_button} 0 0
178
179 # Cross check that server LED off state via Redfish.
George Keishing52eb7c22022-03-11 10:58:53 -0600180 Verify Identify LED State Via Redfish Off
manashsarmaffb30932020-08-24 07:31:54 -0500181
182
manashsarma65c9e142020-08-23 07:27:52 -0500183Verify BMC Time In Overview Page
184 [Documentation] Verify that BMC date from GUI matches with BMC time via Redfish.
185 [Tags] Verify_BMC_Time_In_Overview_Page
186
ganesanb4d430282023-04-27 14:33:23 +0000187 ${date_time}= Redfish.Get Attribute ${REDFISH_BASE_URI}Managers/${MANAGER_ID} DateTime
manashsarma65c9e142020-08-23 07:27:52 -0500188 ${converted_date}= Convert Date ${date_time} result_format=%Y-%m-%d
189
190 Page Should Contain ${converted_date}
191
192
manashsarma43458ff2021-08-17 05:42:47 -0500193Verify BMC Information At Host Power Off State
194 [Documentation] Verify that BMC information is displayed at host power off state.
195 [Tags] Verify_BMC_Information_At_Host_Power_Off_State
196
197 Redfish Power Off stack_mode=skip
198 ${firmware_version}= Redfish Get BMC Version
199 Page Should Contain ${firmware_version}
200
201
rramyasr-in305d23a2022-01-19 01:32:04 -0600202Verify View More Button For Dumps
203 [Documentation] Verify view more button for dumps button in overview page.
204 [Tags] Verify_View_More_Button_For_Dumps
205
rramyasr-inb3442ed2023-03-01 10:48:52 -0600206 Wait Until Page Contains Element ${xpath_dumps_view_more_button} timeout=30
207 Click Element ${xpath_dumps_view_more_button}
rramyasr-in5f280c02022-11-11 06:41:00 -0600208 Wait Until Page Contains Element ${xpath_dumps_header} timeout=30
209
210
211Verify View More Button Under Server Information Section
212 [Documentation] Verify view more button under server information section in overview page.
213 [Tags] Verify_View_More_Button_Under_Server_Information_Section
214
rramyasr-in40334392022-11-21 10:14:51 -0600215 Wait Until Page Contains Element ${xpath_server_information_view_more_button} timeout=30
216 Click Element ${xpath_server_information_view_more_button}
rramyasr-in5f280c02022-11-11 06:41:00 -0600217 Wait Until Page Contains Element ${xpath_inventory_and_leds_heading} timeout=30
218
219
220Verify View More Button Under Firmware Information Section
221 [Documentation] Verify view more button under firmware information section in overview page.
222 [Tags] Verify_View_More_Button_Under_Firmware_Information_Section
223
224 Wait Until Page Contains Element ${xpath_firmware_information_view_more_button} timeout=30
225 Click Element ${xpath_firmware_information_view_more_button}
226 Wait Until Page Contains Element ${xpath_firmware_heading} timeout=30
227
228
229Verify View More Button Under Network Information Section
230 [Documentation] Verify view more button under network information section in overview page.
George Keishing44cce892022-11-23 08:05:57 -0600231 [Tags] Verify_View_More_Button_Under_Network_Information_Section
rramyasr-in5f280c02022-11-11 06:41:00 -0600232
rramyasr-in40334392022-11-21 10:14:51 -0600233 Wait Until Page Contains Element ${xpath_network_information_view_more_button} timeout=30
234 Click Element ${xpath_network_information_view_more_button}
rramyasr-in5f280c02022-11-11 06:41:00 -0600235 Wait Until Page Contains Element ${xpath_network_heading} timeout=30
236
237
238Verify View More Button Under Power Information Section
239 [Documentation] Verify view more button under power information section in overview page.
George Keishing44cce892022-11-23 08:05:57 -0600240 [Tags] Verify_View_More_Button_Under_Power_Information_Section
rramyasr-in5f280c02022-11-11 06:41:00 -0600241
242 Wait Until Page Contains Element ${xpath_power_information_view_more_button} timeout=30
243 Click Element ${xpath_power_information_view_more_button}
244 Wait Until Page Contains Element ${xpath_power_heading} timeout=30
245
246
247Verify View More Button Under Event Logs Section
248 [Documentation] Verify view more button under event logs section in overview page.
249 [Tags] Verify_View_More_Button_Under_Event_Logs_Section
250
251 Wait Until Page Contains Element ${xpath_event_logs_view_more_button} timeout=30
252 Click Element ${xpath_event_logs_view_more_button}
253 Wait Until Page Contains Element ${xpath_event_logs_heading} timeout=30
254
255
256Verify View More Button Under Inventory And LEDs Section
257 [Documentation] Verify view more button under inventory and leds section in overview page.
258 [Tags] Verify_View_More_Button_Under_Inventory_And_LEDs_Section
259
260 Wait Until Page Contains Element ${xpath_inventory_and_leds_view_more_button} timeout=30
261 Click Element ${xpath_inventory_and_leds_view_more_button}
262 Wait Until Page Contains Element ${xpath_inventory_and_leds_heading} timeout=30
263
rramyasr-in305d23a2022-01-19 01:32:04 -0600264
rramyasr-in63378272023-04-06 23:58:46 -0500265Verify Text Under Server Information Section
266 [Documentation] Verify text under server information section in overview page.
267 [Tags] Verify_Text_Under_Server_Information_Section
268
269 Page Should Contain Model
270 Page Should Contain Operating mode
271 Page Should Contain Serial number
272 Page Should Contain Service login
273 Page Should Contain Asset tag
274
275
276Verify Text Under Firmware Information Section
277 [Documentation] Verify text under firmware information section in overview page.
278 [Tags] Verify_Text_Under_Firmware_Information_Section
279
280 Page Should Contain Running
281 Page Should Contain Backup
282 Page Should Contain Access key expiration
283
284
285Verify Text Under Network Information Section
286 [Documentation] Verify text under network information section in overview page.
287 [Tags] Verify_Text_Under_Network_Information_Section
288
289 Page Should Contain Hostname
290 Page Should Contain IPv4
291 Page Should Contain DHCPv4
292
293
294Verify Text Under Power Information Section
295 [Documentation] Verify text under power information section in overview page.
296 [Tags] Verify_Text_Under_Power_Information_Section
297
298 Page Should Contain Power consumption
299 Page Should Contain Idle power saver
300 Page Should Contain Power cap
301 Page Should Contain Power mode
302
303
304Verify Text Under Event Logs Section
305 [Documentation] Verify text under event logs section in overview page.
306 [Tags] Verify_Text_Under_Event_Logs_Section
307
308 Page Should Contain Critical
309 Page Should Contain Warning
310
311
312Verify Text Under Inventory And LEDs Section
313 [Documentation] Verify text under inventory and leds section in overview page.
George Keishing7af7d862023-04-24 18:48:13 +0530314 [Tags] Verify_Text_Under_Inventory_And_LEDs_Section
rramyasr-in63378272023-04-06 23:58:46 -0500315
316 Page Should Contain System identify LED
317
318
319Verify Text Under Dumps Section
320 [Documentation] Verify text under Dumps section in overview page.
321 [Tags] Verify_Text_Under_Dumps_Section
322
323 Page Should Contain Total
324
325
Rahul Maheshwarib940e192020-07-07 01:52:24 -0500326*** Keywords ***
327
328Test Setup Execution
329 [Documentation] Do test case setup tasks.
330
331 Click Element ${xpath_overview_menu}
332 Wait Until Page Contains Element ${xpath_overview_page_header}
rramyasr-in7776e322022-10-10 11:01:13 -0500333 Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30
George Keishing52eb7c22022-03-11 10:58:53 -0600334
rramyasr-in13242572022-11-08 01:44:52 -0600335
George Keishing52eb7c22022-03-11 10:58:53 -0600336Verify Identify LED State Via Redfish
337 [Documentation] Verify that Redfish identify LED system with given state.
338 [Arguments] ${expected_state}
339 # Description of argument(s):
340 # expected_state Expected value of Identify LED.
341
rramyasr-in436de602023-03-03 03:13:10 -0600342 ${led_state}= Redfish.Get Attribute /redfish/v1/Systems/system IndicatorLED
343 Should Be True '${led_state}' == '${expected_state}'
George Keishing52eb7c22022-03-11 10:58:53 -0600344
345
346Set IndicatorLED State
George Keishinge23afb52022-03-17 08:25:49 -0500347 [Documentation] Perform redfish PATCH operation.
George Keishing52eb7c22022-03-11 10:58:53 -0600348 [Arguments] ${led_state} ${expect_resp_code}=[200, 204]
349 # Description of argument(s):
350 # led_state IndicatorLED state to "off", "Lit" etc.
351 # expect_resp_code Expected HTTPS response code. Default [200, 204]
352
rramyasr-in436de602023-03-03 03:13:10 -0600353
354 Redfish.Patch /redfish/v1/Systems/system body={"IndicatorLED": "${led_state}"}
355 ... valid_status_codes=${expect_resp_code}
356