]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Sort _get_new/deleted_set_ips responses in unittests
authorCedric Brandily <zzelle@gmail.com>
Tue, 26 May 2015 14:38:26 +0000 (14:38 +0000)
committerCedric Brandily <zzelle@gmail.com>
Fri, 29 May 2015 15:44:01 +0000 (17:44 +0200)
commit77303fbeaa060bcee2befad65dccb457fbb6ab65
tree9537477a7116be7a0e344d82ffd1cc06098a7467
parent2f8373aff60b7293bcc46137a366bf917d784996
Sort _get_new/deleted_set_ips responses in unittests

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

The test assumed that the _get_new/deleted_set_ips from
neutron.agent.linux.ipset_manager return elements in a particular order.
Found with PYTHONHASHSEED=1.

The fix refactors the test case to force sorted responses from
_get_new/deleted_set_ips during unittests.

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