Skip to content

Commit

Permalink
Fix test_ecmp_hash_seed_value failure on 202311 (#13632)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ZhaohuiS authored and mssonicbld committed Jul 15, 2024
1 parent 5a19cca commit b5c5f41
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,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:
Expand Down
14 changes: 9 additions & 5 deletions tests/ecmp/test_ecmp_sai_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")

Expand Down Expand Up @@ -274,7 +278,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, reboot_kwargs=None)
Expand Down

0 comments on commit b5c5f41

Please sign in to comment.