diff --git a/ansible/module_utils/port_utils.py b/ansible/module_utils/port_utils.py index f354c963a3c..2af81f8332f 100644 --- a/ansible/module_utils/port_utils.py +++ b/ansible/module_utils/port_utils.py @@ -235,12 +235,16 @@ def get_port_alias_to_name_map(hwsku, asic_name=None): s100G_ports += [x for x in range(23, 27)] port_alias_to_name_map = _port_alias_to_name_map_50G(all_ports, s100G_ports) - elif hwsku in ["Arista-7260CX3-D108C8", "Arista-7260CX3-D108C8-AILAB", "Arista-7260CX3-D108C8-CSI"]: + elif hwsku in ["Arista-7260CX3-D108C8", "Arista-7260CX3-D108C8-AILAB", + "Arista-7260CX3-D108C8-CSI", "Arista-7260CX3-D108C10"]: # All possible breakout 50G port numbers: all_ports = [x for x in range(1, 65)] # 100G ports s100G_ports = [x for x in range(13, 21)] + if hwsku == "Arista-7260CX3-D108C10": + # The first 2 ports are 100G + s100G_ports.extend([x for x in range(1, 3)]) if hwsku == "Arista-7260CX3-D108C8-AILAB": s100G_ports = [x for x in range(45, 53)] diff --git a/ansible/roles/eos/templates/t0-118-leaf.j2 b/ansible/roles/eos/templates/t0-118-leaf.j2 new file mode 120000 index 00000000000..14475e8d668 --- /dev/null +++ b/ansible/roles/eos/templates/t0-118-leaf.j2 @@ -0,0 +1 @@ +t0-leaf-lag-2.j2 \ No newline at end of file diff --git a/ansible/vars/topo_t0-118.yml b/ansible/vars/topo_t0-118.yml new file mode 100644 index 00000000000..1c21286c0a9 --- /dev/null +++ b/ansible/vars/topo_t0-118.yml @@ -0,0 +1,294 @@ +topology: + host_interfaces: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + - 8 + - 9 + - 10 + - 11 + - 12 + - 13 + - 14 + - 15 + - 16 + - 17 + - 18 + - 19 + - 20 + - 21 + - 30 + - 31 + - 32 + - 33 + - 34 + - 35 + - 36 + - 37 + - 38 + - 39 + - 40 + - 41 + - 42 + - 43 + - 44 + - 45 + - 46 + - 47 + - 48 + - 49 + - 50 + - 51 + - 52 + - 53 + - 54 + - 55 + - 56 + - 57 + - 58 + - 59 + - 60 + - 61 + - 62 + - 63 + - 64 + - 65 + - 66 + - 67 + - 68 + - 69 + - 70 + - 71 + - 72 + - 73 + - 74 + - 75 + - 76 + - 77 + - 78 + - 79 + - 80 + - 81 + - 82 + - 83 + - 84 + - 85 + - 86 + - 87 + - 88 + - 89 + - 90 + - 91 + - 92 + - 93 + - 94 + - 95 + - 96 + - 97 + - 98 + - 99 + - 100 + - 101 + - 102 + - 103 + - 104 + - 105 + - 106 + - 107 + - 108 + - 109 + - 110 + - 111 + - 112 + - 113 + - 114 + - 115 + - 116 + - 117 + VMs: + ARISTA01T1: + vlans: + - 22 + - 23 + vm_offset: 0 + ARISTA02T1: + vlans: + - 24 + - 25 + vm_offset: 1 + ARISTA03T1: + vlans: + - 26 + - 27 + vm_offset: 2 + ARISTA04T1: + vlans: + - 28 + - 29 + vm_offset: 3 + DUT: + vlan_configs: + default_vlan_config: two_vlan_a + one_vlan_a: + Vlan1000: + id: 1000 + intfs: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117] + prefix: 192.168.0.1/21 + prefix_v6: fc02:1000::1/64 + tag: 1000 + two_vlan_a: + Vlan1000: + id: 1000 + intfs: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62] + prefix: 192.168.0.1/25 + prefix_v6: fc02:1000::1/64 + tag: 1000 + Vlan2000: + id: 2000 + intfs: [63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117] + prefix: 192.168.0.129/25 + prefix_v6: fc02:1000:0:1::1/64 + tag: 2000 + four_vlan_a: + Vlan1000: + id: 1000 + intfs: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 30, 31, 33, 34, 35] + prefix: 192.168.0.1/23 + prefix_v6: fc02:400::1/64 + tag: 1000 + Vlan2000: + id: 2000 + intfs: [36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] + prefix: 192.168.2.1/23 + prefix_v6: fc02:401::1/64 + tag: 2000 + Vlan3000: + id: 3000 + intfs: [64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90] + prefix: 192.168.4.1/23 + prefix_v6: fc02:402::1/64 + tag: 3000 + Vlan4000: + id: 4000 + intfs: [91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117] + prefix: 192.168.6.1/23 + prefix_v6: fc02:403::1/64 + tag: 4000 + +configuration_properties: + common: + dut_asn: 4200065100 + dut_type: ToRRouter + swrole: leaf + podset_number: 200 + tor_number: 16 + tor_subnet_number: 2 + max_tor_subnet_number: 16 + tor_subnet_size: 128 + spine_asn: 65534 + leaf_asn_start: 4200064600 + tor_asn_start: 4200065500 + nhipv4: 10.10.246.254 + nhipv6: FC0A::FF + +configuration: + ARISTA01T1: + properties: + - common + bgp: + asn: 4200064600 + peers: + 4200065100: + - 10.0.0.32 + - FC00::21 + interfaces: + Loopback0: + ipv4: 100.1.0.33/32 + ipv6: 2064:100::33/128 + Ethernet1: + lacp: 1 + Ethernet2: + lacp: 1 + Port-Channel1: + ipv4: 10.0.0.33/31 + ipv6: fc00::22/126 + bp_interface: + ipv4: 10.10.246.33/24 + ipv6: fc0a::23/64 + + ARISTA02T1: + properties: + - common + bgp: + asn: 4200064600 + peers: + 4200065100: + - 10.0.0.34 + - FC00::25 + interfaces: + Loopback0: + ipv4: 100.1.0.35/32 + ipv6: 2064:100::26/128 + Ethernet1: + lacp: 1 + Ethernet2: + lacp: 1 + Port-Channel1: + ipv4: 10.0.0.35/31 + ipv6: fc00::26/126 + bp_interface: + ipv4: 10.10.246.35/24 + ipv6: fc0a::26/64 + + ARISTA03T1: + properties: + - common + bgp: + asn: 4200064600 + peers: + 4200065100: + - 10.0.0.36 + - FC00::29 + interfaces: + Loopback0: + ipv4: 100.1.0.37/32 + ipv6: 2064:100::2A/128 + Ethernet1: + lacp: 1 + Ethernet2: + lacp: 1 + Port-Channel1: + ipv4: 10.0.0.37/31 + ipv6: fc00::2A/126 + bp_interface: + ipv4: 10.10.246.37/24 + ipv6: fc0a::2A/64 + + ARISTA04T1: + properties: + - common + bgp: + asn: 4200064600 + peers: + 4200065100: + - 10.0.0.38 + - FC00::2D + interfaces: + Loopback0: + ipv4: 100.1.0.39/32 + ipv6: 2064:100::2E/128 + Ethernet1: + lacp: 1 + Ethernet2: + lacp: 1 + Port-Channel1: + ipv4: 10.0.0.39/31 + ipv6: fc00::2E/126 + bp_interface: + ipv4: 10.10.246.39/24 + ipv6: fc0a::2E/64 diff --git a/ansible/veos b/ansible/veos index 634c7eaa421..de4ff2506f1 100644 --- a/ansible/veos +++ b/ansible/veos @@ -33,6 +33,7 @@ all: - t0-64-32 - t0-80 - t0-116 + - t0-118 - t0-backend - t0-standalone-32 - t0-standalone-64 diff --git a/ansible/veos_vtb b/ansible/veos_vtb index d19e79a6402..c3d37c1dcde 100644 --- a/ansible/veos_vtb +++ b/ansible/veos_vtb @@ -29,6 +29,7 @@ all: - t0-64 - t0-64-32 - t0-116 + - t0-118 - t0-backend - dualtor - dualtor-56 diff --git a/docs/testbed/README.testbed.Overview.md b/docs/testbed/README.testbed.Overview.md index 2dc6666480d..452e1d3b66a 100644 --- a/docs/testbed/README.testbed.Overview.md +++ b/docs/testbed/README.testbed.Overview.md @@ -77,6 +77,7 @@ The T0 type topology has different variations. The differences are just the numb * t0-56-po2vlan * t0-80 * t0-116 +* t0-118 * t0-120 * t0-backend * t0-standalone-32 diff --git a/tests/acl/test_acl.py b/tests/acl/test_acl.py index f69e28e9c21..fcbb514d153 100644 --- a/tests/acl/test_acl.py +++ b/tests/acl/test_acl.py @@ -91,6 +91,9 @@ } # Below M0_VLAN IPs are ip in vlan range +# Note: If two_vlan_a is used, the IP range should choose +# DOWNSTREAM_DST_IP_VLAN and DOWNSTREAM_DST_IP_VLAN2000 +# separately for each vlan DOWNSTREAM_DST_IP_VLAN = { "ipv4": "192.168.0.123", "ipv6": "fc02:1000::5" @@ -277,6 +280,7 @@ def setup(duthosts, ptfhost, rand_selected_dut, rand_unselected_dut, tbinfo, ptf vlan_ports = [] vlan_mac = None + vlan_config = None # Need to refresh below constants for two scenarios of M0 global DOWNSTREAM_DST_IP, DOWNSTREAM_IP_TO_ALLOW, DOWNSTREAM_IP_TO_BLOCK @@ -302,6 +306,18 @@ def setup(duthosts, ptfhost, rand_selected_dut, rand_unselected_dut, tbinfo, ptf DOWNSTREAM_DST_IP = DOWNSTREAM_DST_IP_M0_L3 DOWNSTREAM_IP_TO_ALLOW = DOWNSTREAM_IP_TO_ALLOW_M0_L3 DOWNSTREAM_IP_TO_BLOCK = DOWNSTREAM_IP_TO_BLOCK_M0_L3 + elif tbinfo['topo']['type'] in ['t0']: + try: + vlan_config = tbinfo['topo']['properties']['topology']['DUT']['vlan_configs']['default_vlan_config'] + if vlan_config == 'two_vlan_a': + logging.info("topo {} has 2 vlans".format(tbinfo['topo']['name'])) + DOWNSTREAM_DST_IP = DOWNSTREAM_DST_IP_VLAN2000 if vlan_name == "Vlan2000" else DOWNSTREAM_DST_IP_VLAN + DOWNSTREAM_IP_TO_ALLOW = DOWNSTREAM_IP_TO_ALLOW_VLAN2000 if vlan_name == "Vlan2000" \ + else DOWNSTREAM_IP_TO_ALLOW_VLAN + DOWNSTREAM_IP_TO_BLOCK = DOWNSTREAM_IP_TO_BLOCK_VLAN2000 if vlan_name == "Vlan2000" \ + else DOWNSTREAM_IP_TO_BLOCK_VLAN + except KeyError: + logger.error("topo {} keys are missing in the tbinfo:{}".format(tbinfo['topo']['name'], tbinfo)) if topo in ["t0", "mx", "m0_vlan"]: vlan_ports = [mg_facts["minigraph_ptf_indices"][ifname] for ifname in mg_facts["minigraph_vlans"][vlan_name]["members"]] @@ -409,8 +425,10 @@ def setup(duthosts, ptfhost, rand_selected_dut, rand_unselected_dut, tbinfo, ptf "acl_table_ports": acl_table_ports, "vlan_ports": vlan_ports, "topo": topo, + "topo_name": tbinfo["topo"]["name"], "vlan_mac": vlan_mac, - "loopback_ip": selected_tor_loopback_ip + "loopback_ip": selected_tor_loopback_ip, + "vlan_config": vlan_config } logger.info("Gathered variables for ACL test:\n{}".format(pprint.pformat(setup_information))) @@ -1029,11 +1047,13 @@ def test_dest_ip_match_forwarded(self, setup, direction, ptfadapter, rule_id = 32 else: rule_id = 30 - elif setup["topo"] in ["m0_vlan", "mx"]: + elif setup["topo"] in ["m0_vlan", "mx"] or setup["vlan_config"] == "two_vlan_a": if ip_version == "ipv6": rule_id = 34 if vlan_name == "Vlan1000" else 36 else: rule_id = 33 if vlan_name == "Vlan1000" else 2 + logging.info("topo: {} vlan_config: {} vlan_name: {} rule_id: {} ".format( + setup["topo"], setup["vlan_config"], vlan_name, rule_id)) else: rule_id = 2 else: @@ -1055,11 +1075,13 @@ def test_dest_ip_match_dropped(self, setup, direction, ptfadapter, rule_id = 33 else: rule_id = 31 - elif setup["topo"] in ["m0_vlan", "mx"]: + elif setup["topo"] in ["m0_vlan", "mx"] or setup["vlan_config"] == "two_vlan_a": if ip_version == "ipv6": rule_id = 35 if vlan_name == "Vlan1000" else 37 else: rule_id = 32 if vlan_name == "Vlan1000" else 15 + logging.info("topo: {} vlan_config: {} vlan_name: {} rule_id: {} ".format( + setup["topo"], setup["vlan_config"], vlan_name, rule_id)) else: rule_id = 15 else: diff --git a/tests/conftest.py b/tests/conftest.py index 11081372008..a49a2db4b6c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1799,10 +1799,37 @@ def format_portautoneg_test_id(param): metafunc.parametrize('vlan_name', ['Vlan1000'], scope='module') # Non M0 topo else: - if tbinfo['topo']['type'] in ['t0', 'mx']: - metafunc.parametrize('vlan_name', ['Vlan1000'], scope='module') - else: - metafunc.parametrize('vlan_name', ['no_vlan'], scope='module') + try: + if tbinfo["topo"]["type"] in ["t0", "mx"]: + default_vlan_config = tbinfo["topo"]["properties"]["topology"][ + "DUT" + ]["vlan_configs"]["default_vlan_config"] + if default_vlan_config == "two_vlan_a": + logger.info("default_vlan_config is two_vlan_a") + vlan_list = list( + tbinfo["topo"]["properties"]["topology"]["DUT"][ + "vlan_configs" + ]["two_vlan_a"].keys() + ) + elif default_vlan_config == "one_vlan_a": + logger.info("default_vlan_config is one_vlan_a") + vlan_list = list( + tbinfo["topo"]["properties"]["topology"]["DUT"][ + "vlan_configs" + ]["one_vlan_a"].keys() + ) + else: + vlan_list = ["Vlan1000"] + logger.info("parametrize vlan_name: {}".format(vlan_list)) + metafunc.parametrize("vlan_name", vlan_list, scope="module") + else: + metafunc.parametrize("vlan_name", ["no_vlan"], scope="module") + except KeyError: + logger.error("topo {} keys are missing in the tbinfo={}".format(tbinfo['topo']['name'], tbinfo)) + if tbinfo['topo']['type'] in ['t0', 'mx']: + metafunc.parametrize('vlan_name', ['Vlan1000'], scope='module') + else: + metafunc.parametrize('vlan_name', ['no_vlan'], scope='module') def get_autoneg_tests_data():