From b2b87e481953a9b857ff0315194d43d538f31931 Mon Sep 17 00:00:00 2001 From: Ivan Ivanets Date: Fri, 27 Sep 2024 17:11:18 +0300 Subject: 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 --- test/framework.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'test/framework.py') 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}") -- cgit 1.2.3-korg