diff options
author | Jenkins <jenkins@review.openstack.org> | 2016-08-01 12:50:53 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2016-08-01 12:50:53 +0000 |
commit | 3a87803db99c6d137f96d7105f56e457ef2c7c3b (patch) | |
tree | 39530c947dbd46b07c1dfb7e80409b0b0ebbfe14 | |
parent | 871754ff303db9bfd38ad23633128904b274a105 (diff) | |
parent | d946fb1862dacf3569d7d47759427d1460b64d11 (diff) | |
download | oslo-messaging-3a87803db99c6d137f96d7105f56e457ef2c7c3b.tar.gz |
Merge "Fix pika functional tests"5.6.0
-rw-r--r-- | oslo_messaging/tests/functional/test_rabbitmq.py | 15 | ||||
-rw-r--r-- | oslo_messaging/tests/utils.py | 3 |
2 files changed, 14 insertions, 4 deletions
diff --git a/oslo_messaging/tests/functional/test_rabbitmq.py b/oslo_messaging/tests/functional/test_rabbitmq.py index 74fb73e..9a0427e 100644 --- a/oslo_messaging/tests/functional/test_rabbitmq.py +++ b/oslo_messaging/tests/functional/test_rabbitmq.py @@ -34,11 +34,15 @@ class ConnectedPortMatcher(object): class RabbitMQFailoverTests(test_utils.BaseTestCase): + DRIVERS = [ + "rabbit", + ] + def test_failover_scenario(self): - # NOTE(sileht): run this test only if functionnal suite run of a driver + # NOTE(sileht): run this test only if functional suite run of a driver # that use rabbitmq as backend self.driver = os.environ.get('TRANSPORT_DRIVER') - if self.driver not in ["pika", "rabbit"]: + if self.driver not in self.DRIVERS: self.skipTest("TRANSPORT_DRIVER is not set to a rabbit driver") # NOTE(sileht): Allow only one response at a time, to @@ -51,7 +55,6 @@ class RabbitMQFailoverTests(test_utils.BaseTestCase): rabbit_retry_backoff=0, group='oslo_messaging_rabbit') - # self.pifpaf = self.useFixture(rabbitmq.RabbitMQDriver(cluster=True, port=5692)) @@ -60,6 +63,10 @@ class RabbitMQFailoverTests(test_utils.BaseTestCase): self.n2 = self.pifpaf.env["PIFPAF_RABBITMQ_NODENAME2"] self.n3 = self.pifpaf.env["PIFPAF_RABBITMQ_NODENAME3"] + # NOTE(gdavoian): additional tweak for pika driver + if self.driver == "pika": + self.url = self.url.replace("rabbit", "pika") + # ensure connections will be establish to the first node self.pifpaf.stop_node(self.n2) self.pifpaf.stop_node(self.n3) @@ -118,7 +125,7 @@ class RabbitMQFailoverTests(test_utils.BaseTestCase): rpc_server = self.servers.servers[0].server # FIXME(sileht): Check other connections connections = [ - rpc_server.listener._poll_style_listener._connection + rpc_server.listener._connection ] for conn in connections: self.assertEqual( diff --git a/oslo_messaging/tests/utils.py b/oslo_messaging/tests/utils.py index aa2a563..c5fca87 100644 --- a/oslo_messaging/tests/utils.py +++ b/oslo_messaging/tests/utils.py @@ -39,6 +39,9 @@ class BaseTestCase(base.BaseTestCase): self.messaging_conf.transport_driver = 'fake' self.conf = self.messaging_conf.conf + self.conf.project = 'project' + self.conf.prog = 'prog' + moxfixture = self.useFixture(moxstubout.MoxStubout()) self.mox = moxfixture.mox self.stubs = moxfixture.stubs |