From f4c21a2ea39dff77d10f478000fd12bac42a9421 Mon Sep 17 00:00:00 2001 From: harjotsinghpawra Date: Thu, 19 Dec 2024 13:59:12 +1300 Subject: [PATCH] [test_snmp_queue_counters.py]: Added support for single buffer queue and fix range related issues (#16139) Regression test were failing becuase it was not bale to calculate correct range Description of PR Support for single Queue was not there such as 'Ethernet128|1' modified core to support both 'Ethernet128|1' and 'Ethernet128|0-2' Summary: Fixes # (issue) co-authorized by: jianquanye@microsoft.com --- tests/snmp/test_snmp_queue_counters.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/snmp/test_snmp_queue_counters.py b/tests/snmp/test_snmp_queue_counters.py index 75c8d41d4c1..3cdd1a6497c 100644 --- a/tests/snmp/test_snmp_queue_counters.py +++ b/tests/snmp/test_snmp_queue_counters.py @@ -156,7 +156,10 @@ def test_snmp_queue_counters(duthosts, # check for other duts else: range_str = str(buffer_queue_to_del.split('|')[-1]) - buffer_queues_removed = int(range_str.split('-')[1]) - int(range_str.split('-')[0]) + 1 + if '-' in range_str: + buffer_queues_removed = int(range_str.split('-')[1]) - int(range_str.split('-')[0]) + 1 + else: + buffer_queues_removed = 1 unicast_expected_diff = buffer_queues_removed * UNICAST_CTRS multicast_expected_diff = unicast_expected_diff + (buffer_queues_removed * MULTICAST_CTRS)