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

[T2][Chassis] tsa-tsb: Add additional timer check before checking tsa-tsb service status #15649

Merged
merged 1 commit into from
Dec 14, 2024
Merged
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
12 changes: 11 additions & 1 deletion tests/bgp/test_startup_tsa_tsb_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ def check_tsc_command_error(duthost):
return False


def check_tsa_tsb_service_run_time_diff(service_uptime, configured_service_timer):
"""
@summary: Determine time difference between service runtime and configured value
"""
current_time = datetime.datetime.now()
actual_service_timer = (current_time - service_uptime).total_seconds()
return int(actual_service_timer) < configured_service_timer


def nbrhosts_to_dut(duthost, nbrhosts):
"""
@summary: Fetch the neighbor hosts' details for duthost
Expand Down Expand Up @@ -1102,7 +1111,8 @@ def test_user_init_tsb_on_sup_while_service_run_on_dut(duthosts, localhost,
suphost.shell('TSB')

for linecard in duthosts.frontend_nodes:
if get_tsa_tsb_service_status(linecard, 'running'):
if get_tsa_tsb_service_status(linecard, 'running') and \
check_tsa_tsb_service_run_time_diff(service_uptime, tsa_tsb_timer[linecard]):
# Verify DUT continues to be in maintenance state if the timer is running.
pytest_assert(TS_MAINTENANCE == get_traffic_shift_state(linecard, cmd='TSC no-stats'),
"DUT is not in maintenance state when startup_tsa_tsb service is running")
Expand Down
Loading