Browse Source

Do not assume order of pci slot list

This fixes the neutron.tests.unit.sriovnicagent.test_eswitch_manager
.TestEmbSwitch.test_get_pci_list unit test that breaks with a
randomized PYTHONHASHSEED (see the bug report).

The test assumed that the pci slot list was sorted, so sort
the result before comparing.

Note: There are several other unrelated unit tests that also break with a
randomized PYTHONHASHSEED, but they are not addressed here. They will be
addressed in separate patches.

Change-Id: Ia2d879cc1251fb9cf9b653a41064e902b30005af
Partial-bug: #1348818
changes/35/111835/4
Pritesh Kothari 8 years ago committed by pritesh
parent
commit
b0f68bb145
  1. 3
      neutron/tests/unit/sriovnicagent/test_eswitch_manager.py

3
neutron/tests/unit/sriovnicagent/test_eswitch_manager.py

@ -280,7 +280,8 @@ class TestEmbSwitch(base.BaseTestCase):
def test_get_pci_list(self):
result = self.emb_switch.get_pci_slot_list()
self.assertEqual([tup[0] for tup in self.SCANNED_DEVICES], result)
self.assertEqual([tup[0] for tup in self.SCANNED_DEVICES],
sorted(result))
class TestPciOsWrapper(base.BaseTestCase):

Loading…
Cancel
Save