]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Do not assume order of iptables_firewall method responses
authorCedric Brandily <zzelle@gmail.com>
Tue, 26 May 2015 17:54:22 +0000 (19:54 +0200)
committerCedric Brandily <zzelle@gmail.com>
Wed, 27 May 2015 09:42:13 +0000 (11:42 +0200)
commite9d17b8bfff31072a3d017ce64e36ac99007a052
tree6a09d7a9704606e1895c4804aeb2176a5c9dfbf6
parent3425be06bf069a256dbb0fdb9528459544e9947f
Do not assume order of iptables_firewall method responses

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

The test assumed that the _get_remote_sg_ids and
_determine_remote_sgs_to_remove methods from
neutron.agent.linux.iptables_firewall returned elements in a particular
order. Found with PYTHONHASHSEED=1.

The fix refactors the test case to handle unsorted responses from
_get_remote_sg_ids and _determine_remote_sgs_to_remove.

[1] neutron.tests.unit.agent.linux.test_iptables_firewall:
 test_prepare_port_filter_with_new_members
 test_prepare_port_filter_with_sg_no_member
 test_remove_port_filter_with_destroy_ipset_chain

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