Skip to content

Commit

Permalink
Fixed logic to delete the interface from BUFFER_QUEUE (#16687)
Browse files Browse the repository at this point in the history
Description of PR
The interface from where the queuestats fetched was different from the interface that was deleted from the BUFFER_QUEUE.

Github issue: aristanetworks/sonic-qual.msft#371
This issue is seen after PR: #15688

The issue was that
XML dump is below for context

buffer_queue_to_del = 'Ethernet112|6'
buffer_queues = ['Ethernet112|0-1', 'Ethernet112|2-4', 'Ethernet112|5', 'Ethernet112|6', 'Ethernet112|7', 'Ethernet116|0-1', ...]
buffer_queues_removed = 1
interface  = 'Ethernet68'
When the string 'Ethernet112|6' when split with delimiter "|" the string in 1st index "6" is a substring of "Ethernet68" and it picked as a candidate to delete it from BQ, which is wrong.

Summary:
Fixes # aristanetworks/sonic-qual.msft#371
  • Loading branch information
raaghavendrakra-arista authored Feb 17, 2025
1 parent 63fdab8 commit 7b9f7b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/snmp/test_snmp_queue_counters.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def test_snmp_queue_counters(duthosts,

# Get appropriate buffer queue value to delete
buffer_queues = list(data['BUFFER_QUEUE'].keys())
iface_buffer_queues = [bq for bq in buffer_queues if any(val in interface for val in bq.split('|'))]
iface_buffer_queues = [bq for bq in buffer_queues if bq.split('|')[0] == interface]
if iface_buffer_queues:
buffer_queue_to_del = iface_buffer_queues[0]
else:
Expand Down

0 comments on commit 7b9f7b6

Please sign in to comment.