Skip to content

Commit

Permalink
[pbh]: Add YANG UT rev03.
Browse files Browse the repository at this point in the history
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
  • Loading branch information
nazariig committed Jul 13, 2021
1 parent ab84cfc commit bc53bb6
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,8 @@
"PBH_RULE": {
"pbh_table|nvgre": {
"priority": "1",
"ether_type": "0x0800",
"ip_protocol": "0x2f",
"gre_key": "0x2500/0xffffff00",
"inner_ether_type": "0x86dd",
"hash": "inner_v6_hash",
Expand All @@ -695,6 +697,7 @@
},
"pbh_table|vxlan": {
"priority": "2",
"ether_type": "0x0800",
"ip_protocol": "0x11",
"l4_dst_port": "0x12b5",
"inner_ether_type": "0x0800",
Expand Down
4 changes: 4 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests/pbh.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
"desc": "Configure invalid GRE_KEY in PBH_RULE.",
"eStrKey": "Pattern"
},
"PBH_RULE_INVALID_ETHER_TYPE": {
"desc": "Configure invalid ETHER_TYPE in PBH_RULE.",
"eStrKey": "Pattern"
},
"PBH_RULE_INVALID_IP_PROTOCOL": {
"desc": "Configure invalid IP_PROTOCOL in PBH_RULE.",
"eStrKey": "Pattern"
Expand Down
59 changes: 59 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests_config/pbh.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
"table_name": "pbh_table",
"rule_name": "nvgre",
"priority": 1,
"ether_type": "0x0800",
"ip_protocol": "0x2f",
"gre_key": "0x2500/0xffffff00",
"inner_ether_type": "0x86dd",
"hash": "inner_v6_hash",
Expand All @@ -84,6 +86,7 @@
"table_name": "pbh_table",
"rule_name": "vxlan",
"priority": 2,
"ether_type": "0x0800",
"ip_protocol": "0x11",
"l4_dst_port": "0x12b5",
"inner_ether_type": "0x0800",
Expand Down Expand Up @@ -337,6 +340,62 @@
}
}
},
"PBH_RULE_INVALID_ETHER_TYPE": {
"sonic-pbh:sonic-pbh": {
"sonic-pbh:PBH_HASH_FIELD": {
"PBH_HASH_FIELD_LIST": [
{
"hash_field_name": "inner_ip_proto",
"hash_field": "INNER_IP_PROTOCOL",
"sequence_id": 1
}
]
},
"sonic-pbh:PBH_HASH": {
"PBH_HASH_LIST": [
{
"hash_name": "inner_v6_hash",
"hash_field_list": [
"inner_ip_proto"
]
}
]
},
"sonic-pbh:PBH_RULE": {
"PBH_RULE_LIST": [
{
"table_name": "pbh_table",
"rule_name": "nvgre",
"priority": 1,
"ether_type": "0800",
"hash": "inner_v6_hash"
}
]
},
"sonic-pbh:PBH_TABLE": {
"PBH_TABLE_LIST": [
{
"table_name": "pbh_table",
"interface_list": [
"Ethernet0"
],
"description": "NVGRE"
}
]
}
},
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"name": "Ethernet0",
"lanes": "0,1,2,3",
"speed": 100000
}
]
}
}
},
"PBH_RULE_INVALID_IP_PROTOCOL": {
"sonic-pbh:sonic-pbh": {
"sonic-pbh:PBH_HASH_FIELD": {
Expand Down

0 comments on commit bc53bb6

Please sign in to comment.