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
This commit is contained in:
Pritesh Kothari 2014-08-04 14:14:20 -07:00 committed by pritesh
parent cada146fe3
commit b0f68bb145
1 changed files with 2 additions and 1 deletions

View File

@ -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):