]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Fix PYTHONHASHSEED bugs in test_security_groups_rpc
authorJohn Davidge <jodavidg@cisco.com>
Wed, 22 Oct 2014 09:28:52 +0000 (02:28 -0700)
committerJohn Davidge <jodavidg@cisco.com>
Mon, 17 Nov 2014 19:00:28 +0000 (19:00 +0000)
commitd8ee3055eeffb8779caf2fb355ab4b84d5b280db
tree89ce9c341e5d297d786ef7c62d2c5a210dfb09ad
parentaa3b5dda15293a77ad12599084c54dd6ecb20302
Fix PYTHONHASHSEED bugs in test_security_groups_rpc

This fixes the test_security_groups_rpc unit test that breaks with a
randomized PYTHONHASHSEED (see the bug report).

The test assumed that several Dicts had elements in a particular order.
Found with PYTHONHASHSEED=2701526934.

The fix refactors the test case by using an OrderedDict instead of a Dict.
Or in the case of the regex strings, injecting different values depending
on the order of the devices2 and devices3 Dicts.

An upstream spelling mistake is also addressed in this patch.

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: I744117edfc5869b0750349a89f2792f622e4285d
neutron/tests/unit/test_security_groups_rpc.py