]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Do not assume order of dictionary elements in init_l3
authorCedric Brandily <zzelle@gmail.com>
Wed, 27 May 2015 17:57:04 +0000 (19:57 +0200)
committerCedric Brandily <zzelle@gmail.com>
Wed, 27 May 2015 17:57:04 +0000 (19:57 +0200)
commite135bcea472e08347fc3dc3df01aa1fa909504fb
tree668b47c1f8007eee1d76443ad2aa3a7c124453f8
parentd518307cef8e23b040020b85da05ddc56c570e96
Do not assume order of dictionary elements in init_l3

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
neutron/tests/unit/agent/linux/test_interface.py