blob: f774c09bb2aaec8adef92f64848e58047a880897 [file] [log] [blame]
Prashanth Kattic8bfc362019-09-03 07:40:43 -05001*** Settings ***
2Documentation Network stack stress tests using "nping" tool.
3
shrsuman123c1a260c2022-02-01 03:38:56 -06004# 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 Kattic8bfc362019-09-03 07:40:43 -05007Resource ../lib/resource.robot
Prashanth Katti2f80bf12021-06-17 07:43:25 -05008Resource ../lib/bmc_redfish_resource.robot
9Resource ../lib/ipmi_client.robot
Prashanth Kattic8bfc362019-09-03 07:40:43 -050010
11Library OperatingSystem
12Library String
13Library ../lib/gen_robot_valid.py
14Library ../lib/bmc_network_utils.py
Prashanth Katti2f80bf12021-06-17 07:43:25 -050015Library ../lib/ipmi_utils.py
Prashanth Kattic8bfc362019-09-03 07:40:43 -050016
17Suite Setup Suite Setup Execution
18
19Force Tags Network_Nping
20
21*** Variables ***
22
23${delay} 1000ms
24${count} 4
25${program_name} nping
Prashanth Katti2f80bf12021-06-17 07:43:25 -050026${iterations} 5000
Prashanth Kattic8bfc362019-09-03 07:40:43 -050027
28*** Test Cases ***
29
30Send ICMP Timestamp Request
31 [Documentation] Send ICMP packet type 13 and check BMC drops such packets
32 [Tags] Send_ICMP_Timestamp_Request
33
34 # Send ICMP packet type 13 to BMC and check packet loss.
35 ${packet_loss}= Send Network Packets And Get Packet Loss
36 ... ${OPENBMC_HOST} ${count} ${ICMP_PACKETS} ${NETWORK_PORT} ${ICMP_TIMESTAMP_REQUEST}
37 Should Be Equal As Numbers ${packet_loss} 100.00
38 ... msg=FAILURE: BMC is not dropping timestamp request messages.
39
40Send ICMP Netmask Request
41 [Documentation] Send ICMP packet type 17 and check BMC drops such packets
42 [Tags] Send_ICMP_Netmask_Request
43
44 # Send ICMP packet type 17 to BMC and check packet loss.
45 ${packet_loss}= Send Network Packets And Get Packet Loss
46 ... ${OPENBMC_HOST} ${count} ${ICMP_PACKETS} ${NETWORK_PORT} ${ICMP_NETMASK_REQUEST}
47 Should Be Equal As Numbers ${packet_loss} 100.00
48 ... msg=FAILURE: BMC is not dropping netmask request messages.
49
shrsuman123c1a260c2022-02-01 03:38:56 -060050Send Continuous ICMP Echo Request To BMC And Verify No Packet Loss
51 [Documentation] Send ICMP packet type 8 continuously and check no packets are dropped from BMC
52 [Tags] Send_Continuous_ICMP_Echo_Request_To_BMC_And_Verify_No_Packet_Loss
53
54 # Send ICMP packet type 8 to BMC and check packet loss.
55 ${packet_loss}= Send Network Packets And Get Packet Loss
56 ... ${OPENBMC_HOST} ${iterations} ${ICMP_PACKETS}
57 Should Be Equal As Numbers ${packet_loss} 0.0
58 ... msg=FAILURE: BMC is dropping packets.
59
Prashanth Kattic8bfc362019-09-03 07:40:43 -050060Send Network Packets Continuously To Redfish Interface
61 [Documentation] Send network packets continuously to Redfish interface and verify stability.
62 [Tags] Send_Network_Packets_Continuously_To_Redfish_Interface
63
64 # Send large number of packets to Redfish interface.
65 ${packet_loss}= Send Network Packets And Get Packet Loss
Prashanth Katti2f80bf12021-06-17 07:43:25 -050066 ... ${OPENBMC_HOST} ${iterations} ${TCP_PACKETS} ${REDFISH_INTERFACE}
Prashanth Kattib18762b2021-06-21 07:55:52 -050067 Should Be Equal As Numbers ${packet_loss} 0.0
Prashanth Kattic8bfc362019-09-03 07:40:43 -050068 ... msg=FAILURE: BMC is dropping some packets.
69
70 # Check if Redfish interface is functional.
71 Redfish.Login
72 Redfish.Logout
73
Prashanth Katti2f80bf12021-06-17 07:43:25 -050074
75Send Network Packets Continuously To IPMI Port
76 [Documentation] Send network packets continuously to IPMI port and verify stability.
77 [Tags] Send_Network_Packets_Continuously_To_IPMI_Port
78
79 # Send large number of packets to IPMI port.
80 ${packet_loss}= Send Network Packets And Get Packet Loss
81 ... ${OPENBMC_HOST} ${iterations} ${TCP_PACKETS} ${IPMI_PORT}
Prashanth Kattib18762b2021-06-21 07:55:52 -050082 Should Be Equal As Numbers ${packet_loss} 0.0
Prashanth Katti2f80bf12021-06-17 07:43:25 -050083 ... msg=FAILURE: BMC is dropping some packets.
84
85 # Check if IPMI interface is functional.
86 Run IPMI Standard Command chassis status
87
88
89Send Network Packets Continuously To SSH Port
90 [Documentation] Send network packets continuously to SSH port and verify stability.
91 [Tags] Send_Network_Packets_Continuously_To_SSH_Port
92
93 # Send large number of packets to SSH port.
94 ${packet_loss}= Send Network Packets And Get Packet Loss
95 ... ${OPENBMC_HOST} ${iterations} ${TCP_PACKETS} ${SSH_PORT}
Prashanth Kattib18762b2021-06-21 07:55:52 -050096 Should Be Equal As Numbers ${packet_loss} 0.0
Prashanth Katti2f80bf12021-06-17 07:43:25 -050097 ... msg=FAILURE: BMC is dropping some packets.
98
99 # Check if SSH interface is functional.
100
101 SSHLibrary.Open Connection ${OPENBMC_HOST}
102 Open Connection And Log In ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD}
103
104
Prashanth Kattib18762b2021-06-21 07:55:52 -0500105Flood Redfish Interface With Packets With Flags And Check Stability
106 [Documentation] Send large number of packets with flags to Redfish interface
107 ... and check stability.
108 [Tags] Flood_Redfish_Interface_With_Packets_With_Flags_And_Check_Stability
109 [Template] Send Network Packets With Flags And Verify Stability
110
111 # Target No. Of packets Interface Flags
112
113 # Flood syn packets and check BMC behavior.
114 ${OPENBMC_HOST} ${iterations} ${REDFISH_INTERFACE} ${SYN_PACKETS}
115
116 # Flood reset packets and check BMC behavior.
117 ${OPENBMC_HOST} ${iterations} ${REDFISH_INTERFACE} ${RESET_PACKETS}
118
119 # Flood fin packets and check BMC behavior.
120 ${OPENBMC_HOST} ${iterations} ${REDFISH_INTERFACE} ${FIN_PACKETS}
121
122 # Flood syn ack reset packets and check BMC behavior.
123 ${OPENBMC_HOST} ${iterations} ${REDFISH_INTERFACE} ${SYN_ACK_RESET}
124
125 # Flood packets with all flags and check BMC behavior.
126 ${OPENBMC_HOST} ${iterations} ${REDFISH_INTERFACE} ${ALL_FLAGS}
127
128
Prashanth Kattic8bfc362019-09-03 07:40:43 -0500129*** Keywords ***
130
131Suite Setup Execution
132 [Documentation] Validate the setup.
133
134 Valid Value OPENBMC_HOST
135 Valid Program program_name
136
Prashanth Kattib18762b2021-06-21 07:55:52 -0500137
138Verify Interface Stability
139 [Documentation] Verify interface is up and active.
140 [Arguments] ${port}
141
142 # Description of argument(s):
143 # port Network port.
144
145 Run Keyword If ${port} == ${REDFISH_INTERFACE}
146 ... Redfish.Login
147 ... ELSE IF ${port} == ${SSH_PORT}
148 ... Open Connection And Log In ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD}
149 ... ELSE IF ${port} == ${IPMI_PORT}
150 ... Run External IPMI Standard Command lan print
151 ... ELSE IF ${port} == ${HOST_SOL_PORT}
152 ... Open Connection And Log In ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} port=${HOST_SOL_PORT}
153 ... ELSE
154 ... Redfish.Login