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:15649] [T2][Chassis] tsa-tsb: Add additional timer check before checking tsa-tsb service status #16101

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

mssonicbld
Copy link
Collaborator

Description of PR

Summary:
Fixes # (issue)

  • This PR fixes a corner case w.r.t 'test_user_init_tsb_on_sup_while_service_run_on_dut' test under 'test_startup_tsa_tsb_service.py' and adds more check while fetching the 'tsa-tsb' service status on the line cards after applying 'TSB' on supervisor card.
  • The fix makes sure if the service is 'Active' running state and the service uptime is not the same as configured time.

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Back port request

  • 202012
  • 202205
  • 202305
  • 202311
  • 202405

Approach

What is the motivation for this PR?

  • The test 'test_user_init_tsb_on_sup_while_service_run_on_dut' fails with the following reason for one of the line card,
 # Issue user initiated TSB on the supervisor
 suphost.shell('TSB')
 
 for linecard in duthosts.frontend_nodes:
 if get_tsa_tsb_service_status(linecard, 'running'):
 # 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")
E Failed: DUT is not in maintenance state when startup_tsa_tsb service is running
  • This is because when the service status is checked for the second line card after the service run is completed for the first line card, there are chances the following would happen. Service would show as running and runtime also shows the configured time value (900 seconds = 15 min) and the 'TSC' command shows the state as NORMAL already.

**"stdout": " Active: active (running) since Sat 2024-11-16 20:19:21 UTC; 15min ago",**

AnsibleModule::shell, args=["sudo systemctl status startup_tsa_tsb.service | grep 'Active'"], kwargs={}
AnsibleModule::shell Result => {"changed": true, "stdout": " Active: active (running) since Sat 2024-11-16 20:19:21 UTC; 15min ago", "stderr": "", "rc": 0, "cmd": "sudo systemctl status startup_tsa_tsb.service | grep 'Active'", "start": "2024-11-16 20:34:32.082092", "end": "2024-11-16 20:34:32.107746", "delta": "0:00:00.025654", "msg": "", "invocation": {"module_args": {"_raw_params": "sudo systemctl status startup_tsa_tsb.service | grep 'Active'", "_uses_shell": true, "warn": false, "stdin_add_newline": true, "strip_empty_ends": true, "argv": null, "chdir": null, "executable": null, "creates": null, "removes": null, "stdin": null}}, "stdout_lines": [" Active: active (running) since Sat 2024-11-16 20:19:21 UTC; 15min ago"], "stderr_lines": [], "_ansible_no_log": null, "failed": false}
AnsibleModule::shell, args=["TSC no-stats"], kwargs={}
AnsibleModule::shell Result => {"changed": true, "stdout": "BGP0 : System Mode: Normal\nBGP1 : System Mode: Normal", "stderr": "", "rc": 0, "cmd": "TSC no-stats", "start": "2024-11-16 20:34:33.002669", "end": "2024-11-16 20:34:39.089304", "delta": "0:00:06.086635", "msg": "", "invocation": {"module_args": {"_raw_params": "TSC no-stats", "_uses_shell": true, "warn": false, "stdin_add_newline": true, "strip_empty_ends": true, "argv": null, "chdir": null, "executable": null, "creates": null, "removes": null, "stdin": null}}, "stdout_lines": ["BGP0 : System Mode: Normal", "BGP1 : System Mode: Normal"], "stderr_lines": [], "_ansible_no_log": null, "failed": false}

Note: only this test case requires this change, other tests won't get into this corner case.

How did you do it?

  • Add a timer check in addition to the existing check, where service runtime is lesser than the configured timer value.

How did you verify/test it?

  • Ran the above-mentioned test case on a T2 chassis and made sure the test passed without any issues.

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

)

This PR fixes a corner case w.r.t 'test_user_init_tsb_on_sup_while_service_run_on_dut' test under 'test_startup_tsa_tsb_service.py' and adds more check while fetching the 'tsa-tsb' service status on the line cards after applying 'TSB' on supervisor card.
The fix makes sure if the service is 'Active' running state and the service uptime is not the same as configured time.
@mssonicbld
Copy link
Collaborator Author

/azp run

@mssonicbld
Copy link
Collaborator Author

Original PR: #15649

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld mssonicbld merged commit 59b7d60 into sonic-net:202405 Dec 17, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants