Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests/acl.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@
"eStrKey" : "Mandatory",
"eStr": ["ACL_TABLE"]
},
"ACL_TABLE_CTRLPLANE_REQUIRES_SERVICES": {
"desc": "ACL_TABLE CTRLPLANE type requires services presence.",
"eStrKey" : "Must",
"eStr": ["CTRLPLANE", "services"]
},
"ACL_TABLE_DEFAULT_VALUE_STAGE": {
"desc": "ACL_TABLE DEFAULT VALUE FOR STAGE FIELD.",
"eStrKey" : "Verify",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,20 @@
}
}
},
"ACL_TABLE_CTRLPLANE_REQUIRES_SERVICES": {
"sonic-acl:sonic-acl": {
"sonic-acl:ACL_TABLE": {
"ACL_TABLE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V4",
"policy_desc": "Filter IPv4",
"stage": "ingress",
"type": "CTRLPLANE"
}
]
}
}
},
"ACL_TABLE_UNDEFINED_TABLE_TYPE": {
"sonic-acl:sonic-acl": {
"sonic-acl:ACL_TABLE": {
Expand Down
3 changes: 3 additions & 0 deletions src/sonic-yang-models/yang-templates/sonic-acl.yang.j2
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,9 @@ module sonic-acl {
type string;
}

/* Validating 'services' exist if ACL type is 'CTRLPLANE' */
must "(not(type = 'CTRLPLANE')) or (boolean(services))";

leaf-list ports {
/* union of leafref is allowed in YANG 1.1 */
type union {
Expand Down