Prashanth Katti | c8bfc36 | 2019-09-03 07:40:43 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Network stack stress tests using "nping" tool. |
| 3 | |
shrsuman123 | c1a260c | 2022-02-01 03:38:56 -0600 | [diff] [blame] | 4 | # This Suite has few testcases which uses nping with ICMP. |
| 5 | # ICMP creates a raw socket, which requires root privilege/sudo to run tests. |
| 6 | |
Prashanth Katti | c8bfc36 | 2019-09-03 07:40:43 -0500 | [diff] [blame] | 7 | Resource ../lib/resource.robot |
Prashanth Katti | 2f80bf1 | 2021-06-17 07:43:25 -0500 | [diff] [blame] | 8 | Resource ../lib/bmc_redfish_resource.robot |
| 9 | Resource ../lib/ipmi_client.robot |
Prashanth Katti | 1da8826 | 2022-02-21 05:09:45 -0600 | [diff] [blame] | 10 | Resource ../lib/bmc_network_security_utils.robot |
George Keishing | 369a0dc | 2023-04-05 10:27:42 +0530 | [diff] [blame^] | 11 | Resource ../lib/protocol_setting_utils.robot |
Prashanth Katti | c8bfc36 | 2019-09-03 07:40:43 -0500 | [diff] [blame] | 12 | |
| 13 | Library OperatingSystem |
| 14 | Library String |
| 15 | Library ../lib/gen_robot_valid.py |
| 16 | Library ../lib/bmc_network_utils.py |
Prashanth Katti | 2f80bf1 | 2021-06-17 07:43:25 -0500 | [diff] [blame] | 17 | Library ../lib/ipmi_utils.py |
Prashanth Katti | c8bfc36 | 2019-09-03 07:40:43 -0500 | [diff] [blame] | 18 | |
| 19 | Suite Setup Suite Setup Execution |
| 20 | |
| 21 | Force Tags Network_Nping |
| 22 | |
| 23 | *** Variables *** |
| 24 | |
| 25 | ${delay} 1000ms |
| 26 | ${count} 4 |
| 27 | ${program_name} nping |
Prashanth Katti | 2f80bf1 | 2021-06-17 07:43:25 -0500 | [diff] [blame] | 28 | ${iterations} 5000 |
Prashanth Katti | c8bfc36 | 2019-09-03 07:40:43 -0500 | [diff] [blame] | 29 | |
| 30 | *** Test Cases *** |
| 31 | |
| 32 | Send ICMP Timestamp Request |
| 33 | [Documentation] Send ICMP packet type 13 and check BMC drops such packets |
| 34 | [Tags] Send_ICMP_Timestamp_Request |
| 35 | |
| 36 | # Send ICMP packet type 13 to BMC and check packet loss. |
| 37 | ${packet_loss}= Send Network Packets And Get Packet Loss |
| 38 | ... ${OPENBMC_HOST} ${count} ${ICMP_PACKETS} ${NETWORK_PORT} ${ICMP_TIMESTAMP_REQUEST} |
| 39 | Should Be Equal As Numbers ${packet_loss} 100.00 |
| 40 | ... msg=FAILURE: BMC is not dropping timestamp request messages. |
| 41 | |
| 42 | Send ICMP Netmask Request |
| 43 | [Documentation] Send ICMP packet type 17 and check BMC drops such packets |
| 44 | [Tags] Send_ICMP_Netmask_Request |
| 45 | |
| 46 | # Send ICMP packet type 17 to BMC and check packet loss. |
| 47 | ${packet_loss}= Send Network Packets And Get Packet Loss |
| 48 | ... ${OPENBMC_HOST} ${count} ${ICMP_PACKETS} ${NETWORK_PORT} ${ICMP_NETMASK_REQUEST} |
| 49 | Should Be Equal As Numbers ${packet_loss} 100.00 |
| 50 | ... msg=FAILURE: BMC is not dropping netmask request messages. |
| 51 | |
shrsuman123 | c1a260c | 2022-02-01 03:38:56 -0600 | [diff] [blame] | 52 | Send Continuous ICMP Echo Request To BMC And Verify No Packet Loss |
| 53 | [Documentation] Send ICMP packet type 8 continuously and check no packets are dropped from BMC |
| 54 | [Tags] Send_Continuous_ICMP_Echo_Request_To_BMC_And_Verify_No_Packet_Loss |
| 55 | |
| 56 | # Send ICMP packet type 8 to BMC and check packet loss. |
| 57 | ${packet_loss}= Send Network Packets And Get Packet Loss |
| 58 | ... ${OPENBMC_HOST} ${iterations} ${ICMP_PACKETS} |
| 59 | Should Be Equal As Numbers ${packet_loss} 0.0 |
| 60 | ... msg=FAILURE: BMC is dropping packets. |
| 61 | |
Prashanth Katti | c8bfc36 | 2019-09-03 07:40:43 -0500 | [diff] [blame] | 62 | Send Network Packets Continuously To Redfish Interface |
| 63 | [Documentation] Send network packets continuously to Redfish interface and verify stability. |
| 64 | [Tags] Send_Network_Packets_Continuously_To_Redfish_Interface |
| 65 | |
| 66 | # Send large number of packets to Redfish interface. |
| 67 | ${packet_loss}= Send Network Packets And Get Packet Loss |
Prashanth Katti | 2f80bf1 | 2021-06-17 07:43:25 -0500 | [diff] [blame] | 68 | ... ${OPENBMC_HOST} ${iterations} ${TCP_PACKETS} ${REDFISH_INTERFACE} |
Prashanth Katti | b18762b | 2021-06-21 07:55:52 -0500 | [diff] [blame] | 69 | Should Be Equal As Numbers ${packet_loss} 0.0 |
Prashanth Katti | c8bfc36 | 2019-09-03 07:40:43 -0500 | [diff] [blame] | 70 | ... msg=FAILURE: BMC is dropping some packets. |
| 71 | |
Priya Sinha | 25163b8 | 2023-02-24 05:35:22 -0600 | [diff] [blame] | 72 | # Check if Redfish bmcweb server response is functional. |
Prashanth Katti | c8bfc36 | 2019-09-03 07:40:43 -0500 | [diff] [blame] | 73 | Redfish.Login |
| 74 | Redfish.Logout |
| 75 | |
Prashanth Katti | 2f80bf1 | 2021-06-17 07:43:25 -0500 | [diff] [blame] | 76 | |
| 77 | Send Network Packets Continuously To IPMI Port |
| 78 | [Documentation] Send network packets continuously to IPMI port and verify stability. |
| 79 | [Tags] Send_Network_Packets_Continuously_To_IPMI_Port |
| 80 | |
| 81 | # Send large number of packets to IPMI port. |
| 82 | ${packet_loss}= Send Network Packets And Get Packet Loss |
| 83 | ... ${OPENBMC_HOST} ${iterations} ${TCP_PACKETS} ${IPMI_PORT} |
Prashanth Katti | b18762b | 2021-06-21 07:55:52 -0500 | [diff] [blame] | 84 | Should Be Equal As Numbers ${packet_loss} 0.0 |
Prashanth Katti | 2f80bf1 | 2021-06-17 07:43:25 -0500 | [diff] [blame] | 85 | ... msg=FAILURE: BMC is dropping some packets. |
| 86 | |
| 87 | # Check if IPMI interface is functional. |
| 88 | Run IPMI Standard Command chassis status |
| 89 | |
| 90 | |
| 91 | Send Network Packets Continuously To SSH Port |
| 92 | [Documentation] Send network packets continuously to SSH port and verify stability. |
| 93 | [Tags] Send_Network_Packets_Continuously_To_SSH_Port |
| 94 | |
| 95 | # Send large number of packets to SSH port. |
| 96 | ${packet_loss}= Send Network Packets And Get Packet Loss |
| 97 | ... ${OPENBMC_HOST} ${iterations} ${TCP_PACKETS} ${SSH_PORT} |
Prashanth Katti | b18762b | 2021-06-21 07:55:52 -0500 | [diff] [blame] | 98 | Should Be Equal As Numbers ${packet_loss} 0.0 |
Prashanth Katti | 2f80bf1 | 2021-06-17 07:43:25 -0500 | [diff] [blame] | 99 | ... msg=FAILURE: BMC is dropping some packets. |
| 100 | |
| 101 | # Check if SSH interface is functional. |
| 102 | |
| 103 | SSHLibrary.Open Connection ${OPENBMC_HOST} |
| 104 | Open Connection And Log In ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} |
| 105 | |
| 106 | |
Prashanth Katti | b18762b | 2021-06-21 07:55:52 -0500 | [diff] [blame] | 107 | Flood Redfish Interface With Packets With Flags And Check Stability |
| 108 | [Documentation] Send large number of packets with flags to Redfish interface |
| 109 | ... and check stability. |
| 110 | [Tags] Flood_Redfish_Interface_With_Packets_With_Flags_And_Check_Stability |
| 111 | [Template] Send Network Packets With Flags And Verify Stability |
| 112 | |
| 113 | # Target No. Of packets Interface Flags |
| 114 | |
| 115 | # Flood syn packets and check BMC behavior. |
| 116 | ${OPENBMC_HOST} ${iterations} ${REDFISH_INTERFACE} ${SYN_PACKETS} |
| 117 | |
| 118 | # Flood reset packets and check BMC behavior. |
| 119 | ${OPENBMC_HOST} ${iterations} ${REDFISH_INTERFACE} ${RESET_PACKETS} |
| 120 | |
| 121 | # Flood fin packets and check BMC behavior. |
| 122 | ${OPENBMC_HOST} ${iterations} ${REDFISH_INTERFACE} ${FIN_PACKETS} |
| 123 | |
| 124 | # Flood syn ack reset packets and check BMC behavior. |
| 125 | ${OPENBMC_HOST} ${iterations} ${REDFISH_INTERFACE} ${SYN_ACK_RESET} |
| 126 | |
| 127 | # Flood packets with all flags and check BMC behavior. |
| 128 | ${OPENBMC_HOST} ${iterations} ${REDFISH_INTERFACE} ${ALL_FLAGS} |
| 129 | |
| 130 | |
Megha G N | 1c87ae5 | 2023-02-16 00:08:42 -0600 | [diff] [blame] | 131 | Send Network Packets Continuously To SOL Port |
| 132 | [Documentation] Send network packets continuously to SOL port and verify stability. |
| 133 | [Tags] Send_Network_Packets_Continuously_To_SOL_Port |
| 134 | [Teardown] Run Keywords FFDC On Test Case Fail AND Close all connections |
| 135 | |
| 136 | # Send large number of packets to SOL port. |
| 137 | ${packet_loss}= Send Network Packets And Get Packet Loss |
| 138 | ... ${OPENBMC_HOST} ${iterations} ${TCP_PACKETS} ${HOST_SOL_PORT} |
| 139 | |
| 140 | # Check if SOL interface is functional. |
| 141 | |
| 142 | SSHLibrary.Open Connection ${OPENBMC_HOST} port=${HOST_SOL_PORT} |
| 143 | Verify Interface Stability ${HOST_SOL_PORT} |
| 144 | Should Be Equal As Numbers ${packet_loss} 0.0 |
| 145 | ... msg=FAILURE: BMC is dropping some packets. |
| 146 | |
| 147 | |
Priya Sinha | 25163b8 | 2023-02-24 05:35:22 -0600 | [diff] [blame] | 148 | Send Continuous TCP Connection Requests To Redfish Interface And Check Stability |
| 149 | [Documentation] Establish large number of TCP connections to Redfish port (443) |
| 150 | ... and check check network responses stability. |
| 151 | [Tags] Send_Continuous_TCP_Connection_Requests_To_Redfish_Interface_And_Check_Stability |
| 152 | |
| 153 | # Establish large number of TCP connections to Redfish interface. |
| 154 | ${connection_loss}= Establish TCP Connections And Get Connection Failures |
| 155 | ... ${OPENBMC_HOST} ${iterations} ${TCP_CONNECTION} ${HTTPS_PORT} |
| 156 | |
| 157 | # Check if Redfish interface is functional. |
| 158 | Redfish.Login |
| 159 | Redfish.Logout |
| 160 | |
| 161 | # Check if TCP connections dropped. |
| 162 | Should Be Equal As Numbers ${connection_loss} 0.0 |
| 163 | ... msg=FAILURE: BMC is dropping some connections. |
| 164 | |
| 165 | |
| 166 | Send Continuous TCP Connection Requests To IPMI Interface And Check Stability |
| 167 | [Documentation] Establish large number of TCP connections to IPMI interface |
| 168 | ... and check stability. |
| 169 | [Tags] Send_Continuous_TCP_Connection_Requests_To_IPMI_Interface_And_Check_Stability |
| 170 | |
| 171 | # Establish large number of TCP connections to IPMI interface. |
| 172 | ${connection_loss}= Establish TCP Connections And Get Connection Failures |
| 173 | ... ${OPENBMC_HOST} ${iterations} ${TCP_CONNECTION} ${IPMI_PORT} |
| 174 | |
| 175 | # Check if IPMI interface is functional. |
George Keishing | 369a0dc | 2023-04-05 10:27:42 +0530 | [diff] [blame^] | 176 | Verify IPMI Works lan print |
Priya Sinha | 25163b8 | 2023-02-24 05:35:22 -0600 | [diff] [blame] | 177 | |
| 178 | # Check if TCP/Network connections dropped. |
| 179 | Should Be Equal As Numbers ${connection_loss} 0.0 |
| 180 | ... msg=FAILURE: BMC is dropping connections |
| 181 | |
Megha G N | 5e22deb | 2023-03-08 01:23:56 -0600 | [diff] [blame] | 182 | |
| 183 | Send Continuous TCP Connection Requests To SSH Interface And Check Stability |
| 184 | [Documentation] Establish large number of TCP connections to SSH interface |
| 185 | ... and check stability. |
| 186 | [Tags] Send_Continuous_TCP_Connection_Requests_To_SSH_Interface_And_Check_Stability |
| 187 | |
| 188 | # Establish large number of TCP connections to SSH interface. |
| 189 | ${connection_loss}= Establish TCP Connections And Get Connection Failures |
| 190 | ... ${OPENBMC_HOST} ${iterations} ${TCP_CONNECTION} ${SSH_PORT} |
| 191 | |
| 192 | # Check if SSH interface is functional. |
| 193 | Verify Interface Stability ${SSH_PORT} |
| 194 | |
| 195 | # Check if TCP/Network connections dropped. |
| 196 | Should Be Equal As Numbers ${connection_loss} 0.0 |
| 197 | ... msg=FAILURE: BMC is dropping connections |
| 198 | |
| 199 | |
Prashanth Katti | c8bfc36 | 2019-09-03 07:40:43 -0500 | [diff] [blame] | 200 | *** Keywords *** |
| 201 | |
| 202 | Suite Setup Execution |
| 203 | [Documentation] Validate the setup. |
| 204 | |
| 205 | Valid Value OPENBMC_HOST |
| 206 | Valid Program program_name |
| 207 | |
Prashanth Katti | b18762b | 2021-06-21 07:55:52 -0500 | [diff] [blame] | 208 | |
| 209 | Verify Interface Stability |
| 210 | [Documentation] Verify interface is up and active. |
| 211 | [Arguments] ${port} |
| 212 | |
| 213 | # Description of argument(s): |
| 214 | # port Network port. |
| 215 | |
| 216 | Run Keyword If ${port} == ${REDFISH_INTERFACE} |
| 217 | ... Redfish.Login |
| 218 | ... ELSE IF ${port} == ${SSH_PORT} |
| 219 | ... Open Connection And Log In ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} |
| 220 | ... ELSE IF ${port} == ${IPMI_PORT} |
George Keishing | 6e6d785 | 2022-05-13 03:04:18 -0500 | [diff] [blame] | 221 | ... Run External IPMI Standard Command lan print |
Prashanth Katti | b18762b | 2021-06-21 07:55:52 -0500 | [diff] [blame] | 222 | ... ELSE IF ${port} == ${HOST_SOL_PORT} |
| 223 | ... Open Connection And Log In ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} port=${HOST_SOL_PORT} |
| 224 | ... ELSE |
| 225 | ... Redfish.Login |
Priya Sinha | 25163b8 | 2023-02-24 05:35:22 -0600 | [diff] [blame] | 226 | |
| 227 | Establish TCP Connections And Get Connection Failures |
| 228 | [Documentation] Establish TCP connections and return nping connection responses. |
| 229 | [Arguments] ${target_host} ${num}=${count} ${packet_type}=${TCP_CONNECTION} |
| 230 | ... http_port=${80} |
| 231 | |
| 232 | # Description of argument(s): |
| 233 | # host The host name or IP address of the target system. |
| 234 | # packet_type The type of packets to be sent ("tcp", "udp", "icmp"). |
| 235 | # http_port Network port. |
| 236 | # num Number of connections to be sent. |
| 237 | |
| 238 | # This keyword expects host, port, type and number of connections to be sent |
| 239 | # and rate at which connectionss to be sent, should be given in command line. |
| 240 | # By default it sends 4 TCP connections at 1 connection/second. |
| 241 | |
| 242 | ${cmd_buf}= Set Variable --delay ${delay} ${host} -c ${num} --${packet_type} -p ${port} |
| 243 | ${nping_result}= Nping ${cmd_buf} |
| 244 | [Return] ${nping_result['percent_failed']} |