From a3bba81fb3b5cb178bacab41af21b334f64a3ea3 Mon Sep 17 00:00:00 2001 From: Jibin Bao Date: Thu, 17 Mar 2022 15:53:47 +0800 Subject: [PATCH] Fix dynamic buffer test bug for spc4 On spc4 for 8 lane the max speed is 800G, so update code to get max speed by platform. --- tests/qos/files/dynamic_buffer_param.json | 9 +++++++++ tests/qos/test_buffer.py | 6 ++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/qos/files/dynamic_buffer_param.json b/tests/qos/files/dynamic_buffer_param.json index 718011a73b3..60e67e01498 100644 --- a/tests/qos/files/dynamic_buffer_param.json +++ b/tests/qos/files/dynamic_buffer_param.json @@ -45,6 +45,15 @@ }, "BUFFER_PORT_INGRESS_PROFILE_LIST_TABLE": ["[BUFFER_PROFILE_TABLE:ingress_lossless_zero_profile]"], "BUFFER_PORT_EGRESS_PROFILE_LIST_TABLE": ["[BUFFER_PROFILE_TABLE:egress_lossless_zero_profile]", "[BUFFER_PROFILE_TABLE:egress_lossy_zero_profile]"] + }, + "max_speed_8lane_platform": { + "x86_64-mlnx_msn4410-r0": "400000", + "x86_64-mlnx_msn4700-r0": "400000", + "x86_64-mlnx_msn4700_simx-r0": "400000", + "x86_64-nvidia_sn4800-r0": "400000", + "x86_64-nvidia_sn4800_simx-r0": "400000", + "x86_64-nvidia_sn5600-r0": "800000", + "x86_64-nvidia_sn5600_simx-r0": "800000" } } } diff --git a/tests/qos/test_buffer.py b/tests/qos/test_buffer.py index 9af376eaaa3..18ac6e592af 100644 --- a/tests/qos/test_buffer.py +++ b/tests/qos/test_buffer.py @@ -215,6 +215,7 @@ def load_test_parameters(duthost): global TESTPARAM_EXTRA_OVERHEAD global TESTPARAM_ADMIN_DOWN global ASIC_TYPE + global MAX_SPEED_8LANE_PORT param_file_name = "qos/files/dynamic_buffer_param.json" with open(param_file_name) as file: @@ -228,6 +229,7 @@ def load_test_parameters(duthost): TESTPARAM_SHARED_HEADROOM_POOL = vendor_specific_param['shared-headroom-pool'] TESTPARAM_EXTRA_OVERHEAD = vendor_specific_param['extra_overhead'] TESTPARAM_ADMIN_DOWN = vendor_specific_param['admin-down'] + MAX_SPEED_8LANE_PORT = vendor_specific_param['max_speed_8lane_platform'].get(duthost.facts['platform']) # For ingress profile list, we need to check whether the ingress lossy profile exists ingress_lossy_pool = duthost.shell('redis-cli -n 4 keys "BUFFER_POOL|ingress_lossy_pool"')['stdout'] @@ -748,9 +750,9 @@ def make_expected_profile_name(speed, cable_length, **kwargs): if ASIC_TYPE == 'mellanox': number_of_lanes = kwargs.get('number_of_lanes') if number_of_lanes is not None: - if number_of_lanes == 8 and speed != '400000': + if number_of_lanes == 8 and speed != MAX_SPEED_8LANE_PORT: expected_profile += '8lane_' - elif NUMBER_OF_LANES == 8 and speed != '400000': + elif NUMBER_OF_LANES == 8 and speed != MAX_SPEED_8LANE_PORT: expected_profile += '8lane_' expected_profile += 'profile' return expected_profile