From 49ecb15abd89af40bcf1defcec86f21aa601c50e Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Fri, 12 Mar 2021 16:34:27 -0800 Subject: [PATCH 1/2] [202012][sonic-config-engine] Parse AutoNegotiation element from LinkMetadata section of minigraph file (#7031) Parse the value `AutoNegotiation` element from the `LinkMetadata` section of minigraph file. If the element is present, an `autoneg` key will be added to the port in the `PORT` table of Config DB with a value of either `off` or `on` If an `autoneg` value is present in port_config.ini, the value from the minigraph will take precedence, overriding that value. Also remove `AutoNegotiation` and `EnableAutoNegotiation` elements from the `DeviceInfo` section, as we will use this data in the `LinkMetadata` section to determine whether to enable auto-negotiation for a port. --- src/sonic-config-engine/minigraph.py | 10 + .../tests/fg-ecmp-sample-minigraph.xml | 335 ++++++++--- .../tests/multi_npu_data/sample-minigraph.xml | 57 +- .../tests/sample-arista-7050-t0-minigraph.xml | 345 +++++++++-- .../tests/sample-dell-6100-t0-minigraph.xml | 534 ++++++++++++++++-- .../tests/simple-sample-graph-case.xml | 94 ++- .../tests/simple-sample-graph-metadata.xml | 6 - .../tests/simple-sample-graph.xml | 11 - .../tests/t0-sample-autoneg-port-config.ini | 33 ++ .../tests/t0-sample-graph-mvrf.xml | 16 +- .../tests/t0-sample-graph.xml | 11 +- .../tests/t1-sample-graph-mlnx.xml | 389 +++++++++++-- .../tests/t2-chassis-fe-graph-pc.xml | 77 ++- .../tests/t2-chassis-fe-graph-vni.xml | 41 +- .../tests/t2-chassis-fe-graph.xml | 41 +- src/sonic-config-engine/tests/test_cfggen.py | 192 +++++-- .../tests/test_multinpu_cfggen.py | 18 +- 17 files changed, 1897 insertions(+), 313 deletions(-) create mode 100644 src/sonic-config-engine/tests/t0-sample-autoneg-port-config.ini diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 47db73c34f29..0b99ad07f32b 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -845,6 +845,7 @@ def parse_linkmeta(meta, hname): has_peer_switch = False upper_tor_hostname = '' lower_tor_hostname = '' + auto_negotiation = None properties = linkmeta.find(str(QName(ns1, "Properties"))) for device_property in properties.findall(str(QName(ns1, "DeviceProperty"))): @@ -858,6 +859,8 @@ def parse_linkmeta(meta, hname): upper_tor_hostname = value elif name == "LowerTOR": lower_tor_hostname = value + elif name == "AutoNegotiation": + auto_negotiation = value linkmetas[port] = {} if fec_disabled: @@ -867,6 +870,8 @@ def parse_linkmeta(meta, hname): linkmetas[port]["PeerSwitch"] = lower_tor_hostname else: linkmetas[port]["PeerSwitch"] = upper_tor_hostname + if auto_negotiation: + linkmetas[port]["AutoNegotiation"] = auto_negotiation return linkmetas @@ -1318,6 +1323,11 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw if port.get('speed') == '100000' and linkmetas.get(alias, {}).get('FECDisabled', '').lower() != 'true': port['fec'] = 'rs' + # If AutoNegotiation is available in the minigraph, we override any value we may have received from port_config.ini + autoneg = linkmetas.get(alias, {}).get('AutoNegotiation') + if autoneg: + port['autoneg'] = 'on' if autoneg.lower() == 'true' else 'off' + # If connected to a smart cable, get the connection position for port_name, port in ports.items(): if port_name in mux_cable_ports: diff --git a/src/sonic-config-engine/tests/fg-ecmp-sample-minigraph.xml b/src/sonic-config-engine/tests/fg-ecmp-sample-minigraph.xml index f8fcf1e0fce7..9cca45e25241 100644 --- a/src/sonic-config-engine/tests/fg-ecmp-sample-minigraph.xml +++ b/src/sonic-config-engine/tests/fg-ecmp-sample-minigraph.xml @@ -685,12 +685,10 @@ - true DeviceInterface - true true 1 etp1 @@ -703,7 +701,6 @@ DeviceInterface - true true 1 etp2 @@ -716,7 +713,6 @@ DeviceInterface - true true 1 etp3 @@ -729,7 +725,6 @@ DeviceInterface - true true 1 etp4 @@ -742,7 +737,6 @@ DeviceInterface - true true 1 etp5 @@ -755,7 +749,6 @@ DeviceInterface - true true 1 etp6 @@ -768,7 +761,6 @@ DeviceInterface - true true 1 etp7 @@ -781,7 +773,6 @@ DeviceInterface - true true 1 etp8 @@ -794,7 +785,6 @@ DeviceInterface - true true 1 etp9 @@ -807,7 +797,6 @@ DeviceInterface - true true 1 etp10 @@ -820,7 +809,6 @@ DeviceInterface - true true 1 etp11 @@ -833,7 +821,6 @@ DeviceInterface - true true 1 etp12 @@ -846,7 +833,6 @@ DeviceInterface - true true 1 etp13 @@ -859,7 +845,6 @@ DeviceInterface - true true 1 etp14 @@ -872,7 +857,6 @@ DeviceInterface - true true 1 etp15 @@ -885,7 +869,6 @@ DeviceInterface - true true 1 etp16 @@ -898,7 +881,6 @@ DeviceInterface - true true 1 etp17 @@ -911,7 +893,6 @@ DeviceInterface - true true 1 etp18 @@ -924,7 +905,6 @@ DeviceInterface - true true 1 etp19 @@ -937,7 +917,6 @@ DeviceInterface - true true 1 etp20 @@ -950,7 +929,6 @@ DeviceInterface - true true 1 etp21 @@ -963,7 +941,6 @@ DeviceInterface - true true 1 etp22 @@ -976,7 +953,6 @@ DeviceInterface - true true 1 etp23 @@ -989,7 +965,6 @@ DeviceInterface - true true 1 etp24 @@ -1002,7 +977,6 @@ DeviceInterface - true true 1 etp25 @@ -1015,7 +989,6 @@ DeviceInterface - true true 1 etp26 @@ -1028,7 +1001,6 @@ DeviceInterface - true true 1 etp27 @@ -1041,7 +1013,6 @@ DeviceInterface - true true 1 etp28 @@ -1054,7 +1025,6 @@ DeviceInterface - true true 1 etp29 @@ -1067,7 +1037,6 @@ DeviceInterface - true true 1 etp30 @@ -1080,7 +1049,6 @@ DeviceInterface - true true 1 etp31 @@ -1093,7 +1061,6 @@ DeviceInterface - true true 1 etp32 @@ -1106,7 +1073,6 @@ DeviceInterface - true true 1 etp33 @@ -1119,7 +1085,6 @@ DeviceInterface - true true 1 etp34 @@ -1132,7 +1097,6 @@ DeviceInterface - true true 1 etp35 @@ -1145,7 +1109,6 @@ DeviceInterface - true true 1 etp36 @@ -1158,7 +1121,6 @@ DeviceInterface - true true 1 etp37 @@ -1171,7 +1133,6 @@ DeviceInterface - true true 1 etp38 @@ -1184,7 +1145,6 @@ DeviceInterface - true true 1 etp39 @@ -1197,7 +1157,6 @@ DeviceInterface - true true 1 etp40 @@ -1210,7 +1169,6 @@ DeviceInterface - true true 1 etp41 @@ -1223,7 +1181,6 @@ DeviceInterface - true true 1 etp42 @@ -1236,7 +1193,6 @@ DeviceInterface - true true 1 etp43 @@ -1249,7 +1205,6 @@ DeviceInterface - true true 1 etp44 @@ -1262,7 +1217,6 @@ DeviceInterface - true true 1 etp45 @@ -1275,7 +1229,6 @@ DeviceInterface - true true 1 etp46 @@ -1288,7 +1241,6 @@ DeviceInterface - true true 1 etp47 @@ -1301,7 +1253,6 @@ DeviceInterface - true true 1 etp48 @@ -1314,7 +1265,6 @@ DeviceInterface - true true 1 etp49 @@ -1327,7 +1277,6 @@ DeviceInterface - true true 1 etp50 @@ -1340,7 +1289,6 @@ DeviceInterface - true true 1 etp51 @@ -1353,7 +1301,6 @@ DeviceInterface - true true 1 etp52 @@ -1366,7 +1313,6 @@ DeviceInterface - true true 1 etp53 @@ -1379,7 +1325,6 @@ DeviceInterface - true true 1 etp54 @@ -1392,7 +1337,6 @@ DeviceInterface - true true 1 etp55 @@ -1405,7 +1349,6 @@ DeviceInterface - true true 1 etp56 @@ -1418,7 +1361,6 @@ DeviceInterface - true true 1 etp57 @@ -1431,7 +1373,6 @@ DeviceInterface - true true 1 etp58 @@ -1444,7 +1385,6 @@ DeviceInterface - true true 1 etp59 @@ -1457,7 +1397,6 @@ DeviceInterface - true true 1 etp60 @@ -1470,7 +1409,6 @@ DeviceInterface - true true 1 etp61 @@ -1483,7 +1421,6 @@ DeviceInterface - true true 1 etp62 @@ -1496,7 +1433,6 @@ DeviceInterface - true true 1 etp63 @@ -1509,7 +1445,6 @@ DeviceInterface - true true 1 etp64 @@ -1586,6 +1521,274 @@ + + + + + + + AutoNegotiation + + True + + + str2-sn3800-azd:etp29;ARISTA01T1:Ethernet1 + + + + + + AutoNegotiation + + True + + + str2-sn3800-azd:etp30;ARISTA02T1:Ethernet1 + + + + + + AutoNegotiation + + True + + + str2-sn3800-azd:etp31;ARISTA03T1:Ethernet1 + + + + + + AutoNegotiation + + True + + + str2-sn3800-azd:etp32;ARISTA04T1:Ethernet1 + + + + + + AutoNegotiation + + True + + + Servers0:eth0;str2-sn3800-azd:etp2 + + + + + + AutoNegotiation + + True + + + Servers3:eth0;str2-sn3800-azd:etp5 + + + + + + AutoNegotiation + + True + + + Servers4:eth0;str2-sn3800-azd:etp6 + + + + + + AutoNegotiation + + True + + + Servers7:eth0;str2-sn3800-azd:etp9 + + + + + + AutoNegotiation + + True + + + Servers10:eth0;str2-sn3800-azd:etp10 + + + + + + AutoNegotiation + + True + + + Servers11:eth0;str2-sn3800-azd:etp11 + + + + + + AutoNegotiation + + True + + + Servers10:eth0;str2-sn3800-azd:etp12 + + + + + + AutoNegotiation + + True + + + Servers11:eth0;str2-sn3800-azd:etp13 + + + + + + AutoNegotiation + + True + + + Servers10:eth0;str2-sn3800-azd:etp14 + + + + + + AutoNegotiation + + True + + + Servers11:eth0;str2-sn3800-azd:etp15 + + + + + + AutoNegotiation + + True + + + Servers10:eth0;str2-sn3800-azd:etp16 + + + + + + AutoNegotiation + + True + + + Servers11:eth0;str2-sn3800-azd:etp17 + + + + + + AutoNegotiation + + True + + + Servers10:eth0;str2-sn3800-azd:etp18 + + + + + + AutoNegotiation + + True + + + Servers11:eth0;str2-sn3800-azd:etp19 + + + + + + AutoNegotiation + + True + + + Servers10:eth0;str2-sn3800-azd:etp20 + + + + + + AutoNegotiation + + True + + + Servers11:eth0;str2-sn3800-azd:etp21 + + + + + + AutoNegotiation + + True + + + Servers20:eth0;str2-sn3800-azd:etp22 + + + + + + AutoNegotiation + + True + + + Servers21:eth0;str2-sn3800-azd:etp23 + + + + + + AutoNegotiation + + True + + + Servers22:eth0;str2-sn3800-azd:etp24 + + + + + + AutoNegotiation + + True + + + Servers23:eth0;str2-sn3800-azd:etp25 + + + str2-sn3800-azd ACS-MSN3800 - \ No newline at end of file + diff --git a/src/sonic-config-engine/tests/multi_npu_data/sample-minigraph.xml b/src/sonic-config-engine/tests/multi_npu_data/sample-minigraph.xml index 412262315b4e..5dac8e95bf1a 100644 --- a/src/sonic-config-engine/tests/multi_npu_data/sample-minigraph.xml +++ b/src/sonic-config-engine/tests/multi_npu_data/sample-minigraph.xml @@ -1008,12 +1008,10 @@ - true DeviceInterface - true true 1 Ethernet1/1 @@ -1026,7 +1024,6 @@ DeviceInterface - true true 1 Ethernet1/2 @@ -1039,7 +1036,6 @@ DeviceInterface - true true 1 Ethernet1/3 @@ -1052,7 +1048,6 @@ DeviceInterface - true true 1 Ethernet1/4 @@ -1065,7 +1060,6 @@ DeviceInterface - true true 1 Ethernet1/5 @@ -1078,7 +1072,6 @@ DeviceInterface - true true 1 Ethernet1/6 @@ -1091,7 +1084,6 @@ DeviceInterface - true true 1 Ethernet1/7 @@ -1104,7 +1096,6 @@ DeviceInterface - true true 1 Ethernet1/8 @@ -1241,6 +1232,54 @@ + + + + + + + AutoNegotiation + + True + + + multi_npu_platform_01:Ethernet1/1;01T2:Ethernet1 + + + + + + AutoNegotiation + + True + + + multi_npu_platform_01:Ethernet1/2;01T2:Ethernet2 + + + + + + AutoNegotiation + + True + + + multi_npu_platform_01:Ethernet1/5;05T2:Ethernet1 + + + + + + AutoNegotiation + + True + + + multi_npu_platform_01:Ethernet1/6;05T2:Ethernet2 + + + multi_npu_platform_01 multi-npu-01 diff --git a/src/sonic-config-engine/tests/sample-arista-7050-t0-minigraph.xml b/src/sonic-config-engine/tests/sample-arista-7050-t0-minigraph.xml index 4fd1ba9ba128..4d216b30f203 100644 --- a/src/sonic-config-engine/tests/sample-arista-7050-t0-minigraph.xml +++ b/src/sonic-config-engine/tests/sample-arista-7050-t0-minigraph.xml @@ -462,12 +462,10 @@ - true DeviceInterface - true true 1 Ethernet5/1 @@ -480,7 +478,6 @@ DeviceInterface - true true 1 Ethernet6/1 @@ -493,7 +490,6 @@ DeviceInterface - true true 1 Ethernet7/1 @@ -506,7 +502,6 @@ DeviceInterface - true true 1 Ethernet8/1 @@ -519,7 +514,6 @@ DeviceInterface - true true 1 Ethernet9/1 @@ -532,7 +526,6 @@ DeviceInterface - true true 1 Ethernet10/1 @@ -545,7 +538,6 @@ DeviceInterface - true true 1 Ethernet11/1 @@ -558,7 +550,6 @@ DeviceInterface - true true 1 Ethernet12/1 @@ -571,7 +562,6 @@ DeviceInterface - true true 1 Ethernet13/1 @@ -584,7 +574,6 @@ DeviceInterface - true true 1 Ethernet14/1 @@ -597,7 +586,6 @@ DeviceInterface - true true 1 Ethernet15/1 @@ -610,7 +598,6 @@ DeviceInterface - true true 1 Ethernet16/1 @@ -623,7 +610,6 @@ DeviceInterface - true true 1 Ethernet17/1 @@ -636,7 +622,6 @@ DeviceInterface - true true 1 Ethernet18/1 @@ -649,7 +634,6 @@ DeviceInterface - true true 1 Ethernet19/1 @@ -662,7 +646,6 @@ DeviceInterface - true true 1 Ethernet20/1 @@ -675,7 +658,6 @@ DeviceInterface - true true 1 Ethernet21/1 @@ -688,7 +670,6 @@ DeviceInterface - true true 1 Ethernet22/1 @@ -701,7 +682,6 @@ DeviceInterface - true true 1 Ethernet23/1 @@ -714,7 +694,6 @@ DeviceInterface - true true 1 Ethernet24/1 @@ -727,7 +706,6 @@ DeviceInterface - true true 1 Ethernet25/1 @@ -740,7 +718,6 @@ DeviceInterface - true true 1 Ethernet26/1 @@ -753,7 +730,6 @@ DeviceInterface - true true 1 Ethernet27/1 @@ -766,7 +742,6 @@ DeviceInterface - true true 1 Ethernet28/1 @@ -779,7 +754,6 @@ DeviceInterface - true true 1 Ethernet29 @@ -792,7 +766,6 @@ DeviceInterface - true true 1 Ethernet30 @@ -805,7 +778,6 @@ DeviceInterface - true true 1 Ethernet31 @@ -818,7 +790,6 @@ DeviceInterface - true true 1 Ethernet32 @@ -831,7 +802,6 @@ DeviceInterface - true true 1 Ethernet33 @@ -844,7 +814,6 @@ DeviceInterface - true true 1 Ethernet34 @@ -857,7 +826,6 @@ DeviceInterface - true true 1 Ethernet35 @@ -870,7 +838,6 @@ DeviceInterface - true true 1 Ethernet36 @@ -902,6 +869,318 @@ + + + + + + + AutoNegotiation + + True + + + s7050-dev-1:Ethernet33;ARISTA01T1:Ethernet1 + + + + + + AutoNegotiation + + True + + + s7050-dev-1:Ethernet34;ARISTA02T1:Ethernet1 + + + + + + AutoNegotiation + + True + + + s7050-dev-1:Ethernet35;ARISTA03T1:Ethernet1 + + + + + + AutoNegotiation + + True + + + s7050-dev-1:Ethernet36;ARISTA04T1:Ethernet1 + + + + + + AutoNegotiation + + True + + + Servers0:eth0;s7050-dev-1:Ethernet6/1 + + + + + + AutoNegotiation + + True + + + Servers1:eth0;s7050-dev-1:Ethernet7/1 + + + + + + AutoNegotiation + + True + + + Servers2:eth0;s7050-dev-1:Ethernet8/1 + + + + + + AutoNegotiation + + True + + + Servers3:eth0;s7050-dev-1:Ethernet9/1 + + + + + + AutoNegotiation + + True + + + Servers4:eth0;s7050-dev-1:Ethernet10/1 + + + + + + AutoNegotiation + + True + + + Servers5:eth0;s7050-dev-1:Ethernet11/1 + + + + + + AutoNegotiation + + True + + + Servers6:eth0;s7050-dev-1:Ethernet12/1 + + + + + + AutoNegotiation + + True + + + Servers7:eth0;s7050-dev-1:Ethernet13/1 + + + + + + AutoNegotiation + + True + + + Servers8:eth0;s7050-dev-1:Ethernet14/1 + + + + + + AutoNegotiation + + True + + + Servers9:eth0;s7050-dev-1:Ethernet15/1 + + + + + + AutoNegotiation + + True + + + Servers10:eth0;s7050-dev-1:Ethernet16/1 + + + + + + AutoNegotiation + + True + + + Servers11:eth0;s7050-dev-1:Ethernet17/1 + + + + + + AutoNegotiation + + True + + + Servers12:eth0;s7050-dev-1:Ethernet18/1 + + + + + + AutoNegotiation + + True + + + Servers13:eth0;s7050-dev-1:Ethernet19/1 + + + + + + AutoNegotiation + + True + + + Servers14:eth0;s7050-dev-1:Ethernet20/1 + + + + + + AutoNegotiation + + True + + + Servers15:eth0;s7050-dev-1:Ethernet21/1 + + + + + + AutoNegotiation + + True + + + Servers16:eth0;s7050-dev-1:Ethernet22/1 + + + + + + AutoNegotiation + + True + + + Servers17:eth0;s7050-dev-1:Ethernet23/1 + + + + + + AutoNegotiation + + True + + + Servers18:eth0;s7050-dev-1:Ethernet24/1 + + + + + + AutoNegotiation + + True + + + Servers19:eth0;s7050-dev-1:Ethernet25/1 + + + + + + AutoNegotiation + + True + + + Servers20:eth0;s7050-dev-1:Ethernet26/1 + + + + + + AutoNegotiation + + True + + + Servers21:eth0;s7050-dev-1:Ethernet27/1 + + + + + + AutoNegotiation + + True + + + Servers22:eth0;s7050-dev-1:Ethernet28/1 + + + + + + AutoNegotiation + + True + + + Servers23:eth0;s7050-dev-1:Ethernet29/1 + + + s7050-dev-1 Arista-7050-QX-32S diff --git a/src/sonic-config-engine/tests/sample-dell-6100-t0-minigraph.xml b/src/sonic-config-engine/tests/sample-dell-6100-t0-minigraph.xml index 536a2c8a73c7..7cea7decfcc0 100644 --- a/src/sonic-config-engine/tests/sample-dell-6100-t0-minigraph.xml +++ b/src/sonic-config-engine/tests/sample-dell-6100-t0-minigraph.xml @@ -301,7 +301,6 @@ DeviceInterfaceLink - true 40000 ARISTA01T1 Ethernet1 @@ -311,7 +310,6 @@ DeviceInterfaceLink - true 40000 ARISTA01T1 Ethernet2 @@ -321,7 +319,6 @@ DeviceInterfaceLink - true 40000 ARISTA02T1 Ethernet1 @@ -331,7 +328,6 @@ DeviceInterfaceLink - true 40000 ARISTA02T1 Ethernet2 @@ -341,7 +337,6 @@ DeviceInterfaceLink - true 40000 ARISTA03T1 Ethernet1 @@ -351,7 +346,6 @@ DeviceInterfaceLink - true 40000 ARISTA03T1 Ethernet2 @@ -361,7 +355,6 @@ DeviceInterfaceLink - true 40000 ARISTA04T1 Ethernet1 @@ -371,7 +364,6 @@ DeviceInterfaceLink - true 40000 ARISTA04T1 Ethernet2 @@ -381,7 +373,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/1/7 @@ -391,7 +382,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/1/8 @@ -401,7 +391,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/1/9 @@ -411,7 +400,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/1/10 @@ -421,7 +409,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/1/11 @@ -431,7 +418,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/1/12 @@ -441,7 +427,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/1/13 @@ -451,7 +436,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/1/14 @@ -461,7 +445,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/1/15 @@ -471,7 +454,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/1/16 @@ -481,7 +463,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/3/1 @@ -491,7 +472,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/3/5 @@ -501,7 +481,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/3/6 @@ -511,7 +490,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/3/7 @@ -521,7 +499,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/3/8 @@ -531,7 +508,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/3/9 @@ -541,7 +517,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/3/10 @@ -551,7 +526,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/3/11 @@ -561,7 +535,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/2/7 @@ -571,7 +544,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/2/8 @@ -581,7 +553,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/2/9 @@ -591,7 +562,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/2/10 @@ -601,7 +571,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/2/11 @@ -611,7 +580,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/2/12 @@ -621,7 +589,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/2/13 @@ -631,7 +598,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/2/14 @@ -641,7 +607,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/2/15 @@ -651,7 +616,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/2/16 @@ -661,7 +625,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/4/1 @@ -671,7 +634,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/4/5 @@ -681,7 +643,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/4/6 @@ -691,7 +652,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/4/7 @@ -701,7 +661,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/4/8 @@ -711,7 +670,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/4/9 @@ -721,7 +679,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/4/10 @@ -731,7 +688,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/4/11 @@ -765,6 +721,494 @@ + + + + + + + AutoNegotiation + + True + + + ARISTA01T1:Ethernet1;s6100-dev-1:fortyGigE1/1/1 + + + + + + AutoNegotiation + + True + + + ARISTA01T1:Ethernet2;s6100-dev-1:fortyGigE1/1/2 + + + + + + AutoNegotiation + + True + + + ARISTA02T1:Ethernet1;s6100-dev-1:fortyGigE1/1/5 + + + + + + AutoNegotiation + + True + + + ARISTA02T1:Ethernet2;s6100-dev-1:fortyGigE1/1/6 + + + + + + AutoNegotiation + + True + + + ARISTA03T1:Ethernet1;s6100-dev-1:fortyGigE1/2/1 + + + + + + AutoNegotiation + + True + + + ARISTA03T1:Ethernet2;s6100-dev-1:fortyGigE1/2/2 + + + + + + AutoNegotiation + + True + + + ARISTA04T1:Ethernet1;s6100-dev-1:fortyGigE1/2/5 + + + + + + AutoNegotiation + + True + + + ARISTA04T1:Ethernet2;s6100-dev-1:fortyGigE1/2/6 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/1/7;server-01:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/1/8;server-02:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/1/7;server-03:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/1/7;server-04:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/1/7;server-05:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/1/7;server-06:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/1/7;server-07:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/1/7;server-08:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/1/7;server-09:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/1/7;server-10:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/3/1;server-11:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/3/5;server-12:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/3/6;server-13:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/3/7;server-14:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/3/8;server-15:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/3/9;server-16:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/3/10;server-17:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/3/11;server-18:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/2/7;server-19:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/2/8;server-20:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/2/9;server-21:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/2/10;server-22:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/2/11;server-23:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/2/12;server-24:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/2/13;server-25:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/2/14;server-26:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/2/15;server-27:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/2/16;server-28:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/4/1;server-29:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/4/5;server-30:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/4/6;server-31:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/4/7;server-32:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/4/8;server-33:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/4/9;server-34:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/4/10;server-35:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/4/11;server-36:0 + + + s6100-dev-1 Force10-S6100 - \ No newline at end of file + diff --git a/src/sonic-config-engine/tests/simple-sample-graph-case.xml b/src/sonic-config-engine/tests/simple-sample-graph-case.xml index 95f501200c83..9292170034b3 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph-case.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph-case.xml @@ -197,7 +197,6 @@ DeviceInterfaceLink - true 10000 switch-t0 fortyGigE0/0 @@ -206,7 +205,6 @@ DeviceInterfaceLink - true 10000 switch-t0 fortyGigE0/12 @@ -215,7 +213,6 @@ DeviceInterfaceLink - true 25000 switch-t0 fortyGigE0/4 @@ -224,7 +221,6 @@ DeviceInterfaceLink - true 40000 switch-t0 fortyGigE0/8 @@ -330,26 +326,70 @@ - - - - GeminiPeeringLink - - True - - - UpperTOR - - switch-t0 - - - LowerTOR - - switch2-t0 - - - switch2-t0:MuxTunnel0;switch-t0:MuxTunnel0 - + + + + GeminiPeeringLink + + True + + + UpperTOR + + switch-t0 + + + LowerTOR + + switch2-t0 + + + switch2-t0:MuxTunnel0;switch-t0:MuxTunnel0 + + + + + + AutoNegotiation + + True + + + switch-01t1:port1;switch-t0:fortyGigE0/0 + + + + + + AutoNegotiation + + True + + + switch-02t1:port1;switch-t0:fortyGigE0/12 + + + + + + AutoNegotiation + + True + + + server1:port1;switch-t0:fortyGigE0/4 + + + + + + AutoNegotiation + + True + + + server2:port1;switch-t0:fortyGigE0/8 + @@ -407,12 +447,10 @@ - true DeviceInterface - true true 1 fortyGigE0/0 @@ -425,7 +463,6 @@ DeviceInterface - true true 1 fortyGigE0/4 @@ -438,7 +475,6 @@ DeviceInterface - true true 1 fortyGigE0/8 @@ -452,7 +488,6 @@ DeviceInterface - true true 1 fortyGigE0/12 @@ -471,7 +506,6 @@ DeviceInterface - true true 1 eth0 diff --git a/src/sonic-config-engine/tests/simple-sample-graph-metadata.xml b/src/sonic-config-engine/tests/simple-sample-graph-metadata.xml index 2b3368b7a9c7..ee26ee2111ec 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph-metadata.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph-metadata.xml @@ -265,12 +265,10 @@ - true DeviceInterface - true true 1 fortyGigE0/0 @@ -283,7 +281,6 @@ DeviceInterface - true true 1 fortyGigE0/4 @@ -296,7 +293,6 @@ DeviceInterface - true true 1 fortyGigE0/8 @@ -310,7 +306,6 @@ DeviceInterface - true true 1 fortyGigE0/12 @@ -329,7 +324,6 @@ DeviceInterface - true true 1 Management1 diff --git a/src/sonic-config-engine/tests/simple-sample-graph.xml b/src/sonic-config-engine/tests/simple-sample-graph.xml index 703a005ea5bc..0ac08a3fff04 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph.xml @@ -248,7 +248,6 @@ DeviceInterfaceLink - true 1000 ARISTA01T1 et1 @@ -259,7 +258,6 @@ DeviceInterfaceLink - true 10000 switch-t0 fortyGigE0/1 @@ -270,7 +268,6 @@ DeviceInterfaceLink - true 10000 switch-t0 fortyGigE0/2 @@ -306,12 +303,10 @@ - true DeviceInterface - true true 1 fortyGigE0/0 @@ -324,7 +319,6 @@ DeviceInterface - true true 1 Ethernet1 @@ -337,7 +331,6 @@ DeviceInterface - true true 1 Ethernet2 @@ -350,7 +343,6 @@ DeviceInterface - true true 1 fortyGigE0/4 @@ -363,7 +355,6 @@ DeviceInterface - true true 1 fortyGigE0/8 @@ -377,7 +368,6 @@ DeviceInterface - true true 1 fortyGigE0/12 @@ -396,7 +386,6 @@ DeviceInterface - true 1 Management1 false diff --git a/src/sonic-config-engine/tests/t0-sample-autoneg-port-config.ini b/src/sonic-config-engine/tests/t0-sample-autoneg-port-config.ini new file mode 100644 index 000000000000..91e2283eb4a6 --- /dev/null +++ b/src/sonic-config-engine/tests/t0-sample-autoneg-port-config.ini @@ -0,0 +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 diff --git a/src/sonic-config-engine/tests/t0-sample-graph-mvrf.xml b/src/sonic-config-engine/tests/t0-sample-graph-mvrf.xml index ee633c18bd1e..e7e2b5789816 100644 --- a/src/sonic-config-engine/tests/t0-sample-graph-mvrf.xml +++ b/src/sonic-config-engine/tests/t0-sample-graph-mvrf.xml @@ -355,7 +355,6 @@ DeviceInterfaceLink - true 10000 switch-t0 fortyGigE0/2 @@ -408,6 +407,21 @@ + + + + + + + AutoNegotiation + + True + + + ARISTA05T1:Ethernet1/33;switch-t0:fortyGigE0/2 + + + switch-t0 Force10-S6000 diff --git a/src/sonic-config-engine/tests/t0-sample-graph.xml b/src/sonic-config-engine/tests/t0-sample-graph.xml index 9f416d008d33..f847af1f90cf 100644 --- a/src/sonic-config-engine/tests/t0-sample-graph.xml +++ b/src/sonic-config-engine/tests/t0-sample-graph.xml @@ -435,7 +435,6 @@ DeviceInterfaceLink - true 100000 switch-t0 fortyGigE0/4 @@ -502,6 +501,11 @@ + + AutoNegotiation + + True + FECDisabled @@ -513,6 +517,11 @@ + + AutoNegotiation + + False + FECDisabled diff --git a/src/sonic-config-engine/tests/t1-sample-graph-mlnx.xml b/src/sonic-config-engine/tests/t1-sample-graph-mlnx.xml index 04fc88c34370..cc6f5e95940b 100644 --- a/src/sonic-config-engine/tests/t1-sample-graph-mlnx.xml +++ b/src/sonic-config-engine/tests/t1-sample-graph-mlnx.xml @@ -1745,12 +1745,10 @@ - true DeviceInterface - true true 1 Ethernet0 @@ -1763,7 +1761,6 @@ DeviceInterface - true true 1 Ethernet4 @@ -1776,7 +1773,6 @@ DeviceInterface - true true 1 Ethernet8 @@ -1789,7 +1785,6 @@ DeviceInterface - true true 1 Ethernet12 @@ -1802,7 +1797,6 @@ DeviceInterface - true true 1 Ethernet16 @@ -1815,7 +1809,6 @@ DeviceInterface - true true 1 Ethernet20 @@ -1828,7 +1821,6 @@ DeviceInterface - true true 1 Ethernet24 @@ -1841,7 +1833,6 @@ DeviceInterface - true true 1 Ethernet28 @@ -1854,7 +1845,6 @@ DeviceInterface - true true 1 Ethernet32 @@ -1867,7 +1857,6 @@ DeviceInterface - true true 1 Ethernet36 @@ -1880,7 +1869,6 @@ DeviceInterface - true true 1 Ethernet40 @@ -1893,7 +1881,6 @@ DeviceInterface - true true 1 Ethernet44 @@ -1906,7 +1893,6 @@ DeviceInterface - true true 1 Ethernet48 @@ -1919,7 +1905,6 @@ DeviceInterface - true true 1 Ethernet52 @@ -1932,7 +1917,6 @@ DeviceInterface - true true 1 Ethernet56 @@ -1945,7 +1929,6 @@ DeviceInterface - true true 1 Ethernet60 @@ -1958,7 +1941,6 @@ DeviceInterface - true true 1 Ethernet64 @@ -1971,7 +1953,6 @@ DeviceInterface - true true 1 Ethernet68 @@ -1984,7 +1965,6 @@ DeviceInterface - true true 1 Ethernet72 @@ -1997,7 +1977,6 @@ DeviceInterface - true true 1 Ethernet76 @@ -2010,7 +1989,6 @@ DeviceInterface - true true 1 Ethernet80 @@ -2023,7 +2001,6 @@ DeviceInterface - true true 1 Ethernet84 @@ -2036,7 +2013,6 @@ DeviceInterface - true true 1 Ethernet88 @@ -2049,7 +2025,6 @@ DeviceInterface - true true 1 Ethernet92 @@ -2062,7 +2037,6 @@ DeviceInterface - true true 1 Ethernet96 @@ -2075,7 +2049,6 @@ DeviceInterface - true true 1 Ethernet100 @@ -2088,7 +2061,6 @@ DeviceInterface - true true 1 Ethernet104 @@ -2101,7 +2073,6 @@ DeviceInterface - true true 1 Ethernet108 @@ -2114,7 +2085,6 @@ DeviceInterface - true true 1 Ethernet112 @@ -2127,7 +2097,6 @@ DeviceInterface - true true 1 Ethernet116 @@ -2140,7 +2109,6 @@ DeviceInterface - true true 1 Ethernet120 @@ -2153,7 +2121,6 @@ DeviceInterface - true true 1 Ethernet124 @@ -2235,6 +2202,362 @@ + + + + + + + AutoNegotiation + + True + + + ARISTA01T2:Ethernet1;arc-switch1026:Ethernet0 + + + + + + AutoNegotiation + + True + + + ARISTA02T2:Ethernet1;arc-switch1026:Ethernet4 + + + + + + AutoNegotiation + + True + + + ARISTA03T2:Ethernet1;arc-switch1026:Ethernet8 + + + + + + AutoNegotiation + + True + + + ARISTA04T2:Ethernet1;arc-switch1026:Ethernet12 + + + + + + AutoNegotiation + + True + + + ARISTA05T2:Ethernet1;arc-switch1026:Ethernet16 + + + + + + AutoNegotiation + + True + + + ARISTA06T2:Ethernet1;arc-switch1026:Ethernet20 + + + + + + AutoNegotiation + + True + + + ARISTA07T2:Ethernet1;arc-switch1026:Ethernet24 + + + + + + AutoNegotiation + + True + + + ARISTA08T2:Ethernet1;arc-switch1026:Ethernet28 + + + + + + AutoNegotiation + + True + + + ARISTA09T2:Ethernet1;arc-switch1026:Ethernet32 + + + + + + AutoNegotiation + + True + + + ARISTA10T2:Ethernet1;arc-switch1026:Ethernet36 + + + + + + AutoNegotiation + + True + + + ARISTA11T2:Ethernet1;arc-switch1026:Ethernet40 + + + + + + AutoNegotiation + + True + + + ARISTA12T2:Ethernet1;arc-switch1026:Ethernet44 + + + + + + AutoNegotiation + + True + + + ARISTA13T2:Ethernet1;arc-switch1026:Ethernet48 + + + + + + AutoNegotiation + + True + + + ARISTA14T2:Ethernet1;arc-switch1026:Ethernet52 + + + + + + AutoNegotiation + + True + + + ARISTA15T2:Ethernet1;arc-switch1026:Ethernet56 + + + + + + AutoNegotiation + + True + + + ARISTA16T2:Ethernet1;arc-switch1026:Ethernet60 + + + + + + AutoNegotiation + + True + + + ARISTA01T0:Ethernet1;arc-switch1026:Ethernet64 + + + + + + AutoNegotiation + + True + + + ARISTA02T0:Ethernet1;arc-switch1026:Ethernet68 + + + + + + AutoNegotiation + + True + + + ARISTA03T0:Ethernet1;arc-switch1026:Ethernet72 + + + + + + AutoNegotiation + + True + + + ARISTA04T0:Ethernet1;arc-switch1026:Ethernet76 + + + + + + AutoNegotiation + + True + + + ARISTA05T0:Ethernet1;arc-switch1026:Ethernet80 + + + + + + AutoNegotiation + + True + + + ARISTA06T0:Ethernet1;arc-switch1026:Ethernet84 + + + + + + AutoNegotiation + + True + + + ARISTA07T0:Ethernet1;arc-switch1026:Ethernet88 + + + + + + AutoNegotiation + + True + + + ARISTA08T0:Ethernet1;arc-switch1026:Ethernet92 + + + + + + AutoNegotiation + + True + + + ARISTA09T0:Ethernet1;arc-switch1026:Ethernet96 + + + + + + AutoNegotiation + + True + + + ARISTA10T0:Ethernet1;arc-switch1026:Ethernet100 + + + + + + AutoNegotiation + + True + + + ARISTA11T0:Ethernet1;arc-switch1026:Ethernet104 + + + + + + AutoNegotiation + + True + + + ARISTA12T0:Ethernet1;arc-switch1026:Ethernet108 + + + + + + AutoNegotiation + + True + + + ARISTA13T0:Ethernet1;arc-switch1026:Ethernet112 + + + + + + AutoNegotiation + + True + + + ARISTA14T0:Ethernet1;arc-switch1026:Ethernet116 + + + + + + AutoNegotiation + + True + + + ARISTA15T0:Ethernet1;arc-switch1026:Ethernet120 + + + + + + AutoNegotiation + + True + + + ARISTA16T0:Ethernet1;arc-switch1026:Ethernet124 + + + arc-switch1026 ACS-MSN2700 diff --git a/src/sonic-config-engine/tests/t2-chassis-fe-graph-pc.xml b/src/sonic-config-engine/tests/t2-chassis-fe-graph-pc.xml index 3fb744ce91fd..bc1a5142fc86 100644 --- a/src/sonic-config-engine/tests/t2-chassis-fe-graph-pc.xml +++ b/src/sonic-config-engine/tests/t2-chassis-fe-graph-pc.xml @@ -223,12 +223,10 @@ - true DeviceInterface - true false 1 Ethernet0 @@ -241,7 +239,6 @@ DeviceInterface - true false 1 Ethernet4 @@ -254,7 +251,6 @@ DeviceInterface - true false 1 Ethernet8 @@ -267,7 +263,6 @@ DeviceInterface - true false 1 Ethernet12 @@ -280,7 +275,6 @@ DeviceInterface - true false 1 Ethernet16 @@ -293,7 +287,6 @@ DeviceInterface - true false 1 Ethernet20 @@ -319,6 +312,76 @@ + + + + + + + AutoNegotiation + + True + + + SpineFront01:Ethernet0;Leaf01:Ethernet0 + + + + + + AutoNegotiation + + True + + + SpineFront01:Ethernet4;Leaf01:Ethernet4 + + + + + + AutoNegotiation + + True + + + SpineFront01:Ethernet8;SpineBack01:Ethernet8 + + + + + + AutoNegotiation + + True + + + SpineFront01:Ethernet12;SpineBack01:Ethernet12 + + + + + + AutoNegotiation + + True + + + SpineFront01:Ethernet16;SpineBack02:Ethernet16 + + + + + + AutoNegotiation + + True + + + SpineFront01:Ethernet20;SpineBack02:Ethernet20 + + + SpineFront01 Force10-S6000 diff --git a/src/sonic-config-engine/tests/t2-chassis-fe-graph-vni.xml b/src/sonic-config-engine/tests/t2-chassis-fe-graph-vni.xml index f820b180f701..0dc534b3de88 100644 --- a/src/sonic-config-engine/tests/t2-chassis-fe-graph-vni.xml +++ b/src/sonic-config-engine/tests/t2-chassis-fe-graph-vni.xml @@ -187,12 +187,10 @@ - true DeviceInterface - true false 1 Ethernet0 @@ -205,7 +203,6 @@ DeviceInterface - true false 1 Ethernet4 @@ -218,7 +215,6 @@ DeviceInterface - true false 1 Ethernet8 @@ -244,6 +240,43 @@ + + + + + + + AutoNegotiation + + True + + + SpineFront01:Ethernet0;Leaf01:Ethernet4 + + + + + + AutoNegotiation + + True + + + SpineFront01:Ethernet4;SpineBack01:Ethernet0 + + + + + + AutoNegotiation + + True + + + SpineFront01:Ethernet8;SpineBack02:Ethernet4 + + + SpineFront01 Force10-S6000 diff --git a/src/sonic-config-engine/tests/t2-chassis-fe-graph.xml b/src/sonic-config-engine/tests/t2-chassis-fe-graph.xml index 76320b766be5..3b0c56a57a70 100644 --- a/src/sonic-config-engine/tests/t2-chassis-fe-graph.xml +++ b/src/sonic-config-engine/tests/t2-chassis-fe-graph.xml @@ -186,12 +186,10 @@ - true DeviceInterface - true false 1 Ethernet0 @@ -204,7 +202,6 @@ DeviceInterface - true false 1 Ethernet4 @@ -217,7 +214,6 @@ DeviceInterface - true false 1 Ethernet8 @@ -243,6 +239,43 @@ + + + + + + + AutoNegotiation + + True + + + SpineFront01:Ethernet0;Leaf01:Ethernet4 + + + + + + AutoNegotiation + + True + + + SpineFront01:Ethernet4;SpineBack01:Ethernet0 + + + + + + AutoNegotiation + + True + + + SpineFront01:Ethernet8;SpineBack02:Ethernet4 + + + SpineFront01 Force10-S6000 diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index f6edb58d15a9..6934ede7f114 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -23,6 +23,7 @@ def setUp(self): self.sample_graph_bgp_speaker = os.path.join(self.test_dir, 't0-sample-bgp-speaker.xml') self.sample_device_desc = os.path.join(self.test_dir, 'device.xml') self.port_config = os.path.join(self.test_dir, 't0-sample-port-config.ini') + self.port_config_autoneg = os.path.join(self.test_dir, 't0-sample-autoneg-port-config.ini') self.mlnx_port_config = os.path.join(self.test_dir, 'mellanox-sample-port-config.ini') self.output_file = os.path.join(self.test_dir, 'output') self.output2_file = os.path.join(self.test_dir, 'output2') @@ -330,7 +331,90 @@ def test_minigraph_port_fec_disabled(self): output = self.run_script(argument) self.assertEqual( utils.to_dict(output.strip()), - utils.to_dict("{'lanes': '25,26,27,28', 'description': 'Servers0:eth0', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'speed': '100000'}") + utils.to_dict("{'lanes': '25,26,27,28', 'description': 'Servers0:eth0', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'speed': '100000', 'autoneg': 'on'}") + ) + + def test_minigraph_port_autonegotiation(self): + # Test with a port_config.ini file which doesn't have an 'autoneg' column + argument = '-m "' + self.sample_graph_t0 + '" -p "' + self.port_config + '" -v "PORT"' + output = self.run_script(argument) + self.assertEqual( + utils.to_dict(output.strip()), + utils.to_dict( + "{'Ethernet0': {'alias': 'fortyGigE0/0', 'pfc_asym': 'off', 'lanes': '29,30,31,32', 'description': 'fortyGigE0/0', 'mtu': '9100'}, " + "'Ethernet4': {'lanes': '25,26,27,28', 'description': 'Servers0:eth0', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'autoneg': 'on', 'speed': '100000'}, " + "'Ethernet8': {'lanes': '37,38,39,40', 'description': 'fortyGigE0/8', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'autoneg': 'off'}, " + "'Ethernet12': {'lanes': '33,34,35,36', 'description': 'fortyGigE0/12', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/12', 'admin_status': 'up'}, " + "'Ethernet16': {'lanes': '41,42,43,44', 'description': 'fortyGigE0/16', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/16', 'admin_status': 'up'}, " + "'Ethernet20': {'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/20', 'admin_status': 'up'}, " + "'Ethernet24': {'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/24', 'admin_status': 'up'}, " + "'Ethernet28': {'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/28', 'admin_status': 'up'}, " + "'Ethernet32': {'lanes': '9,10,11,12', 'description': 'fortyGigE0/32', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/32', 'admin_status': 'up'}, " + "'Ethernet36': {'lanes': '13,14,15,16', 'description': 'fortyGigE0/36', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/36', 'admin_status': 'up'}, " + "'Ethernet40': {'lanes': '21,22,23,24', 'description': 'fortyGigE0/40', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/40', 'admin_status': 'up'}, " + "'Ethernet44': {'lanes': '17,18,19,20', 'description': 'fortyGigE0/44', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/44', 'admin_status': 'up'}, " + "'Ethernet48': {'lanes': '49,50,51,52', 'description': 'fortyGigE0/48', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/48', 'admin_status': 'up'}, " + "'Ethernet52': {'lanes': '53,54,55,56', 'description': 'fortyGigE0/52', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/52', 'admin_status': 'up'}, " + "'Ethernet56': {'lanes': '61,62,63,64', 'description': 'fortyGigE0/56', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/56', 'admin_status': 'up'}, " + "'Ethernet60': {'lanes': '57,58,59,60', 'description': 'fortyGigE0/60', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/60', 'admin_status': 'up'}, " + "'Ethernet64': {'lanes': '65,66,67,68', 'description': 'fortyGigE0/64', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/64', 'admin_status': 'up'}, " + "'Ethernet68': {'lanes': '69,70,71,72', 'description': 'fortyGigE0/68', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/68', 'admin_status': 'up'}, " + "'Ethernet72': {'lanes': '77,78,79,80', 'description': 'fortyGigE0/72', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/72', 'admin_status': 'up'}, " + "'Ethernet76': {'lanes': '73,74,75,76', 'description': 'fortyGigE0/76', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/76', 'admin_status': 'up'}, " + "'Ethernet80': {'lanes': '105,106,107,108', 'description': 'fortyGigE0/80', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/80', 'admin_status': 'up'}, " + "'Ethernet84': {'lanes': '109,110,111,112', 'description': 'fortyGigE0/84', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/84', 'admin_status': 'up'}, " + "'Ethernet88': {'lanes': '117,118,119,120', 'description': 'fortyGigE0/88', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/88', 'admin_status': 'up'}, " + "'Ethernet92': {'lanes': '113,114,115,116', 'description': 'fortyGigE0/92', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/92', 'admin_status': 'up'}, " + "'Ethernet96': {'lanes': '121,122,123,124', 'description': 'fortyGigE0/96', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/96', 'admin_status': 'up'}, " + "'Ethernet100': {'lanes': '125,126,127,128', 'description': 'Servers100:eth0', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/100', 'admin_status': 'up'}, " + "'Ethernet104': {'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'lanes': '85,86,87,88', 'description': 'fortyGigE0/104', 'mtu': '9100'}, " + "'Ethernet108': {'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'lanes': '81,82,83,84', 'description': 'fortyGigE0/108', 'mtu': '9100'}, " + "'Ethernet112': {'lanes': '89,90,91,92', 'description': 'ARISTA01T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/112', 'admin_status': 'up'}, " + "'Ethernet116': {'lanes': '93,94,95,96', 'description': 'ARISTA02T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/116', 'admin_status': 'up'}, " + "'Ethernet120': {'lanes': '97,98,99,100', 'description': 'ARISTA03T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/120', 'admin_status': 'up'}, " + "'Ethernet124': {'lanes': '101,102,103,104', 'fec': 'rs', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/124', 'admin_status': 'up', 'speed': '100000', 'description': 'ARISTA04T1:Ethernet1/1'}}" + ) + ) + + # Test with a port_config.ini file which has an 'autoneg' column + argument = '-m "' + self.sample_graph_t0 + '" -p "' + self.port_config_autoneg + '" -v "PORT"' + output = self.run_script(argument) + self.assertEqual( + utils.to_dict(output.strip()), + utils.to_dict( + "{'Ethernet0': {'lanes': '29,30,31,32', 'description': 'fortyGigE0/0', 'mtu': '9100', 'alias': 'fortyGigE0/0', 'pfc_asym': 'off', 'autoneg': 'off'}, " + "'Ethernet4': {'lanes': '25,26,27,28', 'description': 'Servers0:eth0', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'autoneg': 'on', 'speed': '100000'}, " + "'Ethernet8': {'lanes': '37,38,39,40', 'description': 'fortyGigE0/8', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'autoneg': 'off'}, " + "'Ethernet12': {'lanes': '33,34,35,36', 'description': 'fortyGigE0/12', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/12', 'admin_status': 'up', 'autoneg': 'off'}, " + "'Ethernet16': {'lanes': '41,42,43,44', 'description': 'fortyGigE0/16', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/16', 'admin_status': 'up', 'autoneg': 'off'}, " + "'Ethernet20': {'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/20', 'admin_status': 'up', 'autoneg': 'off'}, " + "'Ethernet24': {'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/24', 'admin_status': 'up', 'autoneg': 'off'}, " + "'Ethernet28': {'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/28', 'admin_status': 'up', 'autoneg': 'off'}, " + "'Ethernet32': {'lanes': '9,10,11,12', 'description': 'fortyGigE0/32', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/32', 'admin_status': 'up', 'autoneg': 'off'}, " + "'Ethernet36': {'lanes': '13,14,15,16', 'description': 'fortyGigE0/36', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/36', 'admin_status': 'up', 'autoneg': 'off'}, " + "'Ethernet40': {'lanes': '21,22,23,24', 'description': 'fortyGigE0/40', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/40', 'admin_status': 'up', 'autoneg': 'off'}, " + "'Ethernet44': {'lanes': '17,18,19,20', 'description': 'fortyGigE0/44', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/44', 'admin_status': 'up', 'autoneg': 'off'}, " + "'Ethernet48': {'lanes': '49,50,51,52', 'description': 'fortyGigE0/48', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/48', 'admin_status': 'up', 'autoneg': 'off'}, " + "'Ethernet52': {'lanes': '53,54,55,56', 'description': 'fortyGigE0/52', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/52', 'admin_status': 'up', 'autoneg': 'off'}, " + "'Ethernet56': {'lanes': '61,62,63,64', 'description': 'fortyGigE0/56', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/56', 'admin_status': 'up', 'autoneg': 'off'}, " + "'Ethernet60': {'lanes': '57,58,59,60', 'description': 'fortyGigE0/60', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/60', 'admin_status': 'up', 'autoneg': 'off'}, " + "'Ethernet64': {'lanes': '65,66,67,68', 'description': 'fortyGigE0/64', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/64', 'admin_status': 'up', 'autoneg': 'off'}, " + "'Ethernet68': {'lanes': '69,70,71,72', 'description': 'fortyGigE0/68', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/68', 'admin_status': 'up', 'autoneg': 'off'}, " + "'Ethernet72': {'lanes': '77,78,79,80', 'description': 'fortyGigE0/72', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/72', 'admin_status': 'up', 'autoneg': 'off'}, " + "'Ethernet76': {'lanes': '73,74,75,76', 'description': 'fortyGigE0/76', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/76', 'admin_status': 'up', 'autoneg': 'off'}, " + "'Ethernet80': {'lanes': '105,106,107,108', 'description': 'fortyGigE0/80', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/80', 'admin_status': 'up', 'autoneg': 'off'}, " + "'Ethernet84': {'lanes': '109,110,111,112', 'description': 'fortyGigE0/84', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/84', 'admin_status': 'up', 'autoneg': 'off'}, " + "'Ethernet88': {'lanes': '117,118,119,120', 'description': 'fortyGigE0/88', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/88', 'admin_status': 'up', 'autoneg': 'off'}, " + "'Ethernet92': {'lanes': '113,114,115,116', 'description': 'fortyGigE0/92', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/92', 'admin_status': 'up', 'autoneg': 'off'}, " + "'Ethernet96': {'lanes': '121,122,123,124', 'description': 'fortyGigE0/96', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/96', 'admin_status': 'up', 'autoneg': 'off'}, " + "'Ethernet100': {'lanes': '125,126,127,128', 'description': 'Servers100:eth0', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/100', 'admin_status': 'up', 'autoneg': 'off'}, " + "'Ethernet104': {'lanes': '85,86,87,88', 'description': 'fortyGigE0/104', 'mtu': '9100', 'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'autoneg': 'off'}, " + "'Ethernet108': {'lanes': '81,82,83,84', 'description': 'fortyGigE0/108', 'mtu': '9100', 'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'autoneg': 'off'}, " + "'Ethernet112': {'lanes': '89,90,91,92', 'description': 'ARISTA01T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/112', 'admin_status': 'up', 'autoneg': 'on'}, " + "'Ethernet116': {'lanes': '93,94,95,96', 'description': 'ARISTA02T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/116', 'admin_status': 'up', 'autoneg': 'on'}, " + "'Ethernet120': {'lanes': '97,98,99,100', 'description': 'ARISTA03T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/120', 'admin_status': 'up', 'autoneg': 'on'}, " + "'Ethernet124': {'lanes': '101,102,103,104', 'fec': 'rs', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/124', 'admin_status': 'up', 'autoneg': 'on', 'speed': '100000', 'description': 'ARISTA04T1:Ethernet1/1'}}" + ) ) def test_minigraph_port_rs(self): @@ -383,38 +467,38 @@ def test_minigraph_neighbor_interfaces(self): self.assertEqual( utils.to_dict(output.strip()), utils.to_dict( - "{'Ethernet8': {'lanes': '37,38,39,40', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'speed': '40000', 'mux_cable': 'true'}, " - "'Ethernet0': {'lanes': '29,30,31,32', 'description': 'switch-01t1:port1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/0', 'admin_status': 'up', 'speed': '10000'}, " - "'Ethernet4': {'lanes': '25,26,27,28', 'description': 'server1:port1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'speed': '25000', 'mux_cable': 'true'}, " - "'Ethernet108': {'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'lanes': '81,82,83,84', 'description': 'fortyGigE0/108', 'mtu': '9100'}, " - "'Ethernet100': {'alias': 'fortyGigE0/100', 'pfc_asym': 'off', 'lanes': '125,126,127,128', 'description': 'fortyGigE0/100', 'mtu': '9100'}, " - "'Ethernet104': {'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'lanes': '85,86,87,88', 'description': 'fortyGigE0/104', 'mtu': '9100'}, " - "'Ethernet68': {'alias': 'fortyGigE0/68', 'pfc_asym': 'off', 'lanes': '69,70,71,72', 'description': 'fortyGigE0/68', 'mtu': '9100'}, " - "'Ethernet96': {'alias': 'fortyGigE0/96', 'pfc_asym': 'off', 'lanes': '121,122,123,124', 'description': 'fortyGigE0/96', 'mtu': '9100'}, " - "'Ethernet124': {'alias': 'fortyGigE0/124', 'pfc_asym': 'off', 'lanes': '101,102,103,104', 'description': 'fortyGigE0/124', 'mtu': '9100'}, " - "'Ethernet92': {'alias': 'fortyGigE0/92', 'pfc_asym': 'off', 'lanes': '113,114,115,116', 'description': 'fortyGigE0/92', 'mtu': '9100'}, " - "'Ethernet120': {'alias': 'fortyGigE0/120', 'pfc_asym': 'off', 'lanes': '97,98,99,100', 'description': 'fortyGigE0/120', 'mtu': '9100'}, " + "{'Ethernet0': {'lanes': '29,30,31,32', 'description': 'switch-01t1:port1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/0', 'admin_status': 'up', 'speed': '10000', 'autoneg': 'on'}, " + "'Ethernet4': {'lanes': '25,26,27,28', 'description': 'server1:port1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'speed': '25000', 'autoneg': 'on', 'mux_cable': 'true'}, " + "'Ethernet8': {'lanes': '37,38,39,40', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'speed': '40000', 'autoneg': 'on', 'mux_cable': 'true'}, " + "'Ethernet12': {'lanes': '33,34,35,36', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/12', 'admin_status': 'up', 'speed': '10000', 'autoneg': 'on'}, " + "'Ethernet16': {'alias': 'fortyGigE0/16', 'pfc_asym': 'off', 'lanes': '41,42,43,44', 'description': 'fortyGigE0/16', 'mtu': '9100'}, " + "'Ethernet20': {'alias': 'fortyGigE0/20', 'pfc_asym': 'off', 'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'mtu': '9100'}, " + "'Ethernet24': {'alias': 'fortyGigE0/24', 'pfc_asym': 'off', 'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'mtu': '9100'}, " + "'Ethernet28': {'alias': 'fortyGigE0/28', 'pfc_asym': 'off', 'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'mtu': '9100'}, " + "'Ethernet32': {'alias': 'fortyGigE0/32', 'pfc_asym': 'off', 'lanes': '9,10,11,12', 'description': 'fortyGigE0/32', 'mtu': '9100'}, " + "'Ethernet36': {'alias': 'fortyGigE0/36', 'pfc_asym': 'off', 'lanes': '13,14,15,16', 'description': 'fortyGigE0/36', 'mtu': '9100'}, " + "'Ethernet40': {'alias': 'fortyGigE0/40', 'pfc_asym': 'off', 'lanes': '21,22,23,24', 'description': 'fortyGigE0/40', 'mtu': '9100'}, " + "'Ethernet44': {'alias': 'fortyGigE0/44', 'pfc_asym': 'off', 'lanes': '17,18,19,20', 'description': 'fortyGigE0/44', 'mtu': '9100'}, " + "'Ethernet48': {'alias': 'fortyGigE0/48', 'pfc_asym': 'off', 'lanes': '49,50,51,52', 'description': 'fortyGigE0/48', 'mtu': '9100'}, " "'Ethernet52': {'alias': 'fortyGigE0/52', 'pfc_asym': 'off', 'lanes': '53,54,55,56', 'description': 'fortyGigE0/52', 'mtu': '9100'}, " "'Ethernet56': {'alias': 'fortyGigE0/56', 'pfc_asym': 'off', 'lanes': '61,62,63,64', 'description': 'fortyGigE0/56', 'mtu': '9100'}, " - "'Ethernet76': {'alias': 'fortyGigE0/76', 'pfc_asym': 'off', 'lanes': '73,74,75,76', 'description': 'fortyGigE0/76', 'mtu': '9100'}, " - "'Ethernet72': {'alias': 'fortyGigE0/72', 'pfc_asym': 'off', 'lanes': '77,78,79,80', 'description': 'fortyGigE0/72', 'mtu': '9100'}, " + "'Ethernet60': {'alias': 'fortyGigE0/60', 'pfc_asym': 'off', 'lanes': '57,58,59,60', 'description': 'fortyGigE0/60', 'mtu': '9100'}, " "'Ethernet64': {'alias': 'fortyGigE0/64', 'pfc_asym': 'off', 'lanes': '65,66,67,68', 'description': 'fortyGigE0/64', 'mtu': '9100'}, " - "'Ethernet32': {'alias': 'fortyGigE0/32', 'pfc_asym': 'off', 'lanes': '9,10,11,12', 'description': 'fortyGigE0/32', 'mtu': '9100'}, " - "'Ethernet16': {'alias': 'fortyGigE0/16', 'pfc_asym': 'off', 'lanes': '41,42,43,44', 'description': 'fortyGigE0/16', 'mtu': '9100'}, " - "'Ethernet36': {'alias': 'fortyGigE0/36', 'pfc_asym': 'off', 'lanes': '13,14,15,16', 'description': 'fortyGigE0/36', 'mtu': '9100'}, " - "'Ethernet12': {'lanes': '33,34,35,36', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/12', 'admin_status': 'up', 'speed': '10000'}, " - "'Ethernet88': {'alias': 'fortyGigE0/88', 'pfc_asym': 'off', 'lanes': '117,118,119,120', 'description': 'fortyGigE0/88', 'mtu': '9100'}, " - "'Ethernet116': {'alias': 'fortyGigE0/116', 'pfc_asym': 'off', 'lanes': '93,94,95,96', 'description': 'fortyGigE0/116', 'mtu': '9100'}, " + "'Ethernet68': {'alias': 'fortyGigE0/68', 'pfc_asym': 'off', 'lanes': '69,70,71,72', 'description': 'fortyGigE0/68', 'mtu': '9100'}, " + "'Ethernet72': {'alias': 'fortyGigE0/72', 'pfc_asym': 'off', 'lanes': '77,78,79,80', 'description': 'fortyGigE0/72', 'mtu': '9100'}, " + "'Ethernet76': {'alias': 'fortyGigE0/76', 'pfc_asym': 'off', 'lanes': '73,74,75,76', 'description': 'fortyGigE0/76', 'mtu': '9100'}, " "'Ethernet80': {'alias': 'fortyGigE0/80', 'pfc_asym': 'off', 'lanes': '105,106,107,108', 'description': 'fortyGigE0/80', 'mtu': '9100'}, " - "'Ethernet112': {'alias': 'fortyGigE0/112', 'pfc_asym': 'off', 'lanes': '89,90,91,92', 'description': 'fortyGigE0/112', 'mtu': '9100'}, " "'Ethernet84': {'alias': 'fortyGigE0/84', 'pfc_asym': 'off', 'lanes': '109,110,111,112', 'description': 'fortyGigE0/84', 'mtu': '9100'}, " - "'Ethernet48': {'alias': 'fortyGigE0/48', 'pfc_asym': 'off', 'lanes': '49,50,51,52', 'description': 'fortyGigE0/48', 'mtu': '9100'}, " - "'Ethernet44': {'alias': 'fortyGigE0/44', 'pfc_asym': 'off', 'lanes': '17,18,19,20', 'description': 'fortyGigE0/44', 'mtu': '9100'}, " - "'Ethernet40': {'alias': 'fortyGigE0/40', 'pfc_asym': 'off', 'lanes': '21,22,23,24', 'description': 'fortyGigE0/40', 'mtu': '9100'}, " - "'Ethernet28': {'alias': 'fortyGigE0/28', 'pfc_asym': 'off', 'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'mtu': '9100'}, " - "'Ethernet60': {'alias': 'fortyGigE0/60', 'pfc_asym': 'off', 'lanes': '57,58,59,60', 'description': 'fortyGigE0/60', 'mtu': '9100'}, " - "'Ethernet20': {'alias': 'fortyGigE0/20', 'pfc_asym': 'off', 'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'mtu': '9100'}, " - "'Ethernet24': {'alias': 'fortyGigE0/24', 'pfc_asym': 'off', 'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'mtu': '9100'}}" + "'Ethernet88': {'alias': 'fortyGigE0/88', 'pfc_asym': 'off', 'lanes': '117,118,119,120', 'description': 'fortyGigE0/88', 'mtu': '9100'}, " + "'Ethernet92': {'alias': 'fortyGigE0/92', 'pfc_asym': 'off', 'lanes': '113,114,115,116', 'description': 'fortyGigE0/92', 'mtu': '9100'}, " + "'Ethernet96': {'alias': 'fortyGigE0/96', 'pfc_asym': 'off', 'lanes': '121,122,123,124', 'description': 'fortyGigE0/96', 'mtu': '9100'}, " + "'Ethernet100': {'alias': 'fortyGigE0/100', 'pfc_asym': 'off', 'lanes': '125,126,127,128', 'description': 'fortyGigE0/100', 'mtu': '9100'}, " + "'Ethernet104': {'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'lanes': '85,86,87,88', 'description': 'fortyGigE0/104', 'mtu': '9100'}, " + "'Ethernet108': {'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'lanes': '81,82,83,84', 'description': 'fortyGigE0/108', 'mtu': '9100'}, " + "'Ethernet112': {'alias': 'fortyGigE0/112', 'pfc_asym': 'off', 'lanes': '89,90,91,92', 'description': 'fortyGigE0/112', 'mtu': '9100'}, " + "'Ethernet116': {'alias': 'fortyGigE0/116', 'pfc_asym': 'off', 'lanes': '93,94,95,96', 'description': 'fortyGigE0/116', 'mtu': '9100'}, " + "'Ethernet120': {'alias': 'fortyGigE0/120', 'pfc_asym': 'off', 'lanes': '97,98,99,100', 'description': 'fortyGigE0/120', 'mtu': '9100'}, " + "'Ethernet124': {'alias': 'fortyGigE0/124', 'pfc_asym': 'off', 'lanes': '101,102,103,104', 'description': 'fortyGigE0/124', 'mtu': '9100'}}" ) ) @@ -425,38 +509,38 @@ def test_minigraph_extra_ethernet_interfaces(self): self.assertEqual( utils.to_dict(output.strip()), utils.to_dict( - "{'Ethernet8': {'lanes': '37,38,39,40', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'speed': '1000'}, " - "'Ethernet0': {'lanes': '29,30,31,32', 'description': 'fortyGigE0/0', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/0', 'admin_status': 'up', 'speed': '10000'}, " + "{'Ethernet0': {'lanes': '29,30,31,32', 'description': 'fortyGigE0/0', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/0', 'admin_status': 'up', 'speed': '10000'}, " "'Ethernet4': {'lanes': '25,26,27,28', 'description': 'fortyGigE0/4', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'speed': '25000'}, " - "'Ethernet108': {'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'lanes': '81,82,83,84', 'description': 'fortyGigE0/108', 'mtu': '9100'}, " - "'Ethernet100': {'alias': 'fortyGigE0/100', 'pfc_asym': 'off', 'lanes': '125,126,127,128', 'description': 'fortyGigE0/100', 'mtu': '9100'}, " - "'Ethernet104': {'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'lanes': '85,86,87,88', 'description': 'fortyGigE0/104', 'mtu': '9100'}, " - "'Ethernet68': {'alias': 'fortyGigE0/68', 'pfc_asym': 'off', 'lanes': '69,70,71,72', 'description': 'fortyGigE0/68', 'mtu': '9100'}, " - "'Ethernet96': {'alias': 'fortyGigE0/96', 'pfc_asym': 'off', 'lanes': '121,122,123,124', 'description': 'fortyGigE0/96', 'mtu': '9100'}, " - "'Ethernet124': {'alias': 'fortyGigE0/124', 'pfc_asym': 'off', 'lanes': '101,102,103,104', 'description': 'fortyGigE0/124', 'mtu': '9100'}, " - "'Ethernet92': {'alias': 'fortyGigE0/92', 'pfc_asym': 'off', 'lanes': '113,114,115,116', 'description': 'fortyGigE0/92', 'mtu': '9100'}, " - "'Ethernet120': {'alias': 'fortyGigE0/120', 'pfc_asym': 'off', 'lanes': '97,98,99,100', 'description': 'fortyGigE0/120', 'mtu': '9100'}, " + "'Ethernet8': {'lanes': '37,38,39,40', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'speed': '1000'}, " + "'Ethernet12': {'lanes': '33,34,35,36', 'fec': 'rs', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/12', 'admin_status': 'up', 'speed': '100000', 'description': 'Interface description'}, " + "'Ethernet16': {'alias': 'fortyGigE0/16', 'pfc_asym': 'off', 'lanes': '41,42,43,44', 'description': 'fortyGigE0/16', 'mtu': '9100'}, " + "'Ethernet20': {'alias': 'fortyGigE0/20', 'pfc_asym': 'off', 'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'mtu': '9100'}, " + "'Ethernet24': {'alias': 'fortyGigE0/24', 'pfc_asym': 'off', 'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'mtu': '9100'}, " + "'Ethernet28': {'alias': 'fortyGigE0/28', 'pfc_asym': 'off', 'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'mtu': '9100'}, " + "'Ethernet32': {'alias': 'fortyGigE0/32', 'pfc_asym': 'off', 'lanes': '9,10,11,12', 'description': 'fortyGigE0/32', 'mtu': '9100'}, " + "'Ethernet36': {'alias': 'fortyGigE0/36', 'pfc_asym': 'off', 'lanes': '13,14,15,16', 'description': 'fortyGigE0/36', 'mtu': '9100'}, " + "'Ethernet40': {'alias': 'fortyGigE0/40', 'pfc_asym': 'off', 'lanes': '21,22,23,24', 'description': 'fortyGigE0/40', 'mtu': '9100'}, " + "'Ethernet44': {'alias': 'fortyGigE0/44', 'pfc_asym': 'off', 'lanes': '17,18,19,20', 'description': 'fortyGigE0/44', 'mtu': '9100'}, " + "'Ethernet48': {'alias': 'fortyGigE0/48', 'pfc_asym': 'off', 'lanes': '49,50,51,52', 'description': 'fortyGigE0/48', 'mtu': '9100'}, " "'Ethernet52': {'alias': 'fortyGigE0/52', 'pfc_asym': 'off', 'lanes': '53,54,55,56', 'description': 'fortyGigE0/52', 'mtu': '9100'}, " "'Ethernet56': {'alias': 'fortyGigE0/56', 'pfc_asym': 'off', 'lanes': '61,62,63,64', 'description': 'fortyGigE0/56', 'mtu': '9100'}, " - "'Ethernet76': {'alias': 'fortyGigE0/76', 'pfc_asym': 'off', 'lanes': '73,74,75,76', 'description': 'fortyGigE0/76', 'mtu': '9100'}, " - "'Ethernet72': {'alias': 'fortyGigE0/72', 'pfc_asym': 'off', 'lanes': '77,78,79,80', 'description': 'fortyGigE0/72', 'mtu': '9100'}, " + "'Ethernet60': {'alias': 'fortyGigE0/60', 'pfc_asym': 'off', 'lanes': '57,58,59,60', 'description': 'fortyGigE0/60', 'mtu': '9100'}, " "'Ethernet64': {'alias': 'fortyGigE0/64', 'pfc_asym': 'off', 'lanes': '65,66,67,68', 'description': 'fortyGigE0/64', 'mtu': '9100'}, " - "'Ethernet32': {'alias': 'fortyGigE0/32', 'pfc_asym': 'off', 'lanes': '9,10,11,12', 'description': 'fortyGigE0/32', 'mtu': '9100'}, " - "'Ethernet16': {'alias': 'fortyGigE0/16', 'pfc_asym': 'off', 'lanes': '41,42,43,44', 'description': 'fortyGigE0/16', 'mtu': '9100'}, " - "'Ethernet36': {'alias': 'fortyGigE0/36', 'pfc_asym': 'off', 'lanes': '13,14,15,16', 'description': 'fortyGigE0/36', 'mtu': '9100'}, " - "'Ethernet12': {'lanes': '33,34,35,36', 'fec': 'rs', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/12', 'admin_status': 'up', 'speed': '100000', 'description': 'Interface description'}, " - "'Ethernet88': {'alias': 'fortyGigE0/88', 'pfc_asym': 'off', 'lanes': '117,118,119,120', 'description': 'fortyGigE0/88', 'mtu': '9100'}, " - "'Ethernet116': {'alias': 'fortyGigE0/116', 'pfc_asym': 'off', 'lanes': '93,94,95,96', 'description': 'fortyGigE0/116', 'mtu': '9100'}, " + "'Ethernet68': {'alias': 'fortyGigE0/68', 'pfc_asym': 'off', 'lanes': '69,70,71,72', 'description': 'fortyGigE0/68', 'mtu': '9100'}, " + "'Ethernet72': {'alias': 'fortyGigE0/72', 'pfc_asym': 'off', 'lanes': '77,78,79,80', 'description': 'fortyGigE0/72', 'mtu': '9100'}, " + "'Ethernet76': {'alias': 'fortyGigE0/76', 'pfc_asym': 'off', 'lanes': '73,74,75,76', 'description': 'fortyGigE0/76', 'mtu': '9100'}, " "'Ethernet80': {'alias': 'fortyGigE0/80', 'pfc_asym': 'off', 'lanes': '105,106,107,108', 'description': 'fortyGigE0/80', 'mtu': '9100'}, " - "'Ethernet112': {'alias': 'fortyGigE0/112', 'pfc_asym': 'off', 'lanes': '89,90,91,92', 'description': 'fortyGigE0/112', 'mtu': '9100'}, " "'Ethernet84': {'alias': 'fortyGigE0/84', 'pfc_asym': 'off', 'lanes': '109,110,111,112', 'description': 'fortyGigE0/84', 'mtu': '9100'}, " - "'Ethernet48': {'alias': 'fortyGigE0/48', 'pfc_asym': 'off', 'lanes': '49,50,51,52', 'description': 'fortyGigE0/48', 'mtu': '9100'}, " - "'Ethernet44': {'alias': 'fortyGigE0/44', 'pfc_asym': 'off', 'lanes': '17,18,19,20', 'description': 'fortyGigE0/44', 'mtu': '9100'}, " - "'Ethernet40': {'alias': 'fortyGigE0/40', 'pfc_asym': 'off', 'lanes': '21,22,23,24', 'description': 'fortyGigE0/40', 'mtu': '9100'}, " - "'Ethernet28': {'alias': 'fortyGigE0/28', 'pfc_asym': 'off', 'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'mtu': '9100'}, " - "'Ethernet60': {'alias': 'fortyGigE0/60', 'pfc_asym': 'off', 'lanes': '57,58,59,60', 'description': 'fortyGigE0/60', 'mtu': '9100'}, " - "'Ethernet20': {'alias': 'fortyGigE0/20', 'pfc_asym': 'off', 'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'mtu': '9100'}, " - "'Ethernet24': {'alias': 'fortyGigE0/24', 'pfc_asym': 'off', 'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'mtu': '9100'}}" + "'Ethernet88': {'alias': 'fortyGigE0/88', 'pfc_asym': 'off', 'lanes': '117,118,119,120', 'description': 'fortyGigE0/88', 'mtu': '9100'}, " + "'Ethernet92': {'alias': 'fortyGigE0/92', 'pfc_asym': 'off', 'lanes': '113,114,115,116', 'description': 'fortyGigE0/92', 'mtu': '9100'}, " + "'Ethernet96': {'alias': 'fortyGigE0/96', 'pfc_asym': 'off', 'lanes': '121,122,123,124', 'description': 'fortyGigE0/96', 'mtu': '9100'}, " + "'Ethernet100': {'alias': 'fortyGigE0/100', 'pfc_asym': 'off', 'lanes': '125,126,127,128', 'description': 'fortyGigE0/100', 'mtu': '9100'}, " + "'Ethernet104': {'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'lanes': '85,86,87,88', 'description': 'fortyGigE0/104', 'mtu': '9100'}, " + "'Ethernet108': {'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'lanes': '81,82,83,84', 'description': 'fortyGigE0/108', 'mtu': '9100'}, " + "'Ethernet112': {'alias': 'fortyGigE0/112', 'pfc_asym': 'off', 'lanes': '89,90,91,92', 'description': 'fortyGigE0/112', 'mtu': '9100'}, " + "'Ethernet116': {'alias': 'fortyGigE0/116', 'pfc_asym': 'off', 'lanes': '93,94,95,96', 'description': 'fortyGigE0/116', 'mtu': '9100'}, " + "'Ethernet120': {'alias': 'fortyGigE0/120', 'pfc_asym': 'off', 'lanes': '97,98,99,100', 'description': 'fortyGigE0/120', 'mtu': '9100'}, " + "'Ethernet124': {'alias': 'fortyGigE0/124', 'pfc_asym': 'off', 'lanes': '101,102,103,104', 'description': 'fortyGigE0/124', 'mtu': '9100'}}" ) ) diff --git a/src/sonic-config-engine/tests/test_multinpu_cfggen.py b/src/sonic-config-engine/tests/test_multinpu_cfggen.py index 83955925c9e5..81bad1f66183 100644 --- a/src/sonic-config-engine/tests/test_multinpu_cfggen.py +++ b/src/sonic-config-engine/tests/test_multinpu_cfggen.py @@ -176,15 +176,15 @@ def test_backend_asic_portchannel_intf(self): def test_frontend_asic_ports(self): argument = "-m {} -p {} -n asic0 --var-json \"PORT\"".format(self.sample_graph, self.port_config[0]) 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", "pfc_asym": "off", "role": "Ext", "speed": "40000" }, - "Ethernet4": { "admin_status": "up", "alias": "Ethernet1/2", "asic_port_name": "Eth1-ASIC0", "description": "01T2:Ethernet2", "index": "1", "lanes": "29,30,31,32", "mtu": "9100", "pfc_asym": "off", "role": "Ext", "speed": "40000" }, - "Ethernet8": { "alias": "Ethernet1/3", "asic_port_name": "Eth2-ASIC0", "description": "Ethernet1/3", "index": "2", "lanes": "41,42,43,44", "mtu": "9100", "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", "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", "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", "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", "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", "pfc_asym": "off", "role": "Int", "speed": "40000" }}) + 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", "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", "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", "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", "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", "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", "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", "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", "pfc_asym": "off", "role": "Int", "speed": "40000" }}) def test_frontend_asic_device_neigh(self): argument = "-m {} -p {} -n asic0 --var-json \"DEVICE_NEIGHBOR\"".format(self.sample_graph, self.port_config[0]) From b2460b27628f9a285f8089e4e0bc6f5740a5aec5 Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Sat, 27 Mar 2021 03:39:06 +0000 Subject: [PATCH 2/2] autoneg values are still '0'/'1' in 202012, not 'off'/'on' --- src/sonic-config-engine/minigraph.py | 2 +- .../tests/t0-sample-autoneg-port-config.ini | 64 +++++++-------- src/sonic-config-engine/tests/test_cfggen.py | 78 +++++++++---------- .../tests/test_multinpu_cfggen.py | 4 +- 4 files changed, 74 insertions(+), 74 deletions(-) diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 0b99ad07f32b..eb6a11237e92 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -1326,7 +1326,7 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw # If AutoNegotiation is available in the minigraph, we override any value we may have received from port_config.ini autoneg = linkmetas.get(alias, {}).get('AutoNegotiation') if autoneg: - port['autoneg'] = 'on' if autoneg.lower() == 'true' else 'off' + port['autoneg'] = '1' if autoneg.lower() == 'true' else '0' # If connected to a smart cable, get the connection position for port_name, port in ports.items(): diff --git a/src/sonic-config-engine/tests/t0-sample-autoneg-port-config.ini b/src/sonic-config-engine/tests/t0-sample-autoneg-port-config.ini index 91e2283eb4a6..91555c6e111e 100644 --- a/src/sonic-config-engine/tests/t0-sample-autoneg-port-config.ini +++ b/src/sonic-config-engine/tests/t0-sample-autoneg-port-config.ini @@ -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 +Ethernet0 29,30,31,32 fortyGigE0/0 0 +Ethernet4 25,26,27,28 fortyGigE0/4 0 +Ethernet8 37,38,39,40 fortyGigE0/8 0 +Ethernet12 33,34,35,36 fortyGigE0/12 0 +Ethernet16 41,42,43,44 fortyGigE0/16 0 +Ethernet20 45,46,47,48 fortyGigE0/20 0 +Ethernet24 5,6,7,8 fortyGigE0/24 0 +Ethernet28 1,2,3,4 fortyGigE0/28 0 +Ethernet32 9,10,11,12 fortyGigE0/32 0 +Ethernet36 13,14,15,16 fortyGigE0/36 0 +Ethernet40 21,22,23,24 fortyGigE0/40 0 +Ethernet44 17,18,19,20 fortyGigE0/44 0 +Ethernet48 49,50,51,52 fortyGigE0/48 0 +Ethernet52 53,54,55,56 fortyGigE0/52 0 +Ethernet56 61,62,63,64 fortyGigE0/56 0 +Ethernet60 57,58,59,60 fortyGigE0/60 0 +Ethernet64 65,66,67,68 fortyGigE0/64 0 +Ethernet68 69,70,71,72 fortyGigE0/68 0 +Ethernet72 77,78,79,80 fortyGigE0/72 0 +Ethernet76 73,74,75,76 fortyGigE0/76 0 +Ethernet80 105,106,107,108 fortyGigE0/80 0 +Ethernet84 109,110,111,112 fortyGigE0/84 0 +Ethernet88 117,118,119,120 fortyGigE0/88 0 +Ethernet92 113,114,115,116 fortyGigE0/92 0 +Ethernet96 121,122,123,124 fortyGigE0/96 0 +Ethernet100 125,126,127,128 fortyGigE0/100 0 +Ethernet104 85,86,87,88 fortyGigE0/104 0 +Ethernet108 81,82,83,84 fortyGigE0/108 0 +Ethernet112 89,90,91,92 fortyGigE0/112 1 +Ethernet116 93,94,95,96 fortyGigE0/116 1 +Ethernet120 97,98,99,100 fortyGigE0/120 1 +Ethernet124 101,102,103,104 fortyGigE0/124 1 diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index 6934ede7f114..c81d56a4fabf 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -331,7 +331,7 @@ def test_minigraph_port_fec_disabled(self): output = self.run_script(argument) self.assertEqual( utils.to_dict(output.strip()), - utils.to_dict("{'lanes': '25,26,27,28', 'description': 'Servers0:eth0', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'speed': '100000', 'autoneg': 'on'}") + utils.to_dict("{'lanes': '25,26,27,28', 'description': 'Servers0:eth0', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'speed': '100000', 'autoneg': '1'}") ) def test_minigraph_port_autonegotiation(self): @@ -342,8 +342,8 @@ def test_minigraph_port_autonegotiation(self): utils.to_dict(output.strip()), utils.to_dict( "{'Ethernet0': {'alias': 'fortyGigE0/0', 'pfc_asym': 'off', 'lanes': '29,30,31,32', 'description': 'fortyGigE0/0', 'mtu': '9100'}, " - "'Ethernet4': {'lanes': '25,26,27,28', 'description': 'Servers0:eth0', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'autoneg': 'on', 'speed': '100000'}, " - "'Ethernet8': {'lanes': '37,38,39,40', 'description': 'fortyGigE0/8', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'autoneg': 'off'}, " + "'Ethernet4': {'lanes': '25,26,27,28', 'description': 'Servers0:eth0', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'autoneg': '1', 'speed': '100000'}, " + "'Ethernet8': {'lanes': '37,38,39,40', 'description': 'fortyGigE0/8', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'autoneg': '0'}, " "'Ethernet12': {'lanes': '33,34,35,36', 'description': 'fortyGigE0/12', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/12', 'admin_status': 'up'}, " "'Ethernet16': {'lanes': '41,42,43,44', 'description': 'fortyGigE0/16', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/16', 'admin_status': 'up'}, " "'Ethernet20': {'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/20', 'admin_status': 'up'}, " @@ -382,38 +382,38 @@ def test_minigraph_port_autonegotiation(self): self.assertEqual( utils.to_dict(output.strip()), utils.to_dict( - "{'Ethernet0': {'lanes': '29,30,31,32', 'description': 'fortyGigE0/0', 'mtu': '9100', 'alias': 'fortyGigE0/0', 'pfc_asym': 'off', 'autoneg': 'off'}, " - "'Ethernet4': {'lanes': '25,26,27,28', 'description': 'Servers0:eth0', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'autoneg': 'on', 'speed': '100000'}, " - "'Ethernet8': {'lanes': '37,38,39,40', 'description': 'fortyGigE0/8', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet12': {'lanes': '33,34,35,36', 'description': 'fortyGigE0/12', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/12', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet16': {'lanes': '41,42,43,44', 'description': 'fortyGigE0/16', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/16', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet20': {'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/20', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet24': {'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/24', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet28': {'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/28', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet32': {'lanes': '9,10,11,12', 'description': 'fortyGigE0/32', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/32', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet36': {'lanes': '13,14,15,16', 'description': 'fortyGigE0/36', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/36', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet40': {'lanes': '21,22,23,24', 'description': 'fortyGigE0/40', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/40', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet44': {'lanes': '17,18,19,20', 'description': 'fortyGigE0/44', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/44', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet48': {'lanes': '49,50,51,52', 'description': 'fortyGigE0/48', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/48', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet52': {'lanes': '53,54,55,56', 'description': 'fortyGigE0/52', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/52', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet56': {'lanes': '61,62,63,64', 'description': 'fortyGigE0/56', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/56', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet60': {'lanes': '57,58,59,60', 'description': 'fortyGigE0/60', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/60', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet64': {'lanes': '65,66,67,68', 'description': 'fortyGigE0/64', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/64', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet68': {'lanes': '69,70,71,72', 'description': 'fortyGigE0/68', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/68', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet72': {'lanes': '77,78,79,80', 'description': 'fortyGigE0/72', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/72', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet76': {'lanes': '73,74,75,76', 'description': 'fortyGigE0/76', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/76', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet80': {'lanes': '105,106,107,108', 'description': 'fortyGigE0/80', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/80', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet84': {'lanes': '109,110,111,112', 'description': 'fortyGigE0/84', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/84', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet88': {'lanes': '117,118,119,120', 'description': 'fortyGigE0/88', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/88', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet92': {'lanes': '113,114,115,116', 'description': 'fortyGigE0/92', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/92', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet96': {'lanes': '121,122,123,124', 'description': 'fortyGigE0/96', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/96', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet100': {'lanes': '125,126,127,128', 'description': 'Servers100:eth0', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/100', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet104': {'lanes': '85,86,87,88', 'description': 'fortyGigE0/104', 'mtu': '9100', 'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'autoneg': 'off'}, " - "'Ethernet108': {'lanes': '81,82,83,84', 'description': 'fortyGigE0/108', 'mtu': '9100', 'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'autoneg': 'off'}, " - "'Ethernet112': {'lanes': '89,90,91,92', 'description': 'ARISTA01T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/112', 'admin_status': 'up', 'autoneg': 'on'}, " - "'Ethernet116': {'lanes': '93,94,95,96', 'description': 'ARISTA02T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/116', 'admin_status': 'up', 'autoneg': 'on'}, " - "'Ethernet120': {'lanes': '97,98,99,100', 'description': 'ARISTA03T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/120', 'admin_status': 'up', 'autoneg': 'on'}, " - "'Ethernet124': {'lanes': '101,102,103,104', 'fec': 'rs', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/124', 'admin_status': 'up', 'autoneg': 'on', 'speed': '100000', 'description': 'ARISTA04T1:Ethernet1/1'}}" + "{'Ethernet0': {'lanes': '29,30,31,32', 'description': 'fortyGigE0/0', 'mtu': '9100', 'alias': 'fortyGigE0/0', 'pfc_asym': 'off', 'autoneg': '0'}, " + "'Ethernet4': {'lanes': '25,26,27,28', 'description': 'Servers0:eth0', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'autoneg': '1', 'speed': '100000'}, " + "'Ethernet8': {'lanes': '37,38,39,40', 'description': 'fortyGigE0/8', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet12': {'lanes': '33,34,35,36', 'description': 'fortyGigE0/12', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/12', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet16': {'lanes': '41,42,43,44', 'description': 'fortyGigE0/16', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/16', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet20': {'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/20', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet24': {'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/24', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet28': {'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/28', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet32': {'lanes': '9,10,11,12', 'description': 'fortyGigE0/32', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/32', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet36': {'lanes': '13,14,15,16', 'description': 'fortyGigE0/36', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/36', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet40': {'lanes': '21,22,23,24', 'description': 'fortyGigE0/40', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/40', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet44': {'lanes': '17,18,19,20', 'description': 'fortyGigE0/44', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/44', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet48': {'lanes': '49,50,51,52', 'description': 'fortyGigE0/48', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/48', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet52': {'lanes': '53,54,55,56', 'description': 'fortyGigE0/52', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/52', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet56': {'lanes': '61,62,63,64', 'description': 'fortyGigE0/56', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/56', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet60': {'lanes': '57,58,59,60', 'description': 'fortyGigE0/60', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/60', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet64': {'lanes': '65,66,67,68', 'description': 'fortyGigE0/64', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/64', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet68': {'lanes': '69,70,71,72', 'description': 'fortyGigE0/68', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/68', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet72': {'lanes': '77,78,79,80', 'description': 'fortyGigE0/72', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/72', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet76': {'lanes': '73,74,75,76', 'description': 'fortyGigE0/76', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/76', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet80': {'lanes': '105,106,107,108', 'description': 'fortyGigE0/80', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/80', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet84': {'lanes': '109,110,111,112', 'description': 'fortyGigE0/84', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/84', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet88': {'lanes': '117,118,119,120', 'description': 'fortyGigE0/88', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/88', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet92': {'lanes': '113,114,115,116', 'description': 'fortyGigE0/92', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/92', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet96': {'lanes': '121,122,123,124', 'description': 'fortyGigE0/96', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/96', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet100': {'lanes': '125,126,127,128', 'description': 'Servers100:eth0', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/100', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet104': {'lanes': '85,86,87,88', 'description': 'fortyGigE0/104', 'mtu': '9100', 'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'autoneg': '0'}, " + "'Ethernet108': {'lanes': '81,82,83,84', 'description': 'fortyGigE0/108', 'mtu': '9100', 'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'autoneg': '0'}, " + "'Ethernet112': {'lanes': '89,90,91,92', 'description': 'ARISTA01T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/112', 'admin_status': 'up', 'autoneg': '1'}, " + "'Ethernet116': {'lanes': '93,94,95,96', 'description': 'ARISTA02T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/116', 'admin_status': 'up', 'autoneg': '1'}, " + "'Ethernet120': {'lanes': '97,98,99,100', 'description': 'ARISTA03T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/120', 'admin_status': 'up', 'autoneg': '1'}, " + "'Ethernet124': {'lanes': '101,102,103,104', 'fec': 'rs', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/124', 'admin_status': 'up', 'autoneg': '1', 'speed': '100000', 'description': 'ARISTA04T1:Ethernet1/1'}}" ) ) @@ -467,10 +467,10 @@ def test_minigraph_neighbor_interfaces(self): self.assertEqual( utils.to_dict(output.strip()), utils.to_dict( - "{'Ethernet0': {'lanes': '29,30,31,32', 'description': 'switch-01t1:port1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/0', 'admin_status': 'up', 'speed': '10000', 'autoneg': 'on'}, " - "'Ethernet4': {'lanes': '25,26,27,28', 'description': 'server1:port1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'speed': '25000', 'autoneg': 'on', 'mux_cable': 'true'}, " - "'Ethernet8': {'lanes': '37,38,39,40', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'speed': '40000', 'autoneg': 'on', 'mux_cable': 'true'}, " - "'Ethernet12': {'lanes': '33,34,35,36', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/12', 'admin_status': 'up', 'speed': '10000', 'autoneg': 'on'}, " + "{'Ethernet0': {'lanes': '29,30,31,32', 'description': 'switch-01t1:port1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/0', 'admin_status': 'up', 'speed': '10000', 'autoneg': '1'}, " + "'Ethernet4': {'lanes': '25,26,27,28', 'description': 'server1:port1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'speed': '25000', 'autoneg': '1', 'mux_cable': 'true'}, " + "'Ethernet8': {'lanes': '37,38,39,40', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'speed': '40000', 'autoneg': '1', 'mux_cable': 'true'}, " + "'Ethernet12': {'lanes': '33,34,35,36', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/12', 'admin_status': 'up', 'speed': '10000', 'autoneg': '1'}, " "'Ethernet16': {'alias': 'fortyGigE0/16', 'pfc_asym': 'off', 'lanes': '41,42,43,44', 'description': 'fortyGigE0/16', 'mtu': '9100'}, " "'Ethernet20': {'alias': 'fortyGigE0/20', 'pfc_asym': 'off', 'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'mtu': '9100'}, " "'Ethernet24': {'alias': 'fortyGigE0/24', 'pfc_asym': 'off', 'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'mtu': '9100'}, " diff --git a/src/sonic-config-engine/tests/test_multinpu_cfggen.py b/src/sonic-config-engine/tests/test_multinpu_cfggen.py index 81bad1f66183..542b480da72d 100644 --- a/src/sonic-config-engine/tests/test_multinpu_cfggen.py +++ b/src/sonic-config-engine/tests/test_multinpu_cfggen.py @@ -177,8 +177,8 @@ def test_frontend_asic_ports(self): argument = "-m {} -p {} -n asic0 --var-json \"PORT\"".format(self.sample_graph, self.port_config[0]) 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", "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", "pfc_asym": "off", "role": "Ext", "speed": "40000", "autoneg": "on" }, + {"Ethernet0": { "admin_status": "up", "alias": "Ethernet1/1", "asic_port_name": "Eth0-ASIC0", "description": "01T2:Ethernet1", "index": "0", "lanes": "33,34,35,36", "mtu": "9100", "pfc_asym": "off", "role": "Ext", "speed": "40000", "autoneg": "1" }, + "Ethernet4": { "admin_status": "up", "alias": "Ethernet1/2", "asic_port_name": "Eth1-ASIC0", "description": "01T2:Ethernet2", "index": "1", "lanes": "29,30,31,32", "mtu": "9100", "pfc_asym": "off", "role": "Ext", "speed": "40000", "autoneg": "1" }, "Ethernet8": { "alias": "Ethernet1/3", "asic_port_name": "Eth2-ASIC0", "description": "Ethernet1/3", "index": "2", "lanes": "41,42,43,44", "mtu": "9100", "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", "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", "pfc_asym": "off", "role": "Int", "speed": "40000" },