From 932af34740162406aced0b08c54b7213bbd5022f Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Fri, 7 Dec 2012 11:30:02 -0800 Subject: Fix network manager ipv6 tests. When using a test runner that runs tests in a different order than nosetests it is possible that IPv6AccountIdentiferTestCase tests run before CommonNetworkTestCase. If this happens IPv6AccountIdentiferTestCase sets the ipv6_backend to account_identifier which causes the regexes in CommonNetworkTestCase.test_get_instance_uuids_by_ipv6_regex to not match. Explicitly set the ipv6_backend to rfc2462 in CommonNetworkTestCase's setUp() to ensure the regex's match the addresses in the fake network DB. Part of blueprint grizzly-testtools Change-Id: I0fdb5c3d4130c6cf23b22bca6645581f603a79c5 --- nova/tests/network/test_manager.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nova/tests/network/test_manager.py b/nova/tests/network/test_manager.py index b12d12167..700b74141 100644 --- a/nova/tests/network/test_manager.py +++ b/nova/tests/network/test_manager.py @@ -23,6 +23,7 @@ from nova import context from nova import db from nova.db.sqlalchemy import models from nova import exception +from nova import ipv6 from nova.network import linux_net from nova.network import manager as network_manager from nova.openstack.common import importutils @@ -1118,6 +1119,8 @@ class CommonNetworkTestCase(test.TestCase): def setUp(self): super(CommonNetworkTestCase, self).setUp() self.context = context.RequestContext('fake', 'fake') + self.flags(ipv6_backend='rfc2462') + ipv6.reset_backend() def fake_create_fixed_ips(self, context, network_id, fixed_cidr=None): return None -- cgit