sonic-mgmt
sonic-mgmt copied to clipboard
Tests to verify 'startup_tsa_tsb.service' during linecard bring up - PR#18496
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
- test_tsa_tsb_service_with_dut_cold_reboot
- test_tsa_tsb_service_with_dut_abnormal_reboot
- test_tsa_tsb_service_with_supervisor_cold_reboot
- test_tsa_tsb_service_with_supervisor_abnormal_reboot
- 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
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:
- 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.
- Ensure that the
pre-commit
package is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
@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)
@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,