Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SNMP]: Modify test to verify all queue indexes are present (#11180)
## Approach #### What is the motivation for this PR? ADO : 26336010 Modify test to detect issue sonic-net/sonic-buildimage#17448. #### How did you do it? Currently test_snmp_queue only verifies that each interface does have queue counters associated with it. It does not verify if all the expected queue counters are present. Modify test_snmp_queue to add 2 additional checks: 1. Ensure that queue index with queue configuration in config_db, is present for each interface. 2. Ensure that the number of Unicast queue counters for each interface in 'show queue counters <interface name> is the same as the number of queue indexes in the SNMP result. #### How did you verify/test it? Test case passes for single-asic/multi-asic/Chassis platforms. Test case passed with: 202205/202305/202311/master images Test case fails when run on device with image which has the issue: sonic-net/sonic-buildimage#17448. ``` snmp_q_idx = int(queue_idx) + 1 if str(snmp_q_idx) not in v['queues'][direction_type]: pytest.fail("\ Expected queue index %d not present in SNMP \ > result for interface %s" % (snmp_q_idx, v['name'])) E Failed: Expected queue index 6 not present in SNMP result for interface Ethernet13/3 .. snmp/test_snmp_queue.py:87: Failed -------------------------------------------------------------------------------------------------- generated xml file: /data/sonic-mgmt-int/tests/logs/tr.xml -------------------------------------------------------------------------------------------------- =================================================================================================================== short test summary info ==================================================================================================================== FAILED snmp/test_snmp_queue.py::test_snmp_queues[str3-7060-acs-1] - Failed: Expected queue index 6 not present in SNMP result for interface Ethernet13/3 ================================================================================================================== 1 failed in 248.30 seconds ================================================================================================================== INFO:root:Can not get Allure report URL. Please check logs ```
- Loading branch information