-
Notifications
You must be signed in to change notification settings - Fork 769
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
[ip/test_mgmt_ipv6_only]: Refactor to properly cleanup on failure #16442
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
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]>
1fa636d
to
43def98
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
09449ef
to
7494644
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Liam Kearney <[email protected]>
7494644
to
1079df2
Compare
/azp run |
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): |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@arlakshm @yejianquan pls review when you get the chance, thanks |
@arlakshm @yejianquan bump again, thanks |
Hi @liamkearney-msft overall it looks good to me, and thanks for simplify the more and more complicated logic. We can do it via 2 ways:
I personally prefer way 1, but also OK with way 2 with full qualified test result, @arlakshm what do you think? |
hey @yejianquan, I believe that option 1 is what we have currently been doing - we have increased the timeout for our branches in 202405 to avoid this. This was more of the follow up to fix the root cause that would nuke the testbeds. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
anyway, let's merge it into master first |
…nic-net#16442) 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 sonic-net#16441 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 Signed-off-by: Liam Kearney <[email protected]>
Cherry-pick PR to 202411: #16812 |
…6442) 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 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 Signed-off-by: Liam Kearney <[email protected]>
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
Back port request
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