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

[ip/test_mgmt_ipv6_only]: Refactor to properly cleanup on failure #16442

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

Conversation

liamkearney-msft
Copy link
Contributor

@liamkearney-msft liamkearney-msft commented Jan 10, 2025

Description of PR

ipv6 mgmt only tests can fail in setup, after config has been modified, leading to the teardown to not be run, and the duts to be left in an unreachable state. Refactor the test to split backing up and restoring the config into an independent fixture, such that failures in setting the mgmt IPs won't nuke the testbed. Also refactor / cleanup some other aspects of the tests to enhance clarity.

Summary:
Fixes #16441

Type of change

  • [x ] Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
    • Add ownership here(Microsft required only)
  • [x ] Test case improvement

Back port request

  • 202012
  • 202205
  • 202305
  • 202311
  • 202405
  • 202411

Approach

What is the motivation for this PR?

Fix failures in test setup leaving the testbed in a wedged state, due to removed ipv4 mgmt IPs

How did you do it?

Refactor the test to have config backup and restore in a separate fixture

How did you verify/test it?

Any platform specific information?

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

Documentation

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rlhui rlhui added the Test gap label Jan 10, 2025
ipv6 mgmt only tests can fail in setup, after config has been modified,
leading to the teardown to not be run. Refactor the test to split
backing up and restoring the config into another fixture, such that
failures in setting the mgmt IPs wont nuke the testbed.
Also refactor some other aspects to remove linter bypasses

Signed-off-by: Liam Kearney <[email protected]>
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -55,10 +53,8 @@ def check_ntp_status(host):
return True


def run_ntp(duthosts, rand_one_dut_hostname, setup_ntp):
def run_ntp(duthost):
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to confirm we're removing setup_ntp here because the fixtures are/should be called locally and not used in this function?

Copy link
Contributor Author

@liamkearney-msft liamkearney-msft Jan 20, 2025

Choose a reason for hiding this comment

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

yeah, in this case its redundant - the fixture is not called / used here as this is not a test function. The fixtures are only invoked by the test_xxx functions / or other fixtures

Copy link
Contributor

@Javier-Tan Javier-Tan left a comment

Choose a reason for hiding this comment

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

LGTM

@liamkearney-msft
Copy link
Contributor Author

@arlakshm @yejianquan pls review when you get the chance, thanks

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.

[Bug]: Failures in IPv6 mgmt test setup lead to lost mgmt IPs
4 participants