Skip to content

Commit

Permalink
Enforce uniqueness on vxlanid
Browse files Browse the repository at this point in the history
  • Loading branch information
miatttao committed Feb 25, 2025
1 parent 8367814 commit a650a9b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@

"VNET_ROUTE_TUNNEL_TEST_INVALID_NAME_FORMAT": {
"desc": "VNET route tunnel configuration with invalid name format (missing prefix) in VNET_ROUTE_TUNNEL_LIST table.",
"eStrKey":"InvalidValue"
"eStr":["does not match pattern"]
},

"VNET_ROUTE_TUNNEL_TEST_INVALID_PREFIX": {
"desc": "VNET route tunnel configuration with invalid prefix format in name field.",
"eStrKey":"InvalidValue"
"eStr":["does not match pattern"]
},

"VNET_ROUTE_TUNNEL_TEST_MISSING_ENDPOINT": {
Expand All @@ -53,6 +53,6 @@

"VNET_ROUTE_TUNNEL_TEST_DUPLICATE_VXLANID": {
"desc": "VNET route tunnel configuration with duplicate VXLAN ID across entries.",
"eStr": "Duplicated instance of \"VNET_ROUTE_TUNNEL_LIST\" list."
"eStr": ["VXLAN ID must be unique across all route tunnels"]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ module sonic-vnet-route-tunnel-vxlan {
leaf vxlanid {
type stypes:vnid_type;
description "A valid and unique vni value in encapsulated packet";
must "not(../VNET_ROUTE_TUNNEL_LIST[name != current()/../name][vxlanid = current()])"
{
error-message "VXLAN ID must be unique across all route tunnels";
}
}
}
}
Expand Down

0 comments on commit a650a9b

Please sign in to comment.