-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[Yang] Incorrect definition of IN_PORTS
and OUT_PORTS
in sonic-acl.yang
#16190
Comments
lizhijianrd
changed the title
[Yang] Incorrect definition of
[Yang] Incorrect definition of Aug 21, 2023
IN_PORTS
in sonic-acl.yangIN_PORTS
and OUT_PORTS
in sonic-acl.yang
11 tasks
So we can load ACL rules with "IN_PORTS" with |
yxieca
pushed a commit
that referenced
this issue
Aug 22, 2023
How I did it Update Yang definition of IN_PORTS and OUT_PORTS to string. Since we cannot split the string with comma (,) and validate each substring is a valid SONiC port name. The only restriction for them is must be a string. How to verify it Verified by building sonic_yang_models-1.0-py3-none-any.whl. While building the target package, unit tests were run and passed. Build a SONiC image based on 202205 branch and installed on physical DUT. Re try the steps in [Yang] Incorrect definition of IN_PORTS and OUT_PORTS in sonic-acl.yang #16190 and can see below success response:
11 tasks
mssonicbld
pushed a commit
to mssonicbld/sonic-buildimage
that referenced
this issue
Aug 22, 2023
…-net#16220) How I did it Update Yang definition of IN_PORTS and OUT_PORTS to string. Since we cannot split the string with comma (,) and validate each substring is a valid SONiC port name. The only restriction for them is must be a string. How to verify it Verified by building sonic_yang_models-1.0-py3-none-any.whl. While building the target package, unit tests were run and passed. Build a SONiC image based on 202205 branch and installed on physical DUT. Re try the steps in [Yang] Incorrect definition of IN_PORTS and OUT_PORTS in sonic-acl.yang sonic-net#16190 and can see below success response:
11 tasks
mssonicbld
pushed a commit
to mssonicbld/sonic-buildimage
that referenced
this issue
Aug 22, 2023
…-net#16220) How I did it Update Yang definition of IN_PORTS and OUT_PORTS to string. Since we cannot split the string with comma (,) and validate each substring is a valid SONiC port name. The only restriction for them is must be a string. How to verify it Verified by building sonic_yang_models-1.0-py3-none-any.whl. While building the target package, unit tests were run and passed. Build a SONiC image based on 202205 branch and installed on physical DUT. Re try the steps in [Yang] Incorrect definition of IN_PORTS and OUT_PORTS in sonic-acl.yang sonic-net#16190 and can see below success response:
Yes, you are right. |
11 tasks
mssonicbld
pushed a commit
to mssonicbld/sonic-buildimage
that referenced
this issue
Aug 23, 2023
…-net#16220) How I did it Update Yang definition of IN_PORTS and OUT_PORTS to string. Since we cannot split the string with comma (,) and validate each substring is a valid SONiC port name. The only restriction for them is must be a string. How to verify it Verified by building sonic_yang_models-1.0-py3-none-any.whl. While building the target package, unit tests were run and passed. Build a SONiC image based on 202205 branch and installed on physical DUT. Re try the steps in [Yang] Incorrect definition of IN_PORTS and OUT_PORTS in sonic-acl.yang sonic-net#16190 and can see below success response:
mssonicbld
pushed a commit
that referenced
this issue
Aug 25, 2023
How I did it Update Yang definition of IN_PORTS and OUT_PORTS to string. Since we cannot split the string with comma (,) and validate each substring is a valid SONiC port name. The only restriction for them is must be a string. How to verify it Verified by building sonic_yang_models-1.0-py3-none-any.whl. While building the target package, unit tests were run and passed. Build a SONiC image based on 202205 branch and installed on physical DUT. Re try the steps in [Yang] Incorrect definition of IN_PORTS and OUT_PORTS in sonic-acl.yang #16190 and can see below success response:
yxieca
pushed a commit
that referenced
this issue
Aug 26, 2023
… (#16235) How I did it Update Yang definition of IN_PORTS and OUT_PORTS to string. Since we cannot split the string with comma (,) and validate each substring is a valid SONiC port name. The only restriction for them is must be a string. How to verify it Verified by building sonic_yang_models-1.0-py3-none-any.whl. While building the target package, unit tests were run and passed. Build a SONiC image based on 202205 branch and installed on physical DUT. Re try the steps in [Yang] Incorrect definition of IN_PORTS and OUT_PORTS in sonic-acl.yang #16190 and can see below success response: Co-authored-by: Zhijian Li <[email protected]>
mssonicbld
pushed a commit
that referenced
this issue
Aug 31, 2023
How I did it Update Yang definition of IN_PORTS and OUT_PORTS to string. Since we cannot split the string with comma (,) and validate each substring is a valid SONiC port name. The only restriction for them is must be a string. How to verify it Verified by building sonic_yang_models-1.0-py3-none-any.whl. While building the target package, unit tests were run and passed. Build a SONiC image based on 202205 branch and installed on physical DUT. Re try the steps in [Yang] Incorrect definition of IN_PORTS and OUT_PORTS in sonic-acl.yang #16190 and can see below success response:
sonic-otn
pushed a commit
to sonic-otn/sonic-buildimage
that referenced
this issue
Sep 20, 2023
…-net#16220) How I did it Update Yang definition of IN_PORTS and OUT_PORTS to string. Since we cannot split the string with comma (,) and validate each substring is a valid SONiC port name. The only restriction for them is must be a string. How to verify it Verified by building sonic_yang_models-1.0-py3-none-any.whl. While building the target package, unit tests were run and passed. Build a SONiC image based on 202205 branch and installed on physical DUT. Re try the steps in [Yang] Incorrect definition of IN_PORTS and OUT_PORTS in sonic-acl.yang sonic-net#16190 and can see below success response:
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
The type of
IN_PORTS
andOUT_PORTS
at sonic-acl.yang.j2#L131 is incorrect.According to Everflow-test-plan, it should be a string, not
uint16
. The string format should be a list of SONiC interface name separated by comma, like `"Ethernet3,Ethernet4".According to Sonic-mclag-hld,
OUT_PORTS
should be a string of the same format.This bug causes GCU cannot add/update data-plane ACL rules with
IN_PORTS
andOUT_PORTS
.Steps to reproduce the issue:
a. Write below content to file
acl_table_types.json
on DUT:sonic-cfggen -j acl_table_types.json -w
sudo config acl add table SAMPLE_ACL_TABLE BMCDATAV6 -p Ethernet1,Ethernet2 -s ingress
.acl-loader
:a. Write below content to file
acl_rules.json
on DUT:acl-loader
to load above ACL rule:acl-loader update full --table_name SAMPLE_ACL_TABLE acl_rules.json
.a. Write below content to file
patch.json
on DUT:sudo config apply-patch patch.json
Describe the results you received:
At step 4.b, I got below error on DUT:
From the error message we can see both the first ACL rule (already exist in config_db) and the second ACL rule (in GCU patch) cannot pass Yang validation. They failed on key
IN_PORTS
, which should be a string, but incorrectly defined asuint16
in Yang model.Describe the results you expected:
Expect step 4.b can apply the second ACL rule on DUT successfully.
Output of
show version
:Can repro this issue on 202205.
Output of
show techsupport
:Additional information you deem important (e.g. issue happens only occasionally):
The text was updated successfully, but these errors were encountered: