Skip to content

Commit 294aa9f

Browse files
vivekverma-aristagshemesh2
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] Signed-off-by: Guy Shemesh <[email protected]>
1 parent 911e888 commit 294aa9f

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
@@ -2599,7 +2599,7 @@ def collect_db_dump(request, duthosts):
25992599
collect_db_dump_on_duts(request, duthosts)
26002600

26012601

2602-
def restore_config_db_and_config_reload(duts_data, duthosts):
2602+
def restore_config_db_and_config_reload(duts_data, duthosts, request):
26032603
# First copy the pre_running_config to the config_db.json files
26042604
for duthost in duthosts:
26052605
logger.info("dut reload called on {}".format(duthost.hostname))
@@ -2615,11 +2615,13 @@ def restore_config_db_and_config_reload(duts_data, duthosts):
26152615
duthost.copy(src=asic_cfg_file, dest='/etc/sonic/config_db{}.json'.format(asic_index), verbose=False)
26162616
os.remove(asic_cfg_file)
26172617

2618+
wait_for_bgp = False if request.config.getoption("skip_sanity") else True
2619+
26182620
# Second execute config reload on all duthosts
26192621
with SafeThreadPoolExecutor(max_workers=8) as executor:
26202622
for duthost in duthosts:
26212623
executor.submit(config_reload, duthost, wait_before_force_reload=300, safe_reload=True,
2622-
check_intf_up_ports=True, wait_for_bgp=True)
2624+
check_intf_up_ports=True, wait_for_bgp=wait_for_bgp)
26232625

26242626

26252627
def compare_running_config(pre_running_config, cur_running_config):
@@ -2927,7 +2929,7 @@ def _remove_entry(table_name, key_name, config):
29272929
logger.warning("Core dump or config check failed for {}, results: {}"
29282930
.format(module_name, json.dumps(check_result)))
29292931

2930-
restore_config_db_and_config_reload(duts_data, duthosts)
2932+
restore_config_db_and_config_reload(duts_data, duthosts, request)
29312933
else:
29322934
logger.info("Core dump and config check passed for {}".format(module_name))
29332935

0 commit comments

Comments
 (0)