From: Pritesh Kothari Date: Mon, 4 Aug 2014 20:37:56 +0000 (-0700) Subject: Do not assume order of network_uuid's X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=31783e2eae339e79225f379ace948a0bb6c157f7;p=openstack-build%2Fneutron-build.git Do not assume order of network_uuid's This fixes the neutron.tests.unit.test_linux_dhcp.TestDnsmasq .test_existing_dhcp_networks unit test that breaks with a randomized PYTHONHASHSEED (see the bug report). The test assumed that the network_uuid's 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. Partial-bug: #1348818 Change-Id: Ia6f742e1fae0687164b841beebb4efcf31ff2625 --- diff --git a/neutron/tests/unit/test_linux_dhcp.py b/neutron/tests/unit/test_linux_dhcp.py index 98f06decf..2f83e01fb 100644 --- a/neutron/tests/unit/test_linux_dhcp.py +++ b/neutron/tests/unit/test_linux_dhcp.py @@ -1316,7 +1316,7 @@ tag:tag0,option:router""".lstrip() mock_listdir.assert_called_once_with(path) self.assertEqual(['aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb'], - result) + sorted(result)) def _check_version(self, cmd_out, expected_value): with mock.patch('neutron.agent.linux.utils.execute') as cmd: