IndexError: list index out of range
Stack trace
duthosts = <tests.common.devices.duthosts.DutHosts object at 0x7f31970d5690>
tbinfo = {'auto_recover': 'True', 'comment': 'v-saidia', 'conf-name': 'vms26-t2-chassis-1', 'duts': ['str2-sonic-lc3-1', 'str2-sonic-lc6-1', 'str2-sonic-lc7-1', 'str2-sonic-sup-1'], ...}
def test_update_testbed_metadata(duthosts, tbinfo):
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)
dut = <MultiAsicSonicHost> str2-sonic-sup-1
duthosts = <tests.common.devices.duthosts.DutHosts object at 0x7f31970d5690>
dutinfo = {'asic_services': defaultdict(<type 'list'>, {}), 'features': {'bgp': 'enabled', 'database': 'always_enabled', 'dhcp_r......}, 'Ethernet100': {'admin_state': u'up', 'alias': u'Ethernet26/1', 'fec': u'rs', 'name': u'Ethernet100', ...}, ...}}
metadata = {'str2-sonic-lc3-1': {'asic_services': defaultdict(<type 'list'>, {}), 'features': {'bgp': 'enabled', 'database': 'alwa.....}, 'Ethernet100': {'admin_state': u'up', 'alias': u'Ethernet26/1', 'fec': u'rs', 'name': u'Ethernet100', ...}, ...}}}
tbinfo = {'auto_recover': 'True', 'comment': 'v-saidia', 'conf-name': 'vms26-t2-chassis-1', 'duts': ['str2-sonic-lc3-1', 'str2-sonic-lc6-1', 'str2-sonic-lc7-1', 'str2-sonic-sup-1'], ...}
tbname = 'vms26-t2-chassis-1'
test_pretest.py:135:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_pretest.py:106: in collect_dut_info
fe = random.choice(front_end_asics)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <random.Random object at 0x55c989ebd070>, seq = []
def choice(self, seq):
"""Choose a random element from a non-empty sequence."""
> return seq[int(self.random() * len(seq))] # raises IndexError if seq is empty
E IndexError: list index out of range
self = <random.Random object at 0x55c989ebd070>
seq = []
Description
The
test_update_testbed_metadatafails on supervisor card.Steps to reproduce the issue:
test_update_testbed_metadataon sonic chassisDescribe the results you received:
The test
test_update_testbed_metadatafails with below errorDescribe the results you expected:
The test case must pass without any errors