[acl]: test different subnet masks#481
Merged
lguohan merged 7 commits intosonic-net:masterfrom Jun 8, 2018
Merged
Conversation
Added a test case with ACL rules with different mask /8 /19 ,etc. Verified the proper subnet masks were reflected in the ASICDB.
lguohan
reviewed
Apr 22, 2018
|
|
||
| time.sleep(2) | ||
|
|
||
| subnet_mask_rules = 0 |
Contributor
There was a problem hiding this comment.
can you use for loop to simplify the logic? there are quite a few redundant code here.
lguohan
requested changes
Apr 23, 2018
Contributor
lguohan
left a comment
There was a problem hiding this comment.
can you simply the code logic by uisng for loop?
lguohan
reviewed
May 3, 2018
tests/test_acl.py
Outdated
| (status, fvs) = atbl.get(entry) | ||
| assert status == True | ||
| assert len(fvs) == 6 | ||
| if ('SAI_ACL_ENTRY_ATTR_FIELD_SRC_IP', '23.103.0.0&mask:255.255.192.0') in fvs: |
Contributor
There was a problem hiding this comment.
there is code redundancy in the block as well.
can you define a function as below as use the function to check all entries in acl_entry?
check_rule_existence(entry, rules):
for rule in rules:
check if src_ip in the rule match the entry
check if action of the rule match the entry
check if priority of the rule match the entry
if all match:
then return the True
if none of the rule match, return false
lguohan
requested changes
May 3, 2018
Contributor
lguohan
left a comment
There was a problem hiding this comment.
further improve the code efficiency.
lguohan
approved these changes
Jun 8, 2018
oleksandrivantsiv
pushed a commit
to oleksandrivantsiv/sonic-swss
that referenced
this pull request
Mar 1, 2023
* [vslib] add ACL action capabilities support * [meta] add support for SAI_ATTR_VALUE_TYPE_ACL_CAPABILITY set operation This is needed for SWSS integration testing e.g: use setReadOnlyAttr from VS test suite to modify SAI_SWITCH_ATTR_ACL_STAGE_INGRESS/EGRESS to test orchagent flows Signed-off-by: Stepan Blyschak <[email protected]>
Janetxxx
pushed a commit
to Janetxxx/sonic-swss
that referenced
this pull request
Nov 10, 2025
* Add files via upload * Test case: ACL rule with diff subnet masks Added a test case with ACL rules with different mask /8 /19 ,etc. Verified the proper subnet masks were reflected in the ASICDB. * changing addition of acl rules to a loop to avoid redundancy * added a helper function to improve code efficiency * Update test_acl.py
jianyuewu
pushed a commit
to jianyuewu/sonic-swss
that referenced
this pull request
Dec 24, 2025
…c-net#481) The PR sonic-net/sonic-buildimage#6920 adds the support for swsscommon in `hostcfgd`. The PR test failure are seen because the `config_db.subscribe` doesnt work with swsscommon. This PR adds the support for the following python APIs - `config_db.subscribe` - `config_db.unsubscribe`
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.
What I did
Added a test case that checks that different subnet mask for dest/src ip addresses in ACL rules are programmed correctly in the ASICDB
Why I did it
Part of the ACL test cases propsed by Dell and approved by Microsoft
How I verified it
Ran the python test script in the repo
Details if related
Output of test attatched
subnet_test_logs.txt