Fix buffer queue cnt test to account for different BUFFER_QUEUE configs#19310
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| duthost.copy(content=json.dumps(data, indent=4), dest=CFG_DB_PATH) | ||
| config_reload(duthost, config_source='config_db', safe_reload=True, check_intf_up_ports=True, wait_for_bgp=True) | ||
| config_reload(duthost, config_source='config_db', safe_reload=True, check_intf_up_ports=True, | ||
| wait_for_bgp=True, yang_validate=False) |
There was a problem hiding this comment.
is the yang_validate to False intentional?
There was a problem hiding this comment.
Yes, after modifying BUFFER_QUEUE and doing config reload, we will skip yang validation.
tests/telemetry/test_telemetry.py
Outdated
| """If all queues for that pool are in the same pool ex Ethernet0|0-9 | ||
| We will modify to separate the first queue and the remaining such | ||
| that we get a separate entry for Ethernet0|0 and Ethernet0|1-9""" | ||
| single_key = False |
There was a problem hiding this comment.
The variable name single_key is misleading. It actually indicates whether we have a single queue (not a range). Consider renaming to is_single_queue
There was a problem hiding this comment.
Agreed and changed.
| We will modify to separate the first queue and the remaining such | ||
| that we get a separate entry for Ethernet0|0 and Ethernet0|1-9""" | ||
| single_key = False | ||
| bq_entry = interface_buffer_queues[0] |
There was a problem hiding this comment.
Add a check to ensure interface_buffer_queues is not empty before accessing interface_buffer_queues[0]
| del data['BUFFER_QUEUE'][bq_entry] | ||
| bq_entry = single_queue_entry | ||
| else: | ||
| pytest.skip("Invalid buffer queue range") |
There was a problem hiding this comment.
nit: the logic here is pretty useful for other use cases too. Wanna split the logic out into a helper func to make it more readable?
There was a problem hiding this comment.
Can take this effort in some future PR.
tests/telemetry/test_telemetry.py
Outdated
| = "true" | ||
| load_new_cfg(duthost, data) | ||
| pytest_assert(wait_until(120, 20, 0, check_buffer_queues_cnt_cmd_output, ptfhost, gnxi_path, | ||
| dut_ip, interface_to_check, env.gnmi_port), "Unable to get map data") |
There was a problem hiding this comment.
can you make the failure message more specific?
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull Request Overview
This PR ensures the buffer‐queue count test correctly handles configurations where all queues for an interface are defined in a single range (e.g., Ethernet0|0-9) by splitting that range before removal, and adds a parameter to disable YANG validation on reload.
- Pass
yang_validate=Falseintoconfig_reloadto skip YANG validation during test config loads. - Before removing a buffer‐queue entry, detect and split grouped queue ranges into a single‐queue entry and a remaining range.
- Wrap the removal and assertions in a
try/finallyto restore the original configuration regardless of test outcome.
Comments suppressed due to low confidence (1)
tests/telemetry/test_telemetry.py:34
- [nitpick] Add a brief inline comment explaining why
yang_validate=Falseis required here (e.g., to bypass YANG schema checks for test changes).
config_reload(duthost, config_source='config_db', safe_reload=True, check_intf_up_ports=True,
| """If all queues for that pool are in the same pool ex Ethernet0|0-9 | ||
| We will modify to separate the first queue and the remaining such | ||
| that we get a separate entry for Ethernet0|0 and Ethernet0|1-9""" |
There was a problem hiding this comment.
[nitpick] This triple-quoted string is a hanging literal used as a comment. Replace it with standard # comments to avoid leaving unused string literals in the function body.
| """If all queues for that pool are in the same pool ex Ethernet0|0-9 | |
| We will modify to separate the first queue and the remaining such | |
| that we get a separate entry for Ethernet0|0 and Ethernet0|1-9""" | |
| # If all queues for that pool are in the same pool, e.g., Ethernet0|0-9, | |
| # we will modify to separate the first queue and the remaining such | |
| # that we get a separate entry for Ethernet0|0 and Ethernet0|1-9. |
|
Hi @yejianquan can you please help with merge/backport to 202505? |
…gs (sonic-net#19310) Approach What is the motivation for this PR? Currently this test does not account for BUFFER_QUEUE configs to have only entry for an interface. In some SKU's and config BUFFER_QUEUE may have config such as "BUFFER_QUEUE": { "Ethernet0|0-2": { "profile": "egress_lossy_profile" }, "Ethernet0|3-4": { "profile": "egress_lossless_profile" }, "Ethernet0|5-7": { "profile": "egress_lossy_profile" }, or even "BUFFER_QUEUE": { "Ethernet0|0": { "profile": "egress_lossy_profile" }, "Ethernet0|1": { "profile": "egress_lossless_profile" }, "Ethernet0|2": { "profile": "egress_lossy_profile" }, ... etc The test works fine for the above configs. However if the BUFFER_QUEUE was configured such as "BUFFER_QUEUE": { "Ethernet0|0-9": { "profile": "egress_lossy_profile" }, "Ethernet100|0-9": { "profile": "egress_lossless_profile" }, "Ethernet200|0-9": { "profile": "egress_lossy_profile" }, When we delete Ethernet0|0-9 as part of del data['BUFFER_QUEUE'][ interface_buffer_queues[0] ] we end up deleting all queues for that interface from COUNTERS_QUEUE_NAME_MAP which causes check_buffer_queues_cnt_cmd_output to always return false. This test checks for such edge case and we split the BUFFER_QUEUE config such that we can delete an entry without deleting all entries in the map. How did you do it? Code change How did you verify/test it? Test on 20241110 01/07/2025 19:00:48 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"failed": true, "changed": true, "end": "2025-07-01 19:00:48.806079", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:0\"\n}\n]\nGRPC error\n redis: nil", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "delta": "0:00:00.199525", "stderr": "", "rc": 1, "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "start": "2025-07-01 19:00:48.606554", "msg": "non-zero return code", "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:0\"", "}", "]", "GRPC error", " redis: nil"], "stderr_lines": [], "_ansible_no_log": false} 01/07/2025 19:00:48 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:49 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.227872", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:1\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x15000000000679", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:48.981566", "stderr": "", "delta": "0:00:00.246306", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:1\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x15000000000679"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:49 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:49 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.614484", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:2\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067a", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:49.411463", "stderr": "", "delta": "0:00:00.203021", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:2\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067a"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:49 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.997748", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:3\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067b", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:49.798159", "stderr": "", "delta": "0:00:00.199589", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:3\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067b"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.381489", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:4\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067c", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.177327", "stderr": "", "delta": "0:00:00.204162", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:4\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067c"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.771962", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:5\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067d", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.566323", "stderr": "", "delta": "0:00:00.205639", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:5\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067d"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:51 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:51.236571", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:6\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067e", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.951268", "stderr": "", "delta": "0:00:00.285303", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "choir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:6\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067e"], "stderr_lines": [], "_ansible_no_log": false, "failed": false}
|
Cherry-pick PR to 202411: #19466 |
…gs (sonic-net#19310) Approach What is the motivation for this PR? Currently this test does not account for BUFFER_QUEUE configs to have only entry for an interface. In some SKU's and config BUFFER_QUEUE may have config such as "BUFFER_QUEUE": { "Ethernet0|0-2": { "profile": "egress_lossy_profile" }, "Ethernet0|3-4": { "profile": "egress_lossless_profile" }, "Ethernet0|5-7": { "profile": "egress_lossy_profile" }, or even "BUFFER_QUEUE": { "Ethernet0|0": { "profile": "egress_lossy_profile" }, "Ethernet0|1": { "profile": "egress_lossless_profile" }, "Ethernet0|2": { "profile": "egress_lossy_profile" }, ... etc The test works fine for the above configs. However if the BUFFER_QUEUE was configured such as "BUFFER_QUEUE": { "Ethernet0|0-9": { "profile": "egress_lossy_profile" }, "Ethernet100|0-9": { "profile": "egress_lossless_profile" }, "Ethernet200|0-9": { "profile": "egress_lossy_profile" }, When we delete Ethernet0|0-9 as part of del data['BUFFER_QUEUE'][ interface_buffer_queues[0] ] we end up deleting all queues for that interface from COUNTERS_QUEUE_NAME_MAP which causes check_buffer_queues_cnt_cmd_output to always return false. This test checks for such edge case and we split the BUFFER_QUEUE config such that we can delete an entry without deleting all entries in the map. How did you do it? Code change How did you verify/test it? Test on 20241110 01/07/2025 19:00:48 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"failed": true, "changed": true, "end": "2025-07-01 19:00:48.806079", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:0\"\n}\n]\nGRPC error\n redis: nil", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "delta": "0:00:00.199525", "stderr": "", "rc": 1, "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "start": "2025-07-01 19:00:48.606554", "msg": "non-zero return code", "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:0\"", "}", "]", "GRPC error", " redis: nil"], "stderr_lines": [], "_ansible_no_log": false} 01/07/2025 19:00:48 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:49 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.227872", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:1\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x15000000000679", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:48.981566", "stderr": "", "delta": "0:00:00.246306", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:1\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x15000000000679"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:49 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:49 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.614484", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:2\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067a", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:49.411463", "stderr": "", "delta": "0:00:00.203021", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:2\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067a"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:49 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.997748", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:3\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067b", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:49.798159", "stderr": "", "delta": "0:00:00.199589", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:3\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067b"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.381489", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:4\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067c", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.177327", "stderr": "", "delta": "0:00:00.204162", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:4\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067c"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.771962", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:5\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067d", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.566323", "stderr": "", "delta": "0:00:00.205639", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:5\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067d"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:51 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:51.236571", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:6\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067e", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.951268", "stderr": "", "delta": "0:00:00.285303", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "choir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:6\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067e"], "stderr_lines": [], "_ansible_no_log": false, "failed": false}
|
Cherry-pick PR to 202505: #19501 |
…gs (#19310) Approach What is the motivation for this PR? Currently this test does not account for BUFFER_QUEUE configs to have only entry for an interface. In some SKU's and config BUFFER_QUEUE may have config such as "BUFFER_QUEUE": { "Ethernet0|0-2": { "profile": "egress_lossy_profile" }, "Ethernet0|3-4": { "profile": "egress_lossless_profile" }, "Ethernet0|5-7": { "profile": "egress_lossy_profile" }, or even "BUFFER_QUEUE": { "Ethernet0|0": { "profile": "egress_lossy_profile" }, "Ethernet0|1": { "profile": "egress_lossless_profile" }, "Ethernet0|2": { "profile": "egress_lossy_profile" }, ... etc The test works fine for the above configs. However if the BUFFER_QUEUE was configured such as "BUFFER_QUEUE": { "Ethernet0|0-9": { "profile": "egress_lossy_profile" }, "Ethernet100|0-9": { "profile": "egress_lossless_profile" }, "Ethernet200|0-9": { "profile": "egress_lossy_profile" }, When we delete Ethernet0|0-9 as part of del data['BUFFER_QUEUE'][ interface_buffer_queues[0] ] we end up deleting all queues for that interface from COUNTERS_QUEUE_NAME_MAP which causes check_buffer_queues_cnt_cmd_output to always return false. This test checks for such edge case and we split the BUFFER_QUEUE config such that we can delete an entry without deleting all entries in the map. How did you do it? Code change How did you verify/test it? Test on 20241110 01/07/2025 19:00:48 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"failed": true, "changed": true, "end": "2025-07-01 19:00:48.806079", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:0\"\n}\n]\nGRPC error\n redis: nil", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "delta": "0:00:00.199525", "stderr": "", "rc": 1, "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "start": "2025-07-01 19:00:48.606554", "msg": "non-zero return code", "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:0\"", "}", "]", "GRPC error", " redis: nil"], "stderr_lines": [], "_ansible_no_log": false} 01/07/2025 19:00:48 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:49 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.227872", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:1\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x15000000000679", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:48.981566", "stderr": "", "delta": "0:00:00.246306", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:1\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x15000000000679"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:49 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:49 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.614484", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:2\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067a", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:49.411463", "stderr": "", "delta": "0:00:00.203021", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:2\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067a"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:49 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.997748", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:3\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067b", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:49.798159", "stderr": "", "delta": "0:00:00.199589", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:3\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067b"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.381489", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:4\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067c", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.177327", "stderr": "", "delta": "0:00:00.204162", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:4\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067c"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.771962", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:5\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067d", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.566323", "stderr": "", "delta": "0:00:00.205639", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:5\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067d"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:51 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:51.236571", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:6\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067e", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.951268", "stderr": "", "delta": "0:00:00.285303", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "choir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:6\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067e"], "stderr_lines": [], "_ansible_no_log": false, "failed": false}
|
@zbud-msft , the cherry-pick PR #19466 break test_telemetry.py on 202411 branch: File "/var/src/sonic-mgmt/tests/telemetry/test_telemetry.py", line 34, in load_new_cfg Maybe other branch also broken. |
…gs (sonic-net#19310) Approach What is the motivation for this PR? Currently this test does not account for BUFFER_QUEUE configs to have only entry for an interface. In some SKU's and config BUFFER_QUEUE may have config such as "BUFFER_QUEUE": { "Ethernet0|0-2": { "profile": "egress_lossy_profile" }, "Ethernet0|3-4": { "profile": "egress_lossless_profile" }, "Ethernet0|5-7": { "profile": "egress_lossy_profile" }, or even "BUFFER_QUEUE": { "Ethernet0|0": { "profile": "egress_lossy_profile" }, "Ethernet0|1": { "profile": "egress_lossless_profile" }, "Ethernet0|2": { "profile": "egress_lossy_profile" }, ... etc The test works fine for the above configs. However if the BUFFER_QUEUE was configured such as "BUFFER_QUEUE": { "Ethernet0|0-9": { "profile": "egress_lossy_profile" }, "Ethernet100|0-9": { "profile": "egress_lossless_profile" }, "Ethernet200|0-9": { "profile": "egress_lossy_profile" }, When we delete Ethernet0|0-9 as part of del data['BUFFER_QUEUE'][ interface_buffer_queues[0] ] we end up deleting all queues for that interface from COUNTERS_QUEUE_NAME_MAP which causes check_buffer_queues_cnt_cmd_output to always return false. This test checks for such edge case and we split the BUFFER_QUEUE config such that we can delete an entry without deleting all entries in the map. How did you do it? Code change How did you verify/test it? Test on 20241110 01/07/2025 19:00:48 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"failed": true, "changed": true, "end": "2025-07-01 19:00:48.806079", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:0\"\n}\n]\nGRPC error\n redis: nil", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "delta": "0:00:00.199525", "stderr": "", "rc": 1, "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "start": "2025-07-01 19:00:48.606554", "msg": "non-zero return code", "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:0\"", "}", "]", "GRPC error", " redis: nil"], "stderr_lines": [], "_ansible_no_log": false} 01/07/2025 19:00:48 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:49 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.227872", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:1\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x15000000000679", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:48.981566", "stderr": "", "delta": "0:00:00.246306", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:1\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x15000000000679"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:49 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:49 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.614484", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:2\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067a", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:49.411463", "stderr": "", "delta": "0:00:00.203021", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:2\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067a"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:49 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.997748", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:3\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067b", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:49.798159", "stderr": "", "delta": "0:00:00.199589", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:3\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067b"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.381489", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:4\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067c", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.177327", "stderr": "", "delta": "0:00:00.204162", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:4\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067c"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.771962", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:5\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067d", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.566323", "stderr": "", "delta": "0:00:00.205639", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:5\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067d"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:51 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:51.236571", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:6\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067e", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.951268", "stderr": "", "delta": "0:00:00.285303", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "choir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:6\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067e"], "stderr_lines": [], "_ansible_no_log": false, "failed": false}
…gs (sonic-net#19310) Approach What is the motivation for this PR? Currently this test does not account for BUFFER_QUEUE configs to have only entry for an interface. In some SKU's and config BUFFER_QUEUE may have config such as "BUFFER_QUEUE": { "Ethernet0|0-2": { "profile": "egress_lossy_profile" }, "Ethernet0|3-4": { "profile": "egress_lossless_profile" }, "Ethernet0|5-7": { "profile": "egress_lossy_profile" }, or even "BUFFER_QUEUE": { "Ethernet0|0": { "profile": "egress_lossy_profile" }, "Ethernet0|1": { "profile": "egress_lossless_profile" }, "Ethernet0|2": { "profile": "egress_lossy_profile" }, ... etc The test works fine for the above configs. However if the BUFFER_QUEUE was configured such as "BUFFER_QUEUE": { "Ethernet0|0-9": { "profile": "egress_lossy_profile" }, "Ethernet100|0-9": { "profile": "egress_lossless_profile" }, "Ethernet200|0-9": { "profile": "egress_lossy_profile" }, When we delete Ethernet0|0-9 as part of del data['BUFFER_QUEUE'][ interface_buffer_queues[0] ] we end up deleting all queues for that interface from COUNTERS_QUEUE_NAME_MAP which causes check_buffer_queues_cnt_cmd_output to always return false. This test checks for such edge case and we split the BUFFER_QUEUE config such that we can delete an entry without deleting all entries in the map. How did you do it? Code change How did you verify/test it? Test on 20241110 01/07/2025 19:00:48 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"failed": true, "changed": true, "end": "2025-07-01 19:00:48.806079", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:0\"\n}\n]\nGRPC error\n redis: nil", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "delta": "0:00:00.199525", "stderr": "", "rc": 1, "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "start": "2025-07-01 19:00:48.606554", "msg": "non-zero return code", "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:0\"", "}", "]", "GRPC error", " redis: nil"], "stderr_lines": [], "_ansible_no_log": false} 01/07/2025 19:00:48 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:49 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.227872", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:1\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x15000000000679", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:48.981566", "stderr": "", "delta": "0:00:00.246306", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:1\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x15000000000679"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:49 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:49 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.614484", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:2\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067a", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:49.411463", "stderr": "", "delta": "0:00:00.203021", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:2\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067a"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:49 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.997748", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:3\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067b", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:49.798159", "stderr": "", "delta": "0:00:00.199589", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:3\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067b"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.381489", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:4\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067c", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.177327", "stderr": "", "delta": "0:00:00.204162", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:4\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067c"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.771962", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:5\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067d", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.566323", "stderr": "", "delta": "0:00:00.205639", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:5\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067d"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:51 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:51.236571", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:6\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067e", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.951268", "stderr": "", "delta": "0:00:00.285303", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "choir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:6\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067e"], "stderr_lines": [], "_ansible_no_log": false, "failed": false}
…gs (sonic-net#19310) Approach What is the motivation for this PR? Currently this test does not account for BUFFER_QUEUE configs to have only entry for an interface. In some SKU's and config BUFFER_QUEUE may have config such as "BUFFER_QUEUE": { "Ethernet0|0-2": { "profile": "egress_lossy_profile" }, "Ethernet0|3-4": { "profile": "egress_lossless_profile" }, "Ethernet0|5-7": { "profile": "egress_lossy_profile" }, or even "BUFFER_QUEUE": { "Ethernet0|0": { "profile": "egress_lossy_profile" }, "Ethernet0|1": { "profile": "egress_lossless_profile" }, "Ethernet0|2": { "profile": "egress_lossy_profile" }, ... etc The test works fine for the above configs. However if the BUFFER_QUEUE was configured such as "BUFFER_QUEUE": { "Ethernet0|0-9": { "profile": "egress_lossy_profile" }, "Ethernet100|0-9": { "profile": "egress_lossless_profile" }, "Ethernet200|0-9": { "profile": "egress_lossy_profile" }, When we delete Ethernet0|0-9 as part of del data['BUFFER_QUEUE'][ interface_buffer_queues[0] ] we end up deleting all queues for that interface from COUNTERS_QUEUE_NAME_MAP which causes check_buffer_queues_cnt_cmd_output to always return false. This test checks for such edge case and we split the BUFFER_QUEUE config such that we can delete an entry without deleting all entries in the map. How did you do it? Code change How did you verify/test it? Test on 20241110 01/07/2025 19:00:48 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"failed": true, "changed": true, "end": "2025-07-01 19:00:48.806079", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:0\"\n}\n]\nGRPC error\n redis: nil", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "delta": "0:00:00.199525", "stderr": "", "rc": 1, "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "start": "2025-07-01 19:00:48.606554", "msg": "non-zero return code", "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:0\"", "}", "]", "GRPC error", " redis: nil"], "stderr_lines": [], "_ansible_no_log": false} 01/07/2025 19:00:48 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:49 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.227872", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:1\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x15000000000679", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:48.981566", "stderr": "", "delta": "0:00:00.246306", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:1\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x15000000000679"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:49 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:49 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.614484", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:2\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067a", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:49.411463", "stderr": "", "delta": "0:00:00.203021", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:2\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067a"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:49 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.997748", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:3\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067b", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:49.798159", "stderr": "", "delta": "0:00:00.199589", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:3\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067b"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.381489", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:4\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067c", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.177327", "stderr": "", "delta": "0:00:00.204162", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:4\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067c"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.771962", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:5\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067d", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.566323", "stderr": "", "delta": "0:00:00.205639", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:5\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067d"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:51 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:51.236571", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:6\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067e", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.951268", "stderr": "", "delta": "0:00:00.285303", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "choir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:6\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067e"], "stderr_lines": [], "_ansible_no_log": false, "failed": false}
Code sync sonic-net/sonic-mgmt:202411 => 202412 ``` * c3fd4c0 (HEAD -> code-sync-202412, origin/code-sync-202412) r12f 250802:1704 - Merge remote-tracking branch 'base/202411' into code-sync-202412 |\ | * a7a638a (base/202411) nnelluri-cisco 250722:1131 - cherry pick for the PR#17101 (sonic-net#19748) | * fd4ae21 siva-prasad-cisco 250731:0002 - Ignore log analyzer error message related to source port GID mapping in kernel (sonic-net#19879) | * f986cfa Xu Chen 250730:2120 - Fix saithrift URL generation for Mellanox on internal-202411 branch sonic-net#19899 | * a07fb04 nnelluri-cisco 250604:1347 - filterd backplane ports while checking 'sudo sfputil show error-status' (sonic-net#17859) | * d707fcf nnelluri-cisco 250729:1208 - Added DPC role support for SmartSwitch. (sonic-net#18157) | * 80ea05a dypet 250414:1059 - Fix BFD status check and ipv6 PTF intermittent issue. (sonic-net#17819) | * fc623da Xu Chen 250725:1036 - support dynamic saithrift URL generation (sonic-net#19528) | * 0e5fc8a Mai Bui 250724:1807 - [202411] Ignore auditd error in loganalyzer (sonic-net#19767) | * d03770d Hua Liu 250218:1409 - [TACACS] Increase tacacs server reachability check timeout (sonic-net#16971) | * e8111ac nnelluri-cisco 250717:1033 - Generate new npu-dpu ports Ethernet224 To Ethernet280 for cisco smartswicth "Cisco-8102-28FH-DPU-O" (sonic-net#19257) | * e0060fa Zain Budhwani 250716:1109 - Remove yang_validate option from 202411 (sonic-net#19674) | * 89c4281 AharonMalkin 250715:2042 - Add Nvidia to supported platforms on intf_fec test (sonic-net#19398) | * f35fc20 mssonicbld 250716:0129 - Fix buffer queue cnt test to account for different BUFFER_QUEUE configs (sonic-net#19310) (sonic-net#19466) | * 3e0cabd Chuan Wu 250704:0327 - Update vlan ping test to override the affection of secondary vlan ip (sonic-net#18867) | * ff9d112 Longxiang Lyu 250714:1508 - [dualtor-io] Fix `test_active_link_admin_down_config_reload_link_up_downstream_standby` on Cisco/MLNX (sonic-net#18829) (sonic-net#19511) | * e870d66 Yawen 250714:1246 - [manual cherry-pick] add topo dualtor-aa-64-breakout to qos_sai_base.py (sonic-net#19543) | * 8369780 prabhataravind 250711:0929 - Enable skipped BFD and VxLAN tests on smartswitch T1 (sonic-net#19498) ```
…gs (sonic-net#19310) Approach What is the motivation for this PR? Currently this test does not account for BUFFER_QUEUE configs to have only entry for an interface. In some SKU's and config BUFFER_QUEUE may have config such as "BUFFER_QUEUE": { "Ethernet0|0-2": { "profile": "egress_lossy_profile" }, "Ethernet0|3-4": { "profile": "egress_lossless_profile" }, "Ethernet0|5-7": { "profile": "egress_lossy_profile" }, or even "BUFFER_QUEUE": { "Ethernet0|0": { "profile": "egress_lossy_profile" }, "Ethernet0|1": { "profile": "egress_lossless_profile" }, "Ethernet0|2": { "profile": "egress_lossy_profile" }, ... etc The test works fine for the above configs. However if the BUFFER_QUEUE was configured such as "BUFFER_QUEUE": { "Ethernet0|0-9": { "profile": "egress_lossy_profile" }, "Ethernet100|0-9": { "profile": "egress_lossless_profile" }, "Ethernet200|0-9": { "profile": "egress_lossy_profile" }, When we delete Ethernet0|0-9 as part of del data['BUFFER_QUEUE'][ interface_buffer_queues[0] ] we end up deleting all queues for that interface from COUNTERS_QUEUE_NAME_MAP which causes check_buffer_queues_cnt_cmd_output to always return false. This test checks for such edge case and we split the BUFFER_QUEUE config such that we can delete an entry without deleting all entries in the map. How did you do it? Code change How did you verify/test it? Test on 20241110 01/07/2025 19:00:48 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"failed": true, "changed": true, "end": "2025-07-01 19:00:48.806079", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path ------------------------- [elem { name: \"COUNTERS_QUEUE_NAME_MAP\" } elem { name: \"Ethernet0:0\" } ] GRPC error redis: nil", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "delta": "0:00:00.199525", "stderr": "", "rc": 1, "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "start": "2025-07-01 19:00:48.606554", "msg": "non-zero return code", "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:0\"", "}", "]", "GRPC error", " redis: nil"], "stderr_lines": [], "_ansible_no_log": false} 01/07/2025 19:00:48 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:49 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.227872", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path ------------------------- [elem { name: \"COUNTERS_QUEUE_NAME_MAP\" } elem { name: \"Ethernet0:1\" } ] The GetResponse is below ------------------------- oid:0x15000000000679", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:48.981566", "stderr": "", "delta": "0:00:00.246306", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:1\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x15000000000679"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:49 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:49 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.614484", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path ------------------------- [elem { name: \"COUNTERS_QUEUE_NAME_MAP\" } elem { name: \"Ethernet0:2\" } ] The GetResponse is below ------------------------- oid:0x1500000000067a", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:49.411463", "stderr": "", "delta": "0:00:00.203021", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:2\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067a"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:49 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.997748", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path ------------------------- [elem { name: \"COUNTERS_QUEUE_NAME_MAP\" } elem { name: \"Ethernet0:3\" } ] The GetResponse is below ------------------------- oid:0x1500000000067b", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:49.798159", "stderr": "", "delta": "0:00:00.199589", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:3\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067b"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.381489", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path ------------------------- [elem { name: \"COUNTERS_QUEUE_NAME_MAP\" } elem { name: \"Ethernet0:4\" } ] The GetResponse is below ------------------------- oid:0x1500000000067c", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.177327", "stderr": "", "delta": "0:00:00.204162", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:4\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067c"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.771962", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path ------------------------- [elem { name: \"COUNTERS_QUEUE_NAME_MAP\" } elem { name: \"Ethernet0:5\" } ] The GetResponse is below ------------------------- oid:0x1500000000067d", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.566323", "stderr": "", "delta": "0:00:00.205639", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:5\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067d"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:51 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:51.236571", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path ------------------------- [elem { name: \"COUNTERS_QUEUE_NAME_MAP\" } elem { name: \"Ethernet0:6\" } ] The GetResponse is below ------------------------- oid:0x1500000000067e", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.951268", "stderr": "", "delta": "0:00:00.285303", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "choir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:6\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067e"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} Signed-off-by: opcoder0 <[email protected]>
…gs (sonic-net#19310) Approach What is the motivation for this PR? Currently this test does not account for BUFFER_QUEUE configs to have only entry for an interface. In some SKU's and config BUFFER_QUEUE may have config such as "BUFFER_QUEUE": { "Ethernet0|0-2": { "profile": "egress_lossy_profile" }, "Ethernet0|3-4": { "profile": "egress_lossless_profile" }, "Ethernet0|5-7": { "profile": "egress_lossy_profile" }, or even "BUFFER_QUEUE": { "Ethernet0|0": { "profile": "egress_lossy_profile" }, "Ethernet0|1": { "profile": "egress_lossless_profile" }, "Ethernet0|2": { "profile": "egress_lossy_profile" }, ... etc The test works fine for the above configs. However if the BUFFER_QUEUE was configured such as "BUFFER_QUEUE": { "Ethernet0|0-9": { "profile": "egress_lossy_profile" }, "Ethernet100|0-9": { "profile": "egress_lossless_profile" }, "Ethernet200|0-9": { "profile": "egress_lossy_profile" }, When we delete Ethernet0|0-9 as part of del data['BUFFER_QUEUE'][ interface_buffer_queues[0] ] we end up deleting all queues for that interface from COUNTERS_QUEUE_NAME_MAP which causes check_buffer_queues_cnt_cmd_output to always return false. This test checks for such edge case and we split the BUFFER_QUEUE config such that we can delete an entry without deleting all entries in the map. How did you do it? Code change How did you verify/test it? Test on 20241110 01/07/2025 19:00:48 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"failed": true, "changed": true, "end": "2025-07-01 19:00:48.806079", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:0\"\n}\n]\nGRPC error\n redis: nil", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "delta": "0:00:00.199525", "stderr": "", "rc": 1, "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "start": "2025-07-01 19:00:48.606554", "msg": "non-zero return code", "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:0\"", "}", "]", "GRPC error", " redis: nil"], "stderr_lines": [], "_ansible_no_log": false} 01/07/2025 19:00:48 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:49 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.227872", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:1\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x15000000000679", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:48.981566", "stderr": "", "delta": "0:00:00.246306", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:1\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x15000000000679"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:49 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:49 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.614484", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:2\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067a", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:49.411463", "stderr": "", "delta": "0:00:00.203021", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:2\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067a"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:49 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.997748", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:3\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067b", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:49.798159", "stderr": "", "delta": "0:00:00.199589", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:3\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067b"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.381489", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:4\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067c", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.177327", "stderr": "", "delta": "0:00:00.204162", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:4\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067c"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.771962", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:5\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067d", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.566323", "stderr": "", "delta": "0:00:00.205639", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:5\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067d"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:51 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:51.236571", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:6\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067e", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.951268", "stderr": "", "delta": "0:00:00.285303", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "choir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:6\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067e"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} Signed-off-by: Guy Shemesh <[email protected]>
…gs (sonic-net#19310) Approach What is the motivation for this PR? Currently this test does not account for BUFFER_QUEUE configs to have only entry for an interface. In some SKU's and config BUFFER_QUEUE may have config such as "BUFFER_QUEUE": { "Ethernet0|0-2": { "profile": "egress_lossy_profile" }, "Ethernet0|3-4": { "profile": "egress_lossless_profile" }, "Ethernet0|5-7": { "profile": "egress_lossy_profile" }, or even "BUFFER_QUEUE": { "Ethernet0|0": { "profile": "egress_lossy_profile" }, "Ethernet0|1": { "profile": "egress_lossless_profile" }, "Ethernet0|2": { "profile": "egress_lossy_profile" }, ... etc The test works fine for the above configs. However if the BUFFER_QUEUE was configured such as "BUFFER_QUEUE": { "Ethernet0|0-9": { "profile": "egress_lossy_profile" }, "Ethernet100|0-9": { "profile": "egress_lossless_profile" }, "Ethernet200|0-9": { "profile": "egress_lossy_profile" }, When we delete Ethernet0|0-9 as part of del data['BUFFER_QUEUE'][ interface_buffer_queues[0] ] we end up deleting all queues for that interface from COUNTERS_QUEUE_NAME_MAP which causes check_buffer_queues_cnt_cmd_output to always return false. This test checks for such edge case and we split the BUFFER_QUEUE config such that we can delete an entry without deleting all entries in the map. How did you do it? Code change How did you verify/test it? Test on 20241110 01/07/2025 19:00:48 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"failed": true, "changed": true, "end": "2025-07-01 19:00:48.806079", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:0\"\n}\n]\nGRPC error\n redis: nil", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "delta": "0:00:00.199525", "stderr": "", "rc": 1, "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "start": "2025-07-01 19:00:48.606554", "msg": "non-zero return code", "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:0\"", "}", "]", "GRPC error", " redis: nil"], "stderr_lines": [], "_ansible_no_log": false} 01/07/2025 19:00:48 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:49 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.227872", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:1\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x15000000000679", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:48.981566", "stderr": "", "delta": "0:00:00.246306", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:1\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x15000000000679"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:49 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:49 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.614484", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:2\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067a", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:49.411463", "stderr": "", "delta": "0:00:00.203021", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:2\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067a"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:49 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.997748", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:3\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067b", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:49.798159", "stderr": "", "delta": "0:00:00.199589", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:3\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067b"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.381489", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:4\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067c", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.177327", "stderr": "", "delta": "0:00:00.204162", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:4\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067c"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.771962", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:5\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067d", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.566323", "stderr": "", "delta": "0:00:00.205639", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:5\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067d"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:51 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:51.236571", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:6\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067e", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.951268", "stderr": "", "delta": "0:00:00.285303", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "choir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:6\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067e"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} Signed-off-by: Aharon Malkin <[email protected]>
…gs (sonic-net#19310) Approach What is the motivation for this PR? Currently this test does not account for BUFFER_QUEUE configs to have only entry for an interface. In some SKU's and config BUFFER_QUEUE may have config such as "BUFFER_QUEUE": { "Ethernet0|0-2": { "profile": "egress_lossy_profile" }, "Ethernet0|3-4": { "profile": "egress_lossless_profile" }, "Ethernet0|5-7": { "profile": "egress_lossy_profile" }, or even "BUFFER_QUEUE": { "Ethernet0|0": { "profile": "egress_lossy_profile" }, "Ethernet0|1": { "profile": "egress_lossless_profile" }, "Ethernet0|2": { "profile": "egress_lossy_profile" }, ... etc The test works fine for the above configs. However if the BUFFER_QUEUE was configured such as "BUFFER_QUEUE": { "Ethernet0|0-9": { "profile": "egress_lossy_profile" }, "Ethernet100|0-9": { "profile": "egress_lossless_profile" }, "Ethernet200|0-9": { "profile": "egress_lossy_profile" }, When we delete Ethernet0|0-9 as part of del data['BUFFER_QUEUE'][ interface_buffer_queues[0] ] we end up deleting all queues for that interface from COUNTERS_QUEUE_NAME_MAP which causes check_buffer_queues_cnt_cmd_output to always return false. This test checks for such edge case and we split the BUFFER_QUEUE config such that we can delete an entry without deleting all entries in the map. How did you do it? Code change How did you verify/test it? Test on 20241110 01/07/2025 19:00:48 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"failed": true, "changed": true, "end": "2025-07-01 19:00:48.806079", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:0\"\n}\n]\nGRPC error\n redis: nil", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "delta": "0:00:00.199525", "stderr": "", "rc": 1, "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "start": "2025-07-01 19:00:48.606554", "msg": "non-zero return code", "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:0\"", "}", "]", "GRPC error", " redis: nil"], "stderr_lines": [], "_ansible_no_log": false} 01/07/2025 19:00:48 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:49 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.227872", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:1\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x15000000000679", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:48.981566", "stderr": "", "delta": "0:00:00.246306", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:1\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x15000000000679"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:49 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:49 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.614484", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:2\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067a", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:49.411463", "stderr": "", "delta": "0:00:00.203021", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:2\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067a"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:49 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.997748", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:3\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067b", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:49.798159", "stderr": "", "delta": "0:00:00.199589", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:3\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067b"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.381489", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:4\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067c", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.177327", "stderr": "", "delta": "0:00:00.204162", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:4\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067c"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.771962", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:5\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067d", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.566323", "stderr": "", "delta": "0:00:00.205639", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:5\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067d"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:51 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:51.236571", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:6\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067e", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.951268", "stderr": "", "delta": "0:00:00.285303", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "choir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:6\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067e"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} Signed-off-by: Guy Shemesh <[email protected]>
…gs (sonic-net#19310) Approach What is the motivation for this PR? Currently this test does not account for BUFFER_QUEUE configs to have only entry for an interface. In some SKU's and config BUFFER_QUEUE may have config such as "BUFFER_QUEUE": { "Ethernet0|0-2": { "profile": "egress_lossy_profile" }, "Ethernet0|3-4": { "profile": "egress_lossless_profile" }, "Ethernet0|5-7": { "profile": "egress_lossy_profile" }, or even "BUFFER_QUEUE": { "Ethernet0|0": { "profile": "egress_lossy_profile" }, "Ethernet0|1": { "profile": "egress_lossless_profile" }, "Ethernet0|2": { "profile": "egress_lossy_profile" }, ... etc The test works fine for the above configs. However if the BUFFER_QUEUE was configured such as "BUFFER_QUEUE": { "Ethernet0|0-9": { "profile": "egress_lossy_profile" }, "Ethernet100|0-9": { "profile": "egress_lossless_profile" }, "Ethernet200|0-9": { "profile": "egress_lossy_profile" }, When we delete Ethernet0|0-9 as part of del data['BUFFER_QUEUE'][ interface_buffer_queues[0] ] we end up deleting all queues for that interface from COUNTERS_QUEUE_NAME_MAP which causes check_buffer_queues_cnt_cmd_output to always return false. This test checks for such edge case and we split the BUFFER_QUEUE config such that we can delete an entry without deleting all entries in the map. How did you do it? Code change How did you verify/test it? Test on 20241110 01/07/2025 19:00:48 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"failed": true, "changed": true, "end": "2025-07-01 19:00:48.806079", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:0\"\n}\n]\nGRPC error\n redis: nil", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "delta": "0:00:00.199525", "stderr": "", "rc": 1, "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "start": "2025-07-01 19:00:48.606554", "msg": "non-zero return code", "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:0\"", "}", "]", "GRPC error", " redis: nil"], "stderr_lines": [], "_ansible_no_log": false} 01/07/2025 19:00:48 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:49 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.227872", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:1\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x15000000000679", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:48.981566", "stderr": "", "delta": "0:00:00.246306", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:1\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x15000000000679"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:49 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:49 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.614484", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:2\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067a", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:49.411463", "stderr": "", "delta": "0:00:00.203021", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:2\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067a"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:49 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.997748", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:3\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067b", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:49.798159", "stderr": "", "delta": "0:00:00.199589", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:3\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067b"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.381489", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:4\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067c", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.177327", "stderr": "", "delta": "0:00:00.204162", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:4\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067c"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.771962", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:5\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067d", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.566323", "stderr": "", "delta": "0:00:00.205639", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:5\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067d"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:51 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:51.236571", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:6\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067e", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.951268", "stderr": "", "delta": "0:00:00.285303", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "choir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:6\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067e"], "stderr_lines": [], "_ansible_no_log": false, "failed": false}
…gs (sonic-net#19310) Approach What is the motivation for this PR? Currently this test does not account for BUFFER_QUEUE configs to have only entry for an interface. In some SKU's and config BUFFER_QUEUE may have config such as "BUFFER_QUEUE": { "Ethernet0|0-2": { "profile": "egress_lossy_profile" }, "Ethernet0|3-4": { "profile": "egress_lossless_profile" }, "Ethernet0|5-7": { "profile": "egress_lossy_profile" }, or even "BUFFER_QUEUE": { "Ethernet0|0": { "profile": "egress_lossy_profile" }, "Ethernet0|1": { "profile": "egress_lossless_profile" }, "Ethernet0|2": { "profile": "egress_lossy_profile" }, ... etc The test works fine for the above configs. However if the BUFFER_QUEUE was configured such as "BUFFER_QUEUE": { "Ethernet0|0-9": { "profile": "egress_lossy_profile" }, "Ethernet100|0-9": { "profile": "egress_lossless_profile" }, "Ethernet200|0-9": { "profile": "egress_lossy_profile" }, When we delete Ethernet0|0-9 as part of del data['BUFFER_QUEUE'][ interface_buffer_queues[0] ] we end up deleting all queues for that interface from COUNTERS_QUEUE_NAME_MAP which causes check_buffer_queues_cnt_cmd_output to always return false. This test checks for such edge case and we split the BUFFER_QUEUE config such that we can delete an entry without deleting all entries in the map. How did you do it? Code change How did you verify/test it? Test on 20241110 01/07/2025 19:00:48 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"failed": true, "changed": true, "end": "2025-07-01 19:00:48.806079", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:0\"\n}\n]\nGRPC error\n redis: nil", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "delta": "0:00:00.199525", "stderr": "", "rc": 1, "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "start": "2025-07-01 19:00:48.606554", "msg": "non-zero return code", "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:0\"", "}", "]", "GRPC error", " redis: nil"], "stderr_lines": [], "_ansible_no_log": false} 01/07/2025 19:00:48 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:49 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.227872", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:1\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x15000000000679", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:48.981566", "stderr": "", "delta": "0:00:00.246306", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:1\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x15000000000679"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:49 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:49 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.614484", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:2\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067a", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:49.411463", "stderr": "", "delta": "0:00:00.203021", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:2\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067a"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:49 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.997748", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:3\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067b", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:49.798159", "stderr": "", "delta": "0:00:00.199589", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:3\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067b"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.381489", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:4\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067c", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.177327", "stderr": "", "delta": "0:00:00.204162", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:4\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067c"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.771962", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:5\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067d", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.566323", "stderr": "", "delta": "0:00:00.205639", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:5\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067d"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:51 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:51.236571", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:6\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067e", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.951268", "stderr": "", "delta": "0:00:00.285303", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "choir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:6\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067e"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} Signed-off-by: Guy Shemesh <[email protected]>
…gs (sonic-net#19310) Approach What is the motivation for this PR? Currently this test does not account for BUFFER_QUEUE configs to have only entry for an interface. In some SKU's and config BUFFER_QUEUE may have config such as "BUFFER_QUEUE": { "Ethernet0|0-2": { "profile": "egress_lossy_profile" }, "Ethernet0|3-4": { "profile": "egress_lossless_profile" }, "Ethernet0|5-7": { "profile": "egress_lossy_profile" }, or even "BUFFER_QUEUE": { "Ethernet0|0": { "profile": "egress_lossy_profile" }, "Ethernet0|1": { "profile": "egress_lossless_profile" }, "Ethernet0|2": { "profile": "egress_lossy_profile" }, ... etc The test works fine for the above configs. However if the BUFFER_QUEUE was configured such as "BUFFER_QUEUE": { "Ethernet0|0-9": { "profile": "egress_lossy_profile" }, "Ethernet100|0-9": { "profile": "egress_lossless_profile" }, "Ethernet200|0-9": { "profile": "egress_lossy_profile" }, When we delete Ethernet0|0-9 as part of del data['BUFFER_QUEUE'][ interface_buffer_queues[0] ] we end up deleting all queues for that interface from COUNTERS_QUEUE_NAME_MAP which causes check_buffer_queues_cnt_cmd_output to always return false. This test checks for such edge case and we split the BUFFER_QUEUE config such that we can delete an entry without deleting all entries in the map. How did you do it? Code change How did you verify/test it? Test on 20241110 01/07/2025 19:00:48 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"failed": true, "changed": true, "end": "2025-07-01 19:00:48.806079", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:0\"\n}\n]\nGRPC error\n redis: nil", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "delta": "0:00:00.199525", "stderr": "", "rc": 1, "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "start": "2025-07-01 19:00:48.606554", "msg": "non-zero return code", "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:0\"", "}", "]", "GRPC error", " redis: nil"], "stderr_lines": [], "_ansible_no_log": false} 01/07/2025 19:00:48 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:49 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.227872", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:1\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x15000000000679", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:48.981566", "stderr": "", "delta": "0:00:00.246306", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:1\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x15000000000679"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:49 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:49 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.614484", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:2\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067a", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:49.411463", "stderr": "", "delta": "0:00:00.203021", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:2\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067a"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:49 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.997748", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:3\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067b", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:49.798159", "stderr": "", "delta": "0:00:00.199589", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:3\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067b"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.381489", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:4\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067c", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.177327", "stderr": "", "delta": "0:00:00.204162", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:4\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067c"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:50 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.771962", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:5\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067d", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.566323", "stderr": "", "delta": "0:00:00.205639", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:5\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067d"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} 01/07/2025 19:00:50 base._run L0071 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" "], kwargs={"module_ignore_errors": true} 01/07/2025 19:00:51 base._run L0108 DEBUG | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:51.236571", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path\n ------------------------- \n [elem {\n name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n name: \"Ethernet0:6\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067e", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "rc": 0, "start": "2025-07-01 19:00:50.951268", "stderr": "", "delta": "0:00:00.285303", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6 -xt COUNTERS_DB -o \"xxxxxxxxx\" ", "removes": null, "argv": null, "warn": true, "choir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx with the following gNMI Path", " ------------------------- ", " [elem {", " name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", " name: \"Ethernet0:6\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067e"], "stderr_lines": [], "_ansible_no_log": false, "failed": false} Signed-off-by: Yael Tzur <[email protected]>
Description of PR
Summary:
Fixes #19201
MSADO: 33479698
Type of change
Back port request
Approach
What is the motivation for this PR?
Currently this test does not account for BUFFER_QUEUE configs to have only entry for an interface.
In some SKU's and config
BUFFER_QUEUE may have config such as
or even
The test works fine for the above configs.
However if the BUFFER_QUEUE was configured such as
When we delete Ethernet0|0-9 as part of del data['BUFFER_QUEUE'][ interface_buffer_queues[0] ] we end up deleting all queues for that interface from COUNTERS_QUEUE_NAME_MAP which causes check_buffer_queues_cnt_cmd_output to always return false.
This test checks for such edge case and we split the BUFFER_QUEUE config such that we can delete an entry without deleting all entries in the map.
How did you do it?
Code change
How did you verify/test it?
Test on 20241110
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation