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