[action] [PR:9312] Refactor fixture recover_acl_rule and and use it in module cacl/test_cacl_function.py.#9524
Merged
mssonicbld merged 1 commit intosonic-net:202305from Aug 18, 2023
Conversation
…st_cacl_function.py`. (sonic-net#9312) Description of PR In module cacl/test_cacl_function.py, it will use command acl-loader delete to delete all acl rules, no matter if the testbed has DATAACL rules before test or not. If this testbed has DATAACL rules before, this deletion will cause inconsistent between previous running config and current running config, and will cause unnecessary config reload. In PR sonic-net#9199 , we have a fixture recover_acl_rule to recovery acl rules. So in this PR, I refactor this fixture and use this fixture to recover acl rules in module cacl/test_cacl_function.py. What is the motivation for this PR? In module cacl/test_cacl_function.py, it will use command acl-loader delete to delete all acl rules, no matter if the testbed has DATAACL rules before test or not. If this testbed has DATAACL rules before, this deletion will cause inconsistent between previous running config and current running config, and will cause unnecessary config reload. In PR sonic-net#9199 , we have a fixture recover_acl_rule to recovery acl rules. So in this PR, I refactor this fixture and use this fixture to recover acl rules in module cacl/test_cacl_function.py. How did you do it? Move fixture recover_acl_rule to tests/conftest.py and use this fixture to recover acl rules in module cacl/test_cacl_function.py. How did you verify/test it? ``` 07:34:42 conftest.core_dump_and_config_check L1893 INFO | Core dump and config check passed for cacl/test_cacl_function.py ``` Signed-off-by: Yutong Zhang <[email protected]>
6 tasks
Collaborator
Author
|
Original PR: #9312 |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of PR
In module
cacl/test_cacl_function.py, it will use commandacl-loader deleteto delete all acl rules, no matter if the testbed has DATAACL rules before test or not. If this testbed has DATAACL rules before, this deletion will cause inconsistent between previous running config and current running config, and will cause unnecessary config reload. In PR #9199 , we have a fixturerecover_acl_ruleto recovery acl rules. So in this PR, I refactor this fixture and use this fixture to recover acl rules in modulecacl/test_cacl_function.py.Summary:
Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
In module
cacl/test_cacl_function.py, it will use commandacl-loader deleteto delete all acl rules, no matter if the testbed has DATAACL rules before test or not. If this testbed has DATAACL rules before, this deletion will cause inconsistent between previous running config and current running config, and will cause unnecessary config reload. In PR #9199 , we have a fixturerecover_acl_ruleto recovery acl rules. So in this PR, I refactor this fixture and use this fixture to recover acl rules in modulecacl/test_cacl_function.py.How did you do it?
Move fixture
recover_acl_ruleto tests/conftest.py and use this fixture to recover acl rules in modulecacl/test_cacl_function.py.How did you verify/test it?
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation