Skip to content

[chassis] test_update_testbed_metadata failing on some testbeds #7266

@arlakshm

Description

@arlakshm

Description

Steps to reproduce the issue:

  1. run the tests in test_pretest.py
  2. The test test_update_testbed_metadata fails with following error
    def test_update_testbed_metadata(duthosts, tbinfo, fanouthosts):
        metadata = {}
        tbname = tbinfo['conf-name']
        pytest_require(tbname, "skip test due to lack of testbed name.")

        for dut in duthosts:
            dutinfo = collect_dut_info(dut)
            metadata[dut.hostname] = dutinfo

        info = { tbname : metadata }
        folder = 'metadata'
        filepath = os.path.join(folder, tbname + '.json')
        try:
            if not os.path.exists(folder):
                os.mkdir(folder)
            with open(filepath, 'w') as yf:
                json.dump(info, yf, indent=4)
        except IOError as e:
            logger.warning('Unable to create file {}: {}'.format(filepath, e))

>       prepare_autonegtest_params(duthosts, fanouthosts)

dut        = <MultiAsicSonicHost str2-sonic-sup-1>
duthosts   = [<MultiAsicSonicHost str2-sonic-lc5-1>, <MultiAsicSonicHost str2-sonic-lc6-1>, <MultiAsicSonicHost str2-sonic-lc7-1>, <MultiAsicSonicHost str2-sonic-sup-1>]
dutinfo    = {'asic_services': defaultdict(<type 'list'>, {'lldp': [], 'database': [], 'bgp': [], 'teamd': [], 'syncd': [], 'swss':...: 'enabled', 'bgp': 'enabled', 'database': 'always_enabled', 'dhcp_relay': 'disabled', ...}, 'frontend_asics': [], ...}
fanouthosts = {'str2-fanout-acs-fan-21': { os: 'eos', hostname: 'str2-fanout-acs-fan-21', device_type: 'FanoutLeaf' }, 'str2-fanout-acs-fan-22': { os: 'eos', hostname: 'str2-fanout-acs-fan-22', device_type: 'FanoutLeaf' }}
filepath   = 'metadata/vms26-t2-sonic-1.json'
folder     = 'metadata'
info       = {'vms26-t2-sonic-1': {'str2-sonic-lc5-1': {'asic_services': defaultdict(<type 'list'>, {'lldp': ['lldp1'], 'database': [...'enabled', 'bgp': 'enabled', 'database': 'always_enabled', 'dhcp_relay': 'disabled', ...}, 'frontend_asics': [], ...}}}
metadata   = {'str2-sonic-lc5-1': {'asic_services': defaultdict(<type 'list'>, {'lldp': ['lldp1'], 'database': ['database0'], 'mac..... 'enabled', 'bgp': 'enabled', 'database': 'always_enabled', 'dhcp_relay': 'disabled', ...}, 'frontend_asics': [], ...}}
tbinfo     = {'auto_recover': 'True', 'comment': 'v-saidia', 'conf-name': 'vms26-t2-sonic-1', 'duts': ['str2-sonic-lc5-1', 'str2-sonic-lc6-1', 'str2-sonic-lc7-1', 'str2-sonic-sup-1'], ...}
tbname     = 'vms26-t2-sonic-1'
yf         = <closed file 'metadata/vms26-t2-sonic-1.json', mode 'w' at 0x7f01e29e46f0>

test_pretest.py:151:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_pretest.py:276: in prepare_autonegtest_params
    auto_neg_mode = fanout.get_auto_negotiation_mode(fanout_port)
common/devices/fanout.py:147: in get_auto_negotiation_mode
    return self.host.get_auto_negotiation_mode(interface_name)
common/devices/eos.py:283: in get_auto_negotiation_mode
    }], ignore_error=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

Describe the results you received:

Describe the results you expected:

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

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions