]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Fix PYTHONHASHSEED bugs in test_security_groups_rpc
authorCedric Brandily <zzelle@gmail.com>
Thu, 28 May 2015 07:07:23 +0000 (09:07 +0200)
committerCedric Brandily <zzelle@gmail.com>
Thu, 28 May 2015 07:44:54 +0000 (09:44 +0200)
commitb4363a48214f1bb21bd7934f05a6440bb5d66bb7
treeffa5a6fd945628c0302b7454f37fb50a55f21dcc
parentd518307cef8e23b040020b85da05ddc56c570e96
Fix PYTHONHASHSEED bugs in test_security_groups_rpc

This fixes the test_security_group_member/rule_updated unit tests[1]
that breaks with a randomized PYTHONHASHSEED (see the bug report).

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

The fix refactors the test case by injecting values using the same
ordering[2].

[1] neutron.tests.unit.agent.test_securitygroups_rpc.\
   TestSecurityGroupAgentWithOVSIptables

[2] https://github.com/openstack/neutron/blob/\
   e8364a72e62d83e5a76bec1d7aa76ecfe2ed53ac/\
   neutron/tests/unit/agent/test_securitygroups_rpc.py#L1630-L1635

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: I5077764045a34d1be0e85bb4b80f3655e87692cc
neutron/tests/unit/agent/test_securitygroups_rpc.py