-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#### Why I did it Add yang model for TUNNEL config #### How I did it created sonic-tunnel.yang file and tests #### How to verify it `make target/python-wheels/bullseye/sonic_yang_models-1.0-py3-none-any.whl` #### Link to config_db schema for YANG module changes https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md#tunnel
- Loading branch information
Showing
6 changed files
with
379 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/sonic-yang-models/tests/yang_model_tests/tests/tunnel.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"TUNNEL_LOAD_NORMAL": { | ||
"desc": "Load TUNNEL for dualtor device." | ||
}, | ||
"TUNNEL_INVALID_ADDR": { | ||
"desc": "Load TUNNEL with invalid IPv4 Address.", | ||
"eStr": ["does not satisfy the constraint"] | ||
}, | ||
"TUNNEL_SRC_IP_NOT_PEER_SWITCH": { | ||
"desc": "Load TUNNEL with wrong IPv4 Address.", | ||
"eStr": ["points to a non-existing leaf."] | ||
}, | ||
"TUNNEL_MISSING_MUX_TUNNEL": { | ||
"desc": "Load MUX_TUNNEL missing name.", | ||
"eStr": ["Missing required element"] | ||
} | ||
} | ||
|
143 changes: 143 additions & 0 deletions
143
src/sonic-yang-models/tests/yang_model_tests/tests_config/tunnel.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
{ | ||
"TUNNEL_LOAD_NORMAL": { | ||
"sonic-peer-switch:sonic-peer-switch": { | ||
"sonic-peer-switch:PEER_SWITCH": { | ||
"PEER_SWITCH_LIST": [ | ||
{ | ||
"peer_switch": "vlab-05", | ||
"address_ipv4": "10.1.0.33" | ||
} | ||
] | ||
} | ||
}, | ||
"sonic-dscp-tc-map:sonic-dscp-tc-map": { | ||
"sonic-dscp-tc-map:DSCP_TO_TC_MAP": { | ||
"DSCP_TO_TC_MAP_LIST": [ | ||
{ | ||
"name": "DecapDscpToTcMap", | ||
"DSCP_TO_TC_MAP": [ | ||
{ | ||
"dscp": "1", | ||
"tc": "1" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
"sonic-tc-priority-group-map:sonic-tc-priority-group-map": { | ||
"sonic-tc-priority-group-map:TC_TO_PRIORITY_GROUP_MAP": { | ||
"TC_TO_PRIORITY_GROUP_MAP_LIST": [ | ||
{ | ||
"name": "DecapTcToPgMap", | ||
"TC_TO_PRIORITY_GROUP_MAP": [ | ||
{ | ||
"tc": "1", | ||
"pg": "1" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
"sonic-tc-queue-map:sonic-tc-queue-map": { | ||
"sonic-tc-queue-map:TC_TO_QUEUE_MAP": { | ||
"TC_TO_QUEUE_MAP_LIST": [ | ||
{ | ||
"name": "EncapTcToQueueMap", | ||
"TC_TO_QUEUE_MAP": [ | ||
{ | ||
"tc": "1", | ||
"qindex": "1" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
"sonic-tunnel:sonic-tunnel": { | ||
"sonic-tunnel:TUNNEL": { | ||
"TUNNEL_LIST": [ | ||
{ | ||
"mux_tunnel": "MuxTunnel0", | ||
"dscp_mode": "pipe", | ||
"src_ip": "10.1.0.33", | ||
"dst_ip": "10.1.0.32", | ||
"ecn_mode": "standard", | ||
"encap_ecn_mode": "standard", | ||
"ttl_mode": "pipe", | ||
"tunnel_type": "IPINIP", | ||
"decap_dscp_to_tc_map": "DecapDscpToTcMap", | ||
"decap_tc_to_pg_map": "DecapTcToPgMap", | ||
"encap_tc_to_dscp_map": "EncapTcToDscpMap", | ||
"encap_tc_to_queue_map": "EncapTcToQueueMap" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
|
||
"TUNNEL_INVALID_ADDR": { | ||
"sonic-tunnel:sonic-tunnel": { | ||
"sonic-tunnel:TUNNEL": { | ||
"TUNNEL_LIST": [ | ||
{ | ||
"mux_tunnel": "MuxTunnel0", | ||
"dscp_mode": "pipe", | ||
"dst_ip": "10.1.0.33/32", | ||
"ecn_mode": "standard", | ||
"encap_ecn_mode": "standard", | ||
"ttl_mode": "pipe", | ||
"tunnel_type": "IPINIP" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
|
||
"TUNNEL_SRC_IP_NOT_PEER_SWITCH": { | ||
"sonic-peer-switch:sonic-peer-switch": { | ||
"sonic-peer-switch:PEER_SWITCH": { | ||
"PEER_SWITCH_LIST": [ | ||
{ | ||
"peer_switch": "vlab-05", | ||
"address_ipv4": "10.1.0.33" | ||
} | ||
] | ||
} | ||
}, | ||
"sonic-tunnel:sonic-tunnel": { | ||
"sonic-tunnel:TUNNEL": { | ||
"TUNNEL_LIST": [ | ||
{ | ||
"mux_tunnel": "MuxTunnel0", | ||
"dscp_mode": "pipe", | ||
"dst_ip": "10.1.0.32", | ||
"src_ip": "10.1.0.32", | ||
"ecn_mode": "standard", | ||
"encap_ecn_mode": "standard", | ||
"ttl_mode": "pipe", | ||
"tunnel_type": "IPINIP" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
|
||
"TUNNEL_MISSING_MUX_TUNNEL": { | ||
"sonic-tunnel:sonic-tunnel": { | ||
"sonic-tunnel:TUNNEL": { | ||
"TUNNEL_LIST": [ | ||
{ | ||
"dscp_mode": "pipe", | ||
"dst_ip": "10.1.0.32", | ||
"ecn_mode": "standard", | ||
"encap_ecn_mode": "standard", | ||
"ttl_mode": "pipe", | ||
"tunnel_type": "IPINIP" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.