From 1440fa07b00aec8f3f1cf020293e8ba4eee00059 Mon Sep 17 00:00:00 2001 From: Cong Hou <97947969+congh-nvidia@users.noreply.github.com> Date: Wed, 17 Jan 2024 01:52:33 +0800 Subject: [PATCH] Fix a test issue for the dualtor tunnel monitor for Nvidia platforms (#9625) When the inner/outer dscps are 2/2 or 6/6, the packet is not mapped to queue according to the mapping configuration. And such packets are not expected in production, skip the queue check for them. Change-Id: I8f02d086d2f9eb010684e1ac41cf1abfe6ca2788 --- tests/common/devices/sonic.py | 3 +++ tests/common/dualtor/tunnel_traffic_utils.py | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/tests/common/devices/sonic.py b/tests/common/devices/sonic.py index 687274e49f3..f02108b9742 100644 --- a/tests/common/devices/sonic.py +++ b/tests/common/devices/sonic.py @@ -1718,6 +1718,9 @@ def get_asic_name(self): return asic + def is_nvidia_platform(self): + return 'mellanox' == self.facts['asic_type'] + def _get_platform_asic(self, platform): platform_asic = os.path.join( "/usr/share/sonic/device", platform, "platform_asic" diff --git a/tests/common/dualtor/tunnel_traffic_utils.py b/tests/common/dualtor/tunnel_traffic_utils.py index 113aa398ff5..790a28f4fee 100644 --- a/tests/common/dualtor/tunnel_traffic_utils.py +++ b/tests/common/dualtor/tunnel_traffic_utils.py @@ -237,6 +237,12 @@ def _disassemble_ip_tos(tos): inner_dscp, _ = _disassemble_ip_tos(inner_tos) logging.info("Outer packet DSCP: {0:06b}, inner packet DSCP: {1:06b}".format(outer_dscp, inner_dscp)) check_res = [] + # For Nvidia platforms, queue check for outer/inner dscp 2/2 and 6/6 will fail due to the diversity + # in dscp remapping. Since we don't expect such packets in production, skip the queue check in this case. + if self.standby_tor.is_nvidia_platform(): + logging.info("Skip the queue check for inner/outer dscp 2/2 and 6/6 on Nvidia platforms.") + if (inner_dscp, outer_dscp) in [(2, 2), (6, 6)]: + return " ,".join(check_res) exp_queue = derive_queue_id_from_dscp(self.standby_tor, inner_dscp, True) logging.info("Expect queue: %s", exp_queue) if not wait_until(60, 5, 0, queue_stats_check, self.standby_tor, exp_queue, self.packet_count):