From c3597b104f6ffb4b1b779dbbe54892b363f271b4 Mon Sep 17 00:00:00 2001 From: vkjammala-arista <152394203+vkjammala-arista@users.noreply.github.com> Date: Thu, 31 Jul 2025 06:27:09 +0530 Subject: [PATCH] [snappi-T2] Fix pfcwd/test_pfcwd_actions.py to consider asic value (#19592) Description of PR Summary: [snappi-T2] Fix pfcwd/test_pfcwd_actions.py to consider asic value Fixes # #19591 Type of change Bug fix Testbed and Framework(new/improvement) New Test case Skipped for non-supported platforms Test case improvement Back port request 202205 202305 202311 202405 202411 202505 msft-202405 Approach What is the motivation for this PR? Helper method run_pfc_test is not passing asic_value of the port for enabling/disabling of pfcwd on the dut. This causes config to be not applied for multi-asic devices, where config command needs to be run on asic namespace. And test is failing with No Tx PFCs from DUT after receiving PFCs. How did you do it? Updated helper method to pass asic_value correctly. How did you verify/test it? Test is passing with the fix. co-authorized by: jianquanye@microsoft.com --- .../pfcwd/files/pfcwd_actions_helper.py | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/snappi_tests/pfcwd/files/pfcwd_actions_helper.py b/tests/snappi_tests/pfcwd/files/pfcwd_actions_helper.py index 9c4c04e5e47..7c1a28da2bd 100644 --- a/tests/snappi_tests/pfcwd/files/pfcwd_actions_helper.py +++ b/tests/snappi_tests/pfcwd/files/pfcwd_actions_helper.py @@ -100,22 +100,24 @@ def run_pfc_test(api, pytest_assert(testbed_config is not None, 'Fail to get L2/3 testbed config') + rx_port_asic_value = rx_port['asic_value'] if egress_duthost.is_multi_asic else None + tx_port_asic_value = tx_port['asic_value'] if ingress_duthost.is_multi_asic else None if (test_def['enable_pfcwd_drop']): - start_pfcwd(egress_duthost) - start_pfcwd(ingress_duthost) + start_pfcwd(egress_duthost, rx_port_asic_value) + start_pfcwd(ingress_duthost, tx_port_asic_value) elif (test_def['enable_pfcwd_fwd']): - start_pfcwd_fwd(egress_duthost) - start_pfcwd_fwd(ingress_duthost) + start_pfcwd_fwd(egress_duthost, rx_port_asic_value) + start_pfcwd_fwd(ingress_duthost, tx_port_asic_value) else: - stop_pfcwd(egress_duthost) - stop_pfcwd(ingress_duthost) + stop_pfcwd(egress_duthost, rx_port_asic_value) + stop_pfcwd(ingress_duthost, tx_port_asic_value) if (test_def['enable_credit_wd']): - enable_packet_aging(egress_duthost, rx_port['asic_value']) - enable_packet_aging(ingress_duthost, tx_port['asic_value']) + enable_packet_aging(egress_duthost, rx_port_asic_value) + enable_packet_aging(ingress_duthost, tx_port_asic_value) else: - disable_packet_aging(egress_duthost, rx_port['asic_value']) - disable_packet_aging(ingress_duthost, tx_port['asic_value']) + disable_packet_aging(egress_duthost, rx_port_asic_value) + disable_packet_aging(ingress_duthost, tx_port_asic_value) rx_port_id = 0