diff --git a/files/build_templates/buffers_config.j2 b/files/build_templates/buffers_config.j2 index 11e35a7b4dd6..008772957482 100644 --- a/files/build_templates/buffers_config.j2 +++ b/files/build_templates/buffers_config.j2 @@ -53,6 +53,9 @@ def {%- if DEVICE_NEIGHBOR_METADATA is defined and DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[local_port].name] %} {%- set neighbor = DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[local_port].name] %} {%- set neighbor_role = neighbor.type %} + {%- if 'edgezoneaggregator' == neighbor_role | lower %} + {%- set neighbor_role = 'LeafRouter' %} + {%- endif %} {%- if 'asic' == neighbor_role | lower %} {%- set roles1 = 'internal' %} {%- if 'internal' not in ports2cable %} diff --git a/src/sonic-config-engine/tests/sample-arista-7060-t0-minigraph.xml b/src/sonic-config-engine/tests/sample-arista-7060-t0-minigraph.xml new file mode 100644 index 000000000000..eff3d88acbb9 --- /dev/null +++ b/src/sonic-config-engine/tests/sample-arista-7060-t0-minigraph.xml @@ -0,0 +1,1048 @@ + + + + + + false + str2-7060cx-32s-29 + 10.0.0.56 + ARISTA01T1 + 10.0.0.57 + 1 + 10 + 3 + + + str2-7060cx-32s-29 + FC00::71 + ARISTA01T1 + FC00::72 + 1 + 10 + 3 + + + false + str2-7060cx-32s-29 + 10.0.0.58 + ARISTA02T1 + 10.0.0.59 + 1 + 10 + 3 + + + str2-7060cx-32s-29 + FC00::75 + ARISTA02T1 + FC00::76 + 1 + 10 + 3 + + + false + str2-7060cx-32s-29 + 10.0.0.60 + ARISTA03T1 + 10.0.0.61 + 1 + 10 + 3 + + + str2-7060cx-32s-29 + FC00::79 + ARISTA03T1 + FC00::7A + 1 + 10 + 3 + + + false + str2-7060cx-32s-29 + 10.0.0.62 + ARISTA04T1 + 10.0.0.63 + 1 + 10 + 3 + + + str2-7060cx-32s-29 + FC00::7D + ARISTA04T1 + FC00::7E + 1 + 10 + 3 + + + + + 65100 + str2-7060cx-32s-29 + + +
10.0.0.57
+ + + +
+ +
10.0.0.59
+ + + +
+ +
10.0.0.61
+ + + +
+ +
10.0.0.63
+ + + +
+ + BGPPeer +
10.1.0.32
+ + + + BGPSLBPassive + 10.255.0.0/25 +
+ + BGPPeer +
10.1.0.32
+ + + + BGPVac + 192.168.0.0/21 +
+
+ +
+ + 64600 + ARISTA01T1 + + + + 64600 + ARISTA02T1 + + + + 64600 + ARISTA03T1 + + + + 64600 + ARISTA04T1 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + + + HostIP + eth0 + + 10.3.146.57/23 + + 10.3.146.57/23 + + + V6HostIP + eth0 + + FC00:2::32/64 + + FC00:2::32/64 + + + + + + + str2-7060cx-32s-29 + + + PortChannel101 + Ethernet29/1 + + + + PortChannel102 + Ethernet30/1 + + + + PortChannel103 + Ethernet31/1 + + + + PortChannel104 + Ethernet32/1 + + + + + + Vlan1000 + Ethernet2/1;Ethernet3/1;Ethernet4/1;Ethernet5/1;Ethernet6/1;Ethernet7/1;Ethernet8/1;Ethernet9/1;Ethernet10/1;Ethernet11/1;Ethernet12/1;Ethernet13/1;Ethernet14/1;Ethernet15/1;Ethernet16/1;Ethernet17/1;Ethernet18/1;Ethernet19/1;Ethernet20/1;Ethernet21/1;Ethernet22/1;Ethernet23/1;Ethernet24/1;Ethernet25/1 + False + 0.0.0.0/0 + 192.0.0.1;192.0.0.2;192.0.0.3;192.0.0.4;192.0.0.5;192.0.0.6;192.0.0.7;192.0.0.8;192.0.0.9;192.0.0.10;192.0.0.11;192.0.0.12;192.0.0.13;192.0.0.14;192.0.0.15;192.0.0.16;192.0.0.17;192.0.0.18;192.0.0.19;192.0.0.20;192.0.0.21;192.0.0.22;192.0.0.23;192.0.0.24;192.0.0.25;192.0.0.26;192.0.0.27;192.0.0.28;192.0.0.29;192.0.0.30;192.0.0.31;192.0.0.32;192.0.0.33;192.0.0.34;192.0.0.35;192.0.0.36;192.0.0.37;192.0.0.38;192.0.0.39;192.0.0.40;192.0.0.41;192.0.0.42;192.0.0.43;192.0.0.44;192.0.0.45;192.0.0.46;192.0.0.47;192.0.0.48 + fc02:2000::1;fc02:2000::2;fc02:2000::3;fc02:2000::4 + 1000 + 1000 + 192.168.0.0/21 + + + + + + PortChannel101 + 10.0.0.56/31 + + + + PortChannel101 + FC00::71/126 + + + + PortChannel102 + 10.0.0.58/31 + + + + PortChannel102 + FC00::75/126 + + + + PortChannel103 + 10.0.0.60/31 + + + + PortChannel103 + FC00::79/126 + + + + PortChannel104 + 10.0.0.62/31 + + + + PortChannel104 + FC00::7D/126 + + + + Vlan1000 + 192.168.0.1/21 + + + + Vlan1000 + fc02:1000::1/64 + + + + + + NTP_ACL + NTP + NTP + + + SNMP_ACL + SNMP + SNMP + + + ERSPAN + Everflow + Everflow + + + ERSPANV6 + EverflowV6 + EverflowV6 + + + VTY_LINE + ssh-only + SSH + + + PortChannel101;PortChannel102;PortChannel103;PortChannel104 + DataAcl + DataPlane + + + + + + + + + + DeviceInterfaceLink + ARISTA01T1 + Ethernet1 + str2-7060cx-32s-29 + Ethernet29/1 + + + DeviceInterfaceLink + ARISTA02T1 + Ethernet1 + str2-7060cx-32s-29 + Ethernet30/1 + + + DeviceInterfaceLink + ARISTA03T1 + Ethernet1 + str2-7060cx-32s-29 + Ethernet31/1 + + + DeviceInterfaceLink + ARISTA04T1 + Ethernet1 + str2-7060cx-32s-29 + Ethernet32/1 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet2/1 + Servers0 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet3/1 + Servers1 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet4/1 + Servers2 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet5/1 + Servers3 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet6/1 + Servers4 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet7/1 + Servers5 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet8/1 + Servers6 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet9/1 + Servers7 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet10/1 + Servers8 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet11/1 + Servers9 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet12/1 + Servers10 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet13/1 + Servers11 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet14/1 + Servers12 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet15/1 + Servers13 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet16/1 + Servers14 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet17/1 + Servers15 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet18/1 + Servers16 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet19/1 + Servers17 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet20/1 + Servers18 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet21/1 + Servers19 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet22/1 + Servers20 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet23/1 + Servers21 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet24/1 + Servers22 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet25/1 + Servers23 + eth0 + + + + + str2-7060cx-32s-29 + Arista-7060CX-32S-D48C8 + + 10.3.146.57 + + + + ARISTA04T1 + + 172.16.137.127 + + Arista-VM + + + ARISTA03T1 + + 172.16.137.126 + + Arista-VM + + + ARISTA02T1 + + 172.16.137.125 + + Arista-VM + + + ARISTA01T1 + + 172.16.137.124 + + Arista-VM + + + + + + true + + + DeviceInterface + + true + true + 1 + Ethernet1/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet2/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet3/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet4/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet5/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet6/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet7/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet8/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet9/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet10/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet11/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet12/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet13/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet14/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet15/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet16/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet17/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet18/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet19/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet20/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet21/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet22/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet23/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet24/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet25/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet26/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet27/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet28/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet29/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet30/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet31/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet32/1 + + false + 0 + 0 + 40000 + + + true + 0 + Arista-7060CX-32S-D48C8 + + + + + + + str2-7060cx-32s-29 + + + DeploymentId + + 1 + + + QosProfile + + Profile0 + + + DhcpResources + + 192.0.0.1;192.0.0.2;192.0.0.3;192.0.0.4;192.0.0.5;192.0.0.6;192.0.0.7;192.0.0.8;192.0.0.9;192.0.0.10;192.0.0.11;192.0.0.12;192.0.0.13;192.0.0.14;192.0.0.15;192.0.0.16;192.0.0.17;192.0.0.18;192.0.0.19;192.0.0.20;192.0.0.21;192.0.0.22;192.0.0.23;192.0.0.24;192.0.0.25;192.0.0.26;192.0.0.27;192.0.0.28;192.0.0.29;192.0.0.30;192.0.0.31;192.0.0.32;192.0.0.33;192.0.0.34;192.0.0.35;192.0.0.36;192.0.0.37;192.0.0.38;192.0.0.39;192.0.0.40;192.0.0.41;192.0.0.42;192.0.0.43;192.0.0.44;192.0.0.45;192.0.0.46;192.0.0.47;192.0.0.48 + + + NtpResources + + 10.20.8.129;10.20.8.130 + + + SnmpResources + + 10.3.145.98 + + + SyslogResources + + 10.64.246.95 + + + TacacsGroup + + Starlab + + + TacacsServer + + 100.127.20.21 + + + ForcedMgmtRoutes + + 10.3.145.98/31;10.3.145.8;100.127.20.16/28;10.3.149.170/31;40.122.216.24;13.91.48.226;10.3.145.14;10.64.246.0/23;10.3.146.0/23;10.64.5.5;10.201.148.32/28;10.64.247.0/24 + + + ErspanDestinationIpv4 + + 10.20.6.16 + + + + + + + str2-7060cx-32s-29 + Arista-7060CX-32S-D48C8 +
diff --git a/src/sonic-config-engine/tests/sample_output/py2/buffer-arista7060-t0.json b/src/sonic-config-engine/tests/sample_output/py2/buffer-arista7060-t0.json new file mode 100644 index 000000000000..f883dd1aa417 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py2/buffer-arista7060-t0.json @@ -0,0 +1,440 @@ +{ + "CABLE_LENGTH": { + "AZURE": { + "Ethernet8": "5m", + "Ethernet2": "5m", + "Ethernet0": "5m", + "Ethernet6": "5m", + "Ethernet4": "5m", + "Ethernet108": "5m", + "Ethernet100": "5m", + "Ethernet104": "5m", + "Ethernet106": "5m", + "Ethernet58": "5m", + "Ethernet126": "5m", + "Ethernet96": "5m", + "Ethernet124": "40m", + "Ethernet122": "5m", + "Ethernet92": "5m", + "Ethernet120": "40m", + "Ethernet50": "5m", + "Ethernet52": "5m", + "Ethernet54": "5m", + "Ethernet56": "5m", + "Ethernet76": "5m", + "Ethernet74": "5m", + "Ethernet18": "5m", + "Ethernet70": "5m", + "Ethernet32": "5m", + "Ethernet72": "5m", + "Ethernet16": "5m", + "Ethernet36": "5m", + "Ethernet78": "5m", + "Ethernet60": "5m", + "Ethernet28": "5m", + "Ethernet62": "5m", + "Ethernet14": "5m", + "Ethernet88": "5m", + "Ethernet118": "5m", + "Ethernet24": "5m", + "Ethernet116": "40m", + "Ethernet82": "5m", + "Ethernet114": "5m", + "Ethernet80": "5m", + "Ethernet112": "40m", + "Ethernet86": "5m", + "Ethernet110": "5m", + "Ethernet84": "5m", + "Ethernet48": "5m", + "Ethernet10": "5m", + "Ethernet44": "5m", + "Ethernet42": "5m", + "Ethernet40": "5m", + "Ethernet64": "5m", + "Ethernet66": "5m", + "Ethernet12": "5m", + "Ethernet46": "5m", + "Ethernet20": "5m", + "Ethernet22": "5m", + "Ethernet68": "5m" + } + }, + + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "10875072", + "type": "ingress", + "mode": "dynamic", + "xoff": "4194112" + }, + "egress_lossy_pool": { + "size": "9243812", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "15982720", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"ingress_lossless_pool", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"egress_lossless_pool", + "size":"1518", + "static_th":"15982720" + }, + "egress_lossy_profile": { + "pool":"egress_lossy_pool", + "size":"1518", + "dynamic_th":"3" + } + }, + + "BUFFER_PG": { + "Ethernet8|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet4|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet68|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet96|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet124|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet92|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet120|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet52|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet56|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet76|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet72|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet32|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet16|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet36|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet12|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet28|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet88|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet116|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet80|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet112|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet84|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet48|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet44|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet40|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet64|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet60|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet20|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet24|0": { + "profile" : "ingress_lossy_profile" + } + }, + + "BUFFER_QUEUE": { + "Ethernet8|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet4|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet68|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet96|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet124|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet92|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet120|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet52|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet56|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet76|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet72|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet32|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet16|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet36|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet12|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet28|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet88|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet116|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet80|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet112|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet84|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet48|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet44|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet40|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet64|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet60|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet20|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet24|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet8|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet4|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet68|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet96|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet124|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet92|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet120|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet52|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet56|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet76|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet72|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet32|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet16|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet36|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet12|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet28|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet88|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet116|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet80|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet112|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet84|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet48|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet44|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet40|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet64|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet60|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet20|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet24|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet8|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet4|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet68|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet96|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet124|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet92|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet120|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet52|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet56|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet76|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet72|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet32|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet16|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet36|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet12|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet28|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet88|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet116|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet80|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet112|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet84|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet48|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet44|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet40|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet64|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet60|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet20|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet24|5-6": { + "profile" : "egress_lossy_profile" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7060-t0.json b/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7060-t0.json new file mode 100644 index 000000000000..f883dd1aa417 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7060-t0.json @@ -0,0 +1,440 @@ +{ + "CABLE_LENGTH": { + "AZURE": { + "Ethernet8": "5m", + "Ethernet2": "5m", + "Ethernet0": "5m", + "Ethernet6": "5m", + "Ethernet4": "5m", + "Ethernet108": "5m", + "Ethernet100": "5m", + "Ethernet104": "5m", + "Ethernet106": "5m", + "Ethernet58": "5m", + "Ethernet126": "5m", + "Ethernet96": "5m", + "Ethernet124": "40m", + "Ethernet122": "5m", + "Ethernet92": "5m", + "Ethernet120": "40m", + "Ethernet50": "5m", + "Ethernet52": "5m", + "Ethernet54": "5m", + "Ethernet56": "5m", + "Ethernet76": "5m", + "Ethernet74": "5m", + "Ethernet18": "5m", + "Ethernet70": "5m", + "Ethernet32": "5m", + "Ethernet72": "5m", + "Ethernet16": "5m", + "Ethernet36": "5m", + "Ethernet78": "5m", + "Ethernet60": "5m", + "Ethernet28": "5m", + "Ethernet62": "5m", + "Ethernet14": "5m", + "Ethernet88": "5m", + "Ethernet118": "5m", + "Ethernet24": "5m", + "Ethernet116": "40m", + "Ethernet82": "5m", + "Ethernet114": "5m", + "Ethernet80": "5m", + "Ethernet112": "40m", + "Ethernet86": "5m", + "Ethernet110": "5m", + "Ethernet84": "5m", + "Ethernet48": "5m", + "Ethernet10": "5m", + "Ethernet44": "5m", + "Ethernet42": "5m", + "Ethernet40": "5m", + "Ethernet64": "5m", + "Ethernet66": "5m", + "Ethernet12": "5m", + "Ethernet46": "5m", + "Ethernet20": "5m", + "Ethernet22": "5m", + "Ethernet68": "5m" + } + }, + + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "10875072", + "type": "ingress", + "mode": "dynamic", + "xoff": "4194112" + }, + "egress_lossy_pool": { + "size": "9243812", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "15982720", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"ingress_lossless_pool", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"egress_lossless_pool", + "size":"1518", + "static_th":"15982720" + }, + "egress_lossy_profile": { + "pool":"egress_lossy_pool", + "size":"1518", + "dynamic_th":"3" + } + }, + + "BUFFER_PG": { + "Ethernet8|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet4|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet68|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet96|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet124|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet92|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet120|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet52|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet56|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet76|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet72|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet32|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet16|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet36|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet12|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet28|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet88|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet116|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet80|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet112|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet84|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet48|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet44|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet40|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet64|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet60|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet20|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet24|0": { + "profile" : "ingress_lossy_profile" + } + }, + + "BUFFER_QUEUE": { + "Ethernet8|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet4|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet68|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet96|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet124|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet92|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet120|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet52|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet56|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet76|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet72|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet32|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet16|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet36|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet12|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet28|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet88|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet116|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet80|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet112|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet84|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet48|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet44|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet40|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet64|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet60|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet20|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet24|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet8|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet4|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet68|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet96|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet124|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet92|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet120|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet52|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet56|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet76|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet72|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet32|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet16|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet36|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet12|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet28|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet88|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet116|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet80|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet112|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet84|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet48|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet44|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet40|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet64|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet60|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet20|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet24|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet8|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet4|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet68|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet96|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet124|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet92|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet120|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet52|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet56|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet76|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet72|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet32|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet16|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet36|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet12|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet28|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet88|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet116|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet80|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet112|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet84|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet48|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet44|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet40|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet64|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet60|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet20|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet24|5-6": { + "profile" : "egress_lossy_profile" + } + } +} diff --git a/src/sonic-config-engine/tests/test_j2files.py b/src/sonic-config-engine/tests/test_j2files.py index 0b5ad25be65b..44f5be3755a0 100644 --- a/src/sonic-config-engine/tests/test_j2files.py +++ b/src/sonic-config-engine/tests/test_j2files.py @@ -139,7 +139,7 @@ def test_interfaces(self): self.run_script(argument, output_file=self.output_file) self.assertTrue(utils.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'mvrf_interfaces_nomgmt'), self.output_file)) - + def test_ports_json(self): ports_template = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-orchagent', 'ports.json.j2') argument = ['-m', self.simple_minigraph, '-p', self.t0_port_config, '-t', ports_template] @@ -223,7 +223,7 @@ def test_l2switch_template(self): output_json = json.loads(output) self.assertTrue(json.dumps(sample_output_json, sort_keys=True) == json.dumps(output_json, sort_keys=True)) - + def test_l1_ports_template(self): argument = ['-k', '32x1000Gb', '--preset', 'l1', '-p', self.l1_l3_port_config] output = self.run_script(argument) @@ -345,7 +345,7 @@ def _test_qos_render_template(self, vendor, platform, sku, minigraph, expected): # cleanup qos_config_file_new = os.path.join(dir_path, 'qos_config.j2') os.remove(qos_config_file_new) - + self.remove_machine_conf(file_exist, dir_exist) sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, expected) @@ -529,7 +529,7 @@ def test_ipinip_multi_asic(self): ipinip_file = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-orchagent', 'ipinip.json.j2') argument = ['-m', self.multi_asic_minigraph, '-p', self.multi_asic_port_config, '-t', ipinip_file, '-n', 'asic0'] print(argument) - self.run_script(argument, output_file=self.output_file) + self.run_script(argument, output_file=self.output_file) sample_output_file = os.path.join(self.test_dir, 'multi_npu_data', utils.PYvX_DIR, 'ipinip.json') assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file) @@ -636,6 +636,11 @@ def test_backend_acl_template_render(self): self.run_script(argument, output_file=self.output_file) assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file) + + def test_buffers_edgezone_aggregator_render_template(self): + self._test_buffers_render_template('arista', 'x86_64-arista_7060_cx32s', 'Arista-7060CX-32S-D48C8', 'sample-arista-7060-t0-minigraph.xml', 'buffers.json.j2', 'buffer-arista7060-t0.json') + + def tearDown(self): os.environ["CFGGEN_UNIT_TESTING"] = "" try: