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