Update get_acl_couner with command instead of getting value from redis#5616
Merged
ZhaohuiS merged 2 commits intosonic-net:masterfrom May 9, 2022
Merged
Update get_acl_couner with command instead of getting value from redis#5616ZhaohuiS merged 2 commits intosonic-net:masterfrom
ZhaohuiS merged 2 commits intosonic-net:masterfrom
Conversation
Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
StormLiangMS
reviewed
May 7, 2022
tests/acl/test_acl_outer_vlan.py
Outdated
| result = duthost.show_and_parse('aclshow') | ||
|
|
||
| if len(result) == 0: | ||
| return 0 |
Collaborator
There was a problem hiding this comment.
Is the "0" expected behavior? If not, could we some add debug/error print here?
Contributor
Author
There was a problem hiding this comment.
@StormLiangMS If there is no rule for acl, the output looks like below, result is empty.
We return 0 here. The log file includes all the output of shell command.
admin@str-dx010-acs-5:~$ aclshow -a
RULE NAME TABLE NAME PRIO PACKETS COUNT BYTES COUNT
----------- ------------ ------ --------------- -------------
Contributor
Author
There was a problem hiding this comment.
@StormLiangMS Rethinking about your comment, you are correct. get_acl_counter is called after setup acl rules, so if can't find any expected rule, fail the test case.
tests/acl/test_acl_outer_vlan.py
Outdated
| for rule in result: | ||
| if rule_name == rule['rule name']: | ||
| return int(rule['packets count']) | ||
| return 0 |
Contributor
Author
There was a problem hiding this comment.
It's done in my second commit.
bingwang-ms
reviewed
May 7, 2022
Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
bingwang-ms
approved these changes
May 7, 2022
yaqiangz
pushed a commit
to yaqiangz/sonic-mgmt
that referenced
this pull request
Nov 2, 2022
…value from redis Update get_acl_couner with command instead of getting value from redis. sonic-net#5616 was merged into internal, but currently, dualtor 202205 pipelines are running based on internal-202012 branch, so this fix should be cherry picked into internal-202012 branch to avoid test failure. Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
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)
We can't get acl counters from redis COUNTERS_DB due to this RP sonic-net/sonic-swss#1943.
Parse the output of
aclshowto get counters.Signed-off-by: Zhaohui Sun zhaohuisun@microsoft.com
Type of change
Back port request
Approach
What is the motivation for this PR?
We can't get acl counters from redis
COUNTERS_DBdue to this RP sonic-net/sonic-swss#1943.test_acl_outer_vlan.pykeeps failing because of the errorFailed: Failed to retrieve acl counter for DATAACL_ingress_ipv6|rule_1.How did you do it?
Parse the output of
aclshowto get counters.How did you verify/test it?
run
acl/test_acl_outer_vlan.pyAny platform specific information?
Supported testbed topology if it's a new test case?
Documentation