Skip to content

Commit

Permalink
update unit test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
lmingz committed Feb 27, 2023
1 parent 7e2a485 commit 859deb3
Show file tree
Hide file tree
Showing 2 changed files with 224 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
{
"VALID_FINE_GRAINED_ECMP": {
"desc": "VALID_FINE_GRAINED_ECMP no failure."
"FG_NHG_TEST": {
"desc": "Fine-grained ECMP next-hop group configuration in FG_NHG_LIST table."
},
"FG_NHG_PREFIX_TEST": {
"desc": "Fine-grained ECMP prefix configuration in FG_NHG_PREFIX_LIST table."
},
"FG_NHG_MEMBER_TEST": {
"desc": "Fine-grained ECMP next-hop member configuration in FG_NHG_MEMBER_LIST table."
},
"FG_NHG_MEMBER_TEST_INVALID_IP": {
"desc": "Fine-grained ECMP next-hop member configuration with invalid IP value in FG_NHG_MEMBER_LIST table.",
"eStr": "Invalid value"
},
"FG_NHG_PREFIX_TEST_INVALID_PREFIX":{
"desc": "Fine-grained ECMP prefix configuration with invalid prefix value in FG_NHG_PREFIX_LIST table.",
"eStr": "Invalid value"
},
"FG_NHG_MEMBER_TEST_MISSING_FG_NHG_REF": {
"desc": "Fine-grained ECMP next-hop member configuration with missing FG_NHG reference in FG_NHG_MEMBER_LIST table.",
"eStr": "Missing reference"
},
"FG_NHG_PREFIX_TEST_MISSING_FG_NHG_REF": {
"desc": "Fine-grained ECMP prefix configuration with missing FG_NHG reference in FG_NHG_PREFIX_LIST table.",
"eStr": "Missing reference"
},
"FG_NHG_MEMBER_TEST_MISSING_BANK": {
"desc": "Fine-grained ECMP next-hop member configuration with missing bank in FG_NHG_MEMBER_LIST table.",
"eStr": "Mandatory leaf 'bank' missing"
},
"FG_NHG_TEST_DUPLICATE_ENTRY": {
"desc": "Fine-grained ECMP next-hop group configuration with duplicate entry in FG_NHG_LIST table.",
"eStr": "Duplicate entry"
},
"FG_NHG_PREFIX_TEST_DUPLICATE_ENTRY": {
"desc": "Fine-grained ECMP prefix configuration with duplicate entry in FG_NHG_PREFIX_LIST table.",
"eStr": "Duplicate entry"
},
"FG_NHG_MEMBER_TEST_DUPLICATE_MEMBER": {
"desc": "Fine-grained ECMP next-hop member configuration with duplicate member in FG_NHG_MEMBER_LIST table.",
"eStr": "Duplicate member"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,41 +1,200 @@
{
"VALID_FINE_GRAINED_ECMP":{
"sonic-fine-grained-ecmp:sonic-fine-grained-ecmp":{
"sonic-fine-grained-ecmp:FG_NHG":{
"FG_NHG_LIST":[
"FG_NHG_TEST": {
"sonic-fine-grained-ecmp:sonic-fine-grained-ecmp": {
"sonic-fine-grained-ecmp:FG_NHG": {
"FG_NHG_LIST": [
{
"name":"fgnhg_v4",
"bucket_size": "120",
"name": "group1",
"bucket_size": 10,
"match_mode": "nexthop-based"
},
{
"name":"fgnhg_v6",
"bucket_size": "120",
"name": "group2",
"bucket_size": 20,
"match_mode": "route-based"
}
]
}
}
},
"FG_NHG_PREFIX_TEST": {
"sonic-fine-grained-ecmp:sonic-fine-grained-ecmp": {
"sonic-fine-grained-ecmp:FG_NHG_PREFIX": {
"FG_NHG_PREFIX_LIST": [
{
"ip_prefix": "10.0.0.0/24",
"FG_NHG": "group1"
},
{
"ip_prefix": "10.1.0.0/24",
"FG_NHG": "group2"
}
]
}
}
},
"FG_NHG_MEMBER_TEST": {
"sonic-fine-grained-ecmp:sonic-fine-grained-ecmp": {
"sonic-fine-grained-ecmp:FG_NHG_MEMBER": {
"FG_NHG_MEMBER_LIST": [
{
"next_hop_ip": "10.0.0.1",
"FG_NHG": "group1",
"bank": 1,
"link": "Ethernet1"
},
{
"next_hop_ip": "10.0.0.2",
"FG_NHG": "group1",
"bank": 2,
"link": "Ethernet2"
},
{
"next_hop_ip": "10.1.0.1",
"FG_NHG": "group2",
"bank": 3,
"link": "PortChannel1"
}
]
}
}
},
"FG_NHG_TEST_DUPLICATE_NAME": {
"sonic-fine-grained-ecmp:sonic-fine-grained-ecmp": {
"sonic-fine-grained-ecmp:FG_NHG": {
"FG_NHG_LIST": [
{
"name": "group1",
"bucket_size": 10,
"match_mode": "nexthop-based"
},
{
"name": "group1",
"bucket_size": 20,
"match_mode": "route-based"
}
]
}
}
},
"FG_NHG_MEMBER_TEST_INVALID_IP": {
"sonic-fine-grained-ecmp:sonic-fine-grained-ecmp": {
"sonic-fine-grained-ecmp:FG_NHG_MEMBER": {
"FG_NHG_MEMBER_LIST": [
{
"next_hop_ip": "invalid_ip",
"FG_NHG": "group1",
"bank": 1,
"link": "Ethernet1"
}
],
"FG_NHG_PREFIX_LIST":[
]
}
}
},
"FG_NHG_PREFIX_TEST_INVALID_PREFIX": {
"sonic-fine-grained-ecmp:sonic-fine-grained-ecmp": {
"sonic-fine-grained-ecmp:FG_NHG_PREFIX": {
"FG_NHG_PREFIX_LIST": [
{
"ip_prefix":"100.50.25.12/32",
"FG_NHG": "fgnhg_v4"
"ip_prefix": "invalid_prefix",
"FG_NHG": "group1"
}
]
}
}
},
"FG_NHG_MEMBER_TEST_MISSING_FG_NHG_REF": {
"sonic-fine-grained-ecmp:sonic-fine-grained-ecmp": {
"sonic-fine-grained-ecmp:FG_NHG_MEMBER": {
"FG_NHG_MEMBER_LIST": [
{
"next_hop_ip": "10.0.0.1",
"bank": 1,
"link": "Ethernet1"
}
]
}
}
},
"FG_NHG_PREFIX_TEST_MISSING_FG_NHG_REF": {
"sonic-fine-grained-ecmp:sonic-fine-grained-ecmp": {
"sonic-fine-grained-ecmp:FG_NHG_PREFIX": {
"FG_NHG_PREFIX_LIST": [
{
"ip_prefix": "10.0.0.0/24"
}
]
}
}
},
"FG_NHG_MEMBER_TEST_MISSING_BANK": {
"sonic-fine-grained-ecmp:sonic-fine-grained-ecmp": {
"sonic-fine-grained-ecmp:FG_NHG_MEMBER": {
"FG_NHG_MEMBER_LIST": [
{
"next_hop_ip": "10.0.0.1",
"FG_NHG": "group1",
"link": "Ethernet1"
}
]
}
}
},
"FG_NHG_TEST_DUPLICATE_ENTRY": {
"sonic-fine-grained-ecmp:sonic-fine-grained-ecmp": {
"sonic-fine-grained-ecmp:FG_NHG": {
"FG_NHG_LIST": [
{
"name": "group1",
"bucket_size": 16,
"match_mode": "nexthop-based"
},
{
"name": "group1",
"bucket_size": 8,
"match_mode": "nexthop-based"
}
]
}
}
},
"FG_NHG_PREFIX_TEST_DUPLICATE_ENTRY": {
"sonic-fine-grained-ecmp:sonic-fine-grained-ecmp": {
"sonic-fine-grained-ecmp:FG_NHG_PREFIX": {
"FG_NHG_PREFIX_LIST": [
{
"ip_prefix": "10.0.0.0/24",
"FG_NHG": "group1"
},
{
"ip_prefix":"fc:05::/128",
"FG_NHG": "fgnhg_v6"
"ip_prefix": "10.0.0.0/24",
"FG_NHG": "group2"
}
],
"FG_NHG_MEMBER_LIST":[
]
}
}
},
"FG_NHG_MEMBER_TEST_DUPLICATE_MEMBER": {
"sonic-fine-grained-ecmp:sonic-fine-grained-ecmp": {
"sonic-fine-grained-ecmp:FG_NHG_MEMBER": {
"FG_NHG_MEMBER_LIST": [
{
"next_hop_ip": "10.0.0.1",
"FG_NHG": "group1",
"bank": 1,
"link": "Ethernet1"
},
{
"next_hop_ip":"200.200.200.4",
"FG_NHG": "fgnhg_v4",
"bank": "0",
"link": "Ethernet8"
"next_hop_ip": "10.0.0.2",
"FG_NHG": "group1",
"bank": 2,
"link": "Ethernet2"
},
{
"next_hop_ip":"200.200.200.5",
"FG_NHG": "fgnhg_v4",
"bank": "1",
"link": "Ethernet12"
"next_hop_ip": "10.0.0.1",
"FG_NHG": "group1",
"bank": 3,
"link": "Ethernet3"
}
]
}
Expand Down

0 comments on commit 859deb3

Please sign in to comment.