This fixes the test_interface unit tests[1] that breaks with a
randomized PYTHONHASHSEED (see the bug report).
The test assumed that the init_l3 method from
neutron.agent.linux.interface had dictionary elements in a particular
order. Found with PYTHONHASHSEED=2.
The fix refactors the test case to handle unsorted dictionaries in
init_l3.
[1] neutron.tests.unit.agent.linux.test_interface.TestABCDriver
Partial-bug: #
1348818
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: I1948593b4d7a0069ef060512942b548c74a6b369
mock.call().addr.delete('2001:db8:a::123/64'),
mock.call().route.list_onlink_routes(constants.IP_VERSION_4),
mock.call().route.list_onlink_routes(constants.IP_VERSION_6),
- mock.call().route.add_onlink_route('172.20.0.0/24')])
+ mock.call().route.add_onlink_route('172.20.0.0/24')],
+ any_order=True)
def test_l3_init_with_ipv6_delete_onlink_routes(self):
addresses = [dict(scope='global',