Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
  • Loading branch information
stepanblyschak committed Oct 23, 2021
1 parent a04fc1d commit 700c5d2
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/sonic-yang-models/tests/yang_model_tests/tests/acl.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,21 @@
"ACL_TABLE_CUSTOM_TABLE_TYPE": {
"desc": "ACL_TABLE LOAD TABLE TYPE SUCCESSFULLY."
},
"ACL_TABLE_CUSTOM_TABLE_TYPE_NO_MATCHES": {
"desc": "ACL_TABLE LOAD TABLE TYPE WITH NO MATCHES.",
"eStrKey": "MinElements"
},
"ACL_TABLE_CUSTOM_TABLE_TYPE_NO_BIND_POINT_TYPES": {
"desc": "ACL_TABLE LOAD TABLE TYPE WITH NO BIND POINT TYPES.",
"eStrKey": "MinElements"
},
"ACL_TABLE_CUSTOM_TABLE_TYPE_NO_ACTIONS": {
"desc": "ACL_TABLE LOAD TABLE TYPE SUCCESSFULLY WITH NO ACTIONS."
"desc": "ACL_TABLE LOAD TABLE TYPE SUCCESSFULLY WITH NO ACTIONS.",
"eStrKey" : "Verify",
"verify": {
"xpath": "/sonic-acl:sonic-acl/ACL_TABLE_TYPE/ACL_TABLE_TYPE_LIST[ACL_TABLE_TYPE_NAME='CUSTOM_L3']/ACL_TABLE_TYPE_NAME",
"key": "sonic-acl:actions",
"value": [""]
}
}
}
91 changes: 91 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests_config/acl.json
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,97 @@
}
}
},
"ACL_TABLE_CUSTOM_TABLE_TYPE_NO_MATCHES": {
"sonic-acl:sonic-acl": {
"sonic-acl:ACL_TABLE": {
"ACL_TABLE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V6",
"policy_desc": "Filter IPv6",
"ports": [
"Ethernet0"
],
"stage": "EGRESS",
"type": "CUSTOM_L3"
}
]
},
"sonic-acl:ACL_TABLE_TYPE": {
"ACL_TABLE_TYPE_LIST": [
{
"ACL_TABLE_TYPE_NAME": "CUSTOM_L3",
"actions": [
"PACKET_ACTION"
],
"bind_points": [
"PORT"
]
}
]
}
},
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "0,1,2,3",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
}
]
}
}
},
"ACL_TABLE_CUSTOM_TABLE_TYPE_NO_BIND_POINT_TYPES": {
"sonic-acl:sonic-acl": {
"sonic-acl:ACL_TABLE": {
"ACL_TABLE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V6",
"policy_desc": "Filter IPv6",
"ports": [
"Ethernet0"
],
"stage": "EGRESS",
"type": "CUSTOM_L3"
}
]
},
"sonic-acl:ACL_TABLE_TYPE": {
"ACL_TABLE_TYPE_LIST": [
{
"ACL_TABLE_TYPE_NAME": "CUSTOM_L3",
"matches": [
"SRC_IP",
"IN_PORTS"
],
"actions": [
"PACKET_ACTION"
]
}
]
}
},
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "0,1,2,3",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
}
]
}
}
},
"ACL_TABLE_CUSTOM_TABLE_TYPE_NO_ACTIONS": {
"sonic-acl:sonic-acl": {
"sonic-acl:ACL_TABLE": {
Expand Down
2 changes: 2 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-acl.yang
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ module sonic-acl {

leaf-list matches {
type string;
min-elements 1;
}

leaf-list actions {
Expand All @@ -242,6 +243,7 @@ module sonic-acl {
enum PORT;
enum LAG;
}
min-elements 1;
}
}
}
Expand Down

0 comments on commit 700c5d2

Please sign in to comment.