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
:%(bn)s-PREROUTING - [0:0]
[0:0] -A PREROUTING -j %(bn)s-PREROUTING
[0:0] -A OUTPUT -j %(bn)s-OUTPUT
-[0:0] -A %(bn)s-PREROUTING -m physdev --physdev-in qvbtap_port1 -j CT --zone 1
-[0:0] -A %(bn)s-PREROUTING -m physdev --physdev-in tap_port1 -j CT --zone 1
-[0:0] -A %(bn)s-PREROUTING -m physdev --physdev-in qvbtap_port2 -j CT --zone 1
-[0:0] -A %(bn)s-PREROUTING -m physdev --physdev-in tap_port2 -j CT --zone 1
+[0:0] -A %(bn)s-PREROUTING -m physdev --physdev-in qvbtap_%(port1)s \
+-j CT --zone 1
+[0:0] -A %(bn)s-PREROUTING -m physdev --physdev-in tap_%(port1)s -j CT --zone 1
+[0:0] -A %(bn)s-PREROUTING -m physdev --physdev-in qvbtap_%(port2)s \
+-j CT --zone 1
+[0:0] -A %(bn)s-PREROUTING -m physdev --physdev-in tap_%(port2)s -j CT --zone 1
COMMIT
# Completed by iptables_manager
""" % IPTABLES_ARG