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 |
Megha G N | 8caf4a8 | 2023-02-22 01:01:03 -0600 | [diff] [blame] | 186 | [Teardown] Delete SNMP Manager Via Redfish ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
meghagn | 725ccdd | 2022-02-09 04:55:52 -0600 | [diff] [blame] | 187 | |
| 188 | # event_log expected_error |
| 189 | |
| 190 | # Generate internal failure error. |
| 191 | ${CMD_INTERNAL_FAILURE} ${SNMP_TRAP_BMC_INTERNAL_FAILURE} |
| 192 | |
| 193 | # Generate timeout error. |
| 194 | ${CMD_FRU_CALLOUT} ${SNMP_TRAP_BMC_CALLOUT_ERROR} |
| 195 | |
| 196 | # Generate informational error. |
| 197 | ${CMD_INFORMATIONAL_ERROR} ${SNMP_TRAP_BMC_INFORMATIONAL_ERROR} |
| 198 | |
| 199 | |
George Keishing | 354091f | 2023-02-09 23:13:01 -0600 | [diff] [blame] | 200 | Configure SNMP Manager By Its Hostname Via GUI And Verify |
Megha G N | 2a31e51 | 2023-01-18 04:23:20 -0600 | [diff] [blame] | 201 | [Documentation] Login GUI SNMP alerts page and add SNMP manager with its hostname |
| 202 | ... via GUI and verify. |
| 203 | [Tags] Configure_SNMP_Manager_By_Its_Hostname_Via_GUI_And_Verify |
| 204 | |
| 205 | Set DNS Server IP |
| 206 | |
| 207 | # Navigate to SNMP page and configure SNMP manager. |
| 208 | Click Element ${xpath_snmp_alerts_sub_menu} |
| 209 | Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain snmp-alerts |
| 210 | |
| 211 | Configure SNMP Manager Via GUI ${SNMP_HOSTNAME} ${SNMP_DEFAULT_PORT} |
Megha G N | cce57cc | 2023-02-15 23:40:15 -0600 | [diff] [blame] | 212 | Wait Until Page Contains ${SNMP_HOSTNAME} timeout=15s |
| 213 | |
| 214 | |
| 215 | Verify Persistency Of SNMP Manager And Trap On BMC Reboot |
| 216 | [Documentation] Configure the SNMP manager and verify that it remains operational |
| 217 | ... after a BMC system reboot. Also, confirm that a trap is successfully sent. |
| 218 | [Tags] Verify_Persistency_Of_SNMP_Manager_And_Trap_On_BMC_Reboot |
| 219 | [Template] Create Error On BMC And Verify Trap On Default Port |
Megha G N | 8caf4a8 | 2023-02-22 01:01:03 -0600 | [diff] [blame] | 220 | [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] | 221 | |
| 222 | # event_log expected_error persistency_check |
| 223 | |
| 224 | # Generate internal failure error. |
| 225 | ${CMD_INTERNAL_FAILURE} ${SNMP_TRAP_BMC_INTERNAL_FAILURE} ${True} |
| 226 | |
| 227 | # Generate timeout error. |
| 228 | ${CMD_FRU_CALLOUT} ${SNMP_TRAP_BMC_CALLOUT_ERROR} ${True} |
| 229 | |
| 230 | # Generate informational error. |
| 231 | ${CMD_INFORMATIONAL_ERROR} ${SNMP_TRAP_BMC_INFORMATIONAL_ERROR} ${True} |
Megha G N | 2a31e51 | 2023-01-18 04:23:20 -0600 | [diff] [blame] | 232 | |
| 233 | |
Megha G N | 789752a | 2023-03-02 05:45:47 -0600 | [diff] [blame] | 234 | Configure SNMP Manager Via GUI And Verify SNMP Trap On Non Default Port |
| 235 | [Documentation] Add SNMP manager via GUI SNMP alerts page, generate error on BMC |
| 236 | ... and verify trap on non default port. |
| 237 | [Tags] Configure_SNMP_Manager_Via_GUI_And_Verify_SNMP_Trap_On_Non_Default_Port |
| 238 | [Template] Generate Error Log On BMC And Verify Trap On Non Default Port |
Megha G N | 97c35d5 | 2023-03-08 03:55:57 -0600 | [diff] [blame] | 239 | [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] | 240 | |
| 241 | # event_log_cmd trap_msg |
| 242 | |
| 243 | # Generate internal failure error. |
| 244 | ${CMD_INTERNAL_FAILURE} ${SNMP_TRAP_BMC_INTERNAL_FAILURE} |
| 245 | |
| 246 | # Generate timeout error. |
| 247 | ${CMD_FRU_CALLOUT} ${SNMP_TRAP_BMC_CALLOUT_ERROR} |
| 248 | |
| 249 | # Generate informational error. |
| 250 | ${CMD_INFORMATIONAL_ERROR} ${SNMP_TRAP_BMC_INFORMATIONAL_ERROR} |
| 251 | |
| 252 | |
meghagn | 62945e2 | 2021-10-04 02:33:17 -0500 | [diff] [blame] | 253 | *** Keywords *** |
| 254 | |
| 255 | Suite Setup Execution |
| 256 | [Documentation] Do test case setup tasks. |
| 257 | |
| 258 | Launch Browser And Login GUI |
| 259 | |
| 260 | Click Element ${xpath_settings_menu} |
| 261 | Click Element ${xpath_snmp_alerts_sub_menu} |
| 262 | 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] | 263 | 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] | 264 | Redfish.Login |
| 265 | |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 266 | |
| 267 | Configure SNMP Manager Via GUI |
| 268 | [Documentation] Configure SNMP manager via GUI. |
| 269 | [Arguments] ${snmp_ip} ${port} |
| 270 | |
| 271 | # Description of argument(s): |
| 272 | # snmp_ip SNMP manager IP address. |
| 273 | # port SNMP manager port. |
| 274 | |
| 275 | Click Element ${xpath_add_destination} |
| 276 | Wait Until Page Contains Element ${xpath_snmp_alert_destination_heading} |
| 277 | Input Text ${xpath_ip_address_input_button} ${snmp_ip} |
| 278 | Wait Until Keyword Succeeds 30 sec 5 sec Get Value ${xpath_ip_address_input_button} |
| 279 | Input Text ${xpath_port_optional_input_button} ${port} |
| 280 | Click Element ${xpath_snmp_add_destination_button} |
| 281 | |
| 282 | |
Megha G N | 8caf4a8 | 2023-02-22 01:01:03 -0600 | [diff] [blame] | 283 | Delete All SNMP Managers Via GUI |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 284 | [Documentation] Delete SNMP manager via GUI. |
| 285 | |
George Keishing | fb1b625 | 2023-03-01 10:10:52 -0600 | [diff] [blame] | 286 | Wait Until Page Contains Element ${xpath_select_all_snmp} timeout=30s |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 287 | Click Element At Coordinates ${xpath_select_all_snmp} 0 0 |
| 288 | Wait Until Keyword Succeeds 30 sec 5 sec Click Element ${xpath_delete_button} |
| 289 | Wait Until Page Contains Delete SNMP alert destination |
| 290 | Click Element ${xpath_delete_destination} |
meghagn | a80e4d4 | 2021-12-14 05:46:15 -0600 | [diff] [blame] | 291 | Wait Until Page Contains Successfully deleted SNMP alert destination timeout=45s |
meghagn | c2436bc | 2021-10-11 03:49:21 -0500 | [diff] [blame] | 292 | 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] | 293 | ... ${xpath_snmp_alerts_heading} ${snmp_page_heading} |
meghagn | d3b19ac | 2021-10-22 01:09:25 -0500 | [diff] [blame] | 294 | |
| 295 | |
| 296 | Configure SNMP Manager On BMC With Invalid Setting Via GUI And Verify |
| 297 | |
| 298 | [Documentation] Configure SNMP manager on BMC with invalid setting via GUI and verify. |
| 299 | [Arguments] ${snmp_manager_ip} ${snmp_manager_port} ${expected_error} |
Megha G N | b9ae25a | 2023-01-27 06:25:00 -0600 | [diff] [blame] | 300 | [Teardown] Close Add SNMP Alerts Destination Window ${expected_error} |
meghagn | d3b19ac | 2021-10-22 01:09:25 -0500 | [diff] [blame] | 301 | |
| 302 | # Description of argument(s): |
| 303 | # snmp_manager_ip SNMP manager IP address. |
| 304 | # snmp_manager_port SNMP manager port. |
| 305 | # expected_error Expected error optionally provided in testcase |
| 306 | # .... (e.g. Invalid format / Value must be between 0 – 65535). |
| 307 | |
| 308 | Configure SNMP Manager Via GUI ${snmp_manager_ip} ${snmp_manager_port} |
Megha G N | 97c35d5 | 2023-03-08 03:55:57 -0600 | [diff] [blame] | 309 | Wait Until Page Contains ${expected_error} timeout=60sec |
meghagn | d3b19ac | 2021-10-22 01:09:25 -0500 | [diff] [blame] | 310 | ${status}= Run Keyword And Return Status |
| 311 | ... Verify SNMP Manager Configured On BMC ${snmp_manager_ip} ${snmp_manager_port} |
| 312 | Should Be Equal As Strings ${status} False |
| 313 | ... msg=BMC is allowing to configure with invalid SNMP settings. |
meghagn | 5a4ddb0 | 2021-11-09 01:49:23 -0600 | [diff] [blame] | 314 | |
| 315 | |
| 316 | Configure Multiple SNMP Managers On BMC With Valid Port Via GUI And Verify |
| 317 | [Documentation] Configure multiple SNMP managers on BMC with valid port value via GUI and verify. |
| 318 | [Arguments] ${snmp_ip_value} ${snmp_port_value} |
Megha G N | 8caf4a8 | 2023-02-22 01:01:03 -0600 | [diff] [blame] | 319 | [Teardown] Delete SNMP Manager Via Redfish ${snmp_ip_value} ${snmp_port_value} |
meghagn | 5a4ddb0 | 2021-11-09 01:49:23 -0600 | [diff] [blame] | 320 | |
| 321 | # Description of argument(s): |
| 322 | # snmp_ip_value SNMP manager IP address. |
| 323 | # snmp_port_value SNMP manager port. |
| 324 | |
| 325 | Configure SNMP Manager Via GUI ${snmp_ip_value} ${snmp_port_value} |
| 326 | Verify SNMP Manager Configured On BMC ${snmp_ip_value} ${snmp_port_value} |
meghagn | 725ccdd | 2022-02-09 04:55:52 -0600 | [diff] [blame] | 327 | |
| 328 | |
| 329 | Create Error On BMC And Verify Trap On Default Port |
| 330 | [Documentation] Generate error on BMC and verify if trap is sent to default port. |
| 331 | [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] | 332 | ... ${persistency_check}=${False} |
meghagn | 725ccdd | 2022-02-09 04:55:52 -0600 | [diff] [blame] | 333 | |
| 334 | # Description of argument(s): |
Megha G N | cce57cc | 2023-02-15 23:40:15 -0600 | [diff] [blame] | 335 | # event_log Event logs to be created. |
| 336 | # expected_error Expected error on SNMP. |
| 337 | # persistency_check Check whether reboot is required or not (e.g. True, False). |
meghagn | 725ccdd | 2022-02-09 04:55:52 -0600 | [diff] [blame] | 338 | |
| 339 | Configure SNMP Manager Via GUI ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
| 340 | |
Megha G N | cce57cc | 2023-02-15 23:40:15 -0600 | [diff] [blame] | 341 | Run Keyword If ${persistency_check} == ${True} |
| 342 | ... Run Keywords Reboot BMC via GUI AND Navigate To SNMP Alerts Page |
| 343 | |
meghagn | 725ccdd | 2022-02-09 04:55:52 -0600 | [diff] [blame] | 344 | Start SNMP Manager |
| 345 | |
| 346 | # Generate error log. |
| 347 | BMC Execute Command ${event_log} |
| 348 | |
| 349 | SSHLibrary.Switch Connection snmp_server |
| 350 | ${SNMP_LISTEN_OUT}= Read delay=1s |
| 351 | |
| 352 | # Stop SNMP manager process. |
| 353 | SSHLibrary.Execute Command sudo killall snmptrapd |
| 354 | |
| 355 | # Sample SNMP trap: |
| 356 | # 2021-06-16 07:05:29 xx.xx.xx.xx [UDP: [xx.xx.xx.xx]:58154->[xx.xx.xx.xx]:xxx]: |
| 357 | # DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (2100473) 5:50:04.73 |
| 358 | # SNMPv2-MIB::snmpTrapOID.0 = OID: SNMPv2-SMI::enterprises.49871.1.0.0.1 |
| 359 | # SNMPv2-SMI::enterprises.49871.1.0.1.1 = Gauge32: 369 SNMPv2-SMI::enterprises.49871.1.0.1.2 = Opaque: |
| 360 | # UInt64: 1397718405502468474 SNMPv2-SMI::enterprises.49871.1.0.1.3 = INTEGER: 3 |
| 361 | # SNMPv2-SMI::enterprises.49871.1.0.1.4 = STRING: "xxx.xx.xx Failure" |
| 362 | |
| 363 | ${lines}= Split To Lines ${SNMP_LISTEN_OUT} |
| 364 | ${trap_info}= Get From List ${lines} -1 |
| 365 | ${snmp_trap}= Split String ${trap_info} \t |
| 366 | |
| 367 | Verify SNMP Trap ${snmp_trap} ${expected_error} |
Megha G N | b9ae25a | 2023-01-27 06:25:00 -0600 | [diff] [blame] | 368 | |
| 369 | |
| 370 | Close Add SNMP Alerts Destination Window |
| 371 | [Documentation] Close Add SNMP Alerts Destination window. |
| 372 | [Arguments] ${expected_error}=${invalid_port_error} |
| 373 | |
| 374 | # Description of argument(s): |
| 375 | # expected_error Expected error on SNMP alerts page. |
| 376 | |
| 377 | Run Keyword If '${expected_error}' == '${invalid_port_error}' |
| 378 | ... Click Element ${xpath_cancel_button} |
| 379 | ... ELSE IF '${expected_error}' == '${invalid_ip_error}' |
| 380 | ... Click Element ${xpath_cancel_button} |
Megha G N | 2a31e51 | 2023-01-18 04:23:20 -0600 | [diff] [blame] | 381 | |
| 382 | |
| 383 | Set DNS Server IP |
| 384 | [Documentation] Add static DNS IP. |
George Keishing | 354091f | 2023-02-09 23:13:01 -0600 | [diff] [blame] | 385 | |
Megha G N | 8caf4a8 | 2023-02-22 01:01:03 -0600 | [diff] [blame] | 386 | Wait Until Page Contains Element ${xpath_settings_menu} timeout=30s |
| 387 | Click Element ${xpath_settings_menu} |
Megha G N | 2a31e51 | 2023-01-18 04:23:20 -0600 | [diff] [blame] | 388 | Click Element ${xpath_network_sub_menu} |
| 389 | Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain network |
| 390 | |
| 391 | Add DNS Servers And Verify ${dns_server} |
Megha G N | cce57cc | 2023-02-15 23:40:15 -0600 | [diff] [blame] | 392 | |
| 393 | |
| 394 | Delete Multiple SNMP Managers With Default Port Via GUI |
| 395 | [Documentation] Delete multiple SNMP managers with default port on BMC via GUI. |
| 396 | [Arguments] ${ip_address_list} |
| 397 | |
| 398 | # Description of argument(s): |
| 399 | # ${ip_address_list} List of IP address. |
| 400 | |
| 401 | FOR ${ip_address} IN @{ip_address_list} |
| 402 | Wait Until Keyword Succeeds 30 sec 10 sec |
| 403 | ... Delete SNMP Manager Via GUI ${ip_address} ${SNMP_DEFAULT_PORT} |
| 404 | END |
| 405 | |
| 406 | |
| 407 | Navigate To SNMP Alerts Page |
| 408 | [Documentation] Navigate to SNMP alerts page. |
| 409 | |
| 410 | Click Element ${xpath_settings_menu} |
| 411 | Click Element ${xpath_snmp_alerts_sub_menu} |
| 412 | 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] | 413 | |
| 414 | |
| 415 | Generate Error Log On BMC And Verify Trap On Non Default Port |
| 416 | [Documentation] Generate error log on BMC and verify if trap is sent to non default port. |
| 417 | [Arguments] ${event_log_cmd} ${trap_msg} |
| 418 | ... ${persistency_check}=${False} |
| 419 | |
| 420 | # Description of argument(s): |
| 421 | # event_log_cmd Event logs to be created. |
| 422 | # trap_msg Expected trap on SNMP. |
| 423 | |
Megha G N | 97c35d5 | 2023-03-08 03:55:57 -0600 | [diff] [blame] | 424 | Configure SNMP Manager Via GUI ${SNMP_MGR1_IP} ${NON_DEFAULT_PORT1} |
Megha G N | 789752a | 2023-03-02 05:45:47 -0600 | [diff] [blame] | 425 | |
| 426 | IF ${persistency_check} == ${True} |
| 427 | Reboot BMC via GUI |
| 428 | Navigate To SNMP Alerts Page |
| 429 | END |
| 430 | |
| 431 | Start SNMP Manager |
| 432 | |
| 433 | # Generate error log. |
| 434 | BMC Execute Command ${event_log_cmd} |
| 435 | |
| 436 | SSHLibrary.Switch Connection snmp_server |
| 437 | ${SNMP_LISTEN_OUT}= Read delay=1s |
| 438 | |
| 439 | # Stop SNMP manager process. |
| 440 | SSHLibrary.Execute Command sudo killall snmptrapd |
| 441 | |
| 442 | # Reference URL for SNMP MIB. |
| 443 | # https://github.com/openbmc/phosphor-snmp/blob/master/mibs/NotificationMIB.txt |
| 444 | |
| 445 | # Sample SNMP trap: |
| 446 | # 2021-06-16 07:05:29 xx.xx.xx.xx [UDP: [xx.xx.xx.xx]:58154->[xx.xx.xx.xx]:xxx]: |
| 447 | # DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (2100473) 5:50:04.73 |
| 448 | # SNMPv2-MIB::snmpTrapOID.0 = OID: SNMPv2-SMI::enterprises.49871.1.0.0.1 |
| 449 | # SNMPv2-SMI::enterprises.49871.1.0.1.1 = Gauge32: 369 SNMPv2-SMI::enterprises.49871.1.0.1.2 = Opaque: |
| 450 | # UInt64: 1397718405502468474 SNMPv2-SMI::enterprises.49871.1.0.1.3 = INTEGER: 3 |
| 451 | # SNMPv2-SMI::enterprises.49871.1.0.1.4 = STRING: "xxx.xx.xx Failure" |
| 452 | |
| 453 | ${snmp_info_list}= Split To Lines ${SNMP_LISTEN_OUT} |
| 454 | ${trap_info}= Get From List ${snmp_info_list} -1 |
| 455 | ${snmp_trap}= Split String ${trap_info} \t |
| 456 | |
| 457 | Verify SNMP Trap ${snmp_trap} ${trap_msg} |