sonic-mgmt icon indicating copy to clipboard operation
sonic-mgmt copied to clipboard

Tests to verify 'startup_tsa_tsb.service' during linecard bring up - PR#18496

Open sanjair-git opened this issue 10 months ago • 1 comments

Description of PR

Summary: Fixes # (issue)

  • This PR has tests to verify the changes introduced as part of #18496
  • Basically, this PR has 5 test cases to verify start and stop of the new service 'startup_tsa_tsb.service' added by #18496 including other checks.

Type of change

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

Back port request

  • [ ] 201911
  • [ ] 202012
  • [x] 202205
  • [x] 202305
  • [x] 202311

Approach

What is the motivation for this PR?

  • To verify code changes introduced as part of the PR #18496

How did you do it?

  • Added 5 test cases as mentioned below to verify the changes.
  • Attaching test cases' description document here for further reference and details. BGP-TSA-TSB-Service-TestCases.txt
  1. test_tsa_tsb_service_with_dut_cold_reboot
  2. test_tsa_tsb_service_with_dut_abnormal_reboot
  3. test_tsa_tsb_service_with_supervisor_cold_reboot
  4. test_tsa_tsb_service_with_supervisor_abnormal_reboot
  5. test_tsa_tsb_service_with_user_init_tsa

How did you verify/test it?

  • Ran all the above mentioned test cases on a T2 chassis and made sure tests passed with expected behavior.

Any platform specific information?

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

Documentation

image

sanjair-git avatar Mar 29 '24 21:03 sanjair-git

The pre-commit check detected issues in the files touched by this pull request. The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results: trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/bgp/test_startup_tsa_tsb_service.py:385:47: E128 continuation line under-indented for visual indent
tests/bgp/test_startup_tsa_tsb_service.py:503:51: E128 continuation line under-indented for visual indent

flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

mssonicbld avatar Mar 29 '24 21:03 mssonicbld

@sanjair-git - could we add testcases to validate the behavior when user issues TSA/TSB while the service is running? This could be from linecard or supervisor

Also, a case to validate whether the tsa-tsb timer is sufficient for the system to be stable (ports up, critical services, bgp state etc)

tjchadaga avatar Apr 25 '24 19:04 tjchadaga

@sanjair-git - could we add testcases to validate the behavior when user issues TSA/TSB while the service is running? This could be from linecard or supervisor

Also, a case to validate whether the tsa-tsb timer is sufficient for the system to be stable (ports up, critical services, bgp state etc)

@tjchadaga, For the new test cases, I will raise a separate PR. Other comments, I have looked into it and resolved. Reran the whole test suite again with the changes. Results below,

image

sanjair-git avatar May 02 '24 22:05 sanjair-git