[201911]Handled both REDIRECT and REDIRECT_ACTION ACL rules in ACL or…#1397
[201911]Handled both REDIRECT and REDIRECT_ACTION ACL rules in ACL or…#1397abdosi merged 2 commits intosonic-net:201911from
Conversation
|
This pull request introduces 2 alerts when merging 017585d into 2c9fc8c - view on LGTM.com new alerts:
|
|
retest this please |
|
@abdosi this is a double commit to 201911 branch, the fix is already in master branch. Since, the cherry-pick to 201911 had conflicts, I raised this PR. Can you please merge this PR. |
|
is this PR ref to this Master PR #1278 ? |
wendani
left a comment
There was a problem hiding this comment.
vs test case fails as commented
| for k, v in qualifiers.items(): | ||
| fvs[k] = v | ||
|
|
||
| self.config_db.create_entry("ACL_RULE", "{}|{}".format(table_name, rule_name), fvs) |
There was a problem hiding this comment.
Not available in 201911 branch
| ("priority", "20"), | ||
| ("L4_SRC_PORT", "65000"), | ||
| ("PACKET_ACTION", "REDIRECT:10.0.0.2@Ethernet4")]) | ||
| tbl.set("test_acl_table|redirect_rule", fvs) |
There was a problem hiding this comment.
sleep here for the rule to sync to asic db
| assert False | ||
|
|
||
| # remove acl rule | ||
| tbl = swsscommon.Table(self.cdb, "ACL_TABLE") |
| assert status == False | ||
|
|
||
| config_qualifiers = {"L4_SRC_PORT": "65000"} | ||
| self.dvs_acl.create_redirect_action_acl_rule("test_acl_table", "redirect_action_rule", config_qualifiers, intf="Ethernet4", priority="20") |
| elif fv[0] == "SAI_ACL_ENTRY_ATTR_FIELD_L4_SRC_PORT": | ||
| assert fv[1] == "65000&mask:0xffff" | ||
| elif fv[0] == "SAI_ACL_ENTRY_ATTR_ACTION_REDIRECT": | ||
| assert fv[1] == next_hop_id |
There was a problem hiding this comment.
Should be object id of physical port Ethernet4
| (status, fvs) = atbl.get(acl_entry[0]) | ||
| assert status == False | ||
|
|
||
| tbl._del("test_acl_table") |
There was a problem hiding this comment.
tbl here points to ACL_RULE still
|
|
||
| time.sleep(1) | ||
|
|
||
| keys = atbl.getKeys() |
There was a problem hiding this comment.
atbl here still points to ASIC_STATE:SAI_OBJECT_TYPE_ACL_ENTRY
| ("PACKET_ACTION", "REDIRECT:10.0.0.2@Ethernet4")]) | ||
| tbl.set("test_acl_table|redirect_rule", fvs) | ||
|
|
||
| # check acl table in asic db |
… naming mode "alias" sonic-net#1397 (sonic-net#1411) #### What I did Added fix for Issue in CLI output alignment with shorter alias names in intf naming mode "alias" #### How I did it Added code to remove last few extra characters from string (-------…) using Slicing & Positive Indexing in python, to match the width to alias's name(not interface)
…chagent
What I did
In ACL orchagent code, code is modified to handled both REDIRECT and REDIRECT_ACTION ACL rules.
Why I did it
Currently, the code only handles REDIRECT ACL rule and not REDIRECT_ACTION ACL rule.
How I verified it
I verified by configuring both types of ACL rules and verified it is working.
Details if related