]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Do not assume order of security group rules
authorCedric Brandily <zzelle@gmail.com>
Wed, 27 May 2015 18:30:28 +0000 (20:30 +0200)
committerCedric Brandily <zzelle@gmail.com>
Thu, 28 May 2015 16:31:50 +0000 (16:31 +0000)
commit36a1d14b58028d0294e67786129a2a09ce393cde
treeb016b3449afee569b29ec183a06c18a69d7af543
parent7de7df280bf44a699906217e1552f8a12824185e
Do not assume order of security group rules

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

The test assumed that the security_group_rules_for_devices method from
neutron.agent.securitygroups_rpc returned security group rules in a
particular order. Found with PYTHONHASHSEED=2.

The fix refactors the test case to handle unsorted security group rules.

[1] neutron.tests.unit.plugins.ml2.test_security_group.\
    TestMl2SGServerRpcCallBack.\
    test_security_group_rules_for_devices_ipv4_ingress_addr_pair

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