blob: e6becb8e7367ef36aafe453b67029e9238a1730d [file] [log] [blame]
Prashanth Kattic8bfc362019-09-03 07:40:43 -05001*** Settings ***
2Documentation Network stack stress tests using "nping" tool.
3
4Resource ../lib/resource.robot
Prashanth Katti2f80bf12021-06-17 07:43:25 -05005Resource ../lib/bmc_redfish_resource.robot
6Resource ../lib/ipmi_client.robot
Prashanth Kattic8bfc362019-09-03 07:40:43 -05007
8Library OperatingSystem
9Library String
10Library ../lib/gen_robot_valid.py
11Library ../lib/bmc_network_utils.py
Prashanth Katti2f80bf12021-06-17 07:43:25 -050012Library ../lib/ipmi_utils.py
Prashanth Kattic8bfc362019-09-03 07:40:43 -050013
14Suite Setup Suite Setup Execution
15
16Force Tags Network_Nping
17
18*** Variables ***
19
20${delay} 1000ms
21${count} 4
22${program_name} nping
Prashanth Katti2f80bf12021-06-17 07:43:25 -050023${iterations} 5000
Prashanth Kattic8bfc362019-09-03 07:40:43 -050024
25*** Test Cases ***
26
27Send 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
37Send 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
47Send 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 Katti2f80bf12021-06-17 07:43:25 -050053 ... ${OPENBMC_HOST} ${iterations} ${TCP_PACKETS} ${REDFISH_INTERFACE}
Prashanth Kattic8bfc362019-09-03 07:40:43 -050054 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 Katti2f80bf12021-06-17 07:43:25 -050061
62Send 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
76Send 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 Kattic8bfc362019-09-03 07:40:43 -050092*** Keywords ***
93
94Suite Setup Execution
95 [Documentation] Validate the setup.
96
97 Valid Value OPENBMC_HOST
98 Valid Program program_name
99
100Send Network Packets And Get Packet Loss
101 [Documentation] Send TCP, UDP or ICMP packets to the target.
George Keishing333bb722019-12-11 11:40:49 -0600102 [Arguments] ${host} ${num}=${count} ${packet_type}=${ICMP_PACKETS}
103 ... ${port}=80 ${icmp_type}=${ICMP_ECHO_REQUEST}
Prashanth Kattic8bfc362019-09-03 07:40:43 -0500104
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']}