MCPcopy Create free account
hub / github.com/FDio/vpp / run_basic_conn_test

Method run_basic_conn_test

test/test_acl_plugin_conns.py:162–182  ·  view source on GitHub ↗

Basic conn timeout test

(self, af, acl_side)

Source from the content-addressed store, hash-verified

160 self.logger.info(self.vapi.cli("show event-logger all"))
161
162 def run_basic_conn_test(self, af, acl_side):
163 """Basic conn timeout test"""
164 conn1 = Conn(self, self.pg0, self.pg1, af, UDP, 42001, 4242)
165 conn1.apply_acls(0, acl_side)
166 conn1.send_through(0)
167 # the return packets should pass
168 conn1.send_through(1)
169 # send some packets on conn1, ensure it doesn't go away
170 for i in IterateWithSleep(self, 20, "Keep conn active", 0.3):
171 conn1.send_through(1)
172 # allow the conn to time out
173 for i in IterateWithSleep(self, 30, "Wait for timeout", 0.1):
174 pass
175 # now try to send a packet on the reflected side
176 try:
177 p2 = conn1.send_through(1).command()
178 except:
179 # If we asserted while waiting, it's good.
180 # the conn should have timed out.
181 p2 = None
182 self.assert_equal(p2, None, "packet on long-idle conn")
183
184 def run_active_conn_test(self, af, acl_side):
185 """Idle connection behind active connection test"""

Calls 6

apply_aclsMethod · 0.95
IterateWithSleepClass · 0.85
send_throughMethod · 0.80
ConnClass · 0.70
commandMethod · 0.45
assert_equalMethod · 0.45

Tested by

no test coverage detected