From a4a2bfd0bf8d2e910197052a6894883dc2e48e9b Mon Sep 17 00:00:00 2001 From: Soren Hansen Date: Fri, 15 Oct 2010 21:46:29 +0200 Subject: [PATCH 1/2] Perform a redisectomy on bin/nova-dhcpbridge. --- bin/nova-dhcpbridge | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bin/nova-dhcpbridge b/bin/nova-dhcpbridge index a127ed03..e688fb53 100755 --- a/bin/nova-dhcpbridge +++ b/bin/nova-dhcpbridge @@ -41,7 +41,6 @@ from nova.network import linux_net FLAGS = flags.FLAGS flags.DECLARE('auth_driver', 'nova.auth.manager') -flags.DECLARE('redis_db', 'nova.datastore') flags.DECLARE('network_size', 'nova.network.manager') flags.DECLARE('num_networks', 'nova.network.manager') flags.DECLARE('update_dhcp_on_disassociate', 'nova.network.manager') @@ -94,11 +93,10 @@ def main(): interface = os.environ.get('DNSMASQ_INTERFACE', 'br0') if int(os.environ.get('TESTING', '0')): FLAGS.fake_rabbit = True - FLAGS.redis_db = 8 FLAGS.network_size = 16 FLAGS.connection_type = 'fake' FLAGS.fake_network = True - FLAGS.auth_driver = 'nova.auth.ldapdriver.FakeLdapDriver' + FLAGS.auth_driver = 'nova.auth.dbdriver.DbDriver' FLAGS.num_networks = 5 path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', From 6bfaeb954f0f0c96f73d91890a50448443ac9133 Mon Sep 17 00:00:00 2001 From: Soren Hansen Date: Fri, 15 Oct 2010 21:49:31 +0200 Subject: [PATCH 2/2] Add a greenthread.sleep(0.3) in get_console_output unit test. This is needed because, for eventlet based unit tests, rpc polls, and there's a bit of a race. We need to fix this properly later on. --- nova/tests/cloud_unittest.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nova/tests/cloud_unittest.py b/nova/tests/cloud_unittest.py index ff466135..36ab6029 100644 --- a/nova/tests/cloud_unittest.py +++ b/nova/tests/cloud_unittest.py @@ -26,6 +26,7 @@ import StringIO import tempfile import time +from eventlet import greenthread from twisted.internet import defer import unittest from xml.etree import ElementTree @@ -101,6 +102,9 @@ class CloudTestCase(test.TrialTestCase): instance_id = rv['instancesSet'][0]['instanceId'] output = yield self.cloud.get_console_output(context=self.context, instance_id=[instance_id]) self.assertEquals(b64decode(output['output']), 'FAKE CONSOLE OUTPUT') + # TODO(soren): We need this until we can stop polling in the rpc code + # for unit tests. + greenthread.sleep(0.3) rv = yield self.cloud.terminate_instances(self.context, [instance_id])