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 | |
Rahul Maheshwari | c27708e | 2021-12-21 06:35:27 -0600 | [diff] [blame] | 5 | Resource ../../../lib/snmp/redfish_snmp_utils.robot |
Megha G N | b9ae25a | 2023-01-27 06:25:00 -0600 | [diff] [blame] | 6 | Resource ../../../lib/snmp/resource.robot |
| 7 | Resource ../../lib/gui_resource.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'] |
rramyasr-in | e71ba07 | 2022-06-13 11:12:06 -0500 | [diff] [blame] | 16 | ${xpath_snmp_alerts_heading} //h1[text()="SNMP alerts"] |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 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 | |
Megha GN | c7bcf7c | 2022-08-04 05:30:58 -0500 | [diff] [blame] | 27 | ${snmp_page_heading} SNMP alerts |
| 28 | ${invalid_port_error} Value must be between 0 – 65535 |
| 29 | ${invalid_destination_error} Error in adding SNMP alert destination |
Megha G N | b9ae25a | 2023-01-27 06:25:00 -0600 | [diff] [blame] | 30 | ${invalid_ip_error} Field required |
Megha GN | c7bcf7c | 2022-08-04 05:30:58 -0500 | [diff] [blame] | 31 | |
meghagn | 62945e2 | 2021-10-04 02:33:17 -0500 | [diff] [blame] | 32 | |
| 33 | *** Test Cases *** |
| 34 | |
| 35 | Verify Navigation To SNMP Alerts Page |
| 36 | [Documentation] Verify navigation to SNMP alerts page. |
| 37 | [Tags] Verify_Navigation_To_SNMP_Alerts_Page |
| 38 | |
| 39 | Page Should Contain Element ${xpath_snmp_alerts_heading} |
| 40 | |
| 41 | |
| 42 | Verify Existence Of All Input Boxes In SNMP Alerts Page |
| 43 | [Documentation] Verify existence of all sections in SNMP alerts page. |
| 44 | [Tags] Verify_Existence_Of_All_Input_Boxes_In_SNMP_Alerts_Page |
| 45 | |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 46 | Page Should Contain Checkbox ${xpath_select_all_snmp} |
meghagn | 62945e2 | 2021-10-04 02:33:17 -0500 | [diff] [blame] | 47 | |
| 48 | |
| 49 | Verify Existence Of All Buttons In SNMP Alerts Page |
| 50 | [Documentation] Verify existence of all buttons in SNMP alerts page. |
| 51 | [Tags] Verify_Existence_Of_All_Buttons_In_SNMP_Alerts_Page |
| 52 | |
| 53 | Page should Contain Button ${xpath_add_destination} |
| 54 | |
| 55 | |
| 56 | Verify Existence Of All Fields In Add Destination |
| 57 | [Documentation] Verify existence of all buttons and fields in add destination page. |
George Keishing | d6a7797 | 2022-01-31 12:50:29 -0600 | [diff] [blame] | 58 | [Tags] Verify_Existence_Of_All_Fields_In_Add_Destination |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 59 | [Teardown] Run Keywords Click Button ${xpath_cancel_button} AND |
| 60 | ... Wait Until Keyword Succeeds 10 sec 5 sec |
Megha GN | c7bcf7c | 2022-08-04 05:30:58 -0500 | [diff] [blame] | 61 | ... Refresh GUI And Verify Element Value ${xpath_snmp_alerts_heading} ${snmp_page_heading} |
meghagn | 62945e2 | 2021-10-04 02:33:17 -0500 | [diff] [blame] | 62 | |
| 63 | Click Element ${xpath_add_destination} |
| 64 | Wait Until Page Contains Element ${xpath_snmp_alert_destination_heading} |
| 65 | Page Should Contain Element ${xpath_ip_address_input_button} |
| 66 | Page Should Contain Element ${xpath_port_optional_input_button} |
| 67 | Page Should Contain Element ${xpath_cancel_button} |
| 68 | Page Should Contain Element ${xpath_snmp_add_destination_button} |
| 69 | |
| 70 | |
George Keishing | d6a7797 | 2022-01-31 12:50:29 -0600 | [diff] [blame] | 71 | Configure SNMP Settings On BMC With Non Default Port Via GUI And Verify |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 72 | [Documentation] Configure SNMP settings on BMC with non default port via GUI and verify. |
| 73 | [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] | 74 | [Teardown] Delete SNMP Manager Via GUI ${SNMP_MGR1_IP} ${NON_DEFAULT_PORT1} |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 75 | |
| 76 | Configure SNMP Manager Via GUI ${SNMP_MGR1_IP} ${NON_DEFAULT_PORT1} |
| 77 | |
meghagn | a80e4d4 | 2021-12-14 05:46:15 -0600 | [diff] [blame] | 78 | Wait Until Page Contains ${SNMP_MGR1_IP} timeout=45s |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 79 | |
| 80 | Verify SNMP Manager Configured On BMC ${SNMP_MGR1_IP} ${NON_DEFAULT_PORT1} |
Megha G N | 2b98bc0 | 2023-01-20 02:01:48 -0600 | [diff] [blame] | 81 | |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 82 | |
meghagn | c2436bc | 2021-10-11 03:49:21 -0500 | [diff] [blame] | 83 | Configure SNMP Settings On BMC Via GUI And Verify |
| 84 | [Documentation] Configure SNMP settings on BMC via GUI and verify. |
| 85 | [Tags] Configure_SNMP_Settings_On_BMC_Via_GUI_And_Verify |
meghagn | fe16be9 | 2022-01-28 05:50:19 -0600 | [diff] [blame] | 86 | [Teardown] Delete SNMP Manager Via GUI ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
meghagn | c2436bc | 2021-10-11 03:49:21 -0500 | [diff] [blame] | 87 | |
| 88 | Configure SNMP Manager Via GUI ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
| 89 | |
meghagn | a80e4d4 | 2021-12-14 05:46:15 -0600 | [diff] [blame] | 90 | Wait Until Page Contains ${SNMP_MGR1_IP} timeout=45s |
meghagn | c2436bc | 2021-10-11 03:49:21 -0500 | [diff] [blame] | 91 | |
| 92 | Verify SNMP Manager Configured On BMC ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
| 93 | |
| 94 | |
meghagn | d3b19ac | 2021-10-22 01:09:25 -0500 | [diff] [blame] | 95 | Configure SNMP Settings On BMC With Empty Port Via GUI And Verify |
| 96 | [Documentation] Configure SNMP settings on BMC with empty port via GUI and verify. |
| 97 | [Tags] Configure_SNMP_Settings_On_BMC_With_Empty_Port_Via_GUI_And_Verify |
meghagn | fe16be9 | 2022-01-28 05:50:19 -0600 | [diff] [blame] | 98 | [Teardown] Delete SNMP Manager Via GUI ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
meghagn | d3b19ac | 2021-10-22 01:09:25 -0500 | [diff] [blame] | 99 | |
| 100 | Configure SNMP Manager Via GUI ${SNMP_MGR1_IP} ${empty_port} |
| 101 | |
meghagn | a80e4d4 | 2021-12-14 05:46:15 -0600 | [diff] [blame] | 102 | Wait Until Page Contains ${SNMP_MGR1_IP} timeout=45s |
meghagn | d3b19ac | 2021-10-22 01:09:25 -0500 | [diff] [blame] | 103 | |
| 104 | # SNMP Manager IP is set with default port number when no port number is provided. |
| 105 | Verify SNMP Manager Configured On BMC ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
| 106 | |
| 107 | |
| 108 | Configure Invalid SNMP Settings On BMC Via GUI And Verify |
| 109 | |
| 110 | [Documentation] Configure invalid SNMP settings on BMC via GUI and verify. |
| 111 | [Tags] Configure_Invalid_SNMP_Settings_On_BMC_Via_GUI_And_Verify |
| 112 | [Template] Configure SNMP Manager On BMC With Invalid Setting Via GUI And Verify |
| 113 | |
| 114 | # snmp_manager_ip snmp_manager_port Expected status |
Megha GN | c7bcf7c | 2022-08-04 05:30:58 -0500 | [diff] [blame] | 115 | ${SNMP_MGR1_IP} ${out_of_range_port} ${invalid_port_error} |
| 116 | ${SNMP_MGR1_IP} ${alpha_port} ${invalid_port_error} |
| 117 | ${SNMP_MGR1_IP} ${negative_port} ${invalid_port_error} |
Megha G N | 999964d | 2022-12-06 04:38:10 -0600 | [diff] [blame] | 118 | ${SNMP_MGR1_IP} ${alphanumeric_port} ${invalid_port_error} |
Megha G N | b9ae25a | 2023-01-27 06:25:00 -0600 | [diff] [blame] | 119 | ${empty_ip} ${NON_DEFAULT_PORT1} ${invalid_ip_error} |
Megha GN | c7bcf7c | 2022-08-04 05:30:58 -0500 | [diff] [blame] | 120 | ${out_of_range_ip} ${NON_DEFAULT_PORT1} ${invalid_destination_error} |
| 121 | ${alpha_ip} ${NON_DEFAULT_PORT1} ${invalid_destination_error} |
Megha G N | 999964d | 2022-12-06 04:38:10 -0600 | [diff] [blame] | 122 | ${negative_ip} ${NON_DEFAULT_PORT1} ${invalid_destination_error} |
Megha G N | 2b98bc0 | 2023-01-20 02:01:48 -0600 | [diff] [blame] | 123 | ${less_octet_ip} ${NON_DEFAULT_PORT1} ${invalid_destination_error} |
meghagn | d3b19ac | 2021-10-22 01:09:25 -0500 | [diff] [blame] | 124 | |
| 125 | |
meghagn | 5a4ddb0 | 2021-11-09 01:49:23 -0600 | [diff] [blame] | 126 | Configure Multiple SNMP Managers On BMC Via GUI And Verify |
| 127 | [Documentation] Configure multiple SNMP managers on BMC via GUI and verify. |
George Keishing | d6a7797 | 2022-01-31 12:50:29 -0600 | [diff] [blame] | 128 | [Tags] Configure_Multiple_SNMP_Managers_On_BMC_Via_GUI_And_Verify |
meghagn | 5a4ddb0 | 2021-11-09 01:49:23 -0600 | [diff] [blame] | 129 | [Template] Configure Multiple SNMP Managers On BMC With Valid Port Via GUI And Verify |
| 130 | |
| 131 | # snmp_manager_ip snmp_port |
| 132 | ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
| 133 | ${SNMP_MGR2_IP} ${SNMP_DEFAULT_PORT} |
| 134 | |
| 135 | |
| 136 | Configure Multiple SNMP Managers With Non Default Port Via GUI And Verify |
| 137 | [Documentation] Configure multiple SNMP managers with non-default port via GUI and verify. |
| 138 | [Tags] Configure_Multiple_SNMP_Managers_With_Non_Default_Port_Via_GUI_And_Verify |
| 139 | [Template] Configure Multiple SNMP Managers On BMC With Valid Port Via GUI And Verify |
| 140 | |
| 141 | # snmp_manager_ip snmp_port |
| 142 | ${SNMP_MGR1_IP} ${NON_DEFAULT_PORT1} |
| 143 | ${SNMP_MGR2_IP} ${NON_DEFAULT_PORT1} |
| 144 | |
| 145 | |
| 146 | Configure Multiple SNMP Managers With Different Ports Via GUI And Verify |
| 147 | [Documentation] Configure multiple SNMP managers with different ports via GUI and verify. |
| 148 | [Tags] Configure_Multiple_SNMP_Managers_With_Different_Ports_Via_GUI_And_Verify |
| 149 | [Template] Configure Multiple SNMP Managers On BMC With Valid Port Via GUI And Verify |
| 150 | |
| 151 | # snmp_manager_ip snmp_port |
| 152 | ${SNMP_MGR1_IP} ${NON_DEFAULT_PORT1} |
| 153 | ${SNMP_MGR2_IP} ${SNMP_DEFAULT_PORT} |
| 154 | ${SNMP_MGR3_IP} ${NON_DEFAULT_PORT2} |
| 155 | |
| 156 | |
meghagn | fe16be9 | 2022-01-28 05:50:19 -0600 | [diff] [blame] | 157 | Configure Multiple SNMP Managers On BMC Via GUI And Verify Persistency On BMC Reboot |
| 158 | [Documentation] Login GUI SNMP alerts page and |
| 159 | ... add multiple SNMP Managers on BMC via GUI and verify persistency on BMC reboot. |
| 160 | [Tags] Configure_Multiple_SNMP_Managers_On_BMC_Via_GUI_And_Verify_Persistency_On_BMC_Reboot |
| 161 | [Teardown] Run Keywords Delete SNMP Manager Via GUI ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
| 162 | ... AND Delete SNMP Manager Via GUI ${SNMP_MGR2_IP} ${SNMP_DEFAULT_PORT} |
| 163 | |
| 164 | Configure SNMP Manager Via GUI ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
| 165 | Wait Until Page Contains ${SNMP_MGR1_IP} timeout=45s |
| 166 | |
| 167 | Configure SNMP Manager Via GUI ${SNMP_MGR2_IP} ${SNMP_DEFAULT_PORT} |
| 168 | Wait Until Page Contains ${SNMP_MGR2_IP} timeout=45s |
| 169 | |
| 170 | # Reboot BMC and check persistency SNMP manager. |
| 171 | Reboot BMC via GUI |
| 172 | |
| 173 | Suite Setup Execution |
Megha GN | c7bcf7c | 2022-08-04 05:30:58 -0500 | [diff] [blame] | 174 | Wait Until Page Contains ${snmp_page_heading} timeout=1min |
meghagn | fe16be9 | 2022-01-28 05:50:19 -0600 | [diff] [blame] | 175 | |
| 176 | Verify SNMP Manager Configured On BMC ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
| 177 | Verify SNMP Manager Configured On BMC ${SNMP_MGR2_IP} ${SNMP_DEFAULT_PORT} |
| 178 | |
| 179 | |
meghagn | 725ccdd | 2022-02-09 04:55:52 -0600 | [diff] [blame] | 180 | Configure SNMP Manager Via GUI And Verify SNMP Trap |
| 181 | [Documentation] Login GUI SNMP alerts page and add SNMP manager via GUI |
| 182 | ... and generate error on BMC and verify trap and its fields. |
| 183 | [Tags] Configure_SNMP_Manager_Via_GUI_And_Verify_SNMP_Trap |
| 184 | [Template] Create Error On BMC And Verify Trap On Default Port |
| 185 | [Teardown] Delete SNMP Manager Via GUI ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
| 186 | |
| 187 | # event_log expected_error |
| 188 | |
| 189 | # Generate internal failure error. |
| 190 | ${CMD_INTERNAL_FAILURE} ${SNMP_TRAP_BMC_INTERNAL_FAILURE} |
| 191 | |
| 192 | # Generate timeout error. |
| 193 | ${CMD_FRU_CALLOUT} ${SNMP_TRAP_BMC_CALLOUT_ERROR} |
| 194 | |
| 195 | # Generate informational error. |
| 196 | ${CMD_INFORMATIONAL_ERROR} ${SNMP_TRAP_BMC_INFORMATIONAL_ERROR} |
| 197 | |
| 198 | |
meghagn | 62945e2 | 2021-10-04 02:33:17 -0500 | [diff] [blame] | 199 | *** Keywords *** |
| 200 | |
| 201 | Suite Setup Execution |
| 202 | [Documentation] Do test case setup tasks. |
| 203 | |
| 204 | Launch Browser And Login GUI |
| 205 | |
| 206 | Click Element ${xpath_settings_menu} |
| 207 | Click Element ${xpath_snmp_alerts_sub_menu} |
| 208 | Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain snmp-alerts |
rramyasr-in | 9e2c96f | 2023-01-24 07:59:34 -0600 | [diff] [blame] | 209 | Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30 |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 210 | |
| 211 | Configure SNMP Manager Via GUI |
| 212 | [Documentation] Configure SNMP manager via GUI. |
| 213 | [Arguments] ${snmp_ip} ${port} |
| 214 | |
| 215 | # Description of argument(s): |
| 216 | # snmp_ip SNMP manager IP address. |
| 217 | # port SNMP manager port. |
| 218 | |
| 219 | Click Element ${xpath_add_destination} |
| 220 | Wait Until Page Contains Element ${xpath_snmp_alert_destination_heading} |
| 221 | Input Text ${xpath_ip_address_input_button} ${snmp_ip} |
| 222 | Wait Until Keyword Succeeds 30 sec 5 sec Get Value ${xpath_ip_address_input_button} |
| 223 | Input Text ${xpath_port_optional_input_button} ${port} |
| 224 | Click Element ${xpath_snmp_add_destination_button} |
| 225 | |
| 226 | |
| 227 | Delete SNMP Manager Via GUI |
| 228 | [Documentation] Delete SNMP manager via GUI. |
meghagn | fe16be9 | 2022-01-28 05:50:19 -0600 | [diff] [blame] | 229 | [Arguments] ${snmp_mgr_ip} ${snmp_mgr_port} |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 230 | |
meghagn | fe16be9 | 2022-01-28 05:50:19 -0600 | [diff] [blame] | 231 | # Description of argument(s): |
| 232 | # snmp_mgr_ip SNMP manager IP address. |
| 233 | # snmp_mgr_port SNMP manager port. |
| 234 | |
| 235 | Wait Until Page Contains ${snmp_mgr_ip} ${snmp_mgr_port} |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 236 | Click Element At Coordinates ${xpath_select_all_snmp} 0 0 |
| 237 | Wait Until Keyword Succeeds 30 sec 5 sec Click Element ${xpath_delete_button} |
| 238 | Wait Until Page Contains Delete SNMP alert destination |
| 239 | Click Element ${xpath_delete_destination} |
meghagn | a80e4d4 | 2021-12-14 05:46:15 -0600 | [diff] [blame] | 240 | Wait Until Page Contains Successfully deleted SNMP alert destination timeout=45s |
meghagn | c2436bc | 2021-10-11 03:49:21 -0500 | [diff] [blame] | 241 | Wait Until Keyword Succeeds 30 sec 10 sec Refresh GUI And Verify Element Value |
Megha GN | c7bcf7c | 2022-08-04 05:30:58 -0500 | [diff] [blame] | 242 | ... ${xpath_snmp_alerts_heading} ${snmp_page_heading} |
meghagn | d3b19ac | 2021-10-22 01:09:25 -0500 | [diff] [blame] | 243 | |
| 244 | |
| 245 | Configure SNMP Manager On BMC With Invalid Setting Via GUI And Verify |
| 246 | |
| 247 | [Documentation] Configure SNMP manager on BMC with invalid setting via GUI and verify. |
| 248 | [Arguments] ${snmp_manager_ip} ${snmp_manager_port} ${expected_error} |
Megha G N | b9ae25a | 2023-01-27 06:25:00 -0600 | [diff] [blame] | 249 | [Teardown] Close Add SNMP Alerts Destination Window ${expected_error} |
meghagn | d3b19ac | 2021-10-22 01:09:25 -0500 | [diff] [blame] | 250 | |
| 251 | # Description of argument(s): |
| 252 | # snmp_manager_ip SNMP manager IP address. |
| 253 | # snmp_manager_port SNMP manager port. |
| 254 | # expected_error Expected error optionally provided in testcase |
| 255 | # .... (e.g. Invalid format / Value must be between 0 – 65535). |
| 256 | |
| 257 | Configure SNMP Manager Via GUI ${snmp_manager_ip} ${snmp_manager_port} |
| 258 | Wait Until Page Contains ${expected_error} |
| 259 | ${status}= Run Keyword And Return Status |
| 260 | ... Verify SNMP Manager Configured On BMC ${snmp_manager_ip} ${snmp_manager_port} |
| 261 | Should Be Equal As Strings ${status} False |
| 262 | ... msg=BMC is allowing to configure with invalid SNMP settings. |
meghagn | 5a4ddb0 | 2021-11-09 01:49:23 -0600 | [diff] [blame] | 263 | |
| 264 | |
| 265 | Configure Multiple SNMP Managers On BMC With Valid Port Via GUI And Verify |
| 266 | [Documentation] Configure multiple SNMP managers on BMC with valid port value via GUI and verify. |
| 267 | [Arguments] ${snmp_ip_value} ${snmp_port_value} |
meghagn | fe16be9 | 2022-01-28 05:50:19 -0600 | [diff] [blame] | 268 | [Teardown] Delete SNMP Manager Via GUI ${snmp_ip_value} ${snmp_port_value} |
meghagn | 5a4ddb0 | 2021-11-09 01:49:23 -0600 | [diff] [blame] | 269 | |
| 270 | # Description of argument(s): |
| 271 | # snmp_ip_value SNMP manager IP address. |
| 272 | # snmp_port_value SNMP manager port. |
| 273 | |
| 274 | Configure SNMP Manager Via GUI ${snmp_ip_value} ${snmp_port_value} |
| 275 | Verify SNMP Manager Configured On BMC ${snmp_ip_value} ${snmp_port_value} |
meghagn | 725ccdd | 2022-02-09 04:55:52 -0600 | [diff] [blame] | 276 | |
| 277 | |
| 278 | Create Error On BMC And Verify Trap On Default Port |
| 279 | [Documentation] Generate error on BMC and verify if trap is sent to default port. |
| 280 | [Arguments] ${event_log}=${CMD_INTERNAL_FAILURE} ${expected_error}=${SNMP_TRAP_BMC_INTERNAL_FAILURE} |
| 281 | |
| 282 | # Description of argument(s): |
| 283 | # event_log Event logs to be created. |
| 284 | # expected_error Expected error on SNMP. |
| 285 | |
| 286 | Configure SNMP Manager Via GUI ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
| 287 | |
| 288 | Start SNMP Manager |
| 289 | |
| 290 | # Generate error log. |
| 291 | BMC Execute Command ${event_log} |
| 292 | |
| 293 | SSHLibrary.Switch Connection snmp_server |
| 294 | ${SNMP_LISTEN_OUT}= Read delay=1s |
| 295 | |
| 296 | # Stop SNMP manager process. |
| 297 | SSHLibrary.Execute Command sudo killall snmptrapd |
| 298 | |
| 299 | # Sample SNMP trap: |
| 300 | # 2021-06-16 07:05:29 xx.xx.xx.xx [UDP: [xx.xx.xx.xx]:58154->[xx.xx.xx.xx]:xxx]: |
| 301 | # DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (2100473) 5:50:04.73 |
| 302 | # SNMPv2-MIB::snmpTrapOID.0 = OID: SNMPv2-SMI::enterprises.49871.1.0.0.1 |
| 303 | # SNMPv2-SMI::enterprises.49871.1.0.1.1 = Gauge32: 369 SNMPv2-SMI::enterprises.49871.1.0.1.2 = Opaque: |
| 304 | # UInt64: 1397718405502468474 SNMPv2-SMI::enterprises.49871.1.0.1.3 = INTEGER: 3 |
| 305 | # SNMPv2-SMI::enterprises.49871.1.0.1.4 = STRING: "xxx.xx.xx Failure" |
| 306 | |
| 307 | ${lines}= Split To Lines ${SNMP_LISTEN_OUT} |
| 308 | ${trap_info}= Get From List ${lines} -1 |
| 309 | ${snmp_trap}= Split String ${trap_info} \t |
| 310 | |
| 311 | Verify SNMP Trap ${snmp_trap} ${expected_error} |
Megha G N | b9ae25a | 2023-01-27 06:25:00 -0600 | [diff] [blame] | 312 | |
| 313 | |
| 314 | Close Add SNMP Alerts Destination Window |
| 315 | [Documentation] Close Add SNMP Alerts Destination window. |
| 316 | [Arguments] ${expected_error}=${invalid_port_error} |
| 317 | |
| 318 | # Description of argument(s): |
| 319 | # expected_error Expected error on SNMP alerts page. |
| 320 | |
| 321 | Run Keyword If '${expected_error}' == '${invalid_port_error}' |
| 322 | ... Click Element ${xpath_cancel_button} |
| 323 | ... ELSE IF '${expected_error}' == '${invalid_ip_error}' |
| 324 | ... Click Element ${xpath_cancel_button} |