Skip to content

Bug: voq test failed with IndexError: list index out of range #18166

@ysmanman

Description

@ysmanman

Is it platform specific

generic

Importance or Severity

Medium

Description of the bug

voq tests like test_voq_ipfwd.py failed with the following error:

        """
        rtn_dict = {}
        port = random.choice(iface_list)
        rtn_dict['port'] = port
        rtn_dict['my_ip'] = get_ip_address(cfg_facts, port, version)
        rtn_dict['dut'] = dut
        rtn_dict['asic'] = dut.asics[asic_index]
    
        # Get nbr VM info from the configured facts
        nbr_in_cfg = cfg_facts['BGP_NEIGHBOR']
>       nbr_ip = [n for n in nbr_in_cfg if ipaddress.ip_address(nbr_in_cfg[n]['local_addr']) == rtn_dict['my_ip']][0]
E       IndexError: list index out of range

asic_index = 0
cfg_facts  = {'ACL_TABLE': {'DATAACL': {'policy_desc': 'DATAACL', 'ports': ['PortChannel2001', 'PortChannel2003', 'PortChannel2004'... and/or use are subject to monitoring.\n\nHelp:    https://sonic-net.github.io/SONiC/\n\n', 'state': 'disabled'}}, ...}
dut        = <MultiAsicSonicHost qzd544>
iface_list = ['PortChannel2001', 'PortChannel2003', 'PortChannel2004']
nbr_in_cfg = {'10.0.0.101': {'admin_status': 'up', 'asn': '65012', 'holdtime': '10', 'keepalive': '3', ...}, '10.0.0.5': {'admin_st...0', 'keepalive': '3', ...}, 'fc00::e': {'admin_status': 'up', 'asn': '65012', 'holdtime': '10', 'keepalive': '3', ...}}
nbrhosts   = {'ARISTA01T3': <EosHost VM0100>, 'ARISTA02T3': <EosHost VM0101>, 'ARISTA03T3': <EosHost VM0102>, 'ARISTA05T1': <EosHost VM0103>, ...}
port       = 'PortChannel2001'
rtn_dict   = {'asic': <SonicAsic 0>, 'dut': <MultiAsicSonicHost qzd544>, 'my_ip': IPv4Address('10.0.0.0'), 'port': 'PortChannel2001'}
version    = 4

voq/test_voq_ipfwd.py:148: IndexError</failure></testcase><testcase classname="voq.test_voq_ipfwd.TestVoqIPFwd" name="test_voq_local_interface_ping[portchannel-4-255-1500]" file="voq/test_voq_ipfwd.py" line="617" time="0.006"><properties><property name="start" value="2025-04-27 08:42:50.560290" /><property name="end" value="2025-04-27 08:42:50.608675" /></properties><failure message="IndexError: list index out of range">self = &lt;tests.voq.test_voq_ipfwd.TestVoqIPFwd object at 0x7f93ef7c39d0&gt;, duthosts = [&lt;MultiAsicSonicHost qzd544&gt;]
nbrhosts = {'ARISTA01T3': &lt;EosHost VM0100&gt;, 'ARISTA02T3': &lt;EosHost VM0101&gt;, 'ARISTA03T3': &lt;EosHost VM0102&gt;, 'ARISTA05T1': &lt;EosHost VM0103&gt;, ...}
all_cfg_facts = {'qzd544': [{'ansible_facts': {'ACL_TABLE': {'DATAACL': {'policy_desc': 'DATAACL', 'ports': ['PortChannel2001', 'PortC...ost': 'qzd544', 'namespace': 'asic1', 'filename': None}}, '_ansible_no_log': None, 'failed': False, 'changed': False}]}
ttl = 255, size = 1500, version = 4, porttype = 'portchannel', tbinfo = {'auto_recover': True, 'comment': 'Tests Arista Arista-7280DR3A-36', 'conf-name': 'ardut', 'duts': ['qzd544'], ...}

Steps to Reproduce

Run voq/test_voq_ipfwd.py with topo t2_single_node_min with msft-202503 image + sonic-mgmt.

Actual Behavior and Expected Behavior

Test should pass.

Relevant log output

Output of show version

Attach files (if any)

No response

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions