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 | |
George Keishing | ff981cd | 2023-10-12 17:48:08 +0530 | [diff] [blame^] | 13 | Force Tags SNMP_Alerts_Sub_Menu |
| 14 | |
meghagn | 62945e2 | 2021-10-04 02:33:17 -0500 | [diff] [blame] | 15 | *** Variables *** |
| 16 | |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 17 | ${xpath_snmp_alerts_sub_menu} //*[@data-test-id='nav-item-snmp-alerts'] |
rramyasr-in | e71ba07 | 2022-06-13 11:12:06 -0500 | [diff] [blame] | 18 | ${xpath_snmp_alerts_heading} //h1[text()="SNMP alerts"] |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 19 | ${xpath_select_all_snmp} //*[@data-test-id='snmpAlerts-checkbox-selectAll'] |
| 20 | ${xpath_add_destination} //button[contains(text(),'Add destination')] |
| 21 | ${xpath_snmp_alert_destination_heading} //h5[contains(text(),'Add SNMP alert destination')] |
| 22 | ${xpath_ip_address_input_button} //*[@data-test-id='snmpAlerts-input-ipAddress'] |
| 23 | ${xpath_port_optional_input_button} //*[@data-test-id='snmpAlerts-input-port'] |
| 24 | ${xpath_snmp_add_destination_button} //*[@data-test-id='snmpAlerts-button-ok'] |
| 25 | ${xpath_cancel_button} //button[contains(text(),'Cancel')] |
| 26 | ${xpath_delete_button} //*[@data-test-id='snmpAlerts-button-deleteRow-undefined'] |
| 27 | ${xpath_delete_destination} //button[contains(text(),'Delete destination')] |
meghagn | 62945e2 | 2021-10-04 02:33:17 -0500 | [diff] [blame] | 28 | |
Megha GN | c7bcf7c | 2022-08-04 05:30:58 -0500 | [diff] [blame] | 29 | ${snmp_page_heading} SNMP alerts |
| 30 | ${invalid_port_error} Value must be between 0 – 65535 |
| 31 | ${invalid_destination_error} Error in adding SNMP alert destination |
Megha G N | b9ae25a | 2023-01-27 06:25:00 -0600 | [diff] [blame] | 32 | ${invalid_ip_error} Field required |
Megha G N | 2a31e51 | 2023-01-18 04:23:20 -0600 | [diff] [blame] | 33 | ${dns_server} 10.10.10.10 |
Megha GN | c7bcf7c | 2022-08-04 05:30:58 -0500 | [diff] [blame] | 34 | |
meghagn | 62945e2 | 2021-10-04 02:33:17 -0500 | [diff] [blame] | 35 | |
| 36 | *** Test Cases *** |
| 37 | |
| 38 | Verify Navigation To SNMP Alerts Page |
| 39 | [Documentation] Verify navigation to SNMP alerts page. |
| 40 | [Tags] Verify_Navigation_To_SNMP_Alerts_Page |
| 41 | |
| 42 | Page Should Contain Element ${xpath_snmp_alerts_heading} |
| 43 | |
| 44 | |
| 45 | Verify Existence Of All Input Boxes In SNMP Alerts Page |
| 46 | [Documentation] Verify existence of all sections in SNMP alerts page. |
| 47 | [Tags] Verify_Existence_Of_All_Input_Boxes_In_SNMP_Alerts_Page |
| 48 | |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 49 | Page Should Contain Checkbox ${xpath_select_all_snmp} |
meghagn | 62945e2 | 2021-10-04 02:33:17 -0500 | [diff] [blame] | 50 | |
| 51 | |
| 52 | Verify Existence Of All Buttons In SNMP Alerts Page |
| 53 | [Documentation] Verify existence of all buttons in SNMP alerts page. |
| 54 | [Tags] Verify_Existence_Of_All_Buttons_In_SNMP_Alerts_Page |
| 55 | |
| 56 | Page should Contain Button ${xpath_add_destination} |
| 57 | |
| 58 | |
| 59 | Verify Existence Of All Fields In Add Destination |
| 60 | [Documentation] Verify existence of all buttons and fields in add destination page. |
George Keishing | d6a7797 | 2022-01-31 12:50:29 -0600 | [diff] [blame] | 61 | [Tags] Verify_Existence_Of_All_Fields_In_Add_Destination |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 62 | [Teardown] Run Keywords Click Button ${xpath_cancel_button} AND |
| 63 | ... Wait Until Keyword Succeeds 10 sec 5 sec |
Megha GN | c7bcf7c | 2022-08-04 05:30:58 -0500 | [diff] [blame] | 64 | ... Refresh GUI And Verify Element Value ${xpath_snmp_alerts_heading} ${snmp_page_heading} |
meghagn | 62945e2 | 2021-10-04 02:33:17 -0500 | [diff] [blame] | 65 | |
| 66 | Click Element ${xpath_add_destination} |
| 67 | Wait Until Page Contains Element ${xpath_snmp_alert_destination_heading} |
| 68 | Page Should Contain Element ${xpath_ip_address_input_button} |
| 69 | Page Should Contain Element ${xpath_port_optional_input_button} |
| 70 | Page Should Contain Element ${xpath_cancel_button} |
| 71 | Page Should Contain Element ${xpath_snmp_add_destination_button} |
| 72 | |
| 73 | |
George Keishing | d6a7797 | 2022-01-31 12:50:29 -0600 | [diff] [blame] | 74 | Configure SNMP Settings On BMC With Non Default Port Via GUI And Verify |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 75 | [Documentation] Configure SNMP settings on BMC with non default port via GUI and verify. |
| 76 | [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] | 77 | [Teardown] Delete SNMP Manager Via Redfish ${SNMP_MGR1_IP} ${NON_DEFAULT_PORT1} |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 78 | |
| 79 | Configure SNMP Manager Via GUI ${SNMP_MGR1_IP} ${NON_DEFAULT_PORT1} |
| 80 | |
meghagn | a80e4d4 | 2021-12-14 05:46:15 -0600 | [diff] [blame] | 81 | Wait Until Page Contains ${SNMP_MGR1_IP} timeout=45s |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 82 | |
| 83 | 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] | 84 | |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 85 | |
meghagn | c2436bc | 2021-10-11 03:49:21 -0500 | [diff] [blame] | 86 | Configure SNMP Settings On BMC Via GUI And Verify |
| 87 | [Documentation] Configure SNMP settings on BMC via GUI and verify. |
| 88 | [Tags] Configure_SNMP_Settings_On_BMC_Via_GUI_And_Verify |
Megha G N | 8caf4a8 | 2023-02-22 01:01:03 -0600 | [diff] [blame] | 89 | [Teardown] Delete SNMP Manager Via Redfish ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
meghagn | c2436bc | 2021-10-11 03:49:21 -0500 | [diff] [blame] | 90 | |
| 91 | Configure SNMP Manager Via GUI ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
| 92 | |
meghagn | a80e4d4 | 2021-12-14 05:46:15 -0600 | [diff] [blame] | 93 | Wait Until Page Contains ${SNMP_MGR1_IP} timeout=45s |
meghagn | c2436bc | 2021-10-11 03:49:21 -0500 | [diff] [blame] | 94 | |
| 95 | Verify SNMP Manager Configured On BMC ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
| 96 | |
| 97 | |
meghagn | d3b19ac | 2021-10-22 01:09:25 -0500 | [diff] [blame] | 98 | Configure SNMP Settings On BMC With Empty Port Via GUI And Verify |
| 99 | [Documentation] Configure SNMP settings on BMC with empty port via GUI and verify. |
| 100 | [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] | 101 | [Teardown] Delete SNMP Manager Via Redfish ${SNMP_MGR1_IP} ${empty_port} |
meghagn | d3b19ac | 2021-10-22 01:09:25 -0500 | [diff] [blame] | 102 | |
| 103 | Configure SNMP Manager Via GUI ${SNMP_MGR1_IP} ${empty_port} |
| 104 | |
meghagn | a80e4d4 | 2021-12-14 05:46:15 -0600 | [diff] [blame] | 105 | Wait Until Page Contains ${SNMP_MGR1_IP} timeout=45s |
meghagn | d3b19ac | 2021-10-22 01:09:25 -0500 | [diff] [blame] | 106 | |
| 107 | # SNMP Manager IP is set with default port number when no port number is provided. |
| 108 | Verify SNMP Manager Configured On BMC ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
| 109 | |
| 110 | |
| 111 | Configure Invalid SNMP Settings On BMC Via GUI And Verify |
| 112 | |
| 113 | [Documentation] Configure invalid SNMP settings on BMC via GUI and verify. |
| 114 | [Tags] Configure_Invalid_SNMP_Settings_On_BMC_Via_GUI_And_Verify |
| 115 | [Template] Configure SNMP Manager On BMC With Invalid Setting Via GUI And Verify |
| 116 | |
| 117 | # snmp_manager_ip snmp_manager_port Expected status |
Megha GN | c7bcf7c | 2022-08-04 05:30:58 -0500 | [diff] [blame] | 118 | ${SNMP_MGR1_IP} ${out_of_range_port} ${invalid_port_error} |
| 119 | ${SNMP_MGR1_IP} ${alpha_port} ${invalid_port_error} |
| 120 | ${SNMP_MGR1_IP} ${negative_port} ${invalid_port_error} |
Megha G N | 999964d | 2022-12-06 04:38:10 -0600 | [diff] [blame] | 121 | ${SNMP_MGR1_IP} ${alphanumeric_port} ${invalid_port_error} |
Megha G N | b9ae25a | 2023-01-27 06:25:00 -0600 | [diff] [blame] | 122 | ${empty_ip} ${NON_DEFAULT_PORT1} ${invalid_ip_error} |
Megha GN | c7bcf7c | 2022-08-04 05:30:58 -0500 | [diff] [blame] | 123 | ${out_of_range_ip} ${NON_DEFAULT_PORT1} ${invalid_destination_error} |
| 124 | ${alpha_ip} ${NON_DEFAULT_PORT1} ${invalid_destination_error} |
Megha G N | 999964d | 2022-12-06 04:38:10 -0600 | [diff] [blame] | 125 | ${negative_ip} ${NON_DEFAULT_PORT1} ${invalid_destination_error} |
Megha G N | 2b98bc0 | 2023-01-20 02:01:48 -0600 | [diff] [blame] | 126 | ${less_octet_ip} ${NON_DEFAULT_PORT1} ${invalid_destination_error} |
meghagn | d3b19ac | 2021-10-22 01:09:25 -0500 | [diff] [blame] | 127 | |
| 128 | |
meghagn | 5a4ddb0 | 2021-11-09 01:49:23 -0600 | [diff] [blame] | 129 | Configure Multiple SNMP Managers On BMC Via GUI And Verify |
| 130 | [Documentation] Configure multiple SNMP managers on BMC via GUI and verify. |
George Keishing | d6a7797 | 2022-01-31 12:50:29 -0600 | [diff] [blame] | 131 | [Tags] Configure_Multiple_SNMP_Managers_On_BMC_Via_GUI_And_Verify |
meghagn | 5a4ddb0 | 2021-11-09 01:49:23 -0600 | [diff] [blame] | 132 | [Template] Configure Multiple SNMP Managers On BMC With Valid Port Via GUI And Verify |
| 133 | |
| 134 | # snmp_manager_ip snmp_port |
| 135 | ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
| 136 | ${SNMP_MGR2_IP} ${SNMP_DEFAULT_PORT} |
| 137 | |
| 138 | |
| 139 | Configure Multiple SNMP Managers With Non Default Port Via GUI And Verify |
| 140 | [Documentation] Configure multiple SNMP managers with non-default port via GUI and verify. |
| 141 | [Tags] Configure_Multiple_SNMP_Managers_With_Non_Default_Port_Via_GUI_And_Verify |
| 142 | [Template] Configure Multiple SNMP Managers On BMC With Valid Port Via GUI And Verify |
| 143 | |
| 144 | # snmp_manager_ip snmp_port |
| 145 | ${SNMP_MGR1_IP} ${NON_DEFAULT_PORT1} |
| 146 | ${SNMP_MGR2_IP} ${NON_DEFAULT_PORT1} |
| 147 | |
| 148 | |
| 149 | Configure Multiple SNMP Managers With Different Ports Via GUI And Verify |
| 150 | [Documentation] Configure multiple SNMP managers with different ports via GUI and verify. |
| 151 | [Tags] Configure_Multiple_SNMP_Managers_With_Different_Ports_Via_GUI_And_Verify |
| 152 | [Template] Configure Multiple SNMP Managers On BMC With Valid Port Via GUI And Verify |
| 153 | |
| 154 | # snmp_manager_ip snmp_port |
| 155 | ${SNMP_MGR1_IP} ${NON_DEFAULT_PORT1} |
| 156 | ${SNMP_MGR2_IP} ${SNMP_DEFAULT_PORT} |
| 157 | ${SNMP_MGR3_IP} ${NON_DEFAULT_PORT2} |
| 158 | |
| 159 | |
meghagn | fe16be9 | 2022-01-28 05:50:19 -0600 | [diff] [blame] | 160 | Configure Multiple SNMP Managers On BMC Via GUI And Verify Persistency On BMC Reboot |
| 161 | [Documentation] Login GUI SNMP alerts page and |
| 162 | ... add multiple SNMP Managers on BMC via GUI and verify persistency on BMC reboot. |
| 163 | [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] | 164 | [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] | 165 | ... AND Delete SNMP Manager Via Redfish ${SNMP_MGR2_IP} ${SNMP_DEFAULT_PORT} |
meghagn | fe16be9 | 2022-01-28 05:50:19 -0600 | [diff] [blame] | 166 | |
Megha G N | cce57cc | 2023-02-15 23:40:15 -0600 | [diff] [blame] | 167 | ${ip_address_list}= Create list ${SNMP_MGR1_IP} ${SNMP_MGR2_IP} |
meghagn | fe16be9 | 2022-01-28 05:50:19 -0600 | [diff] [blame] | 168 | Configure SNMP Manager Via GUI ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
| 169 | Wait Until Page Contains ${SNMP_MGR1_IP} timeout=45s |
| 170 | |
| 171 | Configure SNMP Manager Via GUI ${SNMP_MGR2_IP} ${SNMP_DEFAULT_PORT} |
| 172 | Wait Until Page Contains ${SNMP_MGR2_IP} timeout=45s |
| 173 | |
| 174 | # Reboot BMC and check persistency SNMP manager. |
| 175 | Reboot BMC via GUI |
| 176 | |
Megha G N | cce57cc | 2023-02-15 23:40:15 -0600 | [diff] [blame] | 177 | Navigate To SNMP Alerts Page |
Megha G N | 8caf4a8 | 2023-02-22 01:01:03 -0600 | [diff] [blame] | 178 | |
meghagn | fe16be9 | 2022-01-28 05:50:19 -0600 | [diff] [blame] | 179 | Verify SNMP Manager Configured On BMC ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
| 180 | Verify SNMP Manager Configured On BMC ${SNMP_MGR2_IP} ${SNMP_DEFAULT_PORT} |
| 181 | |
| 182 | |
meghagn | 725ccdd | 2022-02-09 04:55:52 -0600 | [diff] [blame] | 183 | Configure SNMP Manager Via GUI And Verify SNMP Trap |
| 184 | [Documentation] Login GUI SNMP alerts page and add SNMP manager via GUI |
| 185 | ... and generate error on BMC and verify trap and its fields. |
| 186 | [Tags] Configure_SNMP_Manager_Via_GUI_And_Verify_SNMP_Trap |
| 187 | [Template] Create Error On BMC And Verify Trap On 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 | 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 | 789752a | 2023-03-02 05:45:47 -0600 | [diff] [blame] | 239 | |
| 240 | # event_log_cmd trap_msg |
| 241 | |
| 242 | # Generate internal failure error. |
| 243 | ${CMD_INTERNAL_FAILURE} ${SNMP_TRAP_BMC_INTERNAL_FAILURE} |
| 244 | |
| 245 | # Generate timeout error. |
| 246 | ${CMD_FRU_CALLOUT} ${SNMP_TRAP_BMC_CALLOUT_ERROR} |
| 247 | |
| 248 | # Generate informational error. |
| 249 | ${CMD_INFORMATIONAL_ERROR} ${SNMP_TRAP_BMC_INFORMATIONAL_ERROR} |
| 250 | |
| 251 | |
Megha G N | 74beeb0 | 2023-05-02 02:00:44 -0500 | [diff] [blame] | 252 | Configure Multiple SNMP Managers Via GUI And Verify SNMP Trap |
| 253 | [Documentation] Configure multiple SNMP Managers on BMC via GUI and check trap. |
| 254 | [Tags] Configure_Multiple_SNMP_Managers_Via_GUI_And_Verify_SNMP_Trap |
| 255 | [Teardown] Run Keywords Delete SNMP Manager Via Redfish ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
| 256 | ... AND Delete SNMP Manager Via Redfish ${SNMP_MGR2_IP} ${NON_DEFAULT_PORT1} |
| 257 | |
| 258 | Configure SNMP Manager Via GUI ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
| 259 | Configure SNMP Manager Via GUI ${SNMP_MGR2_IP} ${NON_DEFAULT_PORT1} |
| 260 | |
| 261 | # Check if trap is generated and sent to SNMP managers those are configured. |
| 262 | |
| 263 | Create Error Log On BMC And Verify Trap ${CMD_INTERNAL_FAILURE} ${SNMP_TRAP_BMC_INTERNAL_FAILURE} |
| 264 | |
| 265 | |
meghagn | 62945e2 | 2021-10-04 02:33:17 -0500 | [diff] [blame] | 266 | *** Keywords *** |
| 267 | |
| 268 | Suite Setup Execution |
| 269 | [Documentation] Do test case setup tasks. |
| 270 | |
| 271 | Launch Browser And Login GUI |
| 272 | |
| 273 | Click Element ${xpath_settings_menu} |
| 274 | Click Element ${xpath_snmp_alerts_sub_menu} |
| 275 | 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] | 276 | 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] | 277 | Redfish.Login |
| 278 | |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 279 | |
| 280 | Configure SNMP Manager Via GUI |
| 281 | [Documentation] Configure SNMP manager via GUI. |
| 282 | [Arguments] ${snmp_ip} ${port} |
| 283 | |
| 284 | # Description of argument(s): |
| 285 | # snmp_ip SNMP manager IP address. |
| 286 | # port SNMP manager port. |
| 287 | |
| 288 | Click Element ${xpath_add_destination} |
| 289 | Wait Until Page Contains Element ${xpath_snmp_alert_destination_heading} |
| 290 | Input Text ${xpath_ip_address_input_button} ${snmp_ip} |
| 291 | Wait Until Keyword Succeeds 30 sec 5 sec Get Value ${xpath_ip_address_input_button} |
| 292 | Input Text ${xpath_port_optional_input_button} ${port} |
| 293 | Click Element ${xpath_snmp_add_destination_button} |
| 294 | |
| 295 | |
Megha G N | 8caf4a8 | 2023-02-22 01:01:03 -0600 | [diff] [blame] | 296 | Delete All SNMP Managers Via GUI |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 297 | [Documentation] Delete SNMP manager via GUI. |
| 298 | |
George Keishing | fb1b625 | 2023-03-01 10:10:52 -0600 | [diff] [blame] | 299 | Wait Until Page Contains Element ${xpath_select_all_snmp} timeout=30s |
meghagn | 705c364 | 2021-10-12 04:14:02 -0500 | [diff] [blame] | 300 | Click Element At Coordinates ${xpath_select_all_snmp} 0 0 |
| 301 | Wait Until Keyword Succeeds 30 sec 5 sec Click Element ${xpath_delete_button} |
| 302 | Wait Until Page Contains Delete SNMP alert destination |
| 303 | Click Element ${xpath_delete_destination} |
meghagn | a80e4d4 | 2021-12-14 05:46:15 -0600 | [diff] [blame] | 304 | Wait Until Page Contains Successfully deleted SNMP alert destination timeout=45s |
meghagn | c2436bc | 2021-10-11 03:49:21 -0500 | [diff] [blame] | 305 | 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] | 306 | ... ${xpath_snmp_alerts_heading} ${snmp_page_heading} |
meghagn | d3b19ac | 2021-10-22 01:09:25 -0500 | [diff] [blame] | 307 | |
| 308 | |
| 309 | Configure SNMP Manager On BMC With Invalid Setting Via GUI And Verify |
| 310 | |
| 311 | [Documentation] Configure SNMP manager on BMC with invalid setting via GUI and verify. |
| 312 | [Arguments] ${snmp_manager_ip} ${snmp_manager_port} ${expected_error} |
Megha G N | b9ae25a | 2023-01-27 06:25:00 -0600 | [diff] [blame] | 313 | [Teardown] Close Add SNMP Alerts Destination Window ${expected_error} |
meghagn | d3b19ac | 2021-10-22 01:09:25 -0500 | [diff] [blame] | 314 | |
| 315 | # Description of argument(s): |
| 316 | # snmp_manager_ip SNMP manager IP address. |
| 317 | # snmp_manager_port SNMP manager port. |
| 318 | # expected_error Expected error optionally provided in testcase |
| 319 | # .... (e.g. Invalid format / Value must be between 0 – 65535). |
| 320 | |
| 321 | Configure SNMP Manager Via GUI ${snmp_manager_ip} ${snmp_manager_port} |
Megha G N | 97c35d5 | 2023-03-08 03:55:57 -0600 | [diff] [blame] | 322 | Wait Until Page Contains ${expected_error} timeout=60sec |
meghagn | d3b19ac | 2021-10-22 01:09:25 -0500 | [diff] [blame] | 323 | ${status}= Run Keyword And Return Status |
| 324 | ... Verify SNMP Manager Configured On BMC ${snmp_manager_ip} ${snmp_manager_port} |
| 325 | Should Be Equal As Strings ${status} False |
| 326 | ... msg=BMC is allowing to configure with invalid SNMP settings. |
meghagn | 5a4ddb0 | 2021-11-09 01:49:23 -0600 | [diff] [blame] | 327 | |
| 328 | |
| 329 | Configure Multiple SNMP Managers On BMC With Valid Port Via GUI And Verify |
| 330 | [Documentation] Configure multiple SNMP managers on BMC with valid port value via GUI and verify. |
| 331 | [Arguments] ${snmp_ip_value} ${snmp_port_value} |
Megha G N | 8caf4a8 | 2023-02-22 01:01:03 -0600 | [diff] [blame] | 332 | [Teardown] Delete SNMP Manager Via Redfish ${snmp_ip_value} ${snmp_port_value} |
meghagn | 5a4ddb0 | 2021-11-09 01:49:23 -0600 | [diff] [blame] | 333 | |
| 334 | # Description of argument(s): |
| 335 | # snmp_ip_value SNMP manager IP address. |
| 336 | # snmp_port_value SNMP manager port. |
| 337 | |
| 338 | Configure SNMP Manager Via GUI ${snmp_ip_value} ${snmp_port_value} |
| 339 | Verify SNMP Manager Configured On BMC ${snmp_ip_value} ${snmp_port_value} |
meghagn | 725ccdd | 2022-02-09 04:55:52 -0600 | [diff] [blame] | 340 | |
| 341 | |
| 342 | Create Error On BMC And Verify Trap On Default Port |
| 343 | [Documentation] Generate error on BMC and verify if trap is sent to default port. |
| 344 | [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] | 345 | ... ${persistency_check}=${False} |
Megha G N | 1ea505e | 2023-03-16 05:24:10 -0500 | [diff] [blame] | 346 | [Teardown] Delete SNMP Manager Via Redfish ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
meghagn | 725ccdd | 2022-02-09 04:55:52 -0600 | [diff] [blame] | 347 | |
| 348 | # Description of argument(s): |
Megha G N | cce57cc | 2023-02-15 23:40:15 -0600 | [diff] [blame] | 349 | # event_log Event logs to be created. |
| 350 | # expected_error Expected error on SNMP. |
| 351 | # persistency_check Check whether reboot is required or not (e.g. True, False). |
meghagn | 725ccdd | 2022-02-09 04:55:52 -0600 | [diff] [blame] | 352 | |
| 353 | Configure SNMP Manager Via GUI ${SNMP_MGR1_IP} ${SNMP_DEFAULT_PORT} |
| 354 | |
Megha G N | a5a2e2f | 2023-04-20 04:01:13 -0500 | [diff] [blame] | 355 | IF ${persistency_check} == ${True} |
| 356 | Reboot BMC via GUI |
| 357 | Navigate To SNMP Alerts Page |
| 358 | Open Connection And Log In ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} |
| 359 | END |
Megha G N | cce57cc | 2023-02-15 23:40:15 -0600 | [diff] [blame] | 360 | |
meghagn | 725ccdd | 2022-02-09 04:55:52 -0600 | [diff] [blame] | 361 | Start SNMP Manager |
| 362 | |
| 363 | # Generate error log. |
| 364 | BMC Execute Command ${event_log} |
| 365 | |
| 366 | SSHLibrary.Switch Connection snmp_server |
| 367 | ${SNMP_LISTEN_OUT}= Read delay=1s |
| 368 | |
| 369 | # Stop SNMP manager process. |
| 370 | SSHLibrary.Execute Command sudo killall snmptrapd |
| 371 | |
| 372 | # Sample SNMP trap: |
| 373 | # 2021-06-16 07:05:29 xx.xx.xx.xx [UDP: [xx.xx.xx.xx]:58154->[xx.xx.xx.xx]:xxx]: |
| 374 | # DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (2100473) 5:50:04.73 |
| 375 | # SNMPv2-MIB::snmpTrapOID.0 = OID: SNMPv2-SMI::enterprises.49871.1.0.0.1 |
| 376 | # SNMPv2-SMI::enterprises.49871.1.0.1.1 = Gauge32: 369 SNMPv2-SMI::enterprises.49871.1.0.1.2 = Opaque: |
| 377 | # UInt64: 1397718405502468474 SNMPv2-SMI::enterprises.49871.1.0.1.3 = INTEGER: 3 |
| 378 | # SNMPv2-SMI::enterprises.49871.1.0.1.4 = STRING: "xxx.xx.xx Failure" |
| 379 | |
| 380 | ${lines}= Split To Lines ${SNMP_LISTEN_OUT} |
| 381 | ${trap_info}= Get From List ${lines} -1 |
| 382 | ${snmp_trap}= Split String ${trap_info} \t |
| 383 | |
| 384 | Verify SNMP Trap ${snmp_trap} ${expected_error} |
Megha G N | b9ae25a | 2023-01-27 06:25:00 -0600 | [diff] [blame] | 385 | |
| 386 | |
| 387 | Close Add SNMP Alerts Destination Window |
| 388 | [Documentation] Close Add SNMP Alerts Destination window. |
| 389 | [Arguments] ${expected_error}=${invalid_port_error} |
| 390 | |
| 391 | # Description of argument(s): |
| 392 | # expected_error Expected error on SNMP alerts page. |
| 393 | |
| 394 | Run Keyword If '${expected_error}' == '${invalid_port_error}' |
| 395 | ... Click Element ${xpath_cancel_button} |
| 396 | ... ELSE IF '${expected_error}' == '${invalid_ip_error}' |
| 397 | ... Click Element ${xpath_cancel_button} |
Megha G N | 2a31e51 | 2023-01-18 04:23:20 -0600 | [diff] [blame] | 398 | |
| 399 | |
| 400 | Set DNS Server IP |
| 401 | [Documentation] Add static DNS IP. |
George Keishing | 354091f | 2023-02-09 23:13:01 -0600 | [diff] [blame] | 402 | |
Megha G N | 8caf4a8 | 2023-02-22 01:01:03 -0600 | [diff] [blame] | 403 | Wait Until Page Contains Element ${xpath_settings_menu} timeout=30s |
| 404 | Click Element ${xpath_settings_menu} |
Megha G N | 2a31e51 | 2023-01-18 04:23:20 -0600 | [diff] [blame] | 405 | Click Element ${xpath_network_sub_menu} |
| 406 | Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain network |
| 407 | |
| 408 | Add DNS Servers And Verify ${dns_server} |
Megha G N | cce57cc | 2023-02-15 23:40:15 -0600 | [diff] [blame] | 409 | |
| 410 | |
| 411 | Delete Multiple SNMP Managers With Default Port Via GUI |
| 412 | [Documentation] Delete multiple SNMP managers with default port on BMC via GUI. |
| 413 | [Arguments] ${ip_address_list} |
| 414 | |
| 415 | # Description of argument(s): |
| 416 | # ${ip_address_list} List of IP address. |
| 417 | |
| 418 | FOR ${ip_address} IN @{ip_address_list} |
| 419 | Wait Until Keyword Succeeds 30 sec 10 sec |
| 420 | ... Delete SNMP Manager Via GUI ${ip_address} ${SNMP_DEFAULT_PORT} |
| 421 | END |
| 422 | |
| 423 | |
| 424 | Navigate To SNMP Alerts Page |
| 425 | [Documentation] Navigate to SNMP alerts page. |
| 426 | |
| 427 | Click Element ${xpath_settings_menu} |
| 428 | Click Element ${xpath_snmp_alerts_sub_menu} |
| 429 | 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] | 430 | |
| 431 | |
| 432 | Generate Error Log On BMC And Verify Trap On Non Default Port |
| 433 | [Documentation] Generate error log on BMC and verify if trap is sent to non default port. |
| 434 | [Arguments] ${event_log_cmd} ${trap_msg} |
| 435 | ... ${persistency_check}=${False} |
Megha G N | 1ea505e | 2023-03-16 05:24:10 -0500 | [diff] [blame] | 436 | [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] | 437 | |
| 438 | # Description of argument(s): |
| 439 | # event_log_cmd Event logs to be created. |
| 440 | # trap_msg Expected trap on SNMP. |
| 441 | |
Megha G N | 97c35d5 | 2023-03-08 03:55:57 -0600 | [diff] [blame] | 442 | Configure SNMP Manager Via GUI ${SNMP_MGR1_IP} ${NON_DEFAULT_PORT1} |
Megha G N | 789752a | 2023-03-02 05:45:47 -0600 | [diff] [blame] | 443 | |
| 444 | IF ${persistency_check} == ${True} |
| 445 | Reboot BMC via GUI |
| 446 | Navigate To SNMP Alerts Page |
Megha G N | a5a2e2f | 2023-04-20 04:01:13 -0500 | [diff] [blame] | 447 | Open Connection And Log In ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} |
Megha G N | 789752a | 2023-03-02 05:45:47 -0600 | [diff] [blame] | 448 | END |
| 449 | |
Megha G N | a5a2e2f | 2023-04-20 04:01:13 -0500 | [diff] [blame] | 450 | Start SNMP Manager On Specific Port ${SNMP_MGR1_IP} ${NON_DEFAULT_PORT1} |
Megha G N | 789752a | 2023-03-02 05:45:47 -0600 | [diff] [blame] | 451 | |
| 452 | # Generate error log. |
| 453 | BMC Execute Command ${event_log_cmd} |
| 454 | |
| 455 | SSHLibrary.Switch Connection snmp_server |
| 456 | ${SNMP_LISTEN_OUT}= Read delay=1s |
| 457 | |
| 458 | # Stop SNMP manager process. |
| 459 | SSHLibrary.Execute Command sudo killall snmptrapd |
| 460 | |
| 461 | # Reference URL for SNMP MIB. |
| 462 | # https://github.com/openbmc/phosphor-snmp/blob/master/mibs/NotificationMIB.txt |
| 463 | |
| 464 | # Sample SNMP trap: |
| 465 | # 2021-06-16 07:05:29 xx.xx.xx.xx [UDP: [xx.xx.xx.xx]:58154->[xx.xx.xx.xx]:xxx]: |
| 466 | # DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (2100473) 5:50:04.73 |
| 467 | # SNMPv2-MIB::snmpTrapOID.0 = OID: SNMPv2-SMI::enterprises.49871.1.0.0.1 |
| 468 | # SNMPv2-SMI::enterprises.49871.1.0.1.1 = Gauge32: 369 SNMPv2-SMI::enterprises.49871.1.0.1.2 = Opaque: |
| 469 | # UInt64: 1397718405502468474 SNMPv2-SMI::enterprises.49871.1.0.1.3 = INTEGER: 3 |
| 470 | # SNMPv2-SMI::enterprises.49871.1.0.1.4 = STRING: "xxx.xx.xx Failure" |
| 471 | |
| 472 | ${snmp_info_list}= Split To Lines ${SNMP_LISTEN_OUT} |
| 473 | ${trap_info}= Get From List ${snmp_info_list} -1 |
| 474 | ${snmp_trap}= Split String ${trap_info} \t |
| 475 | |
| 476 | Verify SNMP Trap ${snmp_trap} ${trap_msg} |
Megha G N | 74beeb0 | 2023-05-02 02:00:44 -0500 | [diff] [blame] | 477 | |
| 478 | |
| 479 | Create Error Log On BMC And Verify Trap |
| 480 | [Documentation] Generate error on BMC |
| 481 | ... and check whether the trap is sent to all those are configured. |
| 482 | [Arguments] ${event_log_cmd} ${trap_msg} |
| 483 | |
| 484 | # Description of argument(s): |
| 485 | # event_log_cmd Command to generate error log. |
| 486 | # trap_msg Expected trap on SNMP. |
| 487 | |
| 488 | Start Multiple SNMP Managers On Specific Port |
| 489 | |
| 490 | # Generate error log. |
| 491 | BMC Execute Command ${event_log_cmd} |
| 492 | |
| 493 | ${alias}= Create List snmp_server1 snmp_server2 |
| 494 | |
| 495 | FOR ${snmp_server} IN @{alias} |
| 496 | SSHLibrary.Switch Connection ${snmp_server} |
| 497 | |
| 498 | ${SNMP_LISTEN_OUT}= Read delay=1s |
| 499 | |
| 500 | # Stop SNMP manager process. |
| 501 | SSHLibrary.Execute Command sudo killall snmptrapd |
| 502 | |
| 503 | # Sample SNMP trap: |
| 504 | # 2021-06-16 07:05:29 xx.xx.xx.xx [UDP: [xx.xx.xx.xx]:58154->[xx.xx.xx.xx]:xxx]: |
| 505 | # DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (2100473) 5:50:04.73 |
| 506 | # SNMPv2-MIB::snmpTrapOID.0 = OID: SNMPv2-SMI::enterprises.49871.1.0.0.1 |
| 507 | # SNMPv2-SMI::enterprises.49871.1.0.1.1 = Gauge32: 369 |
| 508 | # SNMPv2-SMI::enterprises.49871.1.0.1.2 = Opaque: |
| 509 | # UInt64: 1397718405502468474 SNMPv2-SMI::enterprises.49871.1.0.1.3 = INTEGER: 3 |
| 510 | # SNMPv2-SMI::enterprises.49871.1.0.1.4 = STRING: "xxx.xx.xx Failure" |
| 511 | |
| 512 | ${lines}= Split To Lines ${SNMP_LISTEN_OUT} |
| 513 | ${trap_info}= Get From List ${lines} -1 |
| 514 | ${snmp_trap}= Split String ${trap_info} \t |
| 515 | |
| 516 | Verify SNMP Trap ${snmp_trap} ${trap_msg} |
| 517 | END |
| 518 | |
| 519 | |
| 520 | Start Multiple SNMP Managers On Specific Port |
| 521 | [Documentation] Start multiple SNMP managers on specific port. |
| 522 | |
| 523 | Open Connection And Log In ${SNMP_MGR1_USERNAME} ${SNMP_MGR1_PASSWORD} |
| 524 | ... alias=snmp_server1 host=${SNMP_MGR1_IP} |
| 525 | |
| 526 | SSHLibrary.write ${SNMP_TRAPD_CMD} ${SNMP_MGR1_IP}:${SNMP_DEFAULT_PORT} & |
| 527 | |
| 528 | Open Connection And Log In ${SNMP_MGR2_USERNAME} ${SNMP_MGR2_PASSWORD} |
| 529 | ... alias=snmp_server2 host=${SNMP_MGR2_IP} |
| 530 | |
| 531 | # The execution of the SNMP_TRAPD_CMD is necessary to cause SNMP to begin |
| 532 | # listening to SNMP messages. |
| 533 | SSHLibrary.write ${SNMP_TRAPD_CMD} ${SNMP_MGR2_IP}:${NON_DEFAULT_PORT1} & |