Skip to content

test_lag_2 failed on kvm testbed #2480

@lguohan

Description

@lguohan

Description

Steps to reproduce the issue:

  1. ./run_tests.sh -i veos_vtb -d vlab-01 -n vms-kvm-t0 -f vtestbed.csv -k debug -l warning -m individual -q 1 -a False -e --disable_loganalyzer -u -c pc/test_lag_2.py

Describe the results you received:

======================================================================================================= FAILURES =======================================================================================================
_________________________________________________________________________________________ test_lag[unknown|unknown-single_lag] _________________________________________________________________________________________

common_setup_teardown = <tests.common.devices.PTFHost object at 0x7fab4fe58e10>, duthosts = <tests.common.devices.DutHosts object at 0x7fab50880950>
tbinfo = {'comment': 'Tests virtual switch vm', 'conf-name': 'vms-kvm-t0', 'duts': ['vlab-01'], 'group-name': 'vms6-1', ...}
nbrhosts = {'ARISTA01T1': {'conf': {'bgp': {'asn': 64600, 'peers': {65100: ['10.0.0.56', 'FC00::71']}}, 'bp_interface': {'ipv4': ... 'ipv6': 'fc00::7e/126'}}, 'properties': ['common']}, 'host': <tests.common.devices.EosHost object at 0x7fab4eb74b50>}}
fanouthosts = {}, conn_graph_facts = {'device_info': [{}], 'device_port_vlans': [{}]}, all_pcs = 'unknown|unknown', testcase = 'single_lag'

    @pytest.mark.parametrize("testcase", ["single_lag",
                                          "lacp_rate",
                                          "fallback"])
    def test_lag(common_setup_teardown, duthosts, tbinfo, nbrhosts, fanouthosts, conn_graph_facts, all_pcs, testcase):
        ptfhost = common_setup_teardown
    
        dut_name, dut_lag = decode_dut_port_name(all_pcs)
    
        some_test_ran = False
        for duthost in duthosts:
            if dut_name in [ 'unknown', duthost.hostname ]:
                lag_facts = duthost.lag_facts(host = duthost.hostname)['ansible_facts']['lag_facts']
    
>               test_instance = LagTest(duthost, tbinfo, ptfhost, nbrhosts, fanouthosts, conn_graph_facts)

all_pcs    = 'unknown|unknown'
common_setup_teardown = <tests.common.devices.PTFHost object at 0x7fab4fe58e10>
conn_graph_facts = {'device_info': [{}], 'device_port_vlans': [{}]}
dut_lag    = 'unknown'
dut_name   = 'unknown'
duthost    = <tests.common.devices.MultiAsicSonicHost object at 0x7fab508801d0>
duthosts   = <tests.common.devices.DutHosts object at 0x7fab50880950>
fanouthosts = {}
lag_facts  = {'lags': {'PortChannel0001': {'po_config': {'device': u'PortChannel0001', 'hwaddr': u'52:54:00:03:66:e0', 'ports': {'E...e': u'PortChannel0004'}}}}}, 'names': [u'PortChannel0001', u'PortChannel0003', u'PortChannel0002', u'PortChannel0004']}
nbrhosts   = {'ARISTA01T1': {'conf': {'bgp': {'asn': 64600, 'peers': {65100: ['10.0.0.56', 'FC00::71']}}, 'bp_interface': {'ipv4': ... 'ipv6': 'fc00::7e/126'}}, 'properties': ['common']}, 'host': <tests.common.devices.EosHost object at 0x7fab4eb74b50>}}
ptfhost    = <tests.common.devices.PTFHost object at 0x7fab4fe58e10>
some_test_ran = False
tbinfo     = {'comment': 'Tests virtual switch vm', 'conf-name': 'vms-kvm-t0', 'duts': ['vlab-01'], 'group-name': 'vms6-1', ...}
testcase   = 'single_lag'

pc/test_lag_2.py:249: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pc/test_lag_2.py:43: in __init__
    self.mg_facts         = duthost.get_extended_minigraph_facts(tbinfo)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.common.devices.SonicHost object at 0x7fab508806d0>, tbinfo = {'comment': 'Tests virtual switch vm', 'conf-name': 'vms-kvm-t0', 'duts': ['vlab-01'], 'group-name': 'vms6-1', ...}

    def get_extended_minigraph_facts(self, tbinfo):
        mg_facts = self.minigraph_facts(host = self.hostname)['ansible_facts']
        mg_facts['minigraph_ptf_indeces'] = mg_facts['minigraph_port_indices'].copy()
    
        # Fix the ptf port index for multi-dut testbeds. These testbeds have
        # multiple DUTs sharing a same PTF host. Therefore, the indeces from
        # the minigraph facts are not always match up with PTF port indeces.
        try:
            dut_index = tbinfo['duts'].index(self.hostname)
>           map = tbinfo['topo']['ptf_map'][dut_index]
E           KeyError: 0

dut_index  = 0
mg_facts   = {'deployment_id': u'1', 'dhcp_servers': [u'192.0.0.1', u'192.0.0.2', u'192.0.0.3', u'192.0.0.4'], 'forced_mgmt_routes': [], 'inventory_hostname': u'vlab-01', ...}
self       = <tests.common.devices.SonicHost object at 0x7fab508806d0>
tbinfo     = {'comment': 'Tests virtual switch vm', 'conf-name': 'vms-kvm-t0', 'duts': ['vlab-01'], 'group-name': 'vms6-1', ...}

common/devices.py:1057: KeyError
------------------------------------------------------------------------- generated xml file: /var/src/sonic-mgmt/tests/logs/pc/test_lag_2.xml -------------------------------------------------------------------------
=============================================================================================== short test summary info ================================================================================================
FAILED pc/test_lag_2.py::test_lag[unknown|unknown-single_lag] - KeyError: 0
============================================================================================== 1 failed in 26.33 seconds ===============================================================================================
INFO:tests.common.plugins.sanity_check:Start post-test sanity check
INFO:tests.common.plugins.sanity_check:No post-test check is required. Done post-test sanity check
INFO:tests.common.fixtures.ptfhost_utils:Delete PTF test files from PTF host 'ptf-01'
DEBUG:root:/var/src/sonic-mgmt/tests/common/fixtures/ptfhost_utils.py::copy_ptftests_directory#54: [ptf-01] AnsibleModule::file, args=[], kwargs={"path": "/root/ptftests", "state": "absent"}
DEBUG:root:/var/src/sonic-mgmt/tests/common/fixtures/ptfhost_utils.py::copy_ptftests_directory#54: [ptf-01] AnsibleModule::file Result => {"failed": false, "state": "absent", "_ansible_no_log": false, "path": "/root/ptftests", "invocation": {"module_args": {"directory_mode": null, "force": false, "remote_src": null, "access_time": null, "access_time_format": "%Y%m%d%H%M.%S", "_original_basename": null, "follow": true, "owner": null, "path": "/root/ptftests", "src": null, "group": null, "modification_time": null, "unsafe_writes": null, "delimiter": null, "regexp": null, "seuser": null, "recurse": false, "serole": null, "_diff_peek": null, "content": null, "state": "absent", "mode": null, "modification_time_format": "%Y%m%d%H%M.%S", "selevel": null, "attributes": null, "backup": null, "setype": null}}, "diff": {"after": {"path": "/root/ptftests", "state": "absent"}, "before": {"path": "/root/ptftests", "state": "directory"}}, "changed": true}

Describe the results you expected:
test pass.

Additional information you deem important:

**Output of `show version`:**

```
(paste your output here)
```

**Attach debug file `sudo generate_dump`:**

```
(paste your output here)
```

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions