aboutsummaryrefslogtreecommitdiffstats
path: root/test/framework.py
diff options
context:
space:
mode:
authorIvan Ivanets <iivanets@cisco.com>2024-09-27 17:11:18 +0300
committerDave Wallace <dwallacelf@gmail.com>2024-10-01 16:57:44 +0000
commitb2b87e481953a9b857ff0315194d43d538f31931 (patch)
treec1135c0bba437062d48fbf98747bedc46aa328e5 /test/framework.py
parent38e94c3461020f77d2a3cff0511f3a727be8af1a (diff)
tests: fix wireguard test case failures
Type: test There are random failures in the wireguard test cases that are not related to concurrency issues. The root cause is a retry of the handshake initiation after (REKEY_TIMEOUT + JITTER) ms, where JITTER is a random value between 0 and 333 ms. Solution: Add a filter parameter for the `send_and_expect` method of the vpptestcase. This filter allows for excluding unexpected handshake initiation packets when the responder sends two packets (with `message_type = 1` and `message_type = 2`),while only a single packet (with `message_type = 2`) is expected. Change-Id: I62816931fc1b85e2202f3d36eb6c2a23714644d5 Signed-off-by: Ivan Ivanets <iivanets@cisco.com>
Diffstat (limited to 'test/framework.py')
-rw-r--r--test/framework.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/framework.py b/test/framework.py
index fc22ad6483c..62fa1fe9727 100644
--- a/test/framework.py
+++ b/test/framework.py
@@ -26,7 +26,7 @@ from struct import pack, unpack
import scapy.compat
from scapy.packet import Raw, Packet
-from vpp_pg_interface import VppPGInterface
+from vpp_pg_interface import VppPGInterface, is_ipv6_misc
from vpp_sub_interface import VppSubInterface
from vpp_lo_interface import VppLoInterface
from vpp_bvi_interface import VppBviInterface
@@ -547,6 +547,7 @@ class VppTestCase(VppAsfTestCase):
trace=True,
msg=None,
stats_diff=None,
+ filter_out_fn=is_ipv6_misc,
):
if stats_diff:
stats_snapshot = self.snapshot_stats(stats_diff)
@@ -554,7 +555,7 @@ class VppTestCase(VppAsfTestCase):
if not n_rx:
n_rx = 1 if isinstance(pkts, Packet) else len(pkts)
self.pg_send(intf, pkts, worker=worker, trace=trace)
- rx = output.get_capture(n_rx)
+ rx = output.get_capture(n_rx, filter_out_fn=filter_out_fn)
if trace:
if msg:
self.logger.debug(f"send_and_expect: {msg}")