Skip to content

Bug: test_vnet_decap does not support in v6 only topo #21780

@weiguo-nvidia

Description

@weiguo-nvidia

Is it platform specific

generic

Importance or Severity

Critical

Description of the bug

The case test_vnet_decap[inner_ipv4-outer_ipv4] and test_vnet_decap[inner_ipv6-outer_ipv4] do not support v6 only topo.
For v6 only topo, such as t1-isolated-v6-d56u1-lag, only has ipv6 address, no ipv4 address.
Need align this case to support v6 only topo

RuntimeError: There are not enough interfaces needed to perform the test. We need atleast 2 interfaces, but only 0 are available.
request = >
duthosts = []
inner_ip_version = 6, outer_ip_version = 4

    @pytest.fixture
    def setup(request, duthosts, rand_one_dut_hostname, tbinfo, inner_ip_version, outer_ip_version):
        """
        Creates a VXLAN tunnel, a VNET, and one VNET route (with a single endpoint). Also finds an appropriate
        Ethernet port for sending the IP-in-IP packet to the DUT.
        Yields test configuration and data.
        """
        duthost = duthosts[rand_one_dut_hostname]
        asic_type = duthost.facts["asic_type"]
        if asic_type not in ["cisco-8000", "mellanox"]:
            pytest.skip("The VNET decap test will only run on Cisco-8000 and Mellanox ASICs.")
        platform = duthost.facts["platform"]
        if platform in ['x86_64-mlnx_msn2700-r0', 'x86_64-mlnx_msn2700a1-r0']:
            pytest.skip("Mellanox msn2700 switches do not support VNET decapsulation.")
    
        # Should I keep the temporary files copied to DUT?
        ecmp_utils.Constants["KEEP_TEMP_FILES"] = request.config.option.keep_temp_files
        # Is debugging going on, or is it a production run? If it is a
        # production run, use time-stamped file names for temp files.
        ecmp_utils.Constants["DEBUG"] = request.config.option.debug_enabled
        # The host id in the ip addresses for DUT. It can be anything,
        # but helps to keep as a single number that is easy to identify
        # as DUT.
        ecmp_utils.Constants["DUT_HOSTID"] = request.config.option.dut_hostid
    
        # Setup
        router_mac = duthost.facts["router_mac"]
        ecmp_utils.configure_vxlan_switch(duthost, vxlan_port=VXLAN_DST_PORT, dutmac=router_mac)
        minigraph_facts = duthost.get_extended_minigraph_facts(tbinfo)
        outer_ip_version_str = f"v{outer_ip_version}"
>       vnet_interface = ecmp_utils.select_required_interfaces(duthost, 1, minigraph_facts, outer_ip_version_str)[0]

asic_type  = 'mellanox'
duthost    = 
duthosts   = []
inner_ip_version = 6
minigraph_facts = {'deployment_id': '1', 'dhcp_servers': [], 'dhcpv6_servers': [], 'forced_mgmt_routes': ['10.75.0.0/16', '10.213.0.0/16', '10.215.0.0/16', '10.9.0.0/16', '10.212.0.0/16', '10.245.0.0/16', ...], ...}
outer_ip_version = 4
outer_ip_version_str = 'v4'
platform   = 'x86_64-nvidia_sn5640-r0'
request    = >
router_mac = '38:25:f3:75:98:0a'

vxlan/test_vnet_decap.py:88: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 
duthost = , number_of_required_interfaces = 1
minigraph_data = {'deployment_id': '1', 'dhcp_servers': [], 'dhcpv6_servers': [], 'forced_mgmt_routes': ['10.75.0.0/16', '10.213.0.0/16', '10.215.0.0/16', '10.9.0.0/16', '10.212.0.0/16', '10.245.0.0/16', ...], ...}
af = 'v4'

    def select_required_interfaces(
            self, duthost, number_of_required_interfaces, minigraph_data, af):
        '''
        Pick the required number of interfaces to use for tests.
        These interfaces will be selected based on if they are currently
        running a established BGP.  The interfaces will be picked from the T0
        facing side.
        '''
        bgp_interfaces = self.get_all_interfaces_running_bgp(
            duthost,
            minigraph_data,
            "T0")
    
        # Randomly pick the interface from the above list
        list_of_bgp_ips = []
        for neigh_ip_address in bgp_interfaces:
            if isinstance(ip_address(neigh_ip_address), self.IP_TYPE[af]):
                list_of_bgp_ips.append(neigh_ip_address)
    
        ret_interface_list = []
        available_number = len(list_of_bgp_ips)
        # Confirm there are enough interfaces (basicaly more than or equal
        # to the number of vnets).
        if available_number <= number_of_required_interfaces+1:
>           raise RuntimeError(
                "There are not enough interfaces needed to perform the test. "
                "We need atleast {} interfaces, but only {} are "
                "available.".format(
                    number_of_required_interfaces+1, available_number))
E           RuntimeError: There are not enough interfaces needed to perform the test. We need atleast 2 interfaces, but only 0 are available.

af         = 'v4'
available_number = 0
bgp_interfaces = {'fc00::102': {'Ethernet64': 'fc00::101'}, 'fc00::122': {'Ethernet72': 'fc00::121'}, 'fc00::142': {'Ethernet80': 'fc00::141'}, 'fc00::162': {'Ethernet88': 'fc00::161'}, ...}
duthost    = 
list_of_bgp_ips = []
minigraph_data = {'deployment_id': '1', 'dhcp_servers': [], 'dhcpv6_servers': [], 'forced_mgmt_routes': ['10.75.0.0/16', '10.213.0.0/16', '10.215.0.0/16', '10.9.0.0/16', '10.212.0.0/16', '10.245.0.0/16', ...], ...}
neigh_ip_address = 'fc00::162'
number_of_required_interfaces = 1
ret_interface_list = []
self       = 

common/vxlan_ecmp_utils.py:141: RuntimeError

Steps to Reproduce

Run case tests/vxlan/test_vnet_decap.py

Actual Behavior and Expected Behavior

Case pass on v6 only topo

Relevant log output

Output of show version

Attach files (if any)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions