Generic Config Updater cacl test#4775
Merged
wen587 merged 2 commits intosonic-net:masterfrom Dec 3, 2021
Merged
Conversation
qiluo-msft
reviewed
Nov 30, 2021
| from tests.generic_config_updater.gu_utils import generate_tmpfile, delete_tmpfile | ||
|
|
||
| pytestmark = [ | ||
| pytest.mark.topology('t0'), |
Contributor
qiluo-msft
reviewed
Nov 30, 2021
| @@ -0,0 +1,360 @@ | |||
| import logging | |||
Contributor
qiluo-msft
reviewed
Nov 30, 2021
| duthost.shell("sudo cp /etc/sonic/config_db.json {}".format(config_tmpfile)) | ||
|
|
||
| # Cleanup acl config | ||
| duthost.shell('sonic-db-cli CONFIG_DB keys "ACL_RULE|*" | xargs sonic-db-cli CONFIG_DB del', |
Contributor
Contributor
Author
There was a problem hiding this comment.
I tested with empty and the command failed. So I added module_ignore_errors=True to get that error ignored.
Seems yours is the better way to handle an empty table. I will remove module_ignore_error
qiluo-msft
reviewed
Nov 30, 2021
| """ | ||
| cmds = "show acl table" | ||
| output = duthost.shell(cmds) | ||
| pytest_assert(not output['rc'], "'{}' is not running successfully".format(cmds)) |
Contributor
Contributor
Author
There was a problem hiding this comment.
changed. Thanks for the advice
qiluo-msft
reviewed
Nov 30, 2021
| def expect_res_success_acl_rule(duthost, expected_content_list, unexpected_content_list): | ||
| """Check if acl rule added as expected | ||
| """ | ||
| cmds = "sudo iptables -S" |
Contributor
Contributor
Author
There was a problem hiding this comment.
Refering to test_cacl_application.py #L436
qiluo-msft
approved these changes
Dec 1, 2021
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
AntonHryshchuk
pushed a commit
to AntonHryshchuk/sonic-mgmt
that referenced
this pull request
Jan 4, 2022
…g updater (sonic-net#4775) Summary: Testcase of ACL control plane for generic updater apply-patch What is the motivation for this PR? End to End test support for Generic Updater apply-patch This PR is to verify the usage of 'config apply-patch' works on ACL control plane How did you do it? First, we set up a clean ACL env. Then make some config apply change. And check if the ACL is changed as expected. How did you verify/test it? Run test of sonic-mgmt/tests/generic_config_updater/test_acl.py on KVM
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
Summary:
Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
End to End test support for Generic Updater apply-patch
This PR is to verify the usage of 'config apply-patch' works on acl control plane
How did you do it?
First we setup clean ACL env. Then make some config apply change. And check if the ACL is changed as expected.
How did you verify/test it?
Run test of sonic-mgmt/tests/generic_config_updater/test_acl.py on KVM
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation