From 6e63000d9219786ab2b3ec63554db6fa515f08cf Mon Sep 17 00:00:00 2001 From: Zhaohui Sun <94606222+ZhaohuiS@users.noreply.github.com> Date: Mon, 15 Jul 2024 15:46:03 +0800 Subject: [PATCH] Fix test_ecmp_hash_seed_value failure on 202311 (#13632) What is the motivation for this PR? Fix test_ecmp_hash_seed_value failure on 202311 fix one function mistake in case. remove internal and master from skip list, internal and master should support this case now How did you do it? Only check if sai_hash_seed_config_hash_offset_enable exists in config.bcm for 202305 branch, will skip this check for other branches. How did you verify/test it? run test_ecmp_sai_value against 202311. --- .../conditional_mark/tests_mark_conditions.yaml | 3 +-- tests/ecmp/test_ecmp_sai_value.py | 14 +++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml b/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml index 0a42b684d05..16d0bd5301f 100644 --- a/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml +++ b/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml @@ -524,8 +524,7 @@ ecmp/test_ecmp_sai_value.py: conditions: - "topo_type not in ['t1', 't0']" - "asic_type not in ['broadcom']" - - "release in ['201911', '202012', '202205', '202211', 'master']" - - "'internal' in build_version" + - "release in ['201911', '202012', '202205', '202211']" - "topo_type in ['t1'] and hwsku in ['Arista-7050CX3-32S-C32']" ecmp/test_fgnhg.py: diff --git a/tests/ecmp/test_ecmp_sai_value.py b/tests/ecmp/test_ecmp_sai_value.py index 795b22d46fe..05c02e51d55 100644 --- a/tests/ecmp/test_ecmp_sai_value.py +++ b/tests/ecmp/test_ecmp_sai_value.py @@ -126,10 +126,14 @@ def check_config_bcm_file(duthost, topo_type): logging.info("sai_hash_seed_config_hash_offset_enable={}".format(value)) else: logging.info("sai_hash_seed_config_hash_offset_enable not found in the file.") - if topo_type == "t0": - pytest_assert(not cat_output, "sai_hash_seed_config_hash_offset_enable should not set for T0") - if topo_type == "t1": - pytest_assert(cat_output and value == "1", "sai_hash_seed_config_hash_offset_enable is not set to 1") + # with code change https://github.com/sonic-net/sonic-buildimage/pull/18912, + # the sai_hash_seed_config_hash_offset_enable is not set in config.bcm, + # it's set by swss config on 202311 and later image + if "20230531" in duthost.os_version: + if topo_type == "t0": + pytest_assert(not cat_output, "sai_hash_seed_config_hash_offset_enable should not set for T0") + if topo_type == "t1": + pytest_assert(cat_output and value == "1", "sai_hash_seed_config_hash_offset_enable is not set to 1") else: pytest.fail("Config bcm file not found.") @@ -276,7 +280,7 @@ def test_ecmp_offset_value(localhost, duthosts, tbinfo, enum_rand_one_per_hwsku_ elif parameter == "reload": logging.info("Run config reload on DUT") config_reload(duthost, safe_reload=True, check_intf_up_ports=True) - check_hash_seed_value(duthost, asic_name, topo_type) + check_ecmp_offset_value(duthost, asic_name, topo_type, hwsku) elif parameter == "reboot": logging.info("Run cold reboot on DUT") reboot(duthost, localhost, reboot_type=REBOOT_TYPE_COLD, reboot_helper=None,