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