Skip to content

[action] [PR:16220] [YANG SONIC-ACL] Fix Yang definition of IN_PORTS and OUT_PORTS#16235

Merged
yxieca merged 1 commit intosonic-net:202205from
mssonicbld:cherry/202205/16220
Aug 26, 2023
Merged

[action] [PR:16220] [YANG SONIC-ACL] Fix Yang definition of IN_PORTS and OUT_PORTS#16235
yxieca merged 1 commit intosonic-net:202205from
mssonicbld:cherry/202205/16220

Conversation

@mssonicbld
Copy link
Collaborator

Why I did it

Fix #16190 .

Work item tracking
  • Microsoft ADO (number only): 24905710

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

  1. Verified by building sonic_yang_models-1.0-py3-none-any.whl. While building the target package, unit tests were run and passed.
  2. 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:
$ sudo config apply-patch patch.json
Patch Applier: Patch application starting.
Patch Applier: Patch: [{"op": "add", "path": "/ACL_RULE/SAMPLE_ACL_TABLE|RULE_3000", "value": {"PACKET_ACTION": "FORWARD", "PRIORITY": "7000", "IN_PORTS": "Ethernet2"}}]
Patch Applier: Getting current config db.
Patch Applier: Simulating the target full config after applying the patch.
Patch Applier: Validating all JsonPatch operations are permitted on the specified fields
Patch Applier: Validating target config does not have empty tables, since they do not show up in ConfigDb.
Patch Applier: Sorting patch updates.
Patch Applier: The patch was sorted into 1 change:
Patch Applier: LICENSE MAINTAINERS Makefile Makefile.cache Makefile.work README.buildsystem.md README.md ThirdPartyLicenses.txt azure-pipelines.yml build_debian.sh build_debug_docker_j2.sh build_docker.sh build_image.sh check_install.py device dockers files functions.sh get_docker-base.sh install_sonic.py installer onie-image-arm64.conf onie-image-armhf.conf onie-image.conf onie-mk-demo.sh platform push_docker.sh rules scripts slave.mk sonic-slave-bullseye sonic-slave-buster sonic-slave-jessie sonic-slave-stretch src update_screen.sh [{"op": "add", "path": "/ACL_RULE/SAMPLE_ACL_TABLE|RULE_3000", "value": {"PACKET_ACTION": "FORWARD", "PRIORITY": "7000", "IN_PORTS": "Ethernet2"}}]
Patch Applier: Applying 1 change in order:
Patch Applier: LICENSE MAINTAINERS Makefile Makefile.cache Makefile.work README.buildsystem.md README.md ThirdPartyLicenses.txt azure-pipelines.yml build_debian.sh build_debug_docker_j2.sh build_docker.sh build_image.sh check_install.py device dockers files functions.sh get_docker-base.sh install_sonic.py installer onie-image-arm64.conf onie-image-armhf.conf onie-image.conf onie-mk-demo.sh platform push_docker.sh rules scripts slave.mk sonic-slave-bullseye sonic-slave-buster sonic-slave-jessie sonic-slave-stretch src update_screen.sh [{"op": "add", "path": "/ACL_RULE/SAMPLE_ACL_TABLE|RULE_3000", "value": {"PACKET_ACTION": "FORWARD", "PRIORITY": "7000", "IN_PORTS": "Ethernet2"}}]
Patch Applier: Verifying patch updates are reflected on ConfigDB.
Patch Applier: Patch application completed.
Patch applied successfully.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

…-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
Copy link
Collaborator Author

Original PR: #16220

@mssonicbld
Copy link
Collaborator Author

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator Author

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator Author

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@yxieca yxieca merged commit 8757e6b into sonic-net:202205 Aug 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants