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] - New tests for Reliable-TSA feature #13290

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

sanjair-git
Copy link
Contributor

Description of PR

Summary:
Fixes # (issue)

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?

How did you do it?

  • Added 20 new test cases to verify feature in three sets.
  • Attaching test cases' description document here for further reference.
  • Reliable-TSA-Cases.xlsx
  1. First set: TSA/TSB config event on the supervisor or line card. (8 cases)
    test_sup_tsa_act_when_sup_duts_on_tsb_initially
    test_sup_tsa_act_when_sup_on_tsb_duts_on_tsa_initially
    test_sup_tsb_act_when_sup_on_tsa_duts_on_tsb_initially
    test_sup_tsb_act_when_sup_and_duts_on_tsa_initially
    test_dut_tsa_act_when_sup_duts_on_tsb_initially
    test_dut_tsa_act_when_sup_on_tsa_duts_on_tsb_initially
    test_dut_tsb_act_when_sup_on_tsb_duts_on_tsa_initially
    test_dut_tsb_act_when_sup_and_duts_on_tsa_initially

  2. Second set: Config event followed by certain action on the supervisor or line card. (8 cases)
    test_sup_tsa_act_with_sup_reboot
    test_sup_tsa_act_when_duts_on_tsa_with_sup_config_reload
    test_dut_tsa_act_with_reboot_when_sup_dut_on_tsb_init
    test_dut_tsa_with_conf_reload_when_sup_on_tsa_dut_on_tsb_init
    test_sup_tsb_followed_by_dut_bgp_restart_when_sup_on_tsa_duts_on_tsb
    test_sup_tsb_followed_by_dut_bgp_restart_when_sup_and_duts_on_tsa
    test_dut_tsb_followed_by_dut_bgp_restart_when_sup_on_tsb_duts_on_tsa
    test_dut_tsb_followed_by_dut_bgp_restart_when_sup_and_duts_on_tsa

  3. Miscellaneous tests: Use cases with 'startup-tsa-tsb' service etc. (4 cases)
    test_sup_tsa_when_startup_tsa_tsb_service_running
    test_sup_tsb_when_startup_tsa_tsb_service_running
    test_user_init_tsa_on_dut_followed_by_sup_tsa
    test_user_init_tsa_on_dut_followed_by_sup_tsb

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

Reliable TSA test result:
image

Startup-tsa-tsb service test result:
image

Note: PR #12781 is pending merge, and this PR is dependent on that.



@pytest.fixture(scope="module", autouse=True)
def enable_disable_startup_tsa_tsb_service(duthosts):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be re-used from test_startup_tsa_tsb_service.py?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes right. Modified the code to re-use from test_startup_tsa_tsb_service.py file.

for linecard in duthosts.frontend_nodes:
dut_nbrhosts[linecard] = nbrhosts_to_dut(linecard, nbrhosts)
if not check_tsa_persistence_support(linecard):
pytest.skip("TSA persistence not supported in the image")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TSA persistence support on the linecard exists on all images that supports T2 and since this is a T2-only test, this check is not needed.

Should we be checking chassis-app-db for tsa_enabled field instead and skip if reliable tsa is not in the image?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Removed the tsa_persistence_support check and added skip logic based on the chassis-app-db tsa_enabled field for all the test cases.

@mssonicbld
Copy link
Collaborator

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:1164:1: F811 redefinition of unused 'test_user_init_tsa_while_service_run_on_dut' from line 743
tests/bgp/test_startup_tsa_tsb_service.py:1268:1: F811 redefinition of unused 'test_user_init_tsb_while_service_run_on_dut' from line 847
tests/bgp/test_startup_tsa_tsb_service.py:1360:1: F811 redefinition of unused 'test_user_init_tsb_on_sup_while_service_run_on_dut' from line 939
tests/bgp/test_startup_tsa_tsb_service.py:1484:1: F811 redefinition of unused 'test_tsa_tsb_timer_efficiency' from line 1059

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>

@sanjair-git
Copy link
Contributor Author

This test PR is dependent on sonic-buildimage PR #(sonic-net/sonic-buildimage#19539)

@abdosi
Copy link
Contributor

abdosi commented Aug 15, 2024

@tjchadaga: Are we good to merge this ?

@sanjair-git
Copy link
Contributor Author

Latest test results for reference:

image

Recover dut in case of reboot failures or other issue

flake8 fix

flake8 blank line fix

Include critical process check as well for dut recovery

Typo fix

intf check missing

Fix for supervisor config reload test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

4 participants