This commit is contained in:
Rida Hanif 2024-03-25 13:55:33 -07:00 committed by GitHub
commit ce0f661498
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 1369 additions and 1131 deletions

View File

@ -1906,6 +1906,13 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw
for port in ports.values():
port['mtu'] = '9100'
port['tpid'] = '0x8100'
# mode check for vlan membership in PORT table default mode is routed and for vlan membership it is trunk
for port_name, port in ports.items():
if 'mode' not in port:
if port_name in [key[1] for key in vlan_members.keys()]:
port['mode'] = 'trunk'
else:
port['mode'] = 'routed'
# asymmetric PFC is disabled by default
for port in ports.values():
@ -1977,6 +1984,13 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw
pc['mtu'] = '9100'
pc['tpid'] = '0x8100'
pc['admin_status'] = 'up'
# mode check for vlan membership in portchannel and default mode is routed and mode is trunk when port channel has vlan membership
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

View File

@ -1,16 +1,19 @@
{
"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"
},
"Ethernet6": {
"default_brkout_mode": "2x50G"
},
"Ethernet8": {
"default_brkout_mode": "4x25G[10G]"
"default_brkout_mode": "4x25G[10G]",
"mode" : "routed"
},
"Ethernet9": {
"default_brkout_mode": "4x25G[10G]"
@ -22,7 +25,8 @@
"default_brkout_mode": "4x25G[10G]"
},
"Ethernet12": {
"default_brkout_mode": "2x25G(2)+1x50G(2)"
"default_brkout_mode": "2x25G(2)+1x50G(2)",
"mode" : "routed"
},
"Ethernet13": {
"default_brkout_mode": "2x25G(2)+1x50G(2)"
@ -31,7 +35,8 @@
"default_brkout_mode": "2x25G(2)+1x50G(2)"
},
"Ethernet16": {
"default_brkout_mode": "1x50G(2)+2x25G(2)"
"default_brkout_mode": "1x50G(2)+2x25G(2)",
"mode" : "routed"
},
"Ethernet18": {
"default_brkout_mode": "1x50G(2)+2x25G(2)"
@ -40,16 +45,19 @@
"default_brkout_mode": "1x50G(2)+2x25G(2)"
},
"Ethernet20": {
"default_brkout_mode": "1x100G[40G]"
"default_brkout_mode": "1x100G[40G]",
"mode" : "routed"
},
"Ethernet24": {
"default_brkout_mode": "2x50G"
"default_brkout_mode": "2x50G",
"mode" : "routed"
},
"Ethernet26": {
"default_brkout_mode": "2x50G"
},
"Ethernet28": {
"default_brkout_mode": "4x25G[10G]"
"default_brkout_mode": "4x25G[10G]",
"mode" : "routed"
},
"Ethernet29": {
"default_brkout_mode": "4x25G[10G]"
@ -61,7 +69,8 @@
"default_brkout_mode": "4x25G[10G]"
},
"Ethernet32": {
"default_brkout_mode": "2x25G(2)+1x50G(2)"
"default_brkout_mode": "2x25G(2)+1x50G(2)",
"mode" : "routed"
},
"Ethernet33": {
"default_brkout_mode": "2x25G(2)+1x50G(2)"
@ -70,7 +79,8 @@
"default_brkout_mode": "2x25G(2)+1x50G(2)"
},
"Ethernet36": {
"default_brkout_mode": "1x50G(2)+2x25G(2)"
"default_brkout_mode": "1x50G(2)+2x25G(2)",
"mode" : "routed"
},
"Ethernet38": {
"default_brkout_mode": "1x50G(2)+2x25G(2)"
@ -79,16 +89,19 @@
"default_brkout_mode": "1x50G(2)+2x25G(2)"
},
"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"
},
"Ethernet46": {
"default_brkout_mode": "2x50G[40G,25G,10G,1G]"
},
"Ethernet48": {
"default_brkout_mode": "4x25G[10G]"
"default_brkout_mode": "4x25G[10G]",
"mode" : "routed"
},
"Ethernet49": {
"default_brkout_mode": "4x25G[10G]"
@ -100,7 +113,8 @@
"default_brkout_mode": "4x25G[10G]"
},
"Ethernet52": {
"default_brkout_mode": "2x25G(2)+1x50G(2)"
"default_brkout_mode": "2x25G(2)+1x50G(2)",
"mode" : "routed"
},
"Ethernet53": {
"default_brkout_mode": "2x25G(2)+1x50G(2)"
@ -109,7 +123,8 @@
"default_brkout_mode": "2x25G(2)+1x50G(2)"
},
"Ethernet56": {
"default_brkout_mode": "1x50G(2)+2x25G(2)"
"default_brkout_mode": "1x50G(2)+2x25G(2)",
"mode" : "routed"
},
"Ethernet58": {
"default_brkout_mode": "1x50G(2)+2x25G(2)"
@ -118,16 +133,19 @@
"default_brkout_mode": "1x50G(2)+2x25G(2)"
},
"Ethernet60": {
"default_brkout_mode": "1x100G[40G]"
"default_brkout_mode": "1x100G[40G]",
"mode" : "routed"
},
"Ethernet64": {
"default_brkout_mode": "2x50G"
"default_brkout_mode": "2x50G",
"mode" : "routed"
},
"Ethernet66": {
"default_brkout_mode": "2x50G"
},
"Ethernet68": {
"default_brkout_mode": "4x25G[10G]"
"default_brkout_mode": "4x25G[10G]",
"mode" : "routed"
},
"Ethernet69": {
"default_brkout_mode": "4x25G[10G]"
@ -139,7 +157,8 @@
"default_brkout_mode": "4x25G[10G]"
},
"Ethernet72": {
"default_brkout_mode": "2x25G(2)+1x50G(2)"
"default_brkout_mode": "2x25G(2)+1x50G(2)",
"mode" : "routed"
},
"Ethernet73": {
"default_brkout_mode": "2x25G(2)+1x50G(2)"
@ -148,7 +167,8 @@
"default_brkout_mode": "2x25G(2)+1x50G(2)"
},
"Ethernet76": {
"default_brkout_mode": "1x50G(2)+2x25G(2)"
"default_brkout_mode": "1x50G(2)+2x25G(2)",
"mode" : "routed"
},
"Ethernet78": {
"default_brkout_mode": "1x50G(2)+2x25G(2)"
@ -157,16 +177,19 @@
"default_brkout_mode": "1x50G(2)+2x25G(2)"
},
"Ethernet80": {
"default_brkout_mode": "1x100G[40G]"
"default_brkout_mode": "1x100G[40G]",
"mode" : "routed"
},
"Ethernet84": {
"default_brkout_mode": "2x50G"
"default_brkout_mode": "2x50G",
"mode" : "routed"
},
"Ethernet86": {
"default_brkout_mode": "2x50G"
},
"Ethernet88": {
"default_brkout_mode": "4x25G[10G]"
"default_brkout_mode": "4x25G[10G]",
"mode" : "routed"
},
"Ethernet89": {
"default_brkout_mode": "4x25G[10G]"
@ -178,7 +201,8 @@
"default_brkout_mode": "4x25G[10G]"
},
"Ethernet92": {
"default_brkout_mode": "2x25G(2)+1x50G(2)"
"default_brkout_mode": "2x25G(2)+1x50G(2)",
"mode" : "routed"
},
"Ethernet93": {
"default_brkout_mode": "2x25G(2)+1x50G(2)"
@ -187,7 +211,8 @@
"default_brkout_mode": "2x25G(2)+1x50G(2)"
},
"Ethernet96": {
"default_brkout_mode": "1x50G(2)+2x25G(2)"
"default_brkout_mode": "1x50G(2)+2x25G(2)",
"mode" : "routed"
},
"Ethernet98": {
"default_brkout_mode": "1x50G(2)+2x25G(2)"
@ -196,16 +221,19 @@
"default_brkout_mode": "1x50G(2)+2x25G(2)"
},
"Ethernet100": {
"default_brkout_mode": "1x100G[40G]"
"default_brkout_mode": "1x100G[40G]",
"mode" : "routed"
},
"Ethernet104": {
"default_brkout_mode": "2x50G"
"default_brkout_mode": "2x50G",
"mode" : "routed"
},
"Ethernet106": {
"default_brkout_mode": "2x50G"
},
"Ethernet108": {
"default_brkout_mode": "4x25G[10G]"
"default_brkout_mode": "4x25G[10G]",
"mode" : "routed"
},
"Ethernet109": {
"default_brkout_mode": "4x25G[10G]"
@ -217,7 +245,8 @@
"default_brkout_mode": "4x25G[10G]"
},
"Ethernet112": {
"default_brkout_mode": "2x25G(2)+1x50G(2)"
"default_brkout_mode": "2x25G(2)+1x50G(2)",
"mode" : "routed"
},
"Ethernet113": {
"default_brkout_mode": "2x25G(2)+1x50G(2)"
@ -226,7 +255,8 @@
"default_brkout_mode": "2x25G(2)+1x50G(2)"
},
"Ethernet116": {
"default_brkout_mode": "1x50G(2)+2x25G(2)"
"default_brkout_mode": "1x50G(2)+2x25G(2)",
"mode" : "routed"
},
"Ethernet118": {
"default_brkout_mode": "1x50G(2)+2x25G(2)"
@ -235,22 +265,27 @@
"default_brkout_mode": "1x50G(2)+2x25G(2)"
},
"Ethernet120": {
"default_brkout_mode": "1x100G[40G]"
"default_brkout_mode": "1x100G[40G]",
"mode" : "routed"
},
"Ethernet124": {
"default_brkout_mode": "2x50G"
"default_brkout_mode": "2x50G",
"mode" : "routed"
},
"Ethernet126": {
"default_brkout_mode": "2x50G"
},
"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"
},
"Ethernet137": {
"default_brkout_mode": "4x10G[25G]"
@ -262,7 +297,8 @@
"default_brkout_mode": "4x10G[25G]"
},
"Ethernet140": {
"default_brkout_mode": "2x25G(2)+1x50000(2)"
"default_brkout_mode": "2x25G(2)+1x50000(2)",
"mode" : "routed"
},
"Ethernet141": {
"default_brkout_mode": "2x25G(2)+1x50000(2)"
@ -271,7 +307,8 @@
"default_brkout_mode": "2x25G(2)+1x50000(2)"
},
"Ethernet144": {
"default_brkout_mode": "1x100000[50G,40000,25G,10000]"
"default_brkout_mode": "1x100000[50G,40000,25G,10000]",
"mode" : "routed"
}
}
}

View File

@ -4,162 +4,194 @@
"Ethernet8": {
"alias": "fortyGigE0/8",
"lanes": "37,38,39,40",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet0": {
"alias": "fortyGigE0/0",
"lanes": "29,30,31,32",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet4": {
"alias": "fortyGigE0/4",
"lanes": "25,26,27,28",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet108": {
"alias": "fortyGigE0/108",
"lanes": "81,82,83,84",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet100": {
"alias": "fortyGigE0/100",
"lanes": "125,126,127,128",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet104": {
"alias": "fortyGigE0/104",
"lanes": "85,86,87,88",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet68": {
"alias": "fortyGigE0/68",
"lanes": "69,70,71,72",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet96": {
"alias": "fortyGigE0/96",
"lanes": "121,122,123,124",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet124": {
"alias": "fortyGigE0/124",
"lanes": "101,102,103,104",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet92": {
"alias": "fortyGigE0/92",
"lanes": "113,114,115,116",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet120": {
"alias": "fortyGigE0/120",
"lanes": "97,98,99,100",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet52": {
"alias": "fortyGigE0/52",
"lanes": "53,54,55,56",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet56": {
"alias": "fortyGigE0/56",
"lanes": "61,62,63,64",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet76": {
"alias": "fortyGigE0/76",
"lanes": "73,74,75,76",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet72": {
"alias": "fortyGigE0/72",
"lanes": "77,78,79,80",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet64": {
"alias": "fortyGigE0/64",
"lanes": "65,66,67,68",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet32": {
"alias": "fortyGigE0/32",
"lanes": "9,10,11,12",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet16": {
"alias": "fortyGigE0/16",
"lanes": "41,42,43,44",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet36": {
"alias": "fortyGigE0/36",
"lanes": "13,14,15,16",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet12": {
"alias": "fortyGigE0/12",
"lanes": "33,34,35,36",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet88": {
"alias": "fortyGigE0/88",
"lanes": "117,118,119,120",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet116": {
"alias": "fortyGigE0/116",
"lanes": "93,94,95,96",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet80": {
"alias": "fortyGigE0/80",
"lanes": "105,106,107,108",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet112": {
"alias": "fortyGigE0/112",
"lanes": "89,90,91,92",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet84": {
"alias": "fortyGigE0/84",
"lanes": "109,110,111,112",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet48": {
"alias": "fortyGigE0/48",
"lanes": "49,50,51,52",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet44": {
"alias": "fortyGigE0/44",
"lanes": "17,18,19,20",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet40": {
"alias": "fortyGigE0/40",
"lanes": "21,22,23,24",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet28": {
"alias": "fortyGigE0/28",
"lanes": "1,2,3,4",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet60": {
"alias": "fortyGigE0/60",
"lanes": "57,58,59,60",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet20": {
"alias": "fortyGigE0/20",
"lanes": "45,46,47,48",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet24": {
"alias": "fortyGigE0/24",
"lanes": "5,6,7,8",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
}
},
"VLAN": {

View File

@ -4,162 +4,194 @@
"Ethernet0": {
"alias": "fortyGigE0/0",
"lanes": "29,30,31,32",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet4": {
"alias": "fortyGigE0/4",
"lanes": "25,26,27,28",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet8": {
"alias": "fortyGigE0/8",
"lanes": "37,38,39,40",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet12": {
"alias": "fortyGigE0/12",
"lanes": "33,34,35,36",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet16": {
"alias": "fortyGigE0/16",
"lanes": "41,42,43,44",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet20": {
"alias": "fortyGigE0/20",
"lanes": "45,46,47,48",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet24": {
"alias": "fortyGigE0/24",
"lanes": "5,6,7,8",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet28": {
"alias": "fortyGigE0/28",
"lanes": "1,2,3,4",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet32": {
"alias": "fortyGigE0/32",
"lanes": "9,10,11,12",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet36": {
"alias": "fortyGigE0/36",
"lanes": "13,14,15,16",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet40": {
"alias": "fortyGigE0/40",
"lanes": "21,22,23,24",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet44": {
"alias": "fortyGigE0/44",
"lanes": "17,18,19,20",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet48": {
"alias": "fortyGigE0/48",
"lanes": "49,50,51,52",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet52": {
"alias": "fortyGigE0/52",
"lanes": "53,54,55,56",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet56": {
"alias": "fortyGigE0/56",
"lanes": "61,62,63,64",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet60": {
"alias": "fortyGigE0/60",
"lanes": "57,58,59,60",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet64": {
"alias": "fortyGigE0/64",
"lanes": "65,66,67,68",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet68": {
"alias": "fortyGigE0/68",
"lanes": "69,70,71,72",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet72": {
"alias": "fortyGigE0/72",
"lanes": "77,78,79,80",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet76": {
"alias": "fortyGigE0/76",
"lanes": "73,74,75,76",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet80": {
"alias": "fortyGigE0/80",
"lanes": "105,106,107,108",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet84": {
"alias": "fortyGigE0/84",
"lanes": "109,110,111,112",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet88": {
"alias": "fortyGigE0/88",
"lanes": "117,118,119,120",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet92": {
"alias": "fortyGigE0/92",
"lanes": "113,114,115,116",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet96": {
"alias": "fortyGigE0/96",
"lanes": "121,122,123,124",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet100": {
"alias": "fortyGigE0/100",
"lanes": "125,126,127,128",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet104": {
"alias": "fortyGigE0/104",
"lanes": "85,86,87,88",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet108": {
"alias": "fortyGigE0/108",
"lanes": "81,82,83,84",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet112": {
"alias": "fortyGigE0/112",
"lanes": "89,90,91,92",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet116": {
"alias": "fortyGigE0/116",
"lanes": "93,94,95,96",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet120": {
"alias": "fortyGigE0/120",
"lanes": "97,98,99,100",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
},
"Ethernet124": {
"alias": "fortyGigE0/124",
"lanes": "101,102,103,104",
"admin_status": "up"
"admin_status": "up",
"mode": "trunk"
}
},
"VLAN": {

View File

@ -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"],

View File

@ -1,33 +1,33 @@
# name lanes alias autoneg
Ethernet0 29,30,31,32 fortyGigE0/0 off
Ethernet4 25,26,27,28 fortyGigE0/4 off
Ethernet8 37,38,39,40 fortyGigE0/8 off
Ethernet12 33,34,35,36 fortyGigE0/12 off
Ethernet16 41,42,43,44 fortyGigE0/16 off
Ethernet20 45,46,47,48 fortyGigE0/20 off
Ethernet24 5,6,7,8 fortyGigE0/24 off
Ethernet28 1,2,3,4 fortyGigE0/28 off
Ethernet32 9,10,11,12 fortyGigE0/32 off
Ethernet36 13,14,15,16 fortyGigE0/36 off
Ethernet40 21,22,23,24 fortyGigE0/40 off
Ethernet44 17,18,19,20 fortyGigE0/44 off
Ethernet48 49,50,51,52 fortyGigE0/48 off
Ethernet52 53,54,55,56 fortyGigE0/52 off
Ethernet56 61,62,63,64 fortyGigE0/56 off
Ethernet60 57,58,59,60 fortyGigE0/60 off
Ethernet64 65,66,67,68 fortyGigE0/64 off
Ethernet68 69,70,71,72 fortyGigE0/68 off
Ethernet72 77,78,79,80 fortyGigE0/72 off
Ethernet76 73,74,75,76 fortyGigE0/76 off
Ethernet80 105,106,107,108 fortyGigE0/80 off
Ethernet84 109,110,111,112 fortyGigE0/84 off
Ethernet88 117,118,119,120 fortyGigE0/88 off
Ethernet92 113,114,115,116 fortyGigE0/92 off
Ethernet96 121,122,123,124 fortyGigE0/96 off
Ethernet100 125,126,127,128 fortyGigE0/100 off
Ethernet104 85,86,87,88 fortyGigE0/104 off
Ethernet108 81,82,83,84 fortyGigE0/108 off
Ethernet112 89,90,91,92 fortyGigE0/112 on
Ethernet116 93,94,95,96 fortyGigE0/116 on
Ethernet120 97,98,99,100 fortyGigE0/120 on
Ethernet124 101,102,103,104 fortyGigE0/124 on
# name lanes alias autoneg mode
Ethernet0 29,30,31,32 fortyGigE0/0 off routed
Ethernet4 25,26,27,28 fortyGigE0/4 off trunk
Ethernet8 37,38,39,40 fortyGigE0/8 off trunk
Ethernet12 33,34,35,36 fortyGigE0/12 off trunk
Ethernet16 41,42,43,44 fortyGigE0/16 off trunk
Ethernet20 45,46,47,48 fortyGigE0/20 off trunk
Ethernet24 5,6,7,8 fortyGigE0/24 off trunk
Ethernet28 1,2,3,4 fortyGigE0/28 off trunk
Ethernet32 9,10,11,12 fortyGigE0/32 off trunk
Ethernet36 13,14,15,16 fortyGigE0/36 off trunk
Ethernet40 21,22,23,24 fortyGigE0/40 off trunk
Ethernet44 17,18,19,20 fortyGigE0/44 off trunk
Ethernet48 49,50,51,52 fortyGigE0/48 off trunk
Ethernet52 53,54,55,56 fortyGigE0/52 off trunk
Ethernet56 61,62,63,64 fortyGigE0/56 off trunk
Ethernet60 57,58,59,60 fortyGigE0/60 off trunk
Ethernet64 65,66,67,68 fortyGigE0/64 off trunk
Ethernet68 69,70,71,72 fortyGigE0/68 off trunk
Ethernet72 77,78,79,80 fortyGigE0/72 off trunk
Ethernet76 73,74,75,76 fortyGigE0/76 off trunk
Ethernet80 105,106,107,108 fortyGigE0/80 off trunk
Ethernet84 109,110,111,112 fortyGigE0/84 off trunk
Ethernet88 117,118,119,120 fortyGigE0/88 off trunk
Ethernet92 113,114,115,116 fortyGigE0/92 off trunk
Ethernet96 121,122,123,124 fortyGigE0/96 off trunk
Ethernet100 125,126,127,128 fortyGigE0/100 off trunk
Ethernet104 85,86,87,88 fortyGigE0/104 off trunk
Ethernet108 81,82,83,84 fortyGigE0/108 off trunk
Ethernet112 89,90,91,92 fortyGigE0/112 on trunk
Ethernet116 93,94,95,96 fortyGigE0/116 on trunk
Ethernet120 97,98,99,100 fortyGigE0/120 on trunk
Ethernet124 101,102,103,104 fortyGigE0/124 on routed

View File

@ -1,33 +1,34 @@
# name lanes alias
Ethernet0 29,30,31,32 fortyGigE0/0
Ethernet4 25,26,27,28 fortyGigE0/4
Ethernet8 37,38,39,40 fortyGigE0/8
Ethernet12 33,34,35,36 fortyGigE0/12
Ethernet16 41,42,43,44 fortyGigE0/16
Ethernet20 45,46,47,48 fortyGigE0/20
Ethernet24 5,6,7,8 fortyGigE0/24
Ethernet28 1,2,3,4 fortyGigE0/28
Ethernet32 9,10,11,12 fortyGigE0/32
Ethernet36 13,14,15,16 fortyGigE0/36
Ethernet40 21,22,23,24 fortyGigE0/40
Ethernet44 17,18,19,20 fortyGigE0/44
Ethernet48 49,50,51,52 fortyGigE0/48
Ethernet52 53,54,55,56 fortyGigE0/52
Ethernet56 61,62,63,64 fortyGigE0/56
Ethernet60 57,58,59,60 fortyGigE0/60
Ethernet64 65,66,67,68 fortyGigE0/64
Ethernet68 69,70,71,72 fortyGigE0/68
Ethernet72 77,78,79,80 fortyGigE0/72
Ethernet76 73,74,75,76 fortyGigE0/76
Ethernet80 105,106,107,108 fortyGigE0/80
Ethernet84 109,110,111,112 fortyGigE0/84
Ethernet88 117,118,119,120 fortyGigE0/88
Ethernet92 113,114,115,116 fortyGigE0/92
Ethernet96 121,122,123,124 fortyGigE0/96
Ethernet100 125,126,127,128 fortyGigE0/100
Ethernet104 85,86,87,88 fortyGigE0/104
Ethernet108 81,82,83,84 fortyGigE0/108
Ethernet112 89,90,91,92 fortyGigE0/112
Ethernet116 93,94,95,96 fortyGigE0/116
Ethernet120 97,98,99,100 fortyGigE0/120
Ethernet124 101,102,103,104 fortyGigE0/124
# name lanes alias mode
Ethernet0 29,30,31,32 fortyGigE0/0 trunk
Ethernet4 25,26,27,28 fortyGigE0/4 trunk
Ethernet8 37,38,39,40 fortyGigE0/8 trunk
Ethernet12 33,34,35,36 fortyGigE0/12 trunk
Ethernet16 41,42,43,44 fortyGigE0/16 trunk
Ethernet20 45,46,47,48 fortyGigE0/20 trunk
Ethernet24 5,6,7,8 fortyGigE0/24 trunk
Ethernet28 1,2,3,4 fortyGigE0/28 trunk
Ethernet32 9,10,11,12 fortyGigE0/32 trunk
Ethernet36 13,14,15,16 fortyGigE0/36 trunk
Ethernet40 21,22,23,24 fortyGigE0/40 trunk
Ethernet44 17,18,19,20 fortyGigE0/44 trunk
Ethernet48 49,50,51,52 fortyGigE0/48 trunk
Ethernet52 53,54,55,56 fortyGigE0/52 trunk
Ethernet52 53,54,55,56 fortyGigE0/52 trunk
Ethernet56 61,62,63,64 fortyGigE0/56 trunk
Ethernet60 57,58,59,60 fortyGigE0/60 trunk
Ethernet64 65,66,67,68 fortyGigE0/64 trunk
Ethernet68 69,70,71,72 fortyGigE0/68 trunk
Ethernet72 77,78,79,80 fortyGigE0/72 trunk
Ethernet76 73,74,75,76 fortyGigE0/76 trunk
Ethernet80 105,106,107,108 fortyGigE0/80 trunk
Ethernet84 109,110,111,112 fortyGigE0/84 trunk
Ethernet88 117,118,119,120 fortyGigE0/88 trunk
Ethernet92 113,114,115,116 fortyGigE0/92 trunk
Ethernet96 121,122,123,124 fortyGigE0/96 trunk
Ethernet100 125,126,127,128 fortyGigE0/100 trunk
Ethernet104 85,86,87,88 fortyGigE0/104 trunk
Ethernet108 81,82,83,84 fortyGigE0/108 trunk
Ethernet112 89,90,91,92 fortyGigE0/112 trunk
Ethernet116 93,94,95,96 fortyGigE0/116 trunk
Ethernet120 97,98,99,100 fortyGigE0/120 trunk
Ethernet124 101,102,103,104 fortyGigE0/124 trunk

File diff suppressed because one or more lines are too long

View File

@ -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))

View File

@ -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):

View File

@ -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"]
@ -218,27 +218,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"]