Prashanth Katti | c8bfc36 | 2019-09-03 07:40:43 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Network stack stress tests using "nping" tool. |
| 3 | |
| 4 | Resource ../lib/resource.robot |
Prashanth Katti | 2f80bf1 | 2021-06-17 07:43:25 -0500 | [diff] [blame] | 5 | Resource ../lib/bmc_redfish_resource.robot |
| 6 | Resource ../lib/ipmi_client.robot |
Prashanth Katti | c8bfc36 | 2019-09-03 07:40:43 -0500 | [diff] [blame] | 7 | |
| 8 | Library OperatingSystem |
| 9 | Library String |
| 10 | Library ../lib/gen_robot_valid.py |
| 11 | Library ../lib/bmc_network_utils.py |
Prashanth Katti | 2f80bf1 | 2021-06-17 07:43:25 -0500 | [diff] [blame] | 12 | Library ../lib/ipmi_utils.py |
Prashanth Katti | c8bfc36 | 2019-09-03 07:40:43 -0500 | [diff] [blame] | 13 | |
| 14 | Suite Setup Suite Setup Execution |
| 15 | |
| 16 | Force Tags Network_Nping |
| 17 | |
| 18 | *** Variables *** |
| 19 | |
| 20 | ${delay} 1000ms |
| 21 | ${count} 4 |
| 22 | ${program_name} nping |
Prashanth Katti | 2f80bf1 | 2021-06-17 07:43:25 -0500 | [diff] [blame] | 23 | ${iterations} 5000 |
Prashanth Katti | c8bfc36 | 2019-09-03 07:40:43 -0500 | [diff] [blame] | 24 | |
| 25 | *** Test Cases *** |
| 26 | |
| 27 | Send ICMP Timestamp Request |
| 28 | [Documentation] Send ICMP packet type 13 and check BMC drops such packets |
| 29 | [Tags] Send_ICMP_Timestamp_Request |
| 30 | |
| 31 | # Send ICMP packet type 13 to BMC and check packet loss. |
| 32 | ${packet_loss}= Send Network Packets And Get Packet Loss |
| 33 | ... ${OPENBMC_HOST} ${count} ${ICMP_PACKETS} ${NETWORK_PORT} ${ICMP_TIMESTAMP_REQUEST} |
| 34 | Should Be Equal As Numbers ${packet_loss} 100.00 |
| 35 | ... msg=FAILURE: BMC is not dropping timestamp request messages. |
| 36 | |
| 37 | Send ICMP Netmask Request |
| 38 | [Documentation] Send ICMP packet type 17 and check BMC drops such packets |
| 39 | [Tags] Send_ICMP_Netmask_Request |
| 40 | |
| 41 | # Send ICMP packet type 17 to BMC and check packet loss. |
| 42 | ${packet_loss}= Send Network Packets And Get Packet Loss |
| 43 | ... ${OPENBMC_HOST} ${count} ${ICMP_PACKETS} ${NETWORK_PORT} ${ICMP_NETMASK_REQUEST} |
| 44 | Should Be Equal As Numbers ${packet_loss} 100.00 |
| 45 | ... msg=FAILURE: BMC is not dropping netmask request messages. |
| 46 | |
| 47 | Send Network Packets Continuously To Redfish Interface |
| 48 | [Documentation] Send network packets continuously to Redfish interface and verify stability. |
| 49 | [Tags] Send_Network_Packets_Continuously_To_Redfish_Interface |
| 50 | |
| 51 | # Send large number of packets to Redfish interface. |
| 52 | ${packet_loss}= Send Network Packets And Get Packet Loss |
Prashanth Katti | 2f80bf1 | 2021-06-17 07:43:25 -0500 | [diff] [blame] | 53 | ... ${OPENBMC_HOST} ${iterations} ${TCP_PACKETS} ${REDFISH_INTERFACE} |
Prashanth Katti | c8bfc36 | 2019-09-03 07:40:43 -0500 | [diff] [blame] | 54 | Should Be Equal ${packet_loss} 0.0 |
| 55 | ... msg=FAILURE: BMC is dropping some packets. |
| 56 | |
| 57 | # Check if Redfish interface is functional. |
| 58 | Redfish.Login |
| 59 | Redfish.Logout |
| 60 | |
Prashanth Katti | 2f80bf1 | 2021-06-17 07:43:25 -0500 | [diff] [blame] | 61 | |
| 62 | Send Network Packets Continuously To IPMI Port |
| 63 | [Documentation] Send network packets continuously to IPMI port and verify stability. |
| 64 | [Tags] Send_Network_Packets_Continuously_To_IPMI_Port |
| 65 | |
| 66 | # Send large number of packets to IPMI port. |
| 67 | ${packet_loss}= Send Network Packets And Get Packet Loss |
| 68 | ... ${OPENBMC_HOST} ${iterations} ${TCP_PACKETS} ${IPMI_PORT} |
| 69 | Should Be Equal ${packet_loss} 0.0 |
| 70 | ... msg=FAILURE: BMC is dropping some packets. |
| 71 | |
| 72 | # Check if IPMI interface is functional. |
| 73 | Run IPMI Standard Command chassis status |
| 74 | |
| 75 | |
| 76 | Send Network Packets Continuously To SSH Port |
| 77 | [Documentation] Send network packets continuously to SSH port and verify stability. |
| 78 | [Tags] Send_Network_Packets_Continuously_To_SSH_Port |
| 79 | |
| 80 | # Send large number of packets to SSH port. |
| 81 | ${packet_loss}= Send Network Packets And Get Packet Loss |
| 82 | ... ${OPENBMC_HOST} ${iterations} ${TCP_PACKETS} ${SSH_PORT} |
| 83 | Should Be Equal ${packet_loss} 0.0 |
| 84 | ... msg=FAILURE: BMC is dropping some packets. |
| 85 | |
| 86 | # Check if SSH interface is functional. |
| 87 | |
| 88 | SSHLibrary.Open Connection ${OPENBMC_HOST} |
| 89 | Open Connection And Log In ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} |
| 90 | |
| 91 | |
Prashanth Katti | c8bfc36 | 2019-09-03 07:40:43 -0500 | [diff] [blame] | 92 | *** Keywords *** |
| 93 | |
| 94 | Suite Setup Execution |
| 95 | [Documentation] Validate the setup. |
| 96 | |
| 97 | Valid Value OPENBMC_HOST |
| 98 | Valid Program program_name |
| 99 | |
| 100 | Send Network Packets And Get Packet Loss |
| 101 | [Documentation] Send TCP, UDP or ICMP packets to the target. |
George Keishing | 333bb72 | 2019-12-11 11:40:49 -0600 | [diff] [blame] | 102 | [Arguments] ${host} ${num}=${count} ${packet_type}=${ICMP_PACKETS} |
| 103 | ... ${port}=80 ${icmp_type}=${ICMP_ECHO_REQUEST} |
Prashanth Katti | c8bfc36 | 2019-09-03 07:40:43 -0500 | [diff] [blame] | 104 | |
| 105 | # Description of argument(s): |
| 106 | # host The host name or IP address of the target system. |
| 107 | # packet_type The type of packets to be sent ("tcp, "udp", "icmp"). |
| 108 | # port Network port. |
| 109 | # icmp_type Type of ICMP packets (e.g. 8, 13, 17, etc.). |
| 110 | # num Number of packets to be sent. |
| 111 | |
| 112 | # This keyword expects host, port, type and number of packets to be sent |
| 113 | # and rate at which packets to be sent, should be given in command line. |
| 114 | # By default it sends 4 ICMP echo request packets at 1 packets/second. |
| 115 | |
| 116 | ${cmd_suffix}= Set Variable If '${packet_type}' == 'icmp' |
| 117 | ... --icmp-type ${icmp_type} |
| 118 | ... -p ${port} |
| 119 | ${cmd_buf}= Set Variable --delay ${delay} ${host} -c ${num} --${packet_type} ${cmd_suffix} |
| 120 | |
| 121 | ${nping_result}= Nping ${cmd_buf} |
| 122 | [Return] ${nping_result['percent_lost']} |