From d524b0b6c89e0d1708fdb0c2021735f2ec3d631a Mon Sep 17 00:00:00 2001 From: Song Yuan <64041228+ysmanman@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:47:10 -0800 Subject: [PATCH] Use WRED red for DNX (#15126) Description of PR Braodcom DNX only supports WRED red. So update test accordingly. snappi_tests/ecn/test_dequeue_ecn_with_snappi.py::test_dequeue_ecn -------------------------------- live log call --------------------------------- 05:51:48 snappi_api.warning L1138 WARNING| Capture was not stopped for this port Port 0 FAILED [100%] syntax error is fixed. Okay to merge. The new failure E Failed: Only capture 0/101 IP packets. is a different issue. that can be handled in another PR. co-authorized by: jianquanye@microsoft.com --- tests/common/snappi_tests/common_helpers.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/common/snappi_tests/common_helpers.py b/tests/common/snappi_tests/common_helpers.py index 68ce47f8367..35155095035 100644 --- a/tests/common/snappi_tests/common_helpers.py +++ b/tests/common/snappi_tests/common_helpers.py @@ -472,20 +472,20 @@ def config_wred(host_ans, kmin, kmax, pmax, profile=None, asic_value=None): color = 'green' - # Broadcom ASIC only supports RED. - if asic_type == 'broadcom': + # Broadcom DNX ASIC only supports RED. + if "platform_asic" in host_ans.facts and host_ans.facts["platform_asic"] == "broadcom-dnx": color = 'red' - kmax_arg = '-{}max' % color[0] - kmin_arg = '-{}min' % color[0] + kmax_arg = '-{}max'.format(color[0]) + kmin_arg = '-{}min'.format(color[0]) for p in profiles: """ This is not the profile to configure """ if profile is not None and profile != p: continue - kmin_old = int(profiles[p]['{}_min_threshold' % color]) - kmax_old = int(profiles[p]['{}_max_threshold' % color]) + kmin_old = int(profiles[p]['{}_min_threshold'.format(color)]) + kmax_old = int(profiles[p]['{}_max_threshold'.format(color)]) if kmin_old > kmax_old: return False