Skip to content

Commit 8e35a60

Browse files
vivekverma-aristamssonicbld
authored andcommitted
Skip BGP check in teardown if is used (sonic-net#18408)
Description of PR Summary: Skip BGP check in teardown if --skip-sanity is used Fixes sonic-net#18407 Type of change Bug fix Testbed and Framework(new/improvement) New Test case Skipped for non-supported platforms Test case improvement Back port request 202012 202205 202305 202311 202405 202411 msft-202405 msft-202412 Approach What is the motivation for this PR? The issue is described here: sonic-net#18407 How did you do it? Skip bgp check in teradown if --skip-sanity was passed while running the test. co-authorized by: [email protected]
1 parent 5573caf commit 8e35a60

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/conftest.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2538,7 +2538,7 @@ def collect_db_dump(request, duthosts):
25382538
collect_db_dump_on_duts(request, duthosts)
25392539

25402540

2541-
def restore_config_db_and_config_reload(duts_data, duthosts):
2541+
def restore_config_db_and_config_reload(duts_data, duthosts, request):
25422542
# First copy the pre_running_config to the config_db.json files
25432543
for duthost in duthosts:
25442544
logger.info("dut reload called on {}".format(duthost.hostname))
@@ -2554,11 +2554,13 @@ def restore_config_db_and_config_reload(duts_data, duthosts):
25542554
duthost.copy(src=asic_cfg_file, dest='/etc/sonic/config_db{}.json'.format(asic_index), verbose=False)
25552555
os.remove(asic_cfg_file)
25562556

2557+
wait_for_bgp = False if request.config.getoption("skip_sanity") else True
2558+
25572559
# Second execute config reload on all duthosts
25582560
with SafeThreadPoolExecutor(max_workers=8) as executor:
25592561
for duthost in duthosts:
25602562
executor.submit(config_reload, duthost, wait_before_force_reload=300, safe_reload=True,
2561-
check_intf_up_ports=True, wait_for_bgp=True)
2563+
check_intf_up_ports=True, wait_for_bgp=wait_for_bgp)
25622564

25632565

25642566
def compare_running_config(pre_running_config, cur_running_config):
@@ -2866,7 +2868,7 @@ def _remove_entry(table_name, key_name, config):
28662868
logger.warning("Core dump or config check failed for {}, results: {}"
28672869
.format(module_name, json.dumps(check_result)))
28682870

2869-
restore_config_db_and_config_reload(duts_data, duthosts)
2871+
restore_config_db_and_config_reload(duts_data, duthosts, request)
28702872
else:
28712873
logger.info("Core dump and config check passed for {}".format(module_name))
28722874

0 commit comments

Comments
 (0)