meghagn | 62945e2 | 2021-10-04 02:33:17 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
| 3 | Documentation Test OpenBMC GUI "SNMP Alerts" sub-menu of "Settings". |
| 4 | |
| 5 | Resource ../../lib/gui_resource.robot |
Rahul Maheshwari | c27708e | 2021-12-21 06:35:27 -0600 | [diff] [blame] | 6 | Resource ../../../lib/snmp/resource.robot |
| 7 | Resource ../../../lib/snmp/redfish_snmp_utils.robot |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 8 | |
meghagn | 62945e2 | 2021-10-04 02:33:17 -0500 | [diff] [blame] | 9 | Suite Setup Suite Setup Execution |
| 10 | Suite Teardown Close Browser |
| 11 | |
| 12 | |
| 13 | *** Variables *** |
| 14 | |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 15 | ${xpath_snmp_alerts_sub_menu} //*[@data-test-id='nav-item-snmp-alerts'] |
| 16 | ${xpath_snmp_alerts_heading} //h1[text()="SNMP Alerts"] |
| 17 | ${xpath_select_all_snmp} //*[@data-test-id='snmpAlerts-checkbox-selectAll'] |
| 18 | ${xpath_add_destination} //button[contains(text(),'Add destination')] |
| 19 | ${xpath_snmp_alert_destination_heading} //h5[contains(text(),'Add SNMP alert destination')] |
| 20 | ${xpath_ip_address_input_button} //*[@data-test-id='snmpAlerts-input-ipAddress'] |
| 21 | ${xpath_port_optional_input_button} //*[@data-test-id='snmpAlerts-input-port'] |
| 22 | ${xpath_snmp_add_destination_button} //*[@data-test-id='snmpAlerts-button-ok'] |
| 23 | ${xpath_cancel_button} //button[contains(text(),'Cancel')] |
| 24 | ${xpath_delete_button} //*[@data-test-id='snmpAlerts-button-deleteRow-undefined'] |
| 25 | ${xpath_delete_destination} //button[contains(text(),'Delete destination')] |
meghagn | 62945e2 | 2021-10-04 02:33:17 -0500 | [diff] [blame] | 26 | |
| 27 | |
| 28 | *** Test Cases *** |
| 29 | |
| 30 | Verify Navigation To SNMP Alerts Page |
| 31 | [Documentation] Verify navigation to SNMP alerts page. |
| 32 | [Tags] Verify_Navigation_To_SNMP_Alerts_Page |
| 33 | |
| 34 | Page Should Contain Element ${xpath_snmp_alerts_heading} |
| 35 | |
| 36 | |
| 37 | Verify Existence Of All Input Boxes In SNMP Alerts Page |
| 38 | [Documentation] Verify existence of all sections in SNMP alerts page. |
| 39 | [Tags] Verify_Existence_Of_All_Input_Boxes_In_SNMP_Alerts_Page |
| 40 | |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 41 | Page Should Contain Checkbox ${xpath_select_all_snmp} |
meghagn | 62945e2 | 2021-10-04 02:33:17 -0500 | [diff] [blame] | 42 | |
| 43 | |
| 44 | Verify Existence Of All Buttons In SNMP Alerts Page |
| 45 | [Documentation] Verify existence of all buttons in SNMP alerts page. |
| 46 | [Tags] Verify_Existence_Of_All_Buttons_In_SNMP_Alerts_Page |
| 47 | |
| 48 | Page should Contain Button ${xpath_add_destination} |
| 49 | |
| 50 | |
| 51 | Verify Existence Of All Fields In Add Destination |
| 52 | [Documentation] Verify existence of all buttons and fields in add destination page. |
George Keishing | d6a7797 | 2022-01-31 12:50:29 -0600 | [diff] [blame] | 53 | [Tags] Verify_Existence_Of_All_Fields_In_Add_Destination |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 54 | [Teardown] Run Keywords Click Button ${xpath_cancel_button} AND |
| 55 | ... Wait Until Keyword Succeeds 10 sec 5 sec |
| 56 | ... Refresh GUI And Verify Element Value ${xpath_snmp_alerts_heading} SNMP Alerts |
meghagn | 62945e2 | 2021-10-04 02:33:17 -0500 | [diff] [blame] | 57 | |
| 58 | Click Element ${xpath_add_destination} |
| 59 | Wait Until Page Contains Element ${xpath_snmp_alert_destination_heading} |
| 60 | Page Should Contain Element ${xpath_ip_address_input_button} |
| 61 | Page Should Contain Element ${xpath_port_optional_input_button} |
| 62 | Page Should Contain Element ${xpath_cancel_button} |
| 63 | Page Should Contain Element ${xpath_snmp_add_destination_button} |
| 64 | |
| 65 | |
George Keishing | d6a7797 | 2022-01-31 12:50:29 -0600 | [diff] [blame] | 66 | Configure SNMP Settings On BMC With Non Default Port Via GUI And Verify |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 67 | [Documentation] Configure SNMP settings on BMC with non default port via GUI and verify. |
| 68 | [Tags] Configure_SNMP_Settings_On_BMC_With_Non_Default_Port_Via_GUI_And_Verify |
meghagn | fe16be9 | 2022-01-28 05:50:19 -0600 | [diff] [blame] | 69 | [Teardown] Delete SNMP Manager Via GUI ${SNMP_MGR1_IP} ${NON_DEFAULT_PORT1} |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 70 | |
| 71 | Configure SNMP Manager Via GUI ${SNMP_MGR1_IP} ${NON_DEFAULT_PORT1} |
| 72 | |
meghagn | a80e4d4 | 2021-12-14 05:46:15 -0600 | [diff] [blame] | 73 | Wait Until Page Contains ${SNMP_MGR1_IP} timeout=45s |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 74 | |
| 75 | Verify SNMP Manager Configured On BMC ${SNMP_MGR1_IP} ${NON_DEFAULT_PORT1} |
| 76 | |
| 77 | |
meghagn | c2436bc | 2021-10-11 03:49:21 -0500 | [diff] [blame] | 78 | Configure SNMP Settings On BMC Via GUI And Verify |
| 79 | [Documentation] Configure SNMP settings on BMC via GUI and verify. |
| 80 | [Tags] Configure_SNMP_Settings_On_BMC_Via_GUI_And_Verify |
meghagn | fe16be9 | 2022-01-28 05:50:19 -0600 | [diff] [blame] | 81 | [Teardown] Delete SNMP Manager Via GUI ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
meghagn | c2436bc | 2021-10-11 03:49:21 -0500 | [diff] [blame] | 82 | |
| 83 | Configure SNMP Manager Via GUI ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
| 84 | |
meghagn | a80e4d4 | 2021-12-14 05:46:15 -0600 | [diff] [blame] | 85 | Wait Until Page Contains ${SNMP_MGR1_IP} timeout=45s |
meghagn | c2436bc | 2021-10-11 03:49:21 -0500 | [diff] [blame] | 86 | |
| 87 | Verify SNMP Manager Configured On BMC ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
| 88 | |
| 89 | |
meghagn | d3b19ac | 2021-10-22 01:09:25 -0500 | [diff] [blame] | 90 | Configure SNMP Settings On BMC With Empty Port Via GUI And Verify |
| 91 | [Documentation] Configure SNMP settings on BMC with empty port via GUI and verify. |
| 92 | [Tags] Configure_SNMP_Settings_On_BMC_With_Empty_Port_Via_GUI_And_Verify |
meghagn | fe16be9 | 2022-01-28 05:50:19 -0600 | [diff] [blame] | 93 | [Teardown] Delete SNMP Manager Via GUI ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
meghagn | d3b19ac | 2021-10-22 01:09:25 -0500 | [diff] [blame] | 94 | |
| 95 | Configure SNMP Manager Via GUI ${SNMP_MGR1_IP} ${empty_port} |
| 96 | |
meghagn | a80e4d4 | 2021-12-14 05:46:15 -0600 | [diff] [blame] | 97 | Wait Until Page Contains ${SNMP_MGR1_IP} timeout=45s |
meghagn | d3b19ac | 2021-10-22 01:09:25 -0500 | [diff] [blame] | 98 | |
| 99 | # SNMP Manager IP is set with default port number when no port number is provided. |
| 100 | Verify SNMP Manager Configured On BMC ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
| 101 | |
| 102 | |
| 103 | Configure Invalid SNMP Settings On BMC Via GUI And Verify |
| 104 | |
| 105 | [Documentation] Configure invalid SNMP settings on BMC via GUI and verify. |
| 106 | [Tags] Configure_Invalid_SNMP_Settings_On_BMC_Via_GUI_And_Verify |
| 107 | [Template] Configure SNMP Manager On BMC With Invalid Setting Via GUI And Verify |
| 108 | |
| 109 | # snmp_manager_ip snmp_manager_port Expected status |
| 110 | ${SNMP_MGR1_IP} ${out_of_range_port} Value must be between 0 – 65535 |
| 111 | ${SNMP_MGR1_IP} ${alpha_port} Value must be between 0 – 65535 |
| 112 | ${SNMP_MGR1_IP} ${negative_port} Value must be between 0 – 65535 |
| 113 | ${out_of_range_ip} ${NON_DEFAULT_PORT1} Invalid format |
| 114 | ${alpha_ip} ${NON_DEFAULT_PORT1} Invalid format |
| 115 | |
| 116 | |
meghagn | 5a4ddb0 | 2021-11-09 01:49:23 -0600 | [diff] [blame] | 117 | Configure Multiple SNMP Managers On BMC Via GUI And Verify |
| 118 | [Documentation] Configure multiple SNMP managers on BMC via GUI and verify. |
George Keishing | d6a7797 | 2022-01-31 12:50:29 -0600 | [diff] [blame] | 119 | [Tags] Configure_Multiple_SNMP_Managers_On_BMC_Via_GUI_And_Verify |
meghagn | 5a4ddb0 | 2021-11-09 01:49:23 -0600 | [diff] [blame] | 120 | [Template] Configure Multiple SNMP Managers On BMC With Valid Port Via GUI And Verify |
| 121 | |
| 122 | # snmp_manager_ip snmp_port |
| 123 | ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
| 124 | ${SNMP_MGR2_IP} ${SNMP_DEFAULT_PORT} |
| 125 | |
| 126 | |
| 127 | Configure Multiple SNMP Managers With Non Default Port Via GUI And Verify |
| 128 | [Documentation] Configure multiple SNMP managers with non-default port via GUI and verify. |
| 129 | [Tags] Configure_Multiple_SNMP_Managers_With_Non_Default_Port_Via_GUI_And_Verify |
| 130 | [Template] Configure Multiple SNMP Managers On BMC With Valid Port Via GUI And Verify |
| 131 | |
| 132 | # snmp_manager_ip snmp_port |
| 133 | ${SNMP_MGR1_IP} ${NON_DEFAULT_PORT1} |
| 134 | ${SNMP_MGR2_IP} ${NON_DEFAULT_PORT1} |
| 135 | |
| 136 | |
| 137 | Configure Multiple SNMP Managers With Different Ports Via GUI And Verify |
| 138 | [Documentation] Configure multiple SNMP managers with different ports via GUI and verify. |
| 139 | [Tags] Configure_Multiple_SNMP_Managers_With_Different_Ports_Via_GUI_And_Verify |
| 140 | [Template] Configure Multiple SNMP Managers On BMC With Valid Port Via GUI And Verify |
| 141 | |
| 142 | # snmp_manager_ip snmp_port |
| 143 | ${SNMP_MGR1_IP} ${NON_DEFAULT_PORT1} |
| 144 | ${SNMP_MGR2_IP} ${SNMP_DEFAULT_PORT} |
| 145 | ${SNMP_MGR3_IP} ${NON_DEFAULT_PORT2} |
| 146 | |
| 147 | |
meghagn | fe16be9 | 2022-01-28 05:50:19 -0600 | [diff] [blame] | 148 | Configure Multiple SNMP Managers On BMC Via GUI And Verify Persistency On BMC Reboot |
| 149 | [Documentation] Login GUI SNMP alerts page and |
| 150 | ... add multiple SNMP Managers on BMC via GUI and verify persistency on BMC reboot. |
| 151 | [Tags] Configure_Multiple_SNMP_Managers_On_BMC_Via_GUI_And_Verify_Persistency_On_BMC_Reboot |
| 152 | [Teardown] Run Keywords Delete SNMP Manager Via GUI ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
| 153 | ... AND Delete SNMP Manager Via GUI ${SNMP_MGR2_IP} ${SNMP_DEFAULT_PORT} |
| 154 | |
| 155 | Configure SNMP Manager Via GUI ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
| 156 | Wait Until Page Contains ${SNMP_MGR1_IP} timeout=45s |
| 157 | |
| 158 | Configure SNMP Manager Via GUI ${SNMP_MGR2_IP} ${SNMP_DEFAULT_PORT} |
| 159 | Wait Until Page Contains ${SNMP_MGR2_IP} timeout=45s |
| 160 | |
| 161 | # Reboot BMC and check persistency SNMP manager. |
| 162 | Reboot BMC via GUI |
| 163 | |
| 164 | Suite Setup Execution |
| 165 | Wait Until Page Contains SNMP Alerts timeout=1min |
| 166 | |
| 167 | Verify SNMP Manager Configured On BMC ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
| 168 | Verify SNMP Manager Configured On BMC ${SNMP_MGR2_IP} ${SNMP_DEFAULT_PORT} |
| 169 | |
| 170 | |
meghagn | 62945e2 | 2021-10-04 02:33:17 -0500 | [diff] [blame] | 171 | *** Keywords *** |
| 172 | |
| 173 | Suite Setup Execution |
| 174 | [Documentation] Do test case setup tasks. |
| 175 | |
| 176 | Launch Browser And Login GUI |
| 177 | |
| 178 | Click Element ${xpath_settings_menu} |
| 179 | Click Element ${xpath_snmp_alerts_sub_menu} |
| 180 | Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain snmp-alerts |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 181 | |
| 182 | |
| 183 | Configure SNMP Manager Via GUI |
| 184 | [Documentation] Configure SNMP manager via GUI. |
| 185 | [Arguments] ${snmp_ip} ${port} |
| 186 | |
| 187 | # Description of argument(s): |
| 188 | # snmp_ip SNMP manager IP address. |
| 189 | # port SNMP manager port. |
| 190 | |
| 191 | Click Element ${xpath_add_destination} |
| 192 | Wait Until Page Contains Element ${xpath_snmp_alert_destination_heading} |
| 193 | Input Text ${xpath_ip_address_input_button} ${snmp_ip} |
| 194 | Wait Until Keyword Succeeds 30 sec 5 sec Get Value ${xpath_ip_address_input_button} |
| 195 | Input Text ${xpath_port_optional_input_button} ${port} |
| 196 | Click Element ${xpath_snmp_add_destination_button} |
| 197 | |
| 198 | |
| 199 | Delete SNMP Manager Via GUI |
| 200 | [Documentation] Delete SNMP manager via GUI. |
meghagn | fe16be9 | 2022-01-28 05:50:19 -0600 | [diff] [blame] | 201 | [Arguments] ${snmp_mgr_ip} ${snmp_mgr_port} |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 202 | |
meghagn | fe16be9 | 2022-01-28 05:50:19 -0600 | [diff] [blame] | 203 | # Description of argument(s): |
| 204 | # snmp_mgr_ip SNMP manager IP address. |
| 205 | # snmp_mgr_port SNMP manager port. |
| 206 | |
| 207 | Wait Until Page Contains ${snmp_mgr_ip} ${snmp_mgr_port} |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 208 | Click Element At Coordinates ${xpath_select_all_snmp} 0 0 |
| 209 | Wait Until Keyword Succeeds 30 sec 5 sec Click Element ${xpath_delete_button} |
| 210 | Wait Until Page Contains Delete SNMP alert destination |
| 211 | Click Element ${xpath_delete_destination} |
meghagn | a80e4d4 | 2021-12-14 05:46:15 -0600 | [diff] [blame] | 212 | Wait Until Page Contains Successfully deleted SNMP alert destination timeout=45s |
meghagn | c2436bc | 2021-10-11 03:49:21 -0500 | [diff] [blame] | 213 | Wait Until Keyword Succeeds 30 sec 10 sec Refresh GUI And Verify Element Value |
| 214 | ... ${xpath_snmp_alerts_heading} SNMP Alerts |
meghagn | d3b19ac | 2021-10-22 01:09:25 -0500 | [diff] [blame] | 215 | |
| 216 | |
| 217 | Configure SNMP Manager On BMC With Invalid Setting Via GUI And Verify |
| 218 | |
| 219 | [Documentation] Configure SNMP manager on BMC with invalid setting via GUI and verify. |
| 220 | [Arguments] ${snmp_manager_ip} ${snmp_manager_port} ${expected_error} |
| 221 | [Teardown] Click Element ${xpath_cancel_button} |
| 222 | |
| 223 | # Description of argument(s): |
| 224 | # snmp_manager_ip SNMP manager IP address. |
| 225 | # snmp_manager_port SNMP manager port. |
| 226 | # expected_error Expected error optionally provided in testcase |
| 227 | # .... (e.g. Invalid format / Value must be between 0 – 65535). |
| 228 | |
| 229 | Configure SNMP Manager Via GUI ${snmp_manager_ip} ${snmp_manager_port} |
| 230 | Wait Until Page Contains ${expected_error} |
| 231 | ${status}= Run Keyword And Return Status |
| 232 | ... Verify SNMP Manager Configured On BMC ${snmp_manager_ip} ${snmp_manager_port} |
| 233 | Should Be Equal As Strings ${status} False |
| 234 | ... msg=BMC is allowing to configure with invalid SNMP settings. |
meghagn | 5a4ddb0 | 2021-11-09 01:49:23 -0600 | [diff] [blame] | 235 | |
| 236 | |
| 237 | Configure Multiple SNMP Managers On BMC With Valid Port Via GUI And Verify |
| 238 | [Documentation] Configure multiple SNMP managers on BMC with valid port value via GUI and verify. |
| 239 | [Arguments] ${snmp_ip_value} ${snmp_port_value} |
meghagn | fe16be9 | 2022-01-28 05:50:19 -0600 | [diff] [blame] | 240 | [Teardown] Delete SNMP Manager Via GUI ${snmp_ip_value} ${snmp_port_value} |
meghagn | 5a4ddb0 | 2021-11-09 01:49:23 -0600 | [diff] [blame] | 241 | |
| 242 | # Description of argument(s): |
| 243 | # snmp_ip_value SNMP manager IP address. |
| 244 | # snmp_port_value SNMP manager port. |
| 245 | |
| 246 | Configure SNMP Manager Via GUI ${snmp_ip_value} ${snmp_port_value} |
| 247 | Verify SNMP Manager Configured On BMC ${snmp_ip_value} ${snmp_port_value} |