From af55385203735b5e760515902d20b4ffefbb1612 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Tue, 15 Dec 2015 15:26:46 -0500 Subject: [PATCH] remove nova-cert from most functional tests nova-cert is only needed for 1 API resource (os-certificates) and the ec2 api. We don't need to run it on all the other functional tests. Getting rid of a service start / stop on all of them shaves a little time off each test, and means noise in logs. Change-Id: I175b8913fe5d19c8b552c60c793565c042c6b874 --- .../availability-zone-detail-resp.json | 7 ------- doc/api_samples/os-hosts/hosts-list-resp.json | 5 ----- .../availability-zone-detail-resp.json.tpl | 7 ------- .../api_samples/os-hosts/hosts-list-resp.json.tpl | 5 ----- .../functional/api_sample_tests/test_certificates.py | 12 ++++++++++++ nova/tests/functional/integrated_helpers.py | 9 --------- 6 files changed, 12 insertions(+), 33 deletions(-) diff --git a/doc/api_samples/os-availability-zone/availability-zone-detail-resp.json b/doc/api_samples/os-availability-zone/availability-zone-detail-resp.json index 65f6925908fc..5612a310b34b 100644 --- a/doc/api_samples/os-availability-zone/availability-zone-detail-resp.json +++ b/doc/api_samples/os-availability-zone/availability-zone-detail-resp.json @@ -2,13 +2,6 @@ "availabilityZoneInfo": [ { "hosts": { - "cert": { - "nova-cert": { - "active": true, - "available": true, - "updated_at": null - } - }, "conductor": { "nova-conductor": { "active": true, diff --git a/doc/api_samples/os-hosts/hosts-list-resp.json b/doc/api_samples/os-hosts/hosts-list-resp.json index 5bdcae9b64e3..1413b3aabdc5 100644 --- a/doc/api_samples/os-hosts/hosts-list-resp.json +++ b/doc/api_samples/os-hosts/hosts-list-resp.json @@ -10,11 +10,6 @@ "service": "compute", "zone": "nova" }, - { - "host_name": "a942ebfa00064d9d89a9e5a175cb9ba8", - "service": "cert", - "zone": "internal" - }, { "host_name": "e73ec0bd35c64de4a1adfa8b8969a1f6", "service": "consoleauth", diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-availability-zone/availability-zone-detail-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-availability-zone/availability-zone-detail-resp.json.tpl index c38d8928889e..0ed71fe74d3d 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/os-availability-zone/availability-zone-detail-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/os-availability-zone/availability-zone-detail-resp.json.tpl @@ -9,13 +9,6 @@ "updated_at": %(strtime_or_none)s } }, - "cert": { - "nova-cert": { - "active": true, - "available": true, - "updated_at": %(strtime_or_none)s - } - }, "conductor": { "nova-conductor": { "active": true, diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-hosts/hosts-list-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-hosts/hosts-list-resp.json.tpl index 1d705e83e23a..bbf2dba785d9 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/os-hosts/hosts-list-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/os-hosts/hosts-list-resp.json.tpl @@ -10,11 +10,6 @@ "service": "compute", "zone": "nova" }, - { - "host_name": "%(host_name)s", - "service": "cert", - "zone": "internal" - }, { "host_name": "%(host_name)s", "service": "consoleauth", diff --git a/nova/tests/functional/api_sample_tests/test_certificates.py b/nova/tests/functional/api_sample_tests/test_certificates.py index 7fb151a84df9..7512336ab394 100644 --- a/nova/tests/functional/api_sample_tests/test_certificates.py +++ b/nova/tests/functional/api_sample_tests/test_certificates.py @@ -15,7 +15,9 @@ from oslo_config import cfg +from nova import crypto from nova.tests.functional.api_sample_tests import api_sample_base +from nova.tests.unit import fake_crypto CONF = cfg.CONF CONF.import_opt('osapi_compute_extension', @@ -32,6 +34,16 @@ class CertificatesSamplesJsonTest(api_sample_base.ApiSampleTestBaseV21): 'nova.api.openstack.compute.contrib.certificates.Certificates') return f + def setUp(self): + super(CertificatesSamplesJsonTest, self).setUp() + self.stubs.Set(crypto, 'ensure_ca_filesystem', + fake_crypto.ensure_ca_filesystem) + self.stubs.Set(crypto, 'fetch_ca', + fake_crypto.fetch_ca) + self.stubs.Set(crypto, 'generate_x509_cert', + fake_crypto.generate_x509_cert) + self.cert = self.start_service('cert') + def test_create_certificates(self): response = self._do_post('os-certificates', 'certificate-create-req', {}) diff --git a/nova/tests/functional/integrated_helpers.py b/nova/tests/functional/integrated_helpers.py index 310dd8722408..3abaabeaa2ab 100644 --- a/nova/tests/functional/integrated_helpers.py +++ b/nova/tests/functional/integrated_helpers.py @@ -24,14 +24,12 @@ import uuid from oslo_config import cfg from oslo_log import log as logging -from nova import crypto import nova.image.glance from nova import service from nova import test from nova.tests import fixtures as nova_fixtures from nova.tests.functional.api import client from nova.tests.unit import cast_as_call -from nova.tests.unit import fake_crypto import nova.tests.unit.image.fake @@ -76,12 +74,6 @@ class _IntegratedTestBase(test.TestCase): self.flags(verbose=True) nova.tests.unit.image.fake.stub_out_image_service(self.stubs) - self.stubs.Set(crypto, 'ensure_ca_filesystem', - fake_crypto.ensure_ca_filesystem) - self.stubs.Set(crypto, 'fetch_ca', - fake_crypto.fetch_ca) - self.stubs.Set(crypto, 'generate_x509_cert', - fake_crypto.generate_x509_cert) self._setup_services() self.api_fixture = self.useFixture( @@ -110,7 +102,6 @@ class _IntegratedTestBase(test.TestCase): self.conductor = self.start_service('conductor', manager=CONF.conductor.manager) self.compute = self._setup_compute_service() - self.cert = self.start_service('cert') self.consoleauth = self.start_service('consoleauth') self.network = self.start_service('network')