-
Notifications
You must be signed in to change notification settings - Fork 1k
Update get_acl_couner with command instead of getting value from redis #5616
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -284,13 +284,16 @@ def get_acl_counter(duthost, table_name, rule_name, timeout=ACL_COUNTERS_UPDATE_ | |
| Returns: | ||
| Acl counter value for packets | ||
| """ | ||
| cmd = "redis-cli -n 2 hget 'COUNTERS:{}:{}' Packets" | ||
| # Wait for orchagent to update the ACL counters | ||
| time.sleep(timeout) | ||
| result = duthost.shell(cmd.format(table_name, rule_name))['stdout'] | ||
| if result == "": | ||
| pytest.fail("Failed to retrieve acl counter for {}|{}".format(table_name, rule_name)) | ||
| return int(result) | ||
| result = duthost.show_and_parse('aclshow') | ||
|
|
||
| if len(result) == 0: | ||
| return 0 | ||
|
||
| for rule in result: | ||
| if rule_name == rule['rule name']: | ||
| return int(rule['packets count']) | ||
| return 0 | ||
|
||
|
|
||
|
|
||
| def craft_packet(src_mac, dst_mac, dst_ip, ip_version, stage, tagged_mode, vlan_id=10, outer_vlan_id=0, pkt_type=None): | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.