blob: da2fc49764e8831e19e9087e34ba9a063240e2f2 [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
12Suite Setup Launch Browser And Login GUI
13Suite Teardown Close Browser
14Test Setup Test Setup Execution
15
16
17*** Variables ***
18
manashsarma43568c22020-08-19 12:16:24 -050019${xpath_overview_page_header} //h1[contains(text(), "Overview")]
rramyasr-in22ed4ae2021-12-03 04:50:41 -060020${xpath_edit_network_settings_button} (//*[text()="View more"])[3]
21${view_all_event_logs} (//*[text()="View more"])[5]
rramyasr-inb18e15e2022-08-11 05:22:20 -050022${xpath_launch_host_console} //*[@data-test-id='overviewQuickLinks-button-solConsole']
rramyasr-in00b55452021-12-01 23:47:03 -060023${xpath_led_button} //*[@data-test-id='overviewInventory-checkbox-identifyLed']
rramyasr-in305d23a2022-01-19 01:32:04 -060024${view_all_Dumps} (//*[text()="View more"])[7]
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -050025
Rahul Maheshwarib940e192020-07-07 01:52:24 -050026*** Test Cases ***
27
28Verify Existence Of All Sections In Overview Page
29 [Documentation] Verify existence of all sections in Overview page.
30 [Tags] Verify_Existence_Of_All_Sections_In_Overview_Page
31
rramyasr-in1a79b662022-06-13 00:25:50 -050032 Page Should Contain BMC date and time
Ashwini Chandrappa516f70d2021-12-14 01:21:29 -060033 Page Should Contain Firmware information
Rahul Maheshwarib940e192020-07-07 01:52:24 -050034 Page Should Contain Server information
Ashwini Chandrappa516f70d2021-12-14 01:21:29 -060035 Wait Until Page Contains Network information timeout=10
rramyasr-in532c37f2021-12-03 03:39:14 -060036 Page Should Contain Power information
37 Page Should Contain Event logs
38 Page Should Contain Inventory and LEDs
rramyasr-ine6818d12022-01-13 07:23:40 -060039 Page Should Contain Dumps
Rahul Maheshwarib940e192020-07-07 01:52:24 -050040
rramyasr-in19e553c2022-10-27 02:17:41 -050041
manashsarma6d584de2020-08-30 02:33:07 -050042Verify Network Information In Overview Page
43 [Documentation] Verify values under network information section.
George Keishingf9248952021-05-28 07:52:37 -050044 [Tags] Verify_Network_Information_In_Overview_Page
manashsarma6d584de2020-08-30 02:33:07 -050045
46 ${hostname}= Get BMC Hostname
47 Page Should Contain ${hostname}
48
49 # Get all IP addresses and prefix lengths on system.
50
51 ${ip_addr_list}= Get BMC IP Info
52 FOR ${ip_address} IN @{ip_addr_list}
53 ${ip}= Fetch From Left ${ip_address} \/
54 Page Should Contain ${ip}
55 END
56
manashsarma6d584de2020-08-30 02:33:07 -050057
manashsarmae18f99e2020-08-28 10:12:57 -050058Verify Server Information Section
59 [Documentation] Verify values under server information section in overview page.
60 [Tags] Verify_Server_Information_Section
61
62 ${redfish_machine_model}= Redfish.Get Attribute /redfish/v1/Systems/system/ Model
63 Page Should Contain ${redfish_machine_model}
64
65 ${redfish_serial_number}= Redfish.Get Attribute /redfish/v1/Systems/system/ SerialNumber
66 Page Should Contain ${redfish_serial_number}
67
68 ${redfish_motherboard_manufacturer}= Redfish.Get Attribute
manashsarma58de7d72020-09-07 21:05:21 -050069 ... /redfish/v1/Systems/system/ Manufacturer
manashsarmae18f99e2020-08-28 10:12:57 -050070
71 Page Should Contain ${redfish_motherboard_manufacturer}
72
73
manashsarma554ddec2020-08-26 00:46:02 -050074Verify BMC Information Section
75 [Documentation] Verify BMC information section in overview page.
76 [Tags] Verify_BMC_Information_Section
77
78 ${firmware_version}= Redfish Get BMC Version
79 Page Should Contain ${firmware_version}
80
81
manashsarma43568c22020-08-19 12:16:24 -050082Verify Edit Network Setting Button
83 [Documentation] Verify navigation to network setting page after clicking the button in overview page.
84 [Tags] Verify_Edit_Network_Setting_Button
85
86 Click Element ${xpath_edit_network_settings_button}
87 Wait Until Page Contains Element ${xpath_network_page_header}
88
89
manashsarmafb353662020-08-27 05:12:04 -050090Verify Event Under High Priority Events Section
91 [Documentation] Verify event under high priority events section in case of any event.
92 [Tags] Verify_Event_Under_High_Priority_Events_Section
93
94 Redfish Purge Event Log
95 Click Element ${xpath_refresh_button}
96 Generate Test Error Log
Ashwini Chandrappa243a1f22021-07-26 01:10:04 -050097 Click Element ${xpath_refresh_button}
manashsarmafb353662020-08-27 05:12:04 -050098 Wait Until Page Contains xyz.openbmc_project.Common.Error.InternalFailure timeout=30s
99
100
manashsarma7d0a4122020-08-23 13:41:03 -0500101Verify View All Event Logs Button
102 [Documentation] Verify view all event log button in overview page.
103 [Tags] Verify_View_All_Event_Logs_Button
104
105 Generate Test Error Log
106 Page Should Contain Element ${view_all_event_logs} timeout=30
107 Click Element ${view_all_event_logs}
108 Wait Until Page Contains Element ${xpath_event_header} timeout=30
109
110
rramyasr-inb18e15e2022-08-11 05:22:20 -0500111Verify Host Console Button In Overview Page
112 [Documentation] Click host console button and verify page navigation to host console page.
113 [Tags] Verify_Host_Console_Button_In_Overview_Page
manashsarmaa3a25362020-08-23 09:23:28 -0500114
rramyasr-inb18e15e2022-08-11 05:22:20 -0500115 Click Element ${xpath_launch_host_console}
116 Wait Until Page Contains Element ${xpath_host_console_heading}
manashsarmaa3a25362020-08-23 09:23:28 -0500117
118
manashsarmaffb30932020-08-24 07:31:54 -0500119Verify Server LED Turn On
120 [Documentation] Turn on server LED via GUI and verify its status via Redfish.
121 [Tags] Verify_Server_LED_Turn_On
122
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500123 # Turn Off the server LED via Redfish and refresh GUI.
George Keishing52eb7c22022-03-11 10:58:53 -0600124 Set IndicatorLED State Off
125
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500126 Refresh GUI
manashsarmaffb30932020-08-24 07:31:54 -0500127
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500128 # Turn ON the LED via GUI.
manashsarmaffb30932020-08-24 07:31:54 -0500129 Click Element At Coordinates ${xpath_led_button} 0 0
130
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500131 # Cross check that server LED ON state via Redfish.
George Keishing52eb7c22022-03-11 10:58:53 -0600132 Verify Identify LED State Via Redfish Lit
manashsarmaffb30932020-08-24 07:31:54 -0500133
134
135Verify Server LED Turn Off
136 [Documentation] Turn off server LED via GUI and verify its status via Redfish.
137 [Tags] Verify_Server_LED_Turn_Off
138
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500139 # Turn On the server LED via Redfish and refresh GUI.
George Keishing52eb7c22022-03-11 10:58:53 -0600140 Set IndicatorLED State Lit
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500141 Refresh GUI
manashsarmaffb30932020-08-24 07:31:54 -0500142
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500143 # Turn OFF the LED via GUI.
manashsarmaffb30932020-08-24 07:31:54 -0500144 Click Element At Coordinates ${xpath_led_button} 0 0
145
146 # Cross check that server LED off state via Redfish.
George Keishing52eb7c22022-03-11 10:58:53 -0600147 Verify Identify LED State Via Redfish Off
manashsarmaffb30932020-08-24 07:31:54 -0500148
149
manashsarma65c9e142020-08-23 07:27:52 -0500150Verify BMC Time In Overview Page
151 [Documentation] Verify that BMC date from GUI matches with BMC time via Redfish.
152 [Tags] Verify_BMC_Time_In_Overview_Page
153
154 ${date_time}= Redfish.Get Attribute ${REDFISH_BASE_URI}Managers/bmc DateTime
155 ${converted_date}= Convert Date ${date_time} result_format=%Y-%m-%d
156
157 Page Should Contain ${converted_date}
158
159
manashsarma43458ff2021-08-17 05:42:47 -0500160Verify BMC Information At Host Power Off State
161 [Documentation] Verify that BMC information is displayed at host power off state.
162 [Tags] Verify_BMC_Information_At_Host_Power_Off_State
163
164 Redfish Power Off stack_mode=skip
165 ${firmware_version}= Redfish Get BMC Version
166 Page Should Contain ${firmware_version}
167
168
rramyasr-in305d23a2022-01-19 01:32:04 -0600169Verify View More Button For Dumps
170 [Documentation] Verify view more button for dumps button in overview page.
171 [Tags] Verify_View_More_Button_For_Dumps
172
173 Wait Until Page Contains Element ${view_all_Dumps} timeout=30
174 Click Element ${view_all_Dumps}
175 Wait Until Page Contains Element ${xpath_dumps_header} timeout=30
176
Rahul Maheshwarib940e192020-07-07 01:52:24 -0500177*** Keywords ***
178
179Test Setup Execution
180 [Documentation] Do test case setup tasks.
181
182 Click Element ${xpath_overview_menu}
183 Wait Until Page Contains Element ${xpath_overview_page_header}
rramyasr-in7776e322022-10-10 11:01:13 -0500184 Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30
George Keishing52eb7c22022-03-11 10:58:53 -0600185
186Verify Identify LED State Via Redfish
187 [Documentation] Verify that Redfish identify LED system with given state.
188 [Arguments] ${expected_state}
189 # Description of argument(s):
190 # expected_state Expected value of Identify LED.
191
192 # Python module: get_member_list(resource_path)
193 ${systems}= Redfish_Utils.Get Member List /redfish/v1/Systems
194 FOR ${system} IN @{systems}
195 ${led_value}= Redfish.Get Attribute ${system} IndicatorLED
196 Should Be True '${led_value}' == '${expected_state}'
197 END
198
199
200Set IndicatorLED State
George Keishinge23afb52022-03-17 08:25:49 -0500201 [Documentation] Perform redfish PATCH operation.
George Keishing52eb7c22022-03-11 10:58:53 -0600202 [Arguments] ${led_state} ${expect_resp_code}=[200, 204]
203 # Description of argument(s):
204 # led_state IndicatorLED state to "off", "Lit" etc.
205 # expect_resp_code Expected HTTPS response code. Default [200, 204]
206
207 # Python module: get_member_list(resource_path)
208 ${systems}= Redfish_Utils.Get Member List /redfish/v1/Systems
209 FOR ${system} IN @{systems}
210 Redfish.Patch ${system} body={"IndicatorLED":${led_state}} valid_status_codes=${expect_resp_code}
211 END