Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[action] [PR:16807] Adjust TSA-TSB related sonic-mgmt testcases #16961

Merged
merged 1 commit into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/bgp/test_reliable_tsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ def config_reload_linecard_if_unhealthy(lc):
if not (int_status_result[lc] and crit_process_check[lc] and
TS_NORMAL == get_traffic_shift_state(lc, cmd='TSC no-stats')):
logging.info("DUT is not in normal state after supervisor cold reboot, doing config-reload")
config_reload(lc, safe_reload=True, check_intf_up_ports=True)
config_reload(lc, safe_reload=True, check_intf_up_ports=True, exec_tsb=True)

# Make sure linecards are in Normal state, if not do config-reload on the dut
with SafeThreadPoolExecutor(max_workers=8) as executor:
Expand Down Expand Up @@ -1230,7 +1230,7 @@ def config_reload_linecard_if_unhealthy(lc):
if not (int_status_result[lc] and crit_process_check[lc] and
TS_NORMAL == get_traffic_shift_state(lc, cmd='TSC no-stats')):
logging.info("DUT is not in normal state after supervisor cold reboot, doing config-reload")
config_reload(lc, safe_reload=True, check_intf_up_ports=True)
config_reload(lc, safe_reload=True, check_intf_up_ports=True, exec_tsb=True)

# Make sure linecards are in Normal state, if not do config-reload on the dut to recover
with SafeThreadPoolExecutor(max_workers=8) as executor:
Expand Down Expand Up @@ -1613,7 +1613,7 @@ def config_reload_linecard_if_unhealthy(lc):
if not (int_status_result[lc] and crit_process_check[lc] and
TS_NORMAL == get_traffic_shift_state(lc, cmd='TSC no-stats')):
logging.info("DUT is not in normal state after supervisor cold reboot, doing config-reload")
config_reload(lc, safe_reload=True, check_intf_up_ports=True)
config_reload(lc, safe_reload=True, check_intf_up_ports=True, exec_tsb=True)

# Make sure linecards are in Normal state, if not do config-reload on the dut to recover
with SafeThreadPoolExecutor(max_workers=8) as executor:
Expand Down Expand Up @@ -1723,7 +1723,7 @@ def config_reload_linecard_if_unhealthy(lc):
if not (int_status_result and crit_process_check and
TS_NORMAL == get_traffic_shift_state(lc, cmd='TSC no-stats')):
logging.info("DUT is not in normal state after supervisor cold reboot, doing config-reload")
config_reload(lc, safe_reload=True, check_intf_up_ports=True)
config_reload(lc, safe_reload=True, check_intf_up_ports=True, exec_tsb=True)

with SafeThreadPoolExecutor(max_workers=8) as executor:
for linecard in duthosts.frontend_nodes:
Expand Down
20 changes: 10 additions & 10 deletions tests/bgp/test_startup_tsa_tsb_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def config_reload_linecard_if_unhealthy(lc):
)

logging.info("DUT is not in normal state after cold reboot, doing config-reload")
config_reload(lc, safe_reload=True, check_intf_up_ports=True)
config_reload(lc, safe_reload=True, check_intf_up_ports=True, exec_tsb=True)

with SafeThreadPoolExecutor(max_workers=8) as executor:
for linecard in frontend_nodes_per_hwsku:
Expand Down Expand Up @@ -481,7 +481,7 @@ def config_reload_linecard_if_unhealthy(lc):
)

logging.info("DUT is not in normal state after abnormal reboot, doing config-reload")
config_reload(lc, safe_reload=True, check_intf_up_ports=True)
config_reload(lc, safe_reload=True, check_intf_up_ports=True, exec_tsb=True)

with SafeThreadPoolExecutor(max_workers=8) as executor:
for linecard in frontend_nodes_per_hwsku:
Expand Down Expand Up @@ -625,7 +625,7 @@ def config_reload_linecard_if_unhealthy(lc):
)

logging.info("DUT is not in normal state after supervisor cold reboot, doing config-reload")
config_reload(lc, safe_reload=True, check_intf_up_ports=True)
config_reload(lc, safe_reload=True, check_intf_up_ports=True, exec_tsb=True)

# Make sure DUT is in normal state after supervisor cold reboot
with SafeThreadPoolExecutor(max_workers=8) as executor:
Expand Down Expand Up @@ -789,7 +789,7 @@ def config_reload_linecard_if_unhealthy(lc):
)

logging.info("DUT is not in normal state after SUP abnormal reboot, doing config-reload")
config_reload(lc, safe_reload=True, check_intf_up_ports=True)
config_reload(lc, safe_reload=True, check_intf_up_ports=True, exec_tsb=True)

# Make sure DUT is in normal state after supervisor abnormal reboot
with SafeThreadPoolExecutor(max_workers=8) as executor:
Expand Down Expand Up @@ -912,7 +912,7 @@ def run_tsb_and_config_reload(lc):
# Recover to Normal state
lc.shell("TSB")
lc.shell('sudo config save -y')
config_reload(lc, safe_reload=True, check_intf_up_ports=True)
config_reload(lc, safe_reload=True, check_intf_up_ports=True, exec_tsb=True)

with SafeThreadPoolExecutor(max_workers=8) as executor:
for linecard in frontend_nodes_per_hwsku:
Expand Down Expand Up @@ -1061,7 +1061,7 @@ def config_reload_linecard_if_unhealthy(lc):
)

logging.info("DUT is not in normal state after cold reboot, doing config-reload")
config_reload(lc, safe_reload=True, check_intf_up_ports=True)
config_reload(lc, safe_reload=True, check_intf_up_ports=True, exec_tsb=True)

with SafeThreadPoolExecutor(max_workers=8) as executor:
for linecard in frontend_nodes_per_hwsku:
Expand Down Expand Up @@ -1200,7 +1200,7 @@ def config_reload_linecard_if_unhealthy(lc):
)

logging.info("DUT is not in normal state after cold reboot, doing config-reload")
config_reload(lc, safe_reload=True, check_intf_up_ports=True)
config_reload(lc, safe_reload=True, check_intf_up_ports=True, exec_tsb=True)

with SafeThreadPoolExecutor(max_workers=8) as executor:
for linecard in frontend_nodes_per_hwsku:
Expand Down Expand Up @@ -1350,7 +1350,7 @@ def config_reload_linecard_if_unhealthy(lc):
)

logging.info("DUT is not in normal state after supervisor cold reboot, doing config-reload")
config_reload(lc, safe_reload=True, check_intf_up_ports=True)
config_reload(lc, safe_reload=True, check_intf_up_ports=True, exec_tsb=True)

# Make sure linecards are in Normal state and save the config to proceed further
with SafeThreadPoolExecutor(max_workers=8) as executor:
Expand Down Expand Up @@ -1489,7 +1489,7 @@ def config_reload_linecard_if_unhealthy(lc):
)

logging.info("DUT is not in normal state after cold reboot, doing config-reload")
config_reload(lc, safe_reload=True, check_intf_up_ports=True)
config_reload(lc, safe_reload=True, check_intf_up_ports=True, exec_tsb=True)

with SafeThreadPoolExecutor(max_workers=8) as executor:
for linecard in frontend_nodes_per_hwsku:
Expand Down Expand Up @@ -1629,7 +1629,7 @@ def config_reload_linecard_if_unhealthy(lc):
)

logging.info("DUT is not in normal state after supervisor cold reboot, doing config-reload")
config_reload(lc, safe_reload=True, check_intf_up_ports=True)
config_reload(lc, safe_reload=True, check_intf_up_ports=True, exec_tsb=True)

with SafeThreadPoolExecutor(max_workers=8) as executor:
for linecard in duthosts.frontend_nodes:
Expand Down
5 changes: 4 additions & 1 deletion tests/common/config_reload.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def pfcwd_feature_enabled(duthost):
def config_reload(sonic_host, config_source='config_db', wait=120, start_bgp=True, start_dynamic_buffer=True,
safe_reload=False, wait_before_force_reload=0, wait_for_bgp=False,
check_intf_up_ports=False, traffic_shift_away=False, override_config=False,
golden_config_path=DEFAULT_GOLDEN_CONFIG_PATH, is_dut=True):
golden_config_path=DEFAULT_GOLDEN_CONFIG_PATH, is_dut=True, exec_tsb=False):
"""
reload SONiC configuration
:param sonic_host: SONiC host object
Expand Down Expand Up @@ -220,3 +220,6 @@ def _config_reload_cmd_wrapper(cmd, executable):
wait_until(wait + 120, 10, 0, sonic_host.check_bgp_session_state_all_asics, bgp_neighbors),
"Not all bgp sessions are established after config reload",
)

if exec_tsb:
sonic_host.shell("TSB")
Loading