Switchport config-engine changes
This commit is contained in:
parent
ada3e18860
commit
b60bbbc6dd
@ -1953,11 +1953,18 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw
|
||||
for pc_mbr_del_key in pc_mbr_del_keys:
|
||||
del pc_members[pc_mbr_del_key]
|
||||
|
||||
# set default port channel MTU as 9100 and admin status up and default TPID 0x8100
|
||||
# set default port channel MTU as 9100 and admin status up and default TPID 0x8100 for mode is trunk when port has no vlan membership
|
||||
for pc in pcs.values():
|
||||
pc['mtu'] = '9100'
|
||||
pc['tpid'] = '0x8100'
|
||||
pc['admin_status'] = 'up'
|
||||
# mode check for vlan membership in portchannel
|
||||
for pc_name, pc in pcs.items():
|
||||
if 'mode' not in pc:
|
||||
if pc_name in [key[1] for key in vlan_members.keys()]:
|
||||
pc['mode'] = 'trunk'
|
||||
else:
|
||||
pc['mode'] = 'routed'
|
||||
|
||||
results['PORTCHANNEL'] = pcs
|
||||
results['PORTCHANNEL_MEMBER'] = pc_members
|
||||
|
@ -1,115 +1,152 @@
|
||||
{
|
||||
"interfaces": {
|
||||
"Ethernet0": {
|
||||
"default_brkout_mode": "1x100G[40G]"
|
||||
"default_brkout_mode": "1x100G[40G]",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet4": {
|
||||
"default_brkout_mode": "2x50G"
|
||||
"default_brkout_mode": "2x50G",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet8": {
|
||||
"default_brkout_mode": "4x25G[10G]"
|
||||
"default_brkout_mode": "4x25G[10G]",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet12": {
|
||||
"default_brkout_mode": "2x25G(2)+1x50G(2)"
|
||||
"default_brkout_mode": "2x25G(2)+1x50G(2)",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet16": {
|
||||
"default_brkout_mode": "1x50G(2)+2x25G(2)"
|
||||
"default_brkout_mode": "1x50G(2)+2x25G(2)",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet20": {
|
||||
"default_brkout_mode": "1x100G[40G]"
|
||||
"default_brkout_mode": "1x100G[40G]",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet24": {
|
||||
"default_brkout_mode": "2x50G"
|
||||
"default_brkout_mode": "2x50G",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet28": {
|
||||
"default_brkout_mode": "4x25G[10G]"
|
||||
"default_brkout_mode": "4x25G[10G]",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet32": {
|
||||
"default_brkout_mode": "2x25G(2)+1x50G(2)"
|
||||
"default_brkout_mode": "2x25G(2)+1x50G(2)",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet36": {
|
||||
"default_brkout_mode": "1x50G(2)+2x25G(2)"
|
||||
"default_brkout_mode": "1x50G(2)+2x25G(2)",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet40": {
|
||||
"default_brkout_mode": "1x100G[50G,40G,25G,10G,1G]"
|
||||
"default_brkout_mode": "1x100G[50G,40G,25G,10G,1G]",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet44": {
|
||||
"default_brkout_mode": "2x50G[40G,25G,10G,1G]"
|
||||
"default_brkout_mode": "2x50G[40G,25G,10G,1G]",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet48": {
|
||||
"default_brkout_mode": "4x25G[10G]"
|
||||
"default_brkout_mode": "4x25G[10G]",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet52": {
|
||||
"default_brkout_mode": "2x25G(2)+1x50G(2)"
|
||||
"default_brkout_mode": "2x25G(2)+1x50G(2)",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet56": {
|
||||
"default_brkout_mode": "1x50G(2)+2x25G(2)"
|
||||
"default_brkout_mode": "1x50G(2)+2x25G(2)",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet60": {
|
||||
"default_brkout_mode": "1x100G[40G]"
|
||||
"default_brkout_mode": "1x100G[40G]",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet64": {
|
||||
"default_brkout_mode": "2x50G"
|
||||
"default_brkout_mode": "2x50G",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet68": {
|
||||
"default_brkout_mode": "4x25G[10G]"
|
||||
"default_brkout_mode": "4x25G[10G]",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet72": {
|
||||
"default_brkout_mode": "2x25G(2)+1x50G(2)"
|
||||
"default_brkout_mode": "2x25G(2)+1x50G(2)",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet76": {
|
||||
"default_brkout_mode": "1x50G(2)+2x25G(2)"
|
||||
"default_brkout_mode": "1x50G(2)+2x25G(2)",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet80": {
|
||||
"default_brkout_mode": "1x100G[40G]"
|
||||
"default_brkout_mode": "1x100G[40G]",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet84": {
|
||||
"default_brkout_mode": "2x50G"
|
||||
"default_brkout_mode": "2x50G",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet88": {
|
||||
"default_brkout_mode": "4x25G[10G]"
|
||||
"default_brkout_mode": "4x25G[10G]",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet92": {
|
||||
"default_brkout_mode": "2x25G(2)+1x50G(2)"
|
||||
"default_brkout_mode": "2x25G(2)+1x50G(2)",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet96": {
|
||||
"default_brkout_mode": "1x50G(2)+2x25G(2)"
|
||||
"default_brkout_mode": "1x50G(2)+2x25G(2)",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet100": {
|
||||
"default_brkout_mode": "1x100G[40G]"
|
||||
"default_brkout_mode": "1x100G[40G]",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet104": {
|
||||
"default_brkout_mode": "2x50G"
|
||||
"default_brkout_mode": "2x50G",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet108": {
|
||||
"default_brkout_mode": "4x25G[10G]"
|
||||
"default_brkout_mode": "4x25G[10G]",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet112": {
|
||||
"default_brkout_mode": "2x25G(2)+1x50G(2)"
|
||||
"default_brkout_mode": "2x25G(2)+1x50G(2)",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet116": {
|
||||
"default_brkout_mode": "1x50G(2)+2x25G(2)"
|
||||
"default_brkout_mode": "1x50G(2)+2x25G(2)",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet120": {
|
||||
"default_brkout_mode": "1x100G[40G]"
|
||||
"default_brkout_mode": "1x100G[40G]",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet124": {
|
||||
"default_brkout_mode": "2x50G"
|
||||
"default_brkout_mode": "2x50G",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet128": {
|
||||
"default_brkout_mode": "1x40G[100G]"
|
||||
"default_brkout_mode": "1x40G[100G]",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet132": {
|
||||
"default_brkout_mode": "1x25G[100G,50G,40G,10G]"
|
||||
"default_brkout_mode": "1x25G[100G,50G,40G,10G]",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet136": {
|
||||
"default_brkout_mode": "4x10G[25G]"
|
||||
"default_brkout_mode": "4x10G[25G]",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet140": {
|
||||
"default_brkout_mode": "2x25G(2)+1x50000(2)"
|
||||
"default_brkout_mode": "2x25G(2)+1x50000(2)",
|
||||
"mode" : "routed"
|
||||
},
|
||||
"Ethernet144": {
|
||||
"default_brkout_mode": "1x100000[50G,40000,25G,10000]"
|
||||
"default_brkout_mode": "1x100000[50G,40000,25G,10000]",
|
||||
"mode" : "routed"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,6 +15,7 @@
|
||||
"Ethernet0": {
|
||||
"index": "1,1,1,1",
|
||||
"lanes": "0,1,2,3",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth1"],
|
||||
"2x50G": ["Eth1/1", "Eth1/2"],
|
||||
@ -26,6 +27,7 @@
|
||||
"Ethernet4": {
|
||||
"index": "2,2,2,2",
|
||||
"lanes": "4,5,6,7",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth2"],
|
||||
"2x50G": ["Eth2/1", "Eth2/2"],
|
||||
@ -35,6 +37,7 @@
|
||||
"Ethernet8": {
|
||||
"index": "3,3,3,3",
|
||||
"lanes": "8,9,10,11",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth3"],
|
||||
"2x50G": ["Eth3/1", "Eth3/2"],
|
||||
@ -46,6 +49,7 @@
|
||||
"Ethernet12": {
|
||||
"index": "4,4,4,4",
|
||||
"lanes": "12,13,14,15",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth4"],
|
||||
"2x50G": ["Eth4/1", "Eth4/2"],
|
||||
@ -57,6 +61,7 @@
|
||||
"Ethernet16": {
|
||||
"index": "5,5,5,5",
|
||||
"lanes": "16,17,18,19",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth5"],
|
||||
"2x50G": ["Eth5/1", "Eth5/2"],
|
||||
@ -68,6 +73,7 @@
|
||||
"Ethernet20": {
|
||||
"index": "6,6,6,6",
|
||||
"lanes": "20,21,22,23",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth6"],
|
||||
"2x50G": ["Eth6/1", "Eth6/2"],
|
||||
@ -79,6 +85,7 @@
|
||||
"Ethernet24": {
|
||||
"index": "7,7,7,7",
|
||||
"lanes": "24,25,26,27",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth7"],
|
||||
"2x50G": ["Eth7/1", "Eth7/2"],
|
||||
@ -90,6 +97,7 @@
|
||||
"Ethernet28": {
|
||||
"index": "8,8,8,8",
|
||||
"lanes": "28,29,30,31",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth8"],
|
||||
"2x50G": ["Eth8/1", "Eth8/2"],
|
||||
@ -101,6 +109,7 @@
|
||||
"Ethernet32": {
|
||||
"index": "9,9,9,9",
|
||||
"lanes": "32,33,34,35",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth9"],
|
||||
"2x50G": ["Eth9/1", "Eth9/2"],
|
||||
@ -112,6 +121,7 @@
|
||||
"Ethernet36": {
|
||||
"index": "10,10,10,10",
|
||||
"lanes": "36,37,38,39",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth10"],
|
||||
"2x50G": ["Eth10/1", "Eth10/2"],
|
||||
@ -123,6 +133,7 @@
|
||||
"Ethernet40": {
|
||||
"index": "11,11,11,11",
|
||||
"lanes": "40,41,42,43",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[50G,40G,25G,10G,1G]": ["Eth11"],
|
||||
"2x50G[40G,25G,10G,1G]": ["Eth11/1", "Eth11/2"],
|
||||
@ -134,6 +145,7 @@
|
||||
"Ethernet44": {
|
||||
"index": "12,12,12,12",
|
||||
"lanes": "44,45,46,47",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[50G,40G,25G,10G,1G]": ["Eth12"],
|
||||
"2x50G[40G,25G,10G,1G]": ["Eth12/1", "Eth12/2"],
|
||||
@ -145,6 +157,7 @@
|
||||
"Ethernet48": {
|
||||
"index": "13,13,13,13",
|
||||
"lanes": "48,49,50,51",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth13"],
|
||||
"2x50G": ["Eth13/1", "Eth13/2"],
|
||||
@ -156,6 +169,7 @@
|
||||
"Ethernet52": {
|
||||
"index": "14,14,14,14",
|
||||
"lanes": "52,53,54,55",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth14"],
|
||||
"2x50G": ["Eth14/1", "Eth14/2"],
|
||||
@ -167,6 +181,7 @@
|
||||
"Ethernet56": {
|
||||
"index": "15,15,15,15",
|
||||
"lanes": "56,57,58,59",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth15"],
|
||||
"2x50G": ["Eth15/1", "Eth15/2"],
|
||||
@ -178,6 +193,7 @@
|
||||
"Ethernet60": {
|
||||
"index": "16,16,16,16",
|
||||
"lanes": "60,61,62,63",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth16"],
|
||||
"2x50G": ["Eth16/1", "Eth16/2"],
|
||||
@ -189,6 +205,7 @@
|
||||
"Ethernet64": {
|
||||
"index": "17,17,17,17",
|
||||
"lanes": "64,65,66,67",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth17"],
|
||||
"2x50G": ["Eth17/1", "Eth17/2"],
|
||||
@ -200,6 +217,7 @@
|
||||
"Ethernet68": {
|
||||
"index": "18,18,18,18",
|
||||
"lanes": "68,69,70,71",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth18"],
|
||||
"2x50G": ["Eth18/1", "Eth18/2"],
|
||||
@ -211,6 +229,7 @@
|
||||
"Ethernet72": {
|
||||
"index": "19,19,19,19",
|
||||
"lanes": "72,73,74,75",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth19"],
|
||||
"2x50G": ["Eth19/1", "Eth19/2"],
|
||||
@ -222,6 +241,7 @@
|
||||
"Ethernet76": {
|
||||
"index": "20,20,20,20",
|
||||
"lanes": "76,77,78,79",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth20"],
|
||||
"2x50G": ["Eth20/1", "Eth20/2"],
|
||||
@ -233,6 +253,7 @@
|
||||
"Ethernet80": {
|
||||
"index": "21,21,21,21",
|
||||
"lanes": "80,81,82,83",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth21"],
|
||||
"2x50G": ["Eth21/1", "Eth21/2"],
|
||||
@ -244,6 +265,7 @@
|
||||
"Ethernet84": {
|
||||
"index": "22,22,22,22",
|
||||
"lanes": "84,85,86,87",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth22"],
|
||||
"2x50G": ["Eth22/1", "Eth22/2"],
|
||||
@ -255,6 +277,7 @@
|
||||
"Ethernet88": {
|
||||
"index": "23,23,23,23",
|
||||
"lanes": "88,89,90,91",
|
||||
"mode" : "routed",
|
||||
"alias_at_lanes": "Eth23/1, Eth23/2, Eth23/3, Eth23/4",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth23"],
|
||||
@ -267,6 +290,7 @@
|
||||
"Ethernet92": {
|
||||
"index": "24,24,24,24",
|
||||
"lanes": "92,93,94,95",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth24"],
|
||||
"2x50G": ["Eth24/1", "Eth24/2"],
|
||||
@ -278,6 +302,7 @@
|
||||
"Ethernet96": {
|
||||
"index": "25,25,25,25",
|
||||
"lanes": "96,97,98,99",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth25"],
|
||||
"2x50G": ["Eth25/1", "Eth25/2"],
|
||||
@ -289,6 +314,7 @@
|
||||
"Ethernet100": {
|
||||
"index": "26,26,26,26",
|
||||
"lanes": "100,101,102,103",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth26"],
|
||||
"2x50G": ["Eth26/1", "Eth26/2"],
|
||||
@ -300,6 +326,7 @@
|
||||
"Ethernet104": {
|
||||
"index": "27,27,27,27",
|
||||
"lanes": "104,105,106,107",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth27"],
|
||||
"2x50G": ["Eth27/1", "Eth27/2"],
|
||||
@ -311,6 +338,7 @@
|
||||
"Ethernet108": {
|
||||
"index": "28,28,28,28",
|
||||
"lanes": "108,109,110,111",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth28"],
|
||||
"2x50G": ["Eth28/1", "Eth28/2"],
|
||||
@ -322,6 +350,7 @@
|
||||
"Ethernet112": {
|
||||
"index": "29,29,29,29",
|
||||
"lanes": "112,113,114,115",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth29"],
|
||||
"2x50G": ["Eth29/1", "Eth29/2"],
|
||||
@ -333,6 +362,7 @@
|
||||
"Ethernet116": {
|
||||
"index": "30,30,30,30",
|
||||
"lanes": "116,117,118,119",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth30"],
|
||||
"2x50G": ["Eth30/1", "Eth30/2"],
|
||||
@ -344,6 +374,7 @@
|
||||
"Ethernet120": {
|
||||
"index": "31,31,31,31",
|
||||
"lanes": "120,121,122,123",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth31"],
|
||||
"2x50G": ["Eth31/1", "Eth31/2"],
|
||||
@ -355,6 +386,7 @@
|
||||
"Ethernet124": {
|
||||
"index": "32,32,32,32",
|
||||
"lanes": "124,125,126,127",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth32"],
|
||||
"2x50G": ["Eth32/1", "Eth32/2"],
|
||||
@ -366,6 +398,7 @@
|
||||
"Ethernet128": {
|
||||
"index": "33,33,33,33",
|
||||
"lanes": "128,129,130,131",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[40G]": ["Eth33"],
|
||||
"2x50G": ["Eth33/1", "Eth33/2"],
|
||||
@ -377,6 +410,7 @@
|
||||
"Ethernet132": {
|
||||
"index": "34,34,34,34",
|
||||
"lanes": "132,133,134,135",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[50G,40G,25G,10G]": ["Eth34"],
|
||||
"2x50G": ["Eth34/1", "Eth34/2"],
|
||||
@ -388,6 +422,7 @@
|
||||
"Ethernet136": {
|
||||
"index": "35,35,35,35",
|
||||
"lanes": "136,137,138,139",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[50G,40G,25G,10G]": ["Eth35"],
|
||||
"2x50G": ["Eth35/1", "Eth35/2"],
|
||||
@ -399,6 +434,7 @@
|
||||
"Ethernet140": {
|
||||
"index": "36,36,36,36",
|
||||
"lanes": "140,141,142,143",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100000[50G,40000,25000,10G]": ["Eth36"],
|
||||
"2x50G": ["Eth36/1", "Eth36/2"],
|
||||
@ -410,6 +446,7 @@
|
||||
"Ethernet144": {
|
||||
"index": "37,37,37,37",
|
||||
"lanes": "144,145,146,147",
|
||||
"mode" : "routed",
|
||||
"breakout_modes": {
|
||||
"1x100G[50G,40G,25G,10G]": ["Eth37"],
|
||||
"2x50G": ["Eth37/1", "Eth37/2"],
|
||||
|
File diff suppressed because one or more lines are too long
@ -79,19 +79,19 @@ class TestCfgGenPlatformJson(TestCase):
|
||||
argument = ['-m', self.platform_sample_graph, '-p', self.platform_json, '-S', self.hwsku_json, '-v', "PORT[\'Ethernet8\']"]
|
||||
output = self.run_script(argument)
|
||||
self.maxDiff = None
|
||||
expected = "{'index': '3', 'lanes': '8', 'description': 'Eth3/1', 'mtu': '9100', 'alias': 'Eth3/1', 'pfc_asym': 'off', 'speed': '25000', 'tpid': '0x8100'}"
|
||||
expected = "{'index': '3', 'lanes': '8', 'description': 'Eth3/1', 'mtu': '9100', 'alias': 'Eth3/1', 'pfc_asym': 'off', 'speed': '25000', 'tpid': '0x8100','mode': 'routed'}"
|
||||
self.assertEqual(utils.to_dict(output.strip()), utils.to_dict(expected))
|
||||
|
||||
argument = ['-m', self.platform_sample_graph, '-p', self.platform_json, '-S', self.hwsku_json, '-v', "PORT[\'Ethernet112\']"]
|
||||
output = self.run_script(argument)
|
||||
self.maxDiff = None
|
||||
expected = "{'index': '29', 'lanes': '112', 'description': 'Eth29/1', 'mtu': '9100', 'alias': 'Eth29/1', 'pfc_asym': 'off', 'speed': '25000', 'tpid': '0x8100'}"
|
||||
expected = "{'index': '29', 'lanes': '112', 'description': 'Eth29/1', 'mtu': '9100', 'alias': 'Eth29/1', 'pfc_asym': 'off', 'speed': '25000', 'tpid': '0x8100','mode': 'routed'}"
|
||||
self.assertEqual(utils.to_dict(output.strip()), utils.to_dict(expected))
|
||||
|
||||
argument = ['-m', self.platform_sample_graph, '-p', self.platform_json, '-S', self.hwsku_json, '-v', "PORT[\'Ethernet4\']"]
|
||||
output = self.run_script(argument)
|
||||
self.maxDiff = None
|
||||
expected = "{'index': '2', 'lanes': '4,5', 'description': 'Eth2/1', 'admin_status': 'up', 'mtu': '9100', 'alias': 'Eth2/1', 'pfc_asym': 'off', 'speed': '50000', 'tpid': '0x8100'}"
|
||||
expected = "{'index': '2', 'lanes': '4,5', 'description': 'Eth2/1', 'admin_status': 'up', 'mtu': '9100', 'alias': 'Eth2/1', 'pfc_asym': 'off', 'speed': '50000', 'tpid': '0x8100','mode': 'routed'}"
|
||||
print(output.strip())
|
||||
self.assertEqual(utils.to_dict(output.strip()), utils.to_dict(expected))
|
||||
|
||||
|
@ -164,7 +164,7 @@ class TestCfgGenCaseInsensitive(TestCase):
|
||||
output = self.run_script(argument)
|
||||
self.assertEqual(
|
||||
utils.to_dict(output.strip()),
|
||||
utils.to_dict("{'PortChannel01': {'admin_status': 'up', 'min_links': '1', 'mtu': '9100', 'tpid': '0x8100', 'lacp_key': 'auto'}}")
|
||||
utils.to_dict("{'PortChannel01': {'admin_status': 'up', 'min_links': '1', 'mtu': '9100', 'tpid': '0x8100', 'lacp_key': 'auto','mode': 'routed'}}")
|
||||
)
|
||||
|
||||
def test_minigraph_console_mgmt_feature(self):
|
||||
|
@ -163,16 +163,16 @@ class TestMultiNpuCfgGen(TestCase):
|
||||
argument = ["-m", self.sample_graph, "-p", self.port_config[0], "-n", "asic0", "--var-json", "PORTCHANNEL"]
|
||||
output = json.loads(self.run_script(argument))
|
||||
self.assertDictEqual(output, \
|
||||
{'PortChannel0002': {'admin_status': 'up', 'min_links': '2', 'mtu': '9100', 'tpid': '0x8100', 'lacp_key': 'auto'},
|
||||
'PortChannel4001': {'admin_status': 'up', 'min_links': '2', 'mtu': '9100', 'tpid': '0x8100', 'lacp_key': 'auto'},
|
||||
'PortChannel4002': {'admin_status': 'up', 'min_links': '2', 'mtu': '9100', 'tpid': '0x8100', 'lacp_key': 'auto'}})
|
||||
{'PortChannel0002': {'admin_status': 'up', 'min_links': '2', 'mtu': '9100', 'tpid': '0x8100', 'mode': 'routed', 'lacp_key': 'auto' },
|
||||
'PortChannel4001': {'admin_status': 'up', 'min_links': '2', 'mtu': '9100', 'tpid': '0x8100', 'mode': 'routed', 'lacp_key': 'auto'},
|
||||
'PortChannel4002': {'admin_status': 'up', 'min_links': '2', 'mtu': '9100', 'tpid': '0x8100', 'mode': 'routed', 'lacp_key': 'auto'}})
|
||||
|
||||
def test_backend_asic_portchannels(self):
|
||||
argument = ["-m", self.sample_graph, "-p", self.port_config[3], "-n", "asic3", "--var-json", "PORTCHANNEL"]
|
||||
output = json.loads(self.run_script(argument))
|
||||
self.assertDictEqual(output, \
|
||||
{'PortChannel4013': {'admin_status': 'up', 'min_links': '2', 'mtu': '9100', 'tpid': '0x8100', 'lacp_key': 'auto'},
|
||||
'PortChannel4014': {'admin_status': 'up', 'min_links': '2', 'mtu': '9100', 'tpid': '0x8100', 'lacp_key': 'auto'}})
|
||||
{'PortChannel4013': {'admin_status': 'up', 'min_links': '2', 'mtu': '9100', 'tpid': '0x8100', 'mode': 'routed' , 'lacp_key': 'auto'},
|
||||
'PortChannel4014': {'admin_status': 'up', 'min_links': '2', 'mtu': '9100', 'tpid': '0x8100', 'mode': 'routed' , 'lacp_key': 'auto'}})
|
||||
|
||||
def test_frontend_asic_portchannel_mem(self):
|
||||
argument = ["-m", self.sample_graph, "-p", self.port_config[0], "-n", "asic0", "-v", "PORTCHANNEL_MEMBER.keys()|list"]
|
||||
@ -187,6 +187,7 @@ class TestMultiNpuCfgGen(TestCase):
|
||||
output = self.run_script(argument)
|
||||
self.assertEqual(
|
||||
utils.liststr_to_dict(output.strip()),
|
||||
|
||||
utils.liststr_to_dict("['PortChannel4013|Ethernet-BP384', 'PortChannel4014|Ethernet-BP392', 'PortChannel4014|Ethernet-BP396', 'PortChannel4013|Ethernet-BP388']")
|
||||
)
|
||||
|
||||
@ -218,27 +219,27 @@ class TestMultiNpuCfgGen(TestCase):
|
||||
argument = ["-m", self.sample_graph, "-p", self.port_config[0], "-n", "asic0", "--var-json", "PORT"]
|
||||
output = json.loads(self.run_script(argument))
|
||||
self.assertDictEqual(output,
|
||||
{"Ethernet0": { "admin_status": "up", "alias": "Ethernet1/1", "asic_port_name": "Eth0-ASIC0", "description": "01T2:Ethernet1", "index": "0", "lanes": "33,34,35,36", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Ext", "speed": "40000", "autoneg": "on" },
|
||||
"Ethernet4": { "admin_status": "up", "alias": "Ethernet1/2", "asic_port_name": "Eth1-ASIC0", "description": "01T2:Ethernet2", "index": "1", "lanes": "29,30,31,32", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Ext", "speed": "40000", "autoneg": "on" },
|
||||
"Ethernet8": { "alias": "Ethernet1/3", "asic_port_name": "Eth2-ASIC0", "description": "Ethernet1/3", "index": "2", "lanes": "41,42,43,44", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Ext", "speed": "40000" },
|
||||
"Ethernet12": { "alias": "Ethernet1/4", "asic_port_name": "Eth3-ASIC0", "description": "Ethernet1/4", "index": "3", "lanes": "37,38,39,40", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Ext", "speed": "40000" },
|
||||
"Ethernet-BP0": { "admin_status": "up", "alias": "Eth4-ASIC0", "asic_port_name": "Eth4-ASIC0", "description": "ASIC2:Eth0-ASIC2", "index": "0", "lanes": "13,14,15,16", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Int", "speed": "40000" },
|
||||
"Ethernet-BP4": { "admin_status": "up", "alias": "Eth5-ASIC0", "asic_port_name": "Eth5-ASIC0", "description": "ASIC2:Eth1-ASIC2", "index": "1", "lanes": "17,18,19,20", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Int", "speed": "40000" },
|
||||
"Ethernet-BP8": { "admin_status": "up", "alias": "Eth6-ASIC0", "asic_port_name": "Eth6-ASIC0", "description": "ASIC3:Eth0-ASIC3", "index": "2", "lanes": "21,22,23,24", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Int", "speed": "40000" },
|
||||
"Ethernet-BP12": { "admin_status": "up", "alias": "Eth7-ASIC0", "asic_port_name": "Eth7-ASIC0", "description": "ASIC3:Eth1-ASIC3", "index": "3", "lanes": "25,26,27,28", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Int", "speed": "40000" }})
|
||||
{"Ethernet0": { "admin_status": "up", "alias": "Ethernet1/1", "asic_port_name": "Eth0-ASIC0", "description": "01T2:Ethernet1", "index": "0", "lanes": "33,34,35,36", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Ext", "speed": "40000", "autoneg": "on", "mode": "routed"},
|
||||
"Ethernet4": { "admin_status": "up", "alias": "Ethernet1/2", "asic_port_name": "Eth1-ASIC0", "description": "01T2:Ethernet2", "index": "1", "lanes": "29,30,31,32", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Ext", "speed": "40000", "autoneg": "on" , "mode": "routed"},
|
||||
"Ethernet8": { "alias": "Ethernet1/3", "asic_port_name": "Eth2-ASIC0", "description": "Ethernet1/3", "index": "2", "lanes": "41,42,43,44", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Ext", "speed": "40000", "mode": "routed"},
|
||||
"Ethernet12": { "alias": "Ethernet1/4", "asic_port_name": "Eth3-ASIC0", "description": "Ethernet1/4", "index": "3", "lanes": "37,38,39,40", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Ext", "speed": "40000", "mode": "routed"},
|
||||
"Ethernet-BP0": { "admin_status": "up", "alias": "Eth4-ASIC0", "asic_port_name": "Eth4-ASIC0", "description": "ASIC2:Eth0-ASIC2", "index": "0", "lanes": "13,14,15,16", "mtu": "9100", "tpid": "0x8100","pfc_asym": "off", "role": "Int", "speed": "40000", "mode": "routed"},
|
||||
"Ethernet-BP4": { "admin_status": "up", "alias": "Eth5-ASIC0", "asic_port_name": "Eth5-ASIC0", "description": "ASIC2:Eth1-ASIC2", "index": "1", "lanes": "17,18,19,20", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Int", "speed": "40000", "mode": "routed"},
|
||||
"Ethernet-BP8": { "admin_status": "up", "alias": "Eth6-ASIC0", "asic_port_name": "Eth6-ASIC0", "description": "ASIC3:Eth0-ASIC3", "index": "2", "lanes": "21,22,23,24", "mtu": "9100", "tpid": "0x8100","pfc_asym": "off", "role": "Int", "speed": "40000" , "mode": "routed"},
|
||||
"Ethernet-BP12": { "admin_status": "up", "alias": "Eth7-ASIC0", "asic_port_name": "Eth7-ASIC0", "description": "ASIC3:Eth1-ASIC3", "index": "3", "lanes": "25,26,27,28", "mtu": "9100", "tpid": "0x8100","pfc_asym": "off", "role": "Int", "speed": "40000" , "mode": "routed"}})
|
||||
|
||||
def test_frontend_asic_ports_config_db(self):
|
||||
argument = ["-m", self.sample_graph, "-p", self.port_config[0], "-n", "asic0", "--var-json", "PORT"]
|
||||
output = json.loads(self.run_script(argument))
|
||||
self.assertDictEqual(output,
|
||||
{"Ethernet0": { "admin_status": "up", "alias": "Ethernet1/1", "asic_port_name": "Eth0-ASIC0", "description": "01T2:Ethernet1", "index": "0", "lanes": "33,34,35,36", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Ext", "speed": "40000", "autoneg": "on" },
|
||||
"Ethernet4": { "admin_status": "up", "alias": "Ethernet1/2", "asic_port_name": "Eth1-ASIC0", "description": "01T2:Ethernet2", "index": "1", "lanes": "29,30,31,32", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Ext", "speed": "40000", "autoneg": "on" },
|
||||
"Ethernet8": { "alias": "Ethernet1/3", "asic_port_name": "Eth2-ASIC0", "description": "Ethernet1/3", "index": "2", "lanes": "41,42,43,44", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Ext", "speed": "40000" },
|
||||
"Ethernet12": { "alias": "Ethernet1/4", "asic_port_name": "Eth3-ASIC0", "description": "Ethernet1/4", "index": "3", "lanes": "37,38,39,40", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Ext", "speed": "40000" },
|
||||
"Ethernet-BP0": { "admin_status": "up", "alias": "Eth4-ASIC0", "asic_port_name": "Eth4-ASIC0", "description": "ASIC2:Eth0-ASIC2", "index": "0", "lanes": "13,14,15,16", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Int", "speed": "40000" },
|
||||
"Ethernet-BP4": { "admin_status": "up", "alias": "Eth5-ASIC0", "asic_port_name": "Eth5-ASIC0", "description": "ASIC2:Eth1-ASIC2", "index": "1", "lanes": "17,18,19,20", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Int", "speed": "40000" },
|
||||
"Ethernet-BP8": { "admin_status": "up", "alias": "Eth6-ASIC0", "asic_port_name": "Eth6-ASIC0", "description": "ASIC3:Eth0-ASIC3", "index": "2", "lanes": "21,22,23,24", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Int", "speed": "40000" },
|
||||
"Ethernet-BP12": { "admin_status": "up", "alias": "Eth7-ASIC0", "asic_port_name": "Eth7-ASIC0", "description": "ASIC3:Eth1-ASIC3", "index": "3", "lanes": "25,26,27,28", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Int", "speed": "40000" }})
|
||||
{"Ethernet0": { "admin_status": "up", "alias": "Ethernet1/1", "asic_port_name": "Eth0-ASIC0", "description": "01T2:Ethernet1", "index": "0", "lanes": "33,34,35,36", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Ext", "speed": "40000", "autoneg": "on", "mode": "routed"},
|
||||
"Ethernet4": { "admin_status": "up", "alias": "Ethernet1/2", "asic_port_name": "Eth1-ASIC0", "description": "01T2:Ethernet2", "index": "1", "lanes": "29,30,31,32", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Ext", "speed": "40000", "autoneg": "on" , "mode": "routed"},
|
||||
"Ethernet8": { "alias": "Ethernet1/3", "asic_port_name": "Eth2-ASIC0", "description": "Ethernet1/3", "index": "2", "lanes": "41,42,43,44", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Ext", "speed": "40000" , "mode": "routed"},
|
||||
"Ethernet12": { "alias": "Ethernet1/4", "asic_port_name": "Eth3-ASIC0", "description": "Ethernet1/4", "index": "3", "lanes": "37,38,39,40", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Ext", "speed": "40000" , "mode": "routed"},
|
||||
"Ethernet-BP0": { "admin_status": "up", "alias": "Eth4-ASIC0", "asic_port_name": "Eth4-ASIC0", "description": "ASIC2:Eth0-ASIC2", "index": "0", "lanes": "13,14,15,16", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Int", "speed": "40000", "mode": "routed"},
|
||||
"Ethernet-BP4": { "admin_status": "up", "alias": "Eth5-ASIC0", "asic_port_name": "Eth5-ASIC0", "description": "ASIC2:Eth1-ASIC2", "index": "1", "lanes": "17,18,19,20", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Int", "speed": "40000", "mode": "routed" },
|
||||
"Ethernet-BP8": { "admin_status": "up", "alias": "Eth6-ASIC0", "asic_port_name": "Eth6-ASIC0", "description": "ASIC3:Eth0-ASIC3", "index": "2", "lanes": "21,22,23,24", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Int", "speed": "40000" , "mode": "routed"},
|
||||
"Ethernet-BP12": { "admin_status": "up", "alias": "Eth7-ASIC0", "asic_port_name": "Eth7-ASIC0", "description": "ASIC3:Eth1-ASIC3", "index": "3", "lanes": "25,26,27,28", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Int", "speed": "40000", "mode": "routed"}})
|
||||
|
||||
def test_frontend_asic_device_neigh(self):
|
||||
argument = ["-m", self.sample_graph, "-p", self.port_config[0], "-n", "asic0", "--var-json", "DEVICE_NEIGHBOR"]
|
||||
|
Reference in New Issue
Block a user