blob: c22dfe3c36da6507293c243740d58771f3b88b02 [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]
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -050030
Rahul Maheshwarib940e192020-07-07 01:52:24 -050031*** Test Cases ***
32
33Verify Existence Of All Sections In Overview Page
34 [Documentation] Verify existence of all sections in Overview page.
35 [Tags] Verify_Existence_Of_All_Sections_In_Overview_Page
36
rramyasr-in1a79b662022-06-13 00:25:50 -050037 Page Should Contain BMC date and time
Ashwini Chandrappa516f70d2021-12-14 01:21:29 -060038 Page Should Contain Firmware information
Rahul Maheshwarib940e192020-07-07 01:52:24 -050039 Page Should Contain Server information
Ashwini Chandrappa516f70d2021-12-14 01:21:29 -060040 Wait Until Page Contains Network information timeout=10
rramyasr-in532c37f2021-12-03 03:39:14 -060041 Page Should Contain Power information
42 Page Should Contain Event logs
43 Page Should Contain Inventory and LEDs
rramyasr-ine6818d12022-01-13 07:23:40 -060044 Page Should Contain Dumps
Rahul Maheshwarib940e192020-07-07 01:52:24 -050045
rramyasr-in19e553c2022-10-27 02:17:41 -050046
manashsarma6d584de2020-08-30 02:33:07 -050047Verify Network Information In Overview Page
48 [Documentation] Verify values under network information section.
George Keishingf9248952021-05-28 07:52:37 -050049 [Tags] Verify_Network_Information_In_Overview_Page
manashsarma6d584de2020-08-30 02:33:07 -050050
51 ${hostname}= Get BMC Hostname
52 Page Should Contain ${hostname}
53
54 # Get all IP addresses and prefix lengths on system.
55
rramyasr-in690fcd42022-10-27 03:25:39 -050056 ${resp}= Redfish.Get Attribute /redfish/v1/Managers/bmc/EthernetInterfaces/eth0 IPv4StaticAddresses
57 ${ip_addr}= Set Variable ${resp[0]['Address']}
58 Page Should Contain ${ip_addr}
manashsarma6d584de2020-08-30 02:33:07 -050059
manashsarma6d584de2020-08-30 02:33:07 -050060
manashsarmae18f99e2020-08-28 10:12:57 -050061Verify Server Information Section
62 [Documentation] Verify values under server information section in overview page.
63 [Tags] Verify_Server_Information_Section
64
65 ${redfish_machine_model}= Redfish.Get Attribute /redfish/v1/Systems/system/ Model
66 Page Should Contain ${redfish_machine_model}
67
68 ${redfish_serial_number}= Redfish.Get Attribute /redfish/v1/Systems/system/ SerialNumber
69 Page Should Contain ${redfish_serial_number}
70
71 ${redfish_motherboard_manufacturer}= Redfish.Get Attribute
manashsarma58de7d72020-09-07 21:05:21 -050072 ... /redfish/v1/Systems/system/ Manufacturer
manashsarmae18f99e2020-08-28 10:12:57 -050073
74 Page Should Contain ${redfish_motherboard_manufacturer}
75
76
manashsarma554ddec2020-08-26 00:46:02 -050077Verify BMC Information Section
78 [Documentation] Verify BMC information section in overview page.
79 [Tags] Verify_BMC_Information_Section
80
81 ${firmware_version}= Redfish Get BMC Version
82 Page Should Contain ${firmware_version}
83
84
manashsarma43568c22020-08-19 12:16:24 -050085Verify Edit Network Setting Button
86 [Documentation] Verify navigation to network setting page after clicking the button in overview page.
87 [Tags] Verify_Edit_Network_Setting_Button
88
rramyasr-in40334392022-11-21 10:14:51 -060089 Click Element ${xpath_network_information_view_more_button}
rramyasr-in732cc3f2022-11-16 05:30:57 -060090 Wait Until Page Contains Element ${xpath_network_heading}
manashsarma43568c22020-08-19 12:16:24 -050091
92
rramyasr-inb3442ed2023-03-01 10:48:52 -060093Verify Event Under Critical Event Logs Section
94 [Documentation] Verify event under critical event logs section in case of any event.
95 [Tags] Verify_Event_Under_Critical_Event_Logs_Section
96 [Teardown] Redfish Purge Event Log
manashsarmafb353662020-08-27 05:12:04 -050097
98 Redfish Purge Event Log
99 Click Element ${xpath_refresh_button}
100 Generate Test Error Log
Ashwini Chandrappa243a1f22021-07-26 01:10:04 -0500101 Click Element ${xpath_refresh_button}
George Keishinga91601b2023-03-21 09:35:49 +0530102
rramyasr-inb3442ed2023-03-01 10:48:52 -0600103 ${log_count}= Get Text ${xpath_critical_logs_count}
104 Should Be True '${log_count}' == '${1}'
manashsarmafb353662020-08-27 05:12:04 -0500105
106
rramyasr-in40334392022-11-21 10:14:51 -0600107Verify View More Event Logs Button
108 [Documentation] Verify view more event log button in overview page.
109 [Tags] Verify_View_More_Event_Logs_Button
manashsarma7d0a4122020-08-23 13:41:03 -0500110
111 Generate Test Error Log
rramyasr-in40334392022-11-21 10:14:51 -0600112 Page Should Contain Element ${xpath_event_logs_view_more_button} timeout=30
113 Click Element ${xpath_event_logs_view_more_button}
rramyasr-in5f280c02022-11-11 06:41:00 -0600114 Wait Until Page Contains Element ${xpath_event_logs_heading} timeout=30
manashsarma7d0a4122020-08-23 13:41:03 -0500115
116
rramyasr-inb18e15e2022-08-11 05:22:20 -0500117Verify Host Console Button In Overview Page
118 [Documentation] Click host console button and verify page navigation to host console page.
119 [Tags] Verify_Host_Console_Button_In_Overview_Page
manashsarmaa3a25362020-08-23 09:23:28 -0500120
rramyasr-inb18e15e2022-08-11 05:22:20 -0500121 Click Element ${xpath_launch_host_console}
122 Wait Until Page Contains Element ${xpath_host_console_heading}
manashsarmaa3a25362020-08-23 09:23:28 -0500123
124
manashsarmaffb30932020-08-24 07:31:54 -0500125Verify Server LED Turn On
126 [Documentation] Turn on server LED via GUI and verify its status via Redfish.
127 [Tags] Verify_Server_LED_Turn_On
128
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500129 # Turn Off the server LED via Redfish and refresh GUI.
George Keishing52eb7c22022-03-11 10:58:53 -0600130 Set IndicatorLED State Off
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500131 Refresh GUI
manashsarmaffb30932020-08-24 07:31:54 -0500132
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500133 # Turn ON the LED via GUI.
rramyasr-in436de602023-03-03 03:13:10 -0600134 Click Element ${xpath_led_button}
manashsarmaffb30932020-08-24 07:31:54 -0500135
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500136 # Cross check that server LED ON state via Redfish.
George Keishing52eb7c22022-03-11 10:58:53 -0600137 Verify Identify LED State Via Redfish Lit
manashsarmaffb30932020-08-24 07:31:54 -0500138
139
140Verify Server LED Turn Off
141 [Documentation] Turn off server LED via GUI and verify its status via Redfish.
142 [Tags] Verify_Server_LED_Turn_Off
143
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500144 # Turn On the server LED via Redfish and refresh GUI.
George Keishing52eb7c22022-03-11 10:58:53 -0600145 Set IndicatorLED State Lit
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500146 Refresh GUI
manashsarmaffb30932020-08-24 07:31:54 -0500147
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500148 # Turn OFF the LED via GUI.
manashsarmaffb30932020-08-24 07:31:54 -0500149 Click Element At Coordinates ${xpath_led_button} 0 0
150
151 # Cross check that server LED off state via Redfish.
George Keishing52eb7c22022-03-11 10:58:53 -0600152 Verify Identify LED State Via Redfish Off
manashsarmaffb30932020-08-24 07:31:54 -0500153
154
manashsarma65c9e142020-08-23 07:27:52 -0500155Verify BMC Time In Overview Page
156 [Documentation] Verify that BMC date from GUI matches with BMC time via Redfish.
157 [Tags] Verify_BMC_Time_In_Overview_Page
158
159 ${date_time}= Redfish.Get Attribute ${REDFISH_BASE_URI}Managers/bmc DateTime
160 ${converted_date}= Convert Date ${date_time} result_format=%Y-%m-%d
161
162 Page Should Contain ${converted_date}
163
164
manashsarma43458ff2021-08-17 05:42:47 -0500165Verify BMC Information At Host Power Off State
166 [Documentation] Verify that BMC information is displayed at host power off state.
167 [Tags] Verify_BMC_Information_At_Host_Power_Off_State
168
169 Redfish Power Off stack_mode=skip
170 ${firmware_version}= Redfish Get BMC Version
171 Page Should Contain ${firmware_version}
172
173
rramyasr-in305d23a2022-01-19 01:32:04 -0600174Verify View More Button For Dumps
175 [Documentation] Verify view more button for dumps button in overview page.
176 [Tags] Verify_View_More_Button_For_Dumps
177
rramyasr-inb3442ed2023-03-01 10:48:52 -0600178 Wait Until Page Contains Element ${xpath_dumps_view_more_button} timeout=30
179 Click Element ${xpath_dumps_view_more_button}
rramyasr-in5f280c02022-11-11 06:41:00 -0600180 Wait Until Page Contains Element ${xpath_dumps_header} timeout=30
181
182
183Verify View More Button Under Server Information Section
184 [Documentation] Verify view more button under server information section in overview page.
185 [Tags] Verify_View_More_Button_Under_Server_Information_Section
186
rramyasr-in40334392022-11-21 10:14:51 -0600187 Wait Until Page Contains Element ${xpath_server_information_view_more_button} timeout=30
188 Click Element ${xpath_server_information_view_more_button}
rramyasr-in5f280c02022-11-11 06:41:00 -0600189 Wait Until Page Contains Element ${xpath_inventory_and_leds_heading} timeout=30
190
191
192Verify View More Button Under Firmware Information Section
193 [Documentation] Verify view more button under firmware information section in overview page.
194 [Tags] Verify_View_More_Button_Under_Firmware_Information_Section
195
196 Wait Until Page Contains Element ${xpath_firmware_information_view_more_button} timeout=30
197 Click Element ${xpath_firmware_information_view_more_button}
198 Wait Until Page Contains Element ${xpath_firmware_heading} timeout=30
199
200
201Verify View More Button Under Network Information Section
202 [Documentation] Verify view more button under network information section in overview page.
George Keishing44cce892022-11-23 08:05:57 -0600203 [Tags] Verify_View_More_Button_Under_Network_Information_Section
rramyasr-in5f280c02022-11-11 06:41:00 -0600204
rramyasr-in40334392022-11-21 10:14:51 -0600205 Wait Until Page Contains Element ${xpath_network_information_view_more_button} timeout=30
206 Click Element ${xpath_network_information_view_more_button}
rramyasr-in5f280c02022-11-11 06:41:00 -0600207 Wait Until Page Contains Element ${xpath_network_heading} timeout=30
208
209
210Verify View More Button Under Power Information Section
211 [Documentation] Verify view more button under power information section in overview page.
George Keishing44cce892022-11-23 08:05:57 -0600212 [Tags] Verify_View_More_Button_Under_Power_Information_Section
rramyasr-in5f280c02022-11-11 06:41:00 -0600213
214 Wait Until Page Contains Element ${xpath_power_information_view_more_button} timeout=30
215 Click Element ${xpath_power_information_view_more_button}
216 Wait Until Page Contains Element ${xpath_power_heading} timeout=30
217
218
219Verify View More Button Under Event Logs Section
220 [Documentation] Verify view more button under event logs section in overview page.
221 [Tags] Verify_View_More_Button_Under_Event_Logs_Section
222
223 Wait Until Page Contains Element ${xpath_event_logs_view_more_button} timeout=30
224 Click Element ${xpath_event_logs_view_more_button}
225 Wait Until Page Contains Element ${xpath_event_logs_heading} timeout=30
226
227
228Verify View More Button Under Inventory And LEDs Section
229 [Documentation] Verify view more button under inventory and leds section in overview page.
230 [Tags] Verify_View_More_Button_Under_Inventory_And_LEDs_Section
231
232 Wait Until Page Contains Element ${xpath_inventory_and_leds_view_more_button} timeout=30
233 Click Element ${xpath_inventory_and_leds_view_more_button}
234 Wait Until Page Contains Element ${xpath_inventory_and_leds_heading} timeout=30
235
rramyasr-in305d23a2022-01-19 01:32:04 -0600236
Rahul Maheshwarib940e192020-07-07 01:52:24 -0500237*** Keywords ***
238
239Test Setup Execution
240 [Documentation] Do test case setup tasks.
241
242 Click Element ${xpath_overview_menu}
243 Wait Until Page Contains Element ${xpath_overview_page_header}
rramyasr-in7776e322022-10-10 11:01:13 -0500244 Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30
George Keishing52eb7c22022-03-11 10:58:53 -0600245
rramyasr-in13242572022-11-08 01:44:52 -0600246
George Keishing52eb7c22022-03-11 10:58:53 -0600247Verify Identify LED State Via Redfish
248 [Documentation] Verify that Redfish identify LED system with given state.
249 [Arguments] ${expected_state}
250 # Description of argument(s):
251 # expected_state Expected value of Identify LED.
252
rramyasr-in436de602023-03-03 03:13:10 -0600253 ${led_state}= Redfish.Get Attribute /redfish/v1/Systems/system IndicatorLED
254 Should Be True '${led_state}' == '${expected_state}'
George Keishing52eb7c22022-03-11 10:58:53 -0600255
256
257Set IndicatorLED State
George Keishinge23afb52022-03-17 08:25:49 -0500258 [Documentation] Perform redfish PATCH operation.
George Keishing52eb7c22022-03-11 10:58:53 -0600259 [Arguments] ${led_state} ${expect_resp_code}=[200, 204]
260 # Description of argument(s):
261 # led_state IndicatorLED state to "off", "Lit" etc.
262 # expect_resp_code Expected HTTPS response code. Default [200, 204]
263
rramyasr-in436de602023-03-03 03:13:10 -0600264
265 Redfish.Patch /redfish/v1/Systems/system body={"IndicatorLED": "${led_state}"}
266 ... valid_status_codes=${expect_resp_code}
267