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

[copp] Make LLDP disable/enable more robust #2605

Merged
merged 1 commit into from
Dec 1, 2020

Conversation

daall
Copy link
Contributor

@daall daall commented Nov 30, 2020

Signed-off-by: Danny Allen [email protected]

Description of PR

Summary: Make LLDP disable/enable more robust

Type of change

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

Approach

What is the motivation for this PR?

We notice that if the COPP test setup fails, then it never makes it around to re-starting LLDP. This can be problematic for successive

How did you do it?

I separated the LLDP disable/enable into its own separate fixture so that it is guaranteed to run through all the proper steps even if the rest of the setup or teardown fails for some reason.

How did you verify/test it?

Removed the COPP config file so that setup and teardown would fail and then ran the test. Confirmed that LLDP is back up and the autorestart feature is enabled for LLDP after the test finishes.

Any platform specific information?

N/A

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

N/A

Documentation

dut.command("docker exec lldp supervisorctl start lldp-syncd")

@pytest.fixture(scope="class")
def disable_lldp_for_testing(
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 logic not be included in _setup_testbed and _teardown_testbed? If I read it correctly, _teardown_testbed will always be called even if there is a failure as it is now inside finally block.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are other steps in teardown that could fail which would cause it to still be missed. I think the rest of the steps should be fixture-ized as much as possible to avoid this, but 1) I can't test this at the moment (because the COPP test itself has issues w/ the recent COPP changes) and 2) it would make this PR a lot more complex.

@daall daall merged commit b80d460 into sonic-net:master Dec 1, 2020
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.

3 participants