Switchport Modes Port & Port Channel Yang Model Configurations (#13580)

### Why I did it

-  Modified "sonic-port.yang" for adding support in Port Yang model for the "mode" attribute for adding port modes 

- Modified "sonic-portchannel.yang" for adding support in Port Channel Yang model for the "mode" attribute for adding port modes 

- Updated tests for these modifications

#### How to verify it
 
-  Added support to align SONiC yang with Config_db
This commit is contained in:
Rida Hanif 2024-01-27 00:19:08 +05:00 committed by GitHub
parent e8b1722005
commit 88f80fbe08
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 276 additions and 106 deletions

View File

@ -88,21 +88,24 @@
"min_links": "1", "min_links": "1",
"tpid": "0x8100", "tpid": "0x8100",
"mtu": "9100", "mtu": "9100",
"lacp_key": "auto" "lacp_key": "auto",
"mode":"trunk"
}, },
"PortChannel0004": { "PortChannel0004": {
"admin_status": "up", "admin_status": "up",
"min_links": "1", "min_links": "1",
"tpid": "0x9200", "tpid": "0x9200",
"mtu": "9100", "mtu": "9100",
"lacp_key": "auto" "lacp_key": "auto",
"mode":"routed"
}, },
"PortChannel2": { "PortChannel2": {
"admin_status": "up", "admin_status": "up",
"min_links": "1", "min_links": "1",
"tpid": "0x9200", "tpid": "0x9200",
"mtu": "9100", "mtu": "9100",
"lacp_key": "auto" "lacp_key": "auto",
"mode":"trunk"
}, },
"PortChannel42": { "PortChannel42": {
"admin_status": "up", "admin_status": "up",
@ -110,7 +113,8 @@
"mtu": "9100", "mtu": "9100",
"tpid": "0x8100", "tpid": "0x8100",
"fast_rate": "false", "fast_rate": "false",
"fallback" : "true" "fallback" : "true",
"mode":"routed"
} }
}, },
"PORTCHANNEL_INTERFACE": { "PORTCHANNEL_INTERFACE": {
@ -572,7 +576,8 @@
"macsec": "test", "macsec": "test",
"link_training": "off", "link_training": "off",
"laser_freq": "191600", "laser_freq": "191600",
"tx_power": "-26.6" "tx_power": "-26.6",
"mode":"trunk"
}, },
"Ethernet1": { "Ethernet1": {
"alias": "Eth1/2", "alias": "Eth1/2",
@ -586,7 +591,8 @@
"adv_interface_types": "CR,CR4", "adv_interface_types": "CR,CR4",
"link_training": "on", "link_training": "on",
"laser_freq": "191300", "laser_freq": "191300",
"tx_power": "-27.3" "tx_power": "-27.3",
"mode":"trunk"
}, },
"Ethernet2": { "Ethernet2": {
"alias": "Eth1/3", "alias": "Eth1/3",
@ -598,7 +604,8 @@
"autoneg": "on", "autoneg": "on",
"adv_speeds": "all", "adv_speeds": "all",
"adv_interface_types": "all", "adv_interface_types": "all",
"subport" : "0" "subport" : "0",
"mode":"trunk"
}, },
"Ethernet3": { "Ethernet3": {
"alias": "Eth1/4", "alias": "Eth1/4",
@ -607,7 +614,8 @@
"speed": "11100", "speed": "11100",
"tpid": "0x88A8", "tpid": "0x88A8",
"admin_status": "up", "admin_status": "up",
"subport": "1" "subport": "1",
"mode":"trunk"
}, },
"Ethernet4": { "Ethernet4": {
"alias": "Eth2/1", "alias": "Eth2/1",
@ -616,7 +624,8 @@
"speed": "11100", "speed": "11100",
"tpid": "0x9100", "tpid": "0x9100",
"admin_status": "up", "admin_status": "up",
"subport": "2" "subport": "2",
"mode":"trunk"
}, },
"Ethernet5": { "Ethernet5": {
"alias": "Eth2/2", "alias": "Eth2/2",
@ -625,7 +634,8 @@
"speed": "11100", "speed": "11100",
"tpid": "0x9200", "tpid": "0x9200",
"admin_status": "up", "admin_status": "up",
"subport": "3" "subport": "3",
"mode":"trunk"
}, },
"Ethernet6": { "Ethernet6": {
"alias": "Eth2/3", "alias": "Eth2/3",
@ -634,7 +644,8 @@
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up", "admin_status": "up",
"subport": "4" "subport": "4",
"mode":"trunk"
}, },
"Ethernet7": { "Ethernet7": {
"alias": "Eth2/4", "alias": "Eth2/4",
@ -643,7 +654,8 @@
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up", "admin_status": "up",
"subport": "5" "subport": "5",
"mode":"routed"
}, },
"Ethernet8": { "Ethernet8": {
"alias": "Eth3/1", "alias": "Eth3/1",
@ -652,7 +664,8 @@
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up", "admin_status": "up",
"subport": "6" "subport": "6",
"mode":"routed"
}, },
"Ethernet9": { "Ethernet9": {
"alias": "Eth3/2", "alias": "Eth3/2",
@ -661,7 +674,8 @@
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up", "admin_status": "up",
"subport": "7" "subport": "7",
"mode":"routed"
}, },
"Ethernet10": { "Ethernet10": {
"alias": "Eth3/3", "alias": "Eth3/3",
@ -670,7 +684,8 @@
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up", "admin_status": "up",
"subport": "8" "subport": "8",
"mode":"routed"
}, },
"Ethernet11": { "Ethernet11": {
"alias": "Eth3/4", "alias": "Eth3/4",
@ -678,7 +693,8 @@
"description": "", "description": "",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"routed"
}, },
"Ethernet12": { "Ethernet12": {
"alias": "Eth4/1", "alias": "Eth4/1",
@ -686,7 +702,8 @@
"description": "", "description": "",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"routed"
}, },
"Ethernet13": { "Ethernet13": {
"alias": "Eth4/2", "alias": "Eth4/2",
@ -694,7 +711,8 @@
"description": "", "description": "",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"routed"
}, },
"Ethernet14": { "Ethernet14": {
"alias": "Eth4/3", "alias": "Eth4/3",
@ -702,7 +720,8 @@
"description": "", "description": "",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"routed"
}, },
"Ethernet15": { "Ethernet15": {
"alias": "Eth4/4", "alias": "Eth4/4",
@ -710,7 +729,8 @@
"description": "", "description": "",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"routed"
}, },
"Ethernet16": { "Ethernet16": {
"alias": "Eth5/1", "alias": "Eth5/1",
@ -718,7 +738,8 @@
"description": "", "description": "",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"routed"
}, },
"Ethernet17": { "Ethernet17": {
"alias": "Eth5/2", "alias": "Eth5/2",
@ -726,7 +747,8 @@
"description": "", "description": "",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"routed"
}, },
"Ethernet18": { "Ethernet18": {
"alias": "Eth5/3", "alias": "Eth5/3",
@ -734,7 +756,8 @@
"description": "", "description": "",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"routed"
}, },
"Ethernet19": { "Ethernet19": {
"alias": "Eth5/4", "alias": "Eth5/4",
@ -742,7 +765,8 @@
"description": "", "description": "",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"routed"
}, },
"Ethernet20": { "Ethernet20": {
"alias": "Eth6/1", "alias": "Eth6/1",
@ -750,7 +774,8 @@
"description": "", "description": "",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"routed"
}, },
"Ethernet21": { "Ethernet21": {
"alias": "Eth6/2", "alias": "Eth6/2",
@ -758,7 +783,8 @@
"description": "", "description": "",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"routed"
}, },
"Ethernet22": { "Ethernet22": {
"alias": "Eth6/3", "alias": "Eth6/3",
@ -766,7 +792,8 @@
"description": "", "description": "",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"routed"
}, },
"Ethernet23": { "Ethernet23": {
"alias": "Eth6/4", "alias": "Eth6/4",
@ -774,7 +801,8 @@
"description": "", "description": "",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"routed"
}, },
"Ethernet24": { "Ethernet24": {
"alias": "Eth7/1", "alias": "Eth7/1",
@ -782,7 +810,8 @@
"description": "", "description": "",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"routed"
}, },
"Ethernet25": { "Ethernet25": {
"alias": "Eth7/2", "alias": "Eth7/2",
@ -790,7 +819,8 @@
"description": "", "description": "",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"routed"
}, },
"Ethernet26": { "Ethernet26": {
"alias": "Eth7/3", "alias": "Eth7/3",
@ -798,7 +828,8 @@
"description": "", "description": "",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"routed"
}, },
"Ethernet27": { "Ethernet27": {
"alias": "Eth7/4", "alias": "Eth7/4",
@ -806,7 +837,8 @@
"description": "", "description": "",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"routed"
}, },
"Ethernet28": { "Ethernet28": {
"alias": "Eth8/1", "alias": "Eth8/1",
@ -814,7 +846,8 @@
"description": "", "description": "",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"routed"
}, },
"Ethernet29": { "Ethernet29": {
"alias": "Eth8/2", "alias": "Eth8/2",
@ -822,7 +855,8 @@
"description": "", "description": "",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"trunk"
}, },
"Ethernet30": { "Ethernet30": {
"alias": "Eth8/3", "alias": "Eth8/3",
@ -830,7 +864,8 @@
"description": "", "description": "",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"trunk"
}, },
"Ethernet31": { "Ethernet31": {
"alias": "Eth8/4", "alias": "Eth8/4",
@ -838,7 +873,8 @@
"description": "", "description": "",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"trunk"
}, },
"Ethernet32": { "Ethernet32": {
"alias": "Eth9/1", "alias": "Eth9/1",
@ -846,7 +882,8 @@
"description": "", "description": "",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"trunk"
}, },
"Ethernet33": { "Ethernet33": {
"alias": "Eth9/2", "alias": "Eth9/2",
@ -854,7 +891,8 @@
"description": "", "description": "",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"trunk"
}, },
"Ethernet34": { "Ethernet34": {
"alias": "Eth9/3", "alias": "Eth9/3",
@ -862,7 +900,8 @@
"description": "", "description": "",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"trunk"
}, },
"Ethernet35": { "Ethernet35": {
"alias": "Eth9/4", "alias": "Eth9/4",
@ -870,7 +909,8 @@
"description": "", "description": "",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"trunk"
}, },
"Ethernet36": { "Ethernet36": {
"alias": "Eth10/1", "alias": "Eth10/1",
@ -878,7 +918,8 @@
"description": "", "description": "",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"trunk"
}, },
"Ethernet112": { "Ethernet112": {
"alias": "Eth29/1", "alias": "Eth29/1",
@ -887,7 +928,8 @@
"fec": "fc", "fec": "fc",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"routed"
}, },
"Ethernet120": { "Ethernet120": {
"alias": "Eth31/1", "alias": "Eth31/1",
@ -896,7 +938,8 @@
"fec": "auto", "fec": "auto",
"speed": "11100", "speed": "11100",
"tpid": "0x8100", "tpid": "0x8100",
"admin_status": "up" "admin_status": "up",
"mode":"routed"
}, },
"Ethernet-BP0": { "Ethernet-BP0": {
"admin_status": "up", "admin_status": "up",
@ -909,7 +952,8 @@
"pfc_asym": "off", "pfc_asym": "off",
"role": "Int", "role": "Int",
"speed": "40000", "speed": "40000",
"tpid": "0x8100" "tpid": "0x8100",
"mode":"routed"
}, },
"Ethernet-BP4": { "Ethernet-BP4": {
"admin_status": "up", "admin_status": "up",
@ -922,7 +966,8 @@
"pfc_asym": "off", "pfc_asym": "off",
"role": "Int", "role": "Int",
"speed": "40000", "speed": "40000",
"tpid": "0x8100" "tpid": "0x8100",
"mode":"routed"
} }
}, },
"LOGGER": { "LOGGER": {

View File

@ -19,6 +19,11 @@
"PORT_VALID_MTU_TEST_2": { "PORT_VALID_MTU_TEST_2": {
"desc": "PORT_VALID_MTU_TEST_2 no failure." "desc": "PORT_VALID_MTU_TEST_2 no failure."
}, },
"PORT_INVLAID_MODE_TEST": {
"desc": "PORT_INVLAID_MODE_TEST invalid mode failure.",
"eStrKey" : "Pattern",
"eStr": ["routed|access|trunk"]
},
"PORT_VALID_AUTONEG_TEST_1": { "PORT_VALID_AUTONEG_TEST_1": {
"desc": "PORT_VALID_AUTONEG_TEST_1 no failure." "desc": "PORT_VALID_AUTONEG_TEST_1 no failure."
}, },

View File

@ -19,6 +19,11 @@
"eStrKey" : "Pattern", "eStrKey" : "Pattern",
"eStr": ["0x8100|0x9100|0x9200|0x88a8|0x88A8"] "eStr": ["0x8100|0x9100|0x9200|0x88a8|0x88A8"]
}, },
"PORT_CHANNEL_INVALID_MODE": {
"desc": "INCORRECT VALUE OF MODE IN PORT_CHANNEL TABLE.",
"eStrKey" : "Pattern",
"eStr": ["routed|access|trunk"]
},
"PORT_CHANNEL_INVALID_FALLBACK": { "PORT_CHANNEL_INVALID_FALLBACK": {
"desc": "INCORRECT PORTCHANNEL FALLBACK IN PORT_CHANNEL TABLE.", "desc": "INCORRECT PORTCHANNEL FALLBACK IN PORT_CHANNEL TABLE.",
"eStrKey" : "Pattern", "eStrKey" : "Pattern",

View File

@ -28,7 +28,8 @@
"mtu": 9000, "mtu": 9000,
"lanes": "1", "lanes": "1",
"name": "Ethernet0", "name": "Ethernet0",
"speed": 25000 "speed": 25000,
"mode" : "trunk"
} }
] ]
} }
@ -244,7 +245,8 @@
"mtu": 9000, "mtu": 9000,
"lanes": "1", "lanes": "1",
"name": "Ethernet0", "name": "Ethernet0",
"speed": 25000 "speed": 25000,
"mode" : "trunk"
} }
] ]
} }
@ -433,7 +435,8 @@
"mtu": 9000, "mtu": 9000,
"lanes": "1", "lanes": "1",
"name": "Ethernet0", "name": "Ethernet0",
"speed": 25000 "speed": 25000,
"mode" : "trunk"
} }
] ]
} }
@ -498,7 +501,8 @@
"mtu": 9000, "mtu": 9000,
"lanes": "1", "lanes": "1",
"name": "Ethernet0", "name": "Ethernet0",
"speed": 25000 "speed": 25000,
"mode" : "trunk"
} }
] ]
} }
@ -579,7 +583,8 @@
"mtu": 9000, "mtu": 9000,
"lanes": "1", "lanes": "1",
"name": "Ethernet0", "name": "Ethernet0",
"speed": 25000 "speed": 25000,
"mode" : "trunk"
} }
] ]
} }
@ -660,7 +665,8 @@
"mtu": 9000, "mtu": 9000,
"lanes": "1", "lanes": "1",
"name": "Ethernet0", "name": "Ethernet0",
"speed": 25000 "speed": 25000,
"mode" : "trunk"
} }
] ]
} }
@ -741,7 +747,8 @@
"mtu": 9000, "mtu": 9000,
"lanes": "1", "lanes": "1",
"name": "Ethernet0", "name": "Ethernet0",
"speed": 25000 "speed": 25000,
"mode" : "trunk"
} }
] ]
} }
@ -822,7 +829,8 @@
"mtu": 9000, "mtu": 9000,
"lanes": "1", "lanes": "1",
"name": "Ethernet0", "name": "Ethernet0",
"speed": 25000 "speed": 25000,
"mode" : "trunk"
} }
] ]
} }

View File

@ -24,7 +24,8 @@
"mtu": 9000, "mtu": 9000,
"lanes": "1", "lanes": "1",
"name": "Ethernet0", "name": "Ethernet0",
"speed": 25000 "speed": 25000,
"mode":"trunk"
} }
] ]
} }

View File

@ -27,7 +27,8 @@
"lanes": "65", "lanes": "65",
"mtu": 9000, "mtu": 9000,
"name": "Ethernet8", "name": "Ethernet8",
"speed": 25000 "speed": 25000,
"mode":"trunk"
}, },
{ {
"admin_status": "up", "admin_status": "up",
@ -36,7 +37,8 @@
"lanes": "71", "lanes": "71",
"mtu": 9000, "mtu": 9000,
"name": "Ethernet9", "name": "Ethernet9",
"speed": 25000 "speed": 25000,
"mode":"trunk"
} }
] ]
} }
@ -71,7 +73,8 @@
"lanes": "65", "lanes": "65",
"mtu": 9000, "mtu": 9000,
"name": "Ethernet8", "name": "Ethernet8",
"speed": 25000 "speed": 25000,
"mode":"trunk"
} }
] ]
} }
@ -104,7 +107,8 @@
"description": "Ethernet8", "description": "Ethernet8",
"mtu": 9000, "mtu": 9000,
"name": "Ethernet8", "name": "Ethernet8",
"speed": 25000 "speed": 25000,
"mode":"trunk"
} }
] ]
} }
@ -140,7 +144,8 @@
"lanes": "65", "lanes": "65",
"mtu": 9000, "mtu": 9000,
"name": "Ethernet8", "name": "Ethernet8",
"speed": 25000 "speed": 25000,
"mode":"trunk"
} }
] ]
} }
@ -176,7 +181,8 @@
"lanes": "65", "lanes": "65",
"mtu": 9000, "mtu": 9000,
"name": "Ethernet8", "name": "Ethernet8",
"speed": 25000 "speed": 25000,
"mode":"trunk"
} }
] ]
} }
@ -204,7 +210,8 @@
"lanes": "65", "lanes": "65",
"mtu": 9000, "mtu": 9000,
"name": "Ethernet8", "name": "Ethernet8",
"speed": 25000 "speed": 25000,
"mode":"trunk"
} }
] ]
} }
@ -232,7 +239,8 @@
"lanes": "65", "lanes": "65",
"mtu": 9000, "mtu": 9000,
"name": "Ethernet8", "name": "Ethernet8",
"speed": 25000 "speed": 25000,
"mode":"trunk"
} }
] ]
} }
@ -260,7 +268,8 @@
"lanes": "65", "lanes": "65",
"mtu": 9000, "mtu": 9000,
"name": "Ethernet8", "name": "Ethernet8",
"speed": 25000 "speed": 25000,
"mode":"trunk"
} }
] ]
} }

View File

@ -10,7 +10,8 @@
"lanes": "65", "lanes": "65",
"mtu": 9000, "mtu": 9000,
"name": "Ethernet0", "name": "Ethernet0",
"speed": 25000 "speed": 25000,
"mode": "trunk"
}, },
{ {
"admin_status": "up", "admin_status": "up",
@ -19,7 +20,8 @@
"lanes": "65", "lanes": "65",
"mtu": 9000, "mtu": 9000,
"name": "Ethernet10", "name": "Ethernet10",
"speed": 25000 "speed": 25000,
"mode":"routed"
} }
] ]
} }
@ -32,14 +34,17 @@
"min_links": "1", "min_links": "1",
"mtu": "9100", "mtu": "9100",
"lacp_key": "auto", "lacp_key": "auto",
"name": "PortChannel2" "name": "PortChannel2",
"mode":"trunk"
}, },
{ {
"admin_status": "up", "admin_status": "up",
"min_links": "1", "min_links": "1",
"mtu": "9100", "mtu": "9100",
"lacp_key": "auto", "lacp_key": "auto",
"name": "PortChannel10" "name": "PortChannel10",
"mode":"trunk"
} }
] ]
} }
@ -126,7 +131,8 @@
"lanes": "65", "lanes": "65",
"mtu": 9000, "mtu": 9000,
"name": "Ethernet0", "name": "Ethernet0",
"speed": 25000 "speed": 25000,
"mode":"trunk"
}, },
{ {
"admin_status": "up", "admin_status": "up",
@ -135,7 +141,8 @@
"lanes": "65", "lanes": "65",
"mtu": 9000, "mtu": 9000,
"name": "Ethernet4", "name": "Ethernet4",
"speed": 25000 "speed": 25000,
"mode":"trunk"
} }
] ]
} }
@ -148,7 +155,8 @@
"min_links": "1", "min_links": "1",
"mtu": "9100", "mtu": "9100",
"lacp_key": "auto", "lacp_key": "auto",
"name": "PortChannel2" "name": "PortChannel2",
"mode":"trunk"
} }
] ]
} }
@ -302,7 +310,8 @@
"lanes": "65", "lanes": "65",
"mtu": 9000, "mtu": 9000,
"name": "Ethernet12", "name": "Ethernet12",
"speed": 25000 "speed": 25000,
"mode":"routed"
} }
] ]
} }

View File

@ -13,7 +13,8 @@
"pfc_asym": "off", "pfc_asym": "off",
"name": "Ethernet8", "name": "Ethernet8",
"tpid": "0x8100", "tpid": "0x8100",
"speed": 25000 "speed": 25000,
"mode":"trunk"
} }
] ]
} }
@ -33,7 +34,8 @@
"pfc_asym": "on", "pfc_asym": "on",
"name": "Ethernet8", "name": "Ethernet8",
"tpid": "0x8100", "tpid": "0x8100",
"speed": 25000 "speed": 25000,
"mode":"trunk"
} }
] ]
} }
@ -48,7 +50,8 @@
"alias": "eth8", "alias": "eth8",
"lanes": "65", "lanes": "65",
"speed": 25000, "speed": 25000,
"mtu": 68 "mtu": 68,
"mode":"trunk"
} }
] ]
} }
@ -63,7 +66,23 @@
"alias": "eth8", "alias": "eth8",
"lanes": "65", "lanes": "65",
"speed": 25000, "speed": 25000,
"mtu": 9216 "mtu": 9216,
"mode":"trunk"
}
]
}
}
},
"PORT_INVLAID_MODE_TEST": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"name": "Ethernet8",
"alias": "eth8",
"lanes": "65",
"speed": 25000,
"mode" : "off"
} }
] ]
} }
@ -79,7 +98,8 @@
"lanes": "65", "lanes": "65",
"speed": 25000, "speed": 25000,
"tpid": "0x8100", "tpid": "0x8100",
"autoneg": "on" "autoneg": "on",
"mode":"trunk"
} }
] ]
} }
@ -96,7 +116,8 @@
"lanes": "65", "lanes": "65",
"speed": 25000, "speed": 25000,
"tpid": "0x8100", "tpid": "0x8100",
"autoneg": "off" "autoneg": "off",
"mode":"trunk"
} }
] ]
} }
@ -113,7 +134,8 @@
"lanes": "65", "lanes": "65",
"speed": 25000, "speed": 25000,
"tpid": "0x8100", "tpid": "0x8100",
"autoneg": 0 "autoneg": 0,
"mode":"trunk"
} }
] ]
} }
@ -419,7 +441,8 @@
"lanes": "65", "lanes": "65",
"speed": 25000, "speed": 25000,
"tpid": "0x8100", "tpid": "0x8100",
"link_training": "on" "link_training": "on",
"mode":"trunk"
} }
] ]
} }
@ -436,7 +459,8 @@
"lanes": "65", "lanes": "65",
"speed": 25000, "speed": 25000,
"tpid": "0x8100", "tpid": "0x8100",
"link_training": "off" "link_training": "off",
"mode":"trunk"
} }
] ]
} }
@ -525,7 +549,8 @@
"alias": "etp1a", "alias": "etp1a",
"lanes": "60, 61", "lanes": "60, 61",
"speed": 100000, "speed": 100000,
"subport": 9 "subport": 9,
"mode":"trunk"
} }
] ]
} }
@ -541,28 +566,32 @@
"alias": "etp1a", "alias": "etp1a",
"lanes": "60, 61", "lanes": "60, 61",
"speed": 100000, "speed": 100000,
"subport": 1 "subport": 1,
"mode":"trunk"
}, },
{ {
"name": "Ethernet2", "name": "Ethernet2",
"alias": "etp1b", "alias": "etp1b",
"lanes": "62, 63", "lanes": "62, 63",
"speed": 100000, "speed": 100000,
"subport": 2 "subport": 2,
"mode":"trunk"
}, },
{ {
"name": "Ethernet4", "name": "Ethernet4",
"alias": "etp1c", "alias": "etp1c",
"lanes": "64, 65", "lanes": "64, 65",
"speed": 100000, "speed": 100000,
"subport": 3 "subport": 3,
"mode":"trunk"
}, },
{ {
"name": "Ethernet6", "name": "Ethernet6",
"alias": "etp1d", "alias": "etp1d",
"lanes": "66, 67", "lanes": "66, 67",
"speed": 100000, "speed": 100000,
"subport": 4 "subport": 4,
"mode":"trunk"
} }
] ]
} }

View File

@ -11,7 +11,8 @@
"mtu": 9000, "mtu": 9000,
"name": "Ethernet0", "name": "Ethernet0",
"tpid": "0x8100", "tpid": "0x8100",
"speed": 25000 "speed": 25000,
"mode": "routed"
} }
] ]
} }
@ -27,7 +28,8 @@
"lacp_key": "auto", "lacp_key": "auto",
"name": "PortChannel0001", "name": "PortChannel0001",
"fast_rate": "false", "fast_rate": "false",
"fallback" : "false" "fallback" : "false",
"mode" : "routed"
} }
] ]
} }
@ -44,7 +46,8 @@
"lanes": "65", "lanes": "65",
"mtu": 9000, "mtu": 9000,
"name": "Ethernet0", "name": "Ethernet0",
"speed": 25000 "speed": 25000,
"mode": "routed"
} }
] ]
} }
@ -56,7 +59,8 @@
"admin_status": "up", "admin_status": "up",
"min_links": "1024", "min_links": "1024",
"mtu": "9100", "mtu": "9100",
"name": "PortChannel0001" "name": "PortChannel0001",
"mode": "routed"
} }
] ]
} }
@ -73,7 +77,8 @@
"lanes": "65", "lanes": "65",
"mtu": 9000, "mtu": 9000,
"name": "Ethernet0", "name": "Ethernet0",
"speed": 25000 "speed": 25000,
"mode": "routed"
} }
] ]
} }
@ -85,7 +90,8 @@
"admin_status": "up", "admin_status": "up",
"min_links": "1025", "min_links": "1025",
"mtu": "9100", "mtu": "9100",
"name": "PortChannel0001" "name": "PortChannel0001",
"mode":"routed"
} }
] ]
} }
@ -113,6 +119,23 @@
"mtu": "9100", "mtu": "9100",
"tpid": "0x9500", "tpid": "0x9500",
"name": "PortChannel0001" "name": "PortChannel0001"
}
]
}
}
},
"PORT_CHANNEL_INVALID_MODE": {
"sonic-portchannel:sonic-portchannel": {
"sonic-portchannel:PORTCHANNEL": {
"PORTCHANNEL_LIST": [
{
"admin_status": "up",
"mtu": "9100",
"tpid" : "0x9100",
"name": "PortChannel0001",
"mode": "off"
} }
] ]
} }
@ -316,7 +339,8 @@
"lanes": "65", "lanes": "65",
"mtu": 9000, "mtu": 9000,
"name": "Ethernet0", "name": "Ethernet0",
"speed": 25000 "speed": 25000,
"mode": "routed"
} }
] ]
} }
@ -328,7 +352,8 @@
"admin_status": "up", "admin_status": "up",
"min_links": "1", "min_links": "1",
"mtu": "9100", "mtu": "9100",
"name": "PortChannel0001" "name": "PortChannel0001",
"mode":"routed"
} }
] ]
}, },
@ -360,7 +385,8 @@
"lanes": "65", "lanes": "65",
"mtu": 9000, "mtu": 9000,
"name": "Ethernet0", "name": "Ethernet0",
"speed": 25000 "speed": 25000,
"mode": "routed"
} }
] ]
} }
@ -372,7 +398,8 @@
"admin_status": "up", "admin_status": "up",
"min_links": "1", "min_links": "1",
"mtu": "9100", "mtu": "9100",
"name": "PortChannel0001" "name": "PortChannel0001",
"mode": "routed"
} }
] ]
}, },
@ -403,7 +430,8 @@
"lanes": "65", "lanes": "65",
"mtu": 9000, "mtu": 9000,
"name": "Ethernet0", "name": "Ethernet0",
"speed": 25000 "speed": 25000,
"mode": "trunk"
} }
] ]
} }
@ -415,7 +443,8 @@
"admin_status": "up", "admin_status": "up",
"min_links": "1", "min_links": "1",
"mtu": "9100", "mtu": "9100",
"name": "PortChannel0001" "name": "PortChannel0001",
"mode": "routed"
} }
] ]
}, },
@ -440,7 +469,8 @@
"lanes": "65", "lanes": "65",
"mtu": 9000, "mtu": 9000,
"name": "Ethernet0", "name": "Ethernet0",
"speed": 25000 "speed": 25000,
"mode": "routed"
} }
] ]
} }
@ -452,7 +482,8 @@
"admin_status": "up", "admin_status": "up",
"min_links": "1", "min_links": "1",
"mtu": "9100", "mtu": "9100",
"name": "PortChannel0001" "name": "PortChannel0001",
"mode": "routed"
} }
] ]
}, },
@ -477,7 +508,8 @@
"lanes": "65", "lanes": "65",
"mtu": 9000, "mtu": 9000,
"name": "Ethernet0", "name": "Ethernet0",
"speed": 25000 "speed": 25000,
"mode": "routed"
} }
] ]
} }
@ -489,7 +521,8 @@
"admin_status": "up", "admin_status": "up",
"min_links": "1", "min_links": "1",
"mtu": "9100", "mtu": "9100",
"name": "PortChannel0001" "name": "PortChannel0001",
"mode": "routed"
} }
] ]
}, },

View File

@ -224,7 +224,8 @@
"PORTCHANNEL_LIST": [ "PORTCHANNEL_LIST": [
{ {
"admin_status": "up", "admin_status": "up",
"name": "PortChannel5" "name": "PortChannel5",
"mode":"trunk"
} }
] ]
} }
@ -373,7 +374,8 @@
"mtu": 9000, "mtu": 9000,
"lanes": "1", "lanes": "1",
"name": "Ethernet0", "name": "Ethernet0",
"speed": 25000 "speed": 25000,
"mode":"trunk"
} }
] ]
} }
@ -425,7 +427,8 @@
"mtu": 9000, "mtu": 9000,
"lanes": "1", "lanes": "1",
"name": "Ethernet0", "name": "Ethernet0",
"speed": 25000 "speed": 25000,
"mode":"trunk"
} }
] ]
} }
@ -481,7 +484,8 @@
"mtu": 9000, "mtu": 9000,
"lanes": "1", "lanes": "1",
"name": "Ethernet0", "name": "Ethernet0",
"speed": 25000 "speed": 25000,
"mode":"trunk"
} }
] ]
} }
@ -638,7 +642,8 @@
"mtu": 9000, "mtu": 9000,
"lanes": "1", "lanes": "1",
"name": "Ethernet0", "name": "Ethernet0",
"speed": 25000 "speed": 25000,
"mode":"trunk"
} }
] ]
} }

View File

@ -52,6 +52,12 @@ module sonic-port{
} }
} }
leaf mode {
description "SwitchPort Modes possible values are routed|access|trunk. Default value for mode is routed";
type stypes:switchport_mode;
default "routed";
}
leaf description { leaf description {
type string { type string {
length 0..255; length 0..255;

View File

@ -64,6 +64,13 @@ module sonic-portchannel {
} }
} }
leaf mode {
description "PortChannel SwitchPort Mode possible values are routed|access|trunk. Default value for mode is routed.";
type stypes:switchport_mode;
default "routed";
}
leaf description { leaf description {
type string { type string {
length 1..255; length 1..255;

View File

@ -209,6 +209,14 @@ module sonic-types {
} }
} }
typedef switchport_mode {
type string {
pattern "routed|access|trunk";
}
description
"SwitchPort Modes for Port & PortChannel";
}
typedef meter_type { typedef meter_type {
type enumeration { type enumeration {
enum packets; enum packets;