From 72107bc963af334840eddd9638d821b408018db8 Mon Sep 17 00:00:00 2001 From: Corey Bryant Date: Wed, 29 Jan 2020 20:32:03 +0000 Subject: [PATCH] Port tests from Amulet to Zaza Zaza tests can be found here: https://github.com/openstack-charmers/zaza-openstack-tests/pull/68 func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/163 Closes-Bug: #1828424 Change-Id: I1cfebeb15485dd6d92638323d2c9e6bb85f568cb --- Makefile | 8 +- test-requirements.txt | 19 +- tests/README.md | 9 - tests/basic_deployment.py | 887 ------------------------------- tests/bundles/bionic-queens.yaml | 133 +++++ tests/bundles/bionic-rocky.yaml | 152 ++++++ tests/bundles/bionic-stein.yaml | 152 ++++++ tests/bundles/bionic-train.yaml | 167 ++++++ tests/bundles/trusty-mitaka.yaml | 105 ++++ tests/bundles/xenial-mitaka.yaml | 92 ++++ tests/bundles/xenial-ocata.yaml | 105 ++++ tests/bundles/xenial-pike.yaml | 152 ++++++ tests/bundles/xenial-queens.yaml | 152 ++++++ tests/dev-basic-cosmic-rocky | 23 - tests/gate-basic-bionic-queens | 23 - tests/gate-basic-bionic-rocky | 24 - tests/gate-basic-bionic-stein | 24 - tests/gate-basic-bionic-train | 24 - tests/gate-basic-disco-stein | 23 - tests/gate-basic-trusty-mitaka | 25 - tests/gate-basic-xenial-mitaka | 23 - tests/gate-basic-xenial-ocata | 24 - tests/gate-basic-xenial-pike | 24 - tests/gate-basic-xenial-queens | 24 - tests/tests.yaml | 41 +- tox.ini | 56 +- 26 files changed, 1264 insertions(+), 1227 deletions(-) delete mode 100644 tests/README.md delete mode 100644 tests/basic_deployment.py create mode 100644 tests/bundles/bionic-queens.yaml create mode 100644 tests/bundles/bionic-rocky.yaml create mode 100644 tests/bundles/bionic-stein.yaml create mode 100644 tests/bundles/bionic-train.yaml create mode 100644 tests/bundles/trusty-mitaka.yaml create mode 100644 tests/bundles/xenial-mitaka.yaml create mode 100644 tests/bundles/xenial-ocata.yaml create mode 100644 tests/bundles/xenial-pike.yaml create mode 100644 tests/bundles/xenial-queens.yaml delete mode 100755 tests/dev-basic-cosmic-rocky delete mode 100755 tests/gate-basic-bionic-queens delete mode 100755 tests/gate-basic-bionic-rocky delete mode 100755 tests/gate-basic-bionic-stein delete mode 100755 tests/gate-basic-bionic-train delete mode 100755 tests/gate-basic-disco-stein delete mode 100755 tests/gate-basic-trusty-mitaka delete mode 100755 tests/gate-basic-xenial-mitaka delete mode 100755 tests/gate-basic-xenial-ocata delete mode 100755 tests/gate-basic-xenial-pike delete mode 100755 tests/gate-basic-xenial-queens diff --git a/Makefile b/Makefile index 4b7b45b..57cffc8 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,16 @@ #!/usr/bin/make -PYTHON := /usr/bin/env python +PYTHON := /usr/bin/env python3 lint: @tox -e pep8 test: @echo Starting unit tests... - @tox -e py27 + @tox -e py37 functional_test: - @echo Starting functional tests... - @tox -e func27 + @echo Starting Zaza functional tests... + @tox -e func bin/charm_helpers_sync.py: @mkdir -p bin diff --git a/test-requirements.txt b/test-requirements.txt index 1419ac2..b40beae 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7,23 +7,8 @@ mock>=1.2 flake8>=2.2.4,<=2.4.1 stestr>=2.2.0 requests>=2.18.4 -# BEGIN: Amulet OpenStack Charm Helper Requirements -# Liberty client lower constraints -amulet>=1.14.3,<2.0;python_version=='2.7' -bundletester>=0.6.1,<1.0;python_version=='2.7' -python-ceilometerclient>=1.5.0 -python-cinderclient>=1.4.0,<5.0.0 -python-glanceclient>=1.1.0 -python-heatclient>=0.8.0 -python-keystoneclient>=1.7.1 -python-neutronclient>=3.1.0 -python-novaclient>=2.30.1 -python-openstackclient>=1.7.0 -python-swiftclient>=2.6.0 -pika>=0.10.0,<1.0 -distro-info -git+https://github.com/juju/charm-helpers.git#egg=charmhelpers -# END: Amulet OpenStack Charm Helper Requirements # NOTE: workaround for 14.04 pip/tox pytz pyudev # for ceph-* charm unit tests (not mocked?) +git+https://github.com/openstack-charmers/zaza.git#egg=zaza;python_version>='3.0' +git+https://github.com/openstack-charmers/zaza-openstack-tests.git#egg=zaza.openstack diff --git a/tests/README.md b/tests/README.md deleted file mode 100644 index 046be7f..0000000 --- a/tests/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Overview - -This directory provides Amulet tests to verify basic deployment functionality -from the perspective of this charm, its requirements and its features, as -exercised in a subset of the full OpenStack deployment test bundle topology. - -For full details on functional testing of OpenStack charms please refer to -the [functional testing](http://docs.openstack.org/developer/charm-guide/testing.html#functional-testing) -section of the OpenStack Charm Guide. diff --git a/tests/basic_deployment.py b/tests/basic_deployment.py deleted file mode 100644 index ad19d9c..0000000 --- a/tests/basic_deployment.py +++ /dev/null @@ -1,887 +0,0 @@ -# Copyright 2016 Canonical Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import amulet -import ceilometerclient.v2.client as ceilo_client - -from charmhelpers.contrib.openstack.amulet.deployment import ( - OpenStackAmuletDeployment -) - -from charmhelpers.contrib.openstack.amulet.utils import ( - OpenStackAmuletUtils, - DEBUG, - # ERROR -) - -# Use DEBUG to turn on debug logging -u = OpenStackAmuletUtils(DEBUG) - - -class CeiloAgentBasicDeployment(OpenStackAmuletDeployment): - """Amulet tests on a basic ceilometer-agent deployment.""" - - no_origin = ['memcached', 'percona-cluster', 'rabbitmq-server', - 'ceph-mon', 'ceph-osd'] - - def __init__(self, series, openstack=None, source=None, stable=False): - """Deploy the entire test environment.""" - super(CeiloAgentBasicDeployment, self).__init__(series, openstack, - source, stable) - self._add_services() - self._add_relations() - self._configure_services() - self._deploy() - - u.log.info('Waiting on extended status checks...') - self.exclude_services = ['mongodb', 'memcached'] - if self._get_openstack_release() >= self.xenial_pike: - # Ceilometer will come up blocked until the ceilometer-upgrade - # action is run - self.exclude_services.append("ceilometer") - self._auto_wait_for_status(exclude_services=self.exclude_services) - - self.d.sentry.wait() - self._initialize_tests() - - def _add_services(self): - """Add services - - Add the services that we're testing, where ceilometer is local, - and the rest of the service are from lp branches that are - compatible with the local charm (e.g. stable or next). - """ - # Note: ceilometer-agent becomes a subordinate of nova-compute - this_service = {'name': 'ceilometer-agent'} - other_services = [ - self.get_percona_service_entry(), - {'name': 'rabbitmq-server'}, - {'name': 'keystone'}, - {'name': 'glance'}, # to satisfy workload status - {'name': 'ceilometer'}, - {'name': 'nova-compute'}, - {'name': 'nova-cloud-controller'}, - ] - if self._get_openstack_release() >= self.xenial_pike: - other_services.extend([ - {'name': 'gnocchi'}, - {'name': 'memcached', - 'location': 'cs:~memcached-team/memcached'}, - {'name': 'ceph-mon', 'units': 3}, - {'name': 'ceph-osd', 'units': 3, - 'storage': {'osd-devices': 'cinder,10G'}}]) - else: - other_services.append({ - 'name': 'mongodb', - 'location': 'cs:~thedac/{}/mongodb'.format(self.series)}) - super(CeiloAgentBasicDeployment, self)._add_services( - this_service, - other_services, - no_origin=self.no_origin) - - def _add_relations(self): - """Add all of the relations for the services.""" - relations = { - 'ceilometer:amqp': 'rabbitmq-server:amqp', - 'ceilometer:identity-notifications': 'keystone:' - 'identity-notifications', - 'keystone:shared-db': 'percona-cluster:shared-db', - 'ceilometer:ceilometer-service': 'ceilometer-agent:' - 'ceilometer-service', - 'nova-compute:nova-ceilometer': 'ceilometer-agent:nova-ceilometer', - 'nova-compute:amqp': 'rabbitmq-server:amqp', - 'glance:identity-service': 'keystone:identity-service', - 'glance:shared-db': 'percona-cluster:shared-db', - 'glance:amqp': 'rabbitmq-server:amqp', - 'nova-compute:image-service': 'glance:image-service', - 'nova-cloud-controller:shared-db': 'percona-cluster:shared-db', - 'nova-cloud-controller:amqp': 'rabbitmq-server:amqp', - 'nova-cloud-controller:identity-service': 'keystone:' - 'identity-service', - 'nova-cloud-controller:cloud-compute': 'nova-compute:' - 'cloud-compute', - 'nova-cloud-controller:image-service': 'glance:image-service', - 'ceilometer-agent:amqp': 'rabbitmq-server:amqp', - } - if self._get_openstack_release() >= self.xenial_pike: - additional_relations = { - 'ceilometer:metric-service': 'gnocchi:metric-service', - 'ceph-mon:osd': 'ceph-osd:mon', - 'gnocchi:identity-service': 'keystone:identity-service', - 'gnocchi:shared-db': 'percona-cluster:shared-db', - 'gnocchi:storage-ceph': 'ceph-mon:client', - 'gnocchi:coordinator-memcached': 'memcached:cache', - } - - if self._get_openstack_release() >= self.xenial_queens: - identity_relations = {'ceilometer:identity-credentials': - 'keystone:identity-credentials'} - else: - identity_relations = {'ceilometer:identity-service': - 'keystone:identity-service'} - additional_relations.update(identity_relations) - else: - additional_relations = { - 'ceilometer:shared-db': 'mongodb:database', - 'ceilometer:identity-service': 'keystone:identity-service'} - relations.update(additional_relations) - super(CeiloAgentBasicDeployment, self)._add_relations(relations) - - def _configure_services(self): - """Configure all of the services.""" - keystone_config = { - 'admin-password': 'openstack', - 'admin-token': 'ubuntutesting' - } - pxc_config = { - 'max-connections': 1000, - } - configs = { - 'keystone': keystone_config, - 'percona-cluster': pxc_config, - } - super(CeiloAgentBasicDeployment, self)._configure_services(configs) - - def _get_token(self): - return self.keystone.service_catalog.catalog['token']['id'] - - def _initialize_tests(self): - """Perform final initialization before tests get run.""" - # Access the sentries for inspecting service units - self.ceil_sentry = self.d.sentry['ceilometer'][0] - self.ceil_agent_sentry = self.d.sentry['ceilometer-agent'][0] - self.pxc_sentry = self.d.sentry['percona-cluster'][0] - self.keystone_sentry = self.d.sentry['keystone'][0] - self.rabbitmq_sentry = self.d.sentry['rabbitmq-server'][0] - self.nova_sentry = self.d.sentry['nova-compute'][0] - if self._get_openstack_release() >= self.xenial_pike: - self.gnocchi_sentry = self.d.sentry['gnocchi'][0] - else: - self.mongodb_sentry = self.d.sentry['mongodb'][0] - u.log.debug('openstack release val: {}'.format( - self._get_openstack_release())) - u.log.debug('openstack release str: {}'.format( - self._get_openstack_release_string())) - - # Authenticate admin with keystone endpoint - self.keystone_session, self.keystone = u.get_default_keystone_session( - self.keystone_sentry, - openstack_release=self._get_openstack_release()) - - self.log.debug('Instantiating ceilometer client...') - if self._get_openstack_release() >= self.xenial_pike: - self.run_ceilometer_upgrade_action() - self.ceil = ceilo_client.Client(session=self.keystone_session,) - else: - # Authenticate admin with ceilometer endpoint - ep = self.keystone.service_catalog.url_for(service_type='metering', - interface='publicURL') - os_token = self.keystone.auth_token - self.ceil = ceilo_client.Client(endpoint=ep, token=os_token) - - def test_100_services(self): - """Verify the expected services are running on the corresponding - service units.""" - u.log.debug('Checking system services on units...') - release = self._get_openstack_release() - ceilometer_svcs = [ - 'ceilometer-agent-central', - 'ceilometer-agent-notification', - ] - if release < self.xenial_pike: - ceilometer_svcs.append('ceilometer-collector') - - if (release >= self.xenial_ocata and release < self.xenial_pike): - ceilometer_svcs.append('apache2') - - if release < self.xenial_ocata: - ceilometer_svcs.append('ceilometer-api') - - if release < self.trusty_mitaka: - ceilometer_svcs.append('ceilometer-alarm-evaluator') - ceilometer_svcs.append('ceilometer-alarm-notifier') - - service_names = { - self.ceil_sentry: ceilometer_svcs, - } - - ret = u.validate_services_by_name(service_names) - if ret: - amulet.raise_status(amulet.FAIL, msg=ret) - - u.log.debug('OK') - - def test_110_service_catalog(self): - """Verify that the service catalog endpoint data is valid.""" - if self._get_openstack_release() >= self.xenial_pike: - u.log.debug('Skipping catalogue checks as ceilometer no longer ' - 'registers endpoints') - return - u.log.debug('Checking keystone service catalog data...') - endpoint_check = { - 'adminURL': u.valid_url, - 'id': u.not_null, - 'region': 'RegionOne', - 'publicURL': u.valid_url, - 'internalURL': u.valid_url - } - expected = { - 'metering': [endpoint_check], - 'identity': [endpoint_check] - } - actual = self.keystone.service_catalog.get_endpoints() - - ret = u.validate_svc_catalog_endpoint_data( - expected, - actual, - openstack_release=self._get_openstack_release()) - if ret: - amulet.raise_status(amulet.FAIL, msg=ret) - - u.log.debug('OK') - - def test_112_keystone_api_endpoint(self): - """Verify the ceilometer api endpoint data.""" - if self._get_openstack_release() >= self.xenial_pike: - u.log.debug('Skipping catalogue checks as ceilometer no longer ' - 'registers endpoints') - return - u.log.debug('Checking keystone api endpoint data...') - endpoints = self.keystone.endpoints.list() - u.log.debug(endpoints) - internal_port = public_port = '5000' - admin_port = '35357' - expected = {'id': u.not_null, - 'region': 'RegionOne', - 'adminurl': u.valid_url, - 'internalurl': u.valid_url, - 'publicurl': u.valid_url, - 'service_id': u.not_null} - - ret = u.validate_endpoint_data( - endpoints, - admin_port, - internal_port, - public_port, - expected, - openstack_release=self._get_openstack_release()) - if ret: - message = 'Keystone endpoint: {}'.format(ret) - amulet.raise_status(amulet.FAIL, msg=message) - - u.log.debug('OK') - - def test_114_ceilometer_api_endpoint(self): - """Verify the ceilometer api endpoint data.""" - if self._get_openstack_release() >= self.xenial_pike: - u.log.debug('Skipping catalogue checks as ceilometer no longer ' - 'registers endpoints') - return - u.log.debug('Checking ceilometer api endpoint data...') - endpoints = self.keystone.endpoints.list() - u.log.debug(endpoints) - admin_port = internal_port = public_port = '8777' - expected = {'id': u.not_null, - 'region': 'RegionOne', - 'adminurl': u.valid_url, - 'internalurl': u.valid_url, - 'publicurl': u.valid_url, - 'service_id': u.not_null} - - ret = u.validate_endpoint_data(endpoints, admin_port, internal_port, - public_port, expected) - if ret: - message = 'Ceilometer endpoint: {}'.format(ret) - amulet.raise_status(amulet.FAIL, msg=message) - - u.log.debug('OK') - - def test_130_memcache(self): - u.validate_memcache(self.ceil_agent_sentry, - '/etc/ceilometer/ceilometer.conf', - self._get_openstack_release(), - earliest_release=self.trusty_mitaka) - - def test_200_ceilometer_identity_relation(self): - """Verify the ceilometer to keystone identity-service relation data""" - if self._get_openstack_release() >= self.xenial_pike: - u.log.debug('Skipping identity-service checks as ceilometer no ' - 'longer has this rerlation') - return - u.log.debug('Checking ceilometer to keystone identity-service ' - 'relation data...') - unit = self.ceil_sentry - relation = ['identity-service', 'keystone:identity-service'] - ceil_ip = unit.relation('identity-service', - 'keystone:identity-service')['private-address'] - ceil_endpoint = "http://%s:8777" % (ceil_ip) - - expected = { - 'admin_url': ceil_endpoint, - 'internal_url': ceil_endpoint, - 'private-address': ceil_ip, - 'public_url': ceil_endpoint, - 'region': 'RegionOne', - 'requested_roles': 'ResellerAdmin', - 'service': 'ceilometer', - } - - ret = u.validate_relation_data(unit, relation, expected) - if ret: - message = u.relation_error('ceilometer identity-service', ret) - amulet.raise_status(amulet.FAIL, msg=message) - - u.log.debug('OK') - - def test_201_keystone_ceilometer_identity_relation(self): - """Verify the keystone to ceilometer identity-service relation data""" - if self._get_openstack_release() >= self.xenial_pike: - u.log.debug('Skipping identity-service checks as ceilometer no ' - 'longer has this rerlation') - return - u.log.debug('Checking keystone:ceilometer identity relation data...') - unit = self.keystone_sentry - relation = ['identity-service', 'ceilometer:identity-service'] - id_relation = unit.relation('identity-service', - 'ceilometer:identity-service') - id_ip = id_relation['private-address'] - expected = { - 'admin_token': 'ubuntutesting', - 'auth_host': id_ip, - 'auth_port': "35357", - 'auth_protocol': 'http', - 'private-address': id_ip, - 'service_host': id_ip, - 'service_password': u.not_null, - 'service_port': "5000", - 'service_protocol': 'http', - 'service_tenant': 'services', - 'service_tenant_id': u.not_null, - 'service_username': 'ceilometer', - } - ret = u.validate_relation_data(unit, relation, expected) - if ret: - message = u.relation_error('keystone identity-service', ret) - amulet.raise_status(amulet.FAIL, msg=message) - - u.log.debug('OK') - - def test_202_keystone_ceilometer_identity_notes_relation(self): - """Verify ceilometer to keystone identity-notifications relation""" - u.log.debug('Checking keystone:ceilometer ' - 'identity-notifications relation data...') - - # Relation data may vary depending on timing of hooks and relations. - # May be glance- or keystone- or another endpoint-changed value, so - # check that at least one ???-endpoint-changed value exists. - unit = self.keystone_sentry - relation_data = unit.relation('identity-notifications', - 'ceilometer:identity-notifications') - - expected = '-endpoint-changed' - found = 0 - for key in relation_data.keys(): - if expected in key and relation_data[key]: - found += 1 - u.log.debug('{}: {}'.format(key, relation_data[key])) - - if not found: - message = ('keystone:ceilometer identity-notification relation ' - 'error\n expected something like: {}\n actual: ' - '{}'.format(expected, relation_data)) - amulet.raise_status(amulet.FAIL, msg=message) - - u.log.debug('OK') - - def test_203_ceilometer_amqp_relation(self): - """Verify the ceilometer to rabbitmq-server amqp relation data""" - u.log.debug('Checking ceilometer:rabbitmq amqp relation data...') - unit = self.ceil_sentry - relation = ['amqp', 'rabbitmq-server:amqp'] - expected = { - 'username': 'ceilometer', - 'private-address': u.valid_ip, - 'vhost': 'openstack' - } - - ret = u.validate_relation_data(unit, relation, expected) - if ret: - message = u.relation_error('ceilometer amqp', ret) - amulet.raise_status(amulet.FAIL, msg=message) - - u.log.debug('OK') - - def test_204_amqp_ceilometer_relation(self): - """Verify the rabbitmq-server to ceilometer amqp relation data""" - u.log.debug('Checking rabbitmq:ceilometer amqp relation data...') - unit = self.rabbitmq_sentry - relation = ['amqp', 'ceilometer:amqp'] - expected = { - 'hostname': u.valid_ip, - 'private-address': u.valid_ip, - 'password': u.not_null, - } - - ret = u.validate_relation_data(unit, relation, expected) - if ret: - message = u.relation_error('rabbitmq amqp', ret) - amulet.raise_status(amulet.FAIL, msg=message) - - u.log.debug('OK') - - def test_205_ceilometer_to_mongodb_relation(self): - """Verify the ceilometer to mongodb relation data""" - if self._get_openstack_release() >= self.xenial_pike: - u.log.debug('Skipping monodb checks for OS release less than pike') - return - - u.log.debug('Checking ceilometer:mongodb relation data...') - unit = self.ceil_sentry - relation = ['shared-db', 'mongodb:database'] - expected = { - 'ceilometer_database': 'ceilometer', - 'private-address': u.valid_ip, - } - - ret = u.validate_relation_data(unit, relation, expected) - if ret: - message = u.relation_error('ceilometer shared-db', ret) - amulet.raise_status(amulet.FAIL, msg=message) - - u.log.debug('OK') - - def test_206_mongodb_to_ceilometer_relation(self): - """Verify the mongodb to ceilometer relation data""" - if self._get_openstack_release() >= self.xenial_pike: - u.log.debug('Skipping monodb checks for OS release less than pike') - return - u.log.debug('Checking mongodb:ceilometer relation data...') - unit = self.mongodb_sentry - relation = ['database', 'ceilometer:shared-db'] - expected = { - 'hostname': u.valid_ip, - 'port': '27017', - 'private-address': u.valid_ip, - 'type': 'database', - } - - ret = u.validate_relation_data(unit, relation, expected) - if ret: - message = u.relation_error('mongodb database', ret) - amulet.raise_status(amulet.FAIL, msg=message) - - u.log.debug('OK') - - def test_207_ceilometer_ceilometer_agent_relation(self): - """Verify the ceilometer to ceilometer-agent relation data""" - u.log.debug('Checking ceilometer:ceilometer-agent relation data...') - unit = self.ceil_sentry - relation = ['ceilometer-service', - 'ceilometer-agent:ceilometer-service'] - expected = { - 'rabbitmq_user': 'ceilometer', - 'verbose': 'False', - 'rabbitmq_host': u.valid_ip, - 'use_syslog': 'False', - 'metering_secret': u.not_null, - 'rabbitmq_virtual_host': 'openstack', - 'private-address': u.valid_ip, - 'debug': 'False', - 'rabbitmq_password': u.not_null, - 'port': '8767' - } - if self._get_openstack_release() >= self.xenial_pike: - expected['gnocchi_url'] = u.valid_url - if self._get_openstack_release() >= self.xenial_queens: - expected['port'] = '8777' - else: - expected['db_port'] = '27017' - expected['db_name'] = 'ceilometer' - expected['db_host'] = u.valid_ip - expected['service_ports'] = "{'ceilometer_api': [8777, 8767]}" - - ret = u.validate_relation_data(unit, relation, expected) - if ret: - message = u.relation_error('ceilometer-service', ret) - amulet.raise_status(amulet.FAIL, msg=message) - - u.log.debug('OK') - - def test_208_ceilometer_agent_ceilometer_relation(self): - """Verify the ceilometer-agent to ceilometer relation data""" - u.log.debug('Checking ceilometer-agent:ceilometer relation data...') - unit = self.ceil_agent_sentry - relation = ['ceilometer-service', 'ceilometer:ceilometer-service'] - expected = {'private-address': u.valid_ip} - - ret = u.validate_relation_data(unit, relation, expected) - if ret: - message = u.relation_error('ceilometer-service', ret) - amulet.raise_status(amulet.FAIL, msg=message) - - u.log.debug('OK') - - def test_209_nova_compute_ceilometer_agent_relation(self): - """Verify the nova-compute to ceilometer relation data""" - u.log.debug('Checking nova-compute:ceilometer relation data...') - unit = self.nova_sentry - relation = ['nova-ceilometer', 'ceilometer-agent:nova-ceilometer'] - expected = {'private-address': u.valid_ip} - - ret = u.validate_relation_data(unit, relation, expected) - if ret: - message = u.relation_error('ceilometer-service', ret) - amulet.raise_status(amulet.FAIL, msg=message) - - u.log.debug('OK') - - def test_210_ceilometer_agent_nova_compute_relation(self): - """Verify the ceilometer to nova-compute relation data""" - u.log.debug('Checking ceilometer:nova-compute relation data...') - unit = self.ceil_agent_sentry - relation = ['nova-ceilometer', 'nova-compute:nova-ceilometer'] - sub = ('{"nova": {"/etc/nova/nova.conf": {"sections": {"DEFAULT": ' - '[["instance_usage_audit", "True"], ' - '["instance_usage_audit_period", "hour"], ' - '["notify_on_state_change", "vm_and_task_state"]]}}}}') - expected = { - 'subordinate_configuration': sub, - 'private-address': u.valid_ip - } - - ret = u.validate_relation_data(unit, relation, expected) - if ret: - message = u.relation_error('ceilometer-service', ret) - amulet.raise_status(amulet.FAIL, msg=message) - - u.log.debug('OK') - - def test_300_ceilometer_config(self): - """Verify the data in the ceilometer config file.""" - u.log.debug('Checking ceilometer config file data...') - unit = self.ceil_agent_sentry - conf = '/etc/ceilometer/ceilometer.conf' - expected = { - 'DEFAULT': { - 'verbose': 'False', - 'debug': 'False', - }, - } - if self._get_openstack_release() >= self.xenial_pike: - if self._get_openstack_release() >= self.xenial_queens: - ks_rel = self.keystone_sentry.relation( - 'identity-credentials', - 'ceilometer:identity-credentials') - ks_key_prefix = 'credentials' - else: - ks_rel = self.keystone_sentry.relation( - 'identity-service', - 'ceilometer:identity-service') - ks_key_prefix = 'service' - else: - ks_rel = self.keystone_sentry.relation( - 'identity-service', - 'ceilometer:identity-service') - ks_key_prefix = 'service' - - if self._get_openstack_release() < self.trusty_mitaka: - auth_uri = '%s://%s:%s/v2.0' % (ks_rel['service_protocol'], - ks_rel['service_host'], - ks_rel['service_port']) - expected['service_credentials'] = {'os_auth_url': auth_uri, - 'os_tenant_name': 'services', - 'os_username': 'ceilometer', - 'os_password': - ks_rel['service_password']} - else: - auth_uri = '%s://%s:%s' % ( - ks_rel['{}_protocol'.format(ks_key_prefix)], - ks_rel['{}_host'.format(ks_key_prefix)], - ks_rel['{}_port'.format(ks_key_prefix)]) - # NOTE(dosaboy): os_ prefix is deprecated and no longer used as - # of Mitaka. - project_domain_name = 'default' - user_domain_name = 'default' - if 'api_version' in ks_rel and float(ks_rel['api_version']) > 2: - project_domain_name = 'service_domain' - user_domain_name = 'service_domain' - expected['service_credentials'] = { - 'auth_url': auth_uri, - 'project_name': 'services', - 'project_domain_name': project_domain_name, - 'user_domain_name': user_domain_name, - 'username': 'ceilometer', - 'password': ks_rel['{}_password'.format(ks_key_prefix)]} - - for section, pairs in expected.iteritems(): - ret = u.validate_config_data(unit, conf, section, pairs) - if ret: - message = "ceilometer config error: {}".format(ret) - amulet.raise_status(amulet.FAIL, msg=message) - - u.log.debug('OK') - - def test_301_nova_config(self): - """Verify data in the nova compute nova config file""" - u.log.debug('Checking nova compute config file...') - unit = self.nova_sentry - conf = '/etc/nova/nova.conf' - expected = { - 'DEFAULT': { - 'verbose': 'False', - 'debug': 'False', - 'use_syslog': 'False', - 'my_ip': u.valid_ip, - } - } - - for section, pairs in expected.iteritems(): - ret = u.validate_config_data(unit, conf, section, pairs) - if ret: - message = "ceilometer config error: {}".format(ret) - amulet.raise_status(amulet.FAIL, msg=message) - - u.log.debug('OK') - - def test_302_nova_ceilometer_config(self): - """Verify data in the ceilometer config file on the - nova-compute (ceilometer-agent) unit.""" - u.log.debug('Checking nova ceilometer config file...') - unit = self.nova_sentry - conf = '/etc/ceilometer/ceilometer.conf' - expected = { - 'DEFAULT': { - 'logdir': '/var/log/ceilometer' - }, - } - - for section, pairs in expected.iteritems(): - ret = u.validate_config_data(unit, conf, section, pairs) - if ret: - message = "ceilometer config error: {}".format(ret) - amulet.raise_status(amulet.FAIL, msg=message) - - u.log.debug('OK') - - def test_303_nova_ceilometer_config_check_endpoint(self): - """Verify endpoint option on the - nova-compute (ceilometer-agent) unit.""" - u.log.debug('Checking nova ceilometer config file...') - sentry = self.ceil_agent_sentry - conf = '/etc/ceilometer/ceilometer.conf' - - expected_default = { - 'DEFAULT': { - 'logdir': '/var/log/ceilometer' - }, - } - - expected_alternate = { - 'DEFAULT': { - 'logdir': '/var/log/ceilometer' - }, - } - - juju_service = 'ceilometer-agent' - if self._get_openstack_release() >= self.xenial_ocata: - service = 'ceilometer-polling: AgentManager worker(0)' - elif self._get_openstack_release() >= self.xenial_newton: - service = 'ceilometer-polling - AgentManager(0)' - elif self._get_openstack_release() >= self.trusty_liberty: - service = 'ceilometer-polling' - else: - service = 'ceilometer-agent-compute' - if self._get_openstack_release() >= self.trusty_mitaka: - int_value = 'internalURL' - else: - int_value = 'internal' - expected_alternate['service_credentials'] = {'interface': int_value} - option = 'use-internal-endpoints' - set_default = {option: 'False'} - set_alternate = {option: 'True'} - - for section, pairs in expected_default.iteritems(): - ret = u.validate_config_data(sentry, conf, section, pairs) - if ret: - message = "ceilometer config error: {}".format(ret) - amulet.raise_status(amulet.FAIL, msg=message) - - sleep_time = 40 - mtime = u.get_sentry_time(sentry) - self.d.configure(juju_service, set_alternate) - - if not u.service_restarted_since(sentry, mtime, service, - sleep_time=sleep_time, - retry_count=4, retry_sleep_time=20): - self.d.configure(juju_service, set_default) - msg = "service {} didn't restart after config change".format( - service) - amulet.raise_status(amulet.FAIL, msg=msg) - - for section, pairs in expected_alternate.iteritems(): - ret = u.validate_config_data(sentry, conf, section, pairs) - if ret: - message = "ceilometer config error: {}".format(ret) - amulet.raise_status(amulet.FAIL, msg=message) - - mtime = u.get_sentry_time(sentry) - self.d.configure(juju_service, set_default) - - if not u.service_restarted_since(sentry, mtime, service, - sleep_time=sleep_time, - retry_count=4, retry_sleep_time=20): - self.d.configure(juju_service, set_default) - msg = "service {} didn't restart after config change".format( - service) - amulet.raise_status(amulet.FAIL, msg=msg) - - for section, pairs in expected_default.iteritems(): - ret = u.validate_config_data(sentry, conf, section, pairs) - if ret: - message = "ceilometer config error: {}".format(ret) - amulet.raise_status(amulet.FAIL, msg=message) - - u.log.debug('OK') - - def test_400_api_connection(self): - """Simple api calls to check service is up and responding""" - if self._get_openstack_release() >= self.xenial_pike: - u.log.debug('Skipping API checks as ceilometer api has been ' - 'removed') - return - u.log.debug('Checking api functionality...') - assert(self.ceil.samples.list() == []) - assert(self.ceil.meters.list() == []) - u.log.debug('OK') - - # NOTE(beisner): need to add more functional tests - - def test_900_restart_on_config_change(self): - """Verify that the specified services are restarted when the config - is changed. - """ - sentry = self.ceil_sentry - juju_service = 'ceilometer' - - # Expected default and alternate values - set_default = {'debug': 'False'} - set_alternate = {'debug': 'True'} - - # Services which are expected to restart upon config change, - # and corresponding config files affected by the change - conf_file = '/etc/ceilometer/ceilometer.conf' - if self._get_openstack_release() >= self.xenial_pike: - services = { - 'ceilometer-polling: AgentManager worker(0)': conf_file, - 'ceilometer-agent-notification: NotificationService worker(0)': - conf_file, - } - elif self._get_openstack_release() >= self.xenial_ocata: - services = { - 'ceilometer-collector: CollectorService worker(0)': conf_file, - 'ceilometer-polling: AgentManager worker(0)': conf_file, - 'ceilometer-agent-notification: NotificationService worker(0)': - conf_file, - 'apache2': conf_file, - } - elif self._get_openstack_release() >= self.xenial_newton: - services = { - 'ceilometer-collector - CollectorService(0)': conf_file, - 'ceilometer-polling - AgentManager(0)': conf_file, - 'ceilometer-agent-notification - NotificationService(0)': - conf_file, - 'ceilometer-api': conf_file, - } - else: - services = { - 'ceilometer-collector': conf_file, - 'ceilometer-api': conf_file, - 'ceilometer-agent-notification': conf_file, - } - - if self._get_openstack_release() < self.trusty_mitaka: - services['ceilometer-alarm-notifier'] = conf_file - services['ceilometer-alarm-evaluator'] = conf_file - - if self._get_openstack_release() >= self.trusty_liberty: - # Liberty and later - services['ceilometer-polling'] = conf_file - else: - # Juno and earlier - services['ceilometer-agent-central'] = conf_file - - # Make config change, check for service restarts - u.log.debug('Making config change on {}...'.format(juju_service)) - mtime = u.get_sentry_time(sentry) - self.d.configure(juju_service, set_alternate) - - sleep_time = 40 - for s, conf_file in services.iteritems(): - u.log.debug("Checking that service restarted: {}".format(s)) - if not u.validate_service_config_changed(sentry, mtime, s, - conf_file, - retry_count=4, - retry_sleep_time=20, - sleep_time=sleep_time): - self.d.configure(juju_service, set_default) - msg = "service {} didn't restart after config change".format(s) - amulet.raise_status(amulet.FAIL, msg=msg) - sleep_time = 0 - - self.d.configure(juju_service, set_default) - u.log.debug('OK') - - def test_910_pause_and_resume(self): - """The services can be paused and resumed. """ - u.log.debug('Checking pause and resume actions...') - unit = self.d.sentry['ceilometer-agent'][0] - unit_name = unit.info['unit_name'] - - u.log.debug('Checking for active status on {}'.format(unit_name)) - assert u.status_get(unit)[0] == "active" - - u.log.debug('Running pause action on {}'.format(unit_name)) - action_id = u.run_action(unit, "pause") - u.log.debug('Waiting on action {}'.format(action_id)) - assert u.wait_on_action(action_id), "Pause action failed." - u.log.debug('Checking for maintenance status on {}'.format(unit_name)) - assert u.status_get(unit)[0] == "maintenance" - - u.log.debug('Running resume action on {}'.format(unit_name)) - action_id = u.run_action(unit, "resume") - u.log.debug('Waiting on action {}'.format(action_id)) - assert u.wait_on_action(action_id), "Resume action failed." - u.log.debug('Checking for active status on {}'.format(unit_name)) - assert u.status_get(unit)[0] == "active" - u.log.debug('OK') - - def run_ceilometer_upgrade_action(self): - """Run ceilometer-upgrade - - This action will be run early to initialize ceilometer - when gnocchi is related. - Ceilometer will be in a blocked state until this runs. - """ - if self._get_openstack_release() < self.xenial_pike: - u.log.debug('Not checking ceilometer-upgrade') - return - u.log.debug('Checking ceilometer-upgrade') - unit = self.ceil_sentry - - action_id = unit.run_action("ceilometer-upgrade") - assert u.wait_on_action(action_id), "ceilometer-upgrade action failed" - # Wait for acivte Unit is ready on ceilometer - self.exclude_services.remove('ceilometer') - self._auto_wait_for_status(exclude_services=self.exclude_services) - u.log.debug('OK') diff --git a/tests/bundles/bionic-queens.yaml b/tests/bundles/bionic-queens.yaml new file mode 100644 index 0000000..e74e381 --- /dev/null +++ b/tests/bundles/bionic-queens.yaml @@ -0,0 +1,133 @@ +series: bionic + +machines: + 0: {} + 1: {} + 2: {} + 3: {} + 4: {} + 5: {} + 6: {} + 7: {} + 8: {} + 9: {} + 10: {} + 11: {} + 12: {} + 13: {} + 14: {} + +applications: + percona-cluster: + charm: cs:~openstack-charmers-next/percona-cluster + num_units: 1 + options: + max-connections: 1000 + innodb-buffer-pool-size: 256M + to: + - '0' + rabbitmq-server: + charm: cs:~openstack-charmers-next/rabbitmq-server + num_units: 1 + to: + - '1' + memcached: + charm: cs:~memcached-team/memcached + num_units: 1 + to: + - '2' + ceph-osd: + charm: cs:~openstack-charmers-next/ceph-osd + num_units: 3 + storage: + osd-devices: 'cinder,10G' + to: + - '3' + - '4' + - '5' + ceph-mon: + charm: cs:~openstack-charmers-next/ceph-mon + num_units: 3 + to: + - '6' + - '7' + - '8' + keystone: + charm: cs:~openstack-charmers-next/keystone + num_units: 1 + to: + - '9' + glance: + charm: cs:~openstack-charmers-next/glance + num_units: 1 + to: + - '10' + nova-cloud-controller: + charm: cs:~openstack-charmers-next/nova-cloud-controller + num_units: 1 + to: + - '11' + nova-compute: + charm: cs:~openstack-charmers-next/nova-compute + num_units: 1 + to: + - '12' + ceilometer: + charm: cs:~openstack-charmers-next/ceilometer + num_units: 1 + to: + - '13' + gnocchi: + charm: cs:~openstack-charmers-next/gnocchi + num_units: 1 + to: + - '14' + ceilometer-agent: {} + +relations: +- - 'ceilometer:amqp' + - 'rabbitmq-server:amqp' +- - 'ceilometer:identity-notifications' + - 'keystone:identity-notifications' +- - 'ceilometer:ceilometer-service' + - 'ceilometer-agent:ceilometer-service' +- - 'ceilometer:metric-service' + - 'gnocchi:metric-service' +- - 'ceilometer:identity-credentials' + - 'keystone:identity-credentials' +- - 'keystone:shared-db' + - 'percona-cluster:shared-db' +- - 'ceilometer-agent:amqp' + - 'rabbitmq-server:amqp' +- - 'nova-compute:nova-ceilometer' + - 'ceilometer-agent:nova-ceilometer' +- - 'nova-compute:amqp' + - 'rabbitmq-server:amqp' +- - 'glance:identity-service' + - 'keystone:identity-service' +- - 'glance:shared-db' + - 'percona-cluster:shared-db' +- - 'glance:amqp' + - 'rabbitmq-server:amqp' +- - 'nova-compute:image-service' + - 'glance:image-service' +- - 'nova-cloud-controller:shared-db' + - 'percona-cluster:shared-db' +- - 'nova-cloud-controller:amqp' + - 'rabbitmq-server:amqp' +- - 'nova-cloud-controller:identity-service' + - 'keystone:identity-service' +- - 'nova-cloud-controller:cloud-compute' + - 'nova-compute:cloud-compute' +- - 'nova-cloud-controller:image-service' + - 'glance:image-service' +- - 'ceph-mon:osd' + - 'ceph-osd:mon' +- - 'gnocchi:shared-db' + - 'percona-cluster:shared-db' +- - 'gnocchi:storage-ceph' + - 'ceph-mon:client' +- - 'gnocchi:coordinator-memcached' + - 'memcached:cache' +- - 'gnocchi:identity-service' + - 'keystone:identity-service' \ No newline at end of file diff --git a/tests/bundles/bionic-rocky.yaml b/tests/bundles/bionic-rocky.yaml new file mode 100644 index 0000000..249d34b --- /dev/null +++ b/tests/bundles/bionic-rocky.yaml @@ -0,0 +1,152 @@ +options: + source: &source cloud:bionic-rocky + +series: bionic + +machines: + 0: {} + 1: {} + 2: {} + 3: {} + 4: {} + 5: {} + 6: {} + 7: {} + 8: {} + 9: {} + 10: {} + 11: {} + 12: {} + 13: {} + 14: {} + +applications: + percona-cluster: + charm: cs:~openstack-charmers-next/percona-cluster + num_units: 1 + options: + max-connections: 1000 + innodb-buffer-pool-size: 256M + to: + - '0' + rabbitmq-server: + charm: cs:~openstack-charmers-next/rabbitmq-server + num_units: 1 + to: + - '1' + memcached: + charm: cs:~memcached-team/memcached + num_units: 1 + to: + - '2' + ceph-osd: + charm: cs:~openstack-charmers-next/ceph-osd + num_units: 3 + storage: + osd-devices: 'cinder,10G' + options: + source: *source + to: + - '3' + - '4' + - '5' + ceph-mon: + charm: cs:~openstack-charmers-next/ceph-mon + num_units: 3 + options: + source: *source + to: + - '6' + - '7' + - '8' + keystone: + charm: cs:~openstack-charmers-next/keystone + num_units: 1 + options: + openstack-origin: *source + to: + - '9' + glance: + charm: cs:~openstack-charmers-next/glance + num_units: 1 + options: + openstack-origin: *source + to: + - '10' + nova-cloud-controller: + charm: cs:~openstack-charmers-next/nova-cloud-controller + num_units: 1 + options: + openstack-origin: *source + to: + - '11' + nova-compute: + charm: cs:~openstack-charmers-next/nova-compute + num_units: 1 + options: + openstack-origin: *source + to: + - '12' + ceilometer: + charm: cs:~openstack-charmers-next/ceilometer + num_units: 1 + options: + openstack-origin: *source + to: + - '13' + gnocchi: + charm: cs:~openstack-charmers-next/gnocchi + num_units: 1 + options: + openstack-origin: *source + to: + - '14' + ceilometer-agent: {} + +relations: +- - 'ceilometer:amqp' + - 'rabbitmq-server:amqp' +- - 'ceilometer:identity-notifications' + - 'keystone:identity-notifications' +- - 'ceilometer:ceilometer-service' + - 'ceilometer-agent:ceilometer-service' +- - 'ceilometer:metric-service' + - 'gnocchi:metric-service' +- - 'ceilometer:identity-credentials' + - 'keystone:identity-credentials' +- - 'keystone:shared-db' + - 'percona-cluster:shared-db' +- - 'ceilometer-agent:amqp' + - 'rabbitmq-server:amqp' +- - 'nova-compute:nova-ceilometer' + - 'ceilometer-agent:nova-ceilometer' +- - 'nova-compute:amqp' + - 'rabbitmq-server:amqp' +- - 'glance:identity-service' + - 'keystone:identity-service' +- - 'glance:shared-db' + - 'percona-cluster:shared-db' +- - 'glance:amqp' + - 'rabbitmq-server:amqp' +- - 'nova-compute:image-service' + - 'glance:image-service' +- - 'nova-cloud-controller:shared-db' + - 'percona-cluster:shared-db' +- - 'nova-cloud-controller:amqp' + - 'rabbitmq-server:amqp' +- - 'nova-cloud-controller:identity-service' + - 'keystone:identity-service' +- - 'nova-cloud-controller:cloud-compute' + - 'nova-compute:cloud-compute' +- - 'nova-cloud-controller:image-service' + - 'glance:image-service' +- - 'ceph-mon:osd' + - 'ceph-osd:mon' +- - 'gnocchi:shared-db' + - 'percona-cluster:shared-db' +- - 'gnocchi:storage-ceph' + - 'ceph-mon:client' +- - 'gnocchi:coordinator-memcached' + - 'memcached:cache' +- - 'gnocchi:identity-service' + - 'keystone:identity-service' \ No newline at end of file diff --git a/tests/bundles/bionic-stein.yaml b/tests/bundles/bionic-stein.yaml new file mode 100644 index 0000000..e67e427 --- /dev/null +++ b/tests/bundles/bionic-stein.yaml @@ -0,0 +1,152 @@ +options: + source: &source cloud:bionic-stein + +series: bionic + +machines: + 0: {} + 1: {} + 2: {} + 3: {} + 4: {} + 5: {} + 6: {} + 7: {} + 8: {} + 9: {} + 10: {} + 11: {} + 12: {} + 13: {} + 14: {} + +applications: + percona-cluster: + charm: cs:~openstack-charmers-next/percona-cluster + num_units: 1 + options: + max-connections: 1000 + innodb-buffer-pool-size: 256M + to: + - '0' + rabbitmq-server: + charm: cs:~openstack-charmers-next/rabbitmq-server + num_units: 1 + to: + - '1' + memcached: + charm: cs:~memcached-team/memcached + num_units: 1 + to: + - '2' + ceph-osd: + charm: cs:~openstack-charmers-next/ceph-osd + num_units: 3 + storage: + osd-devices: 'cinder,10G' + options: + source: *source + to: + - '3' + - '4' + - '5' + ceph-mon: + charm: cs:~openstack-charmers-next/ceph-mon + num_units: 3 + options: + source: *source + to: + - '6' + - '7' + - '8' + keystone: + charm: cs:~openstack-charmers-next/keystone + num_units: 1 + options: + openstack-origin: *source + to: + - '9' + glance: + charm: cs:~openstack-charmers-next/glance + num_units: 1 + options: + openstack-origin: *source + to: + - '10' + nova-cloud-controller: + charm: cs:~openstack-charmers-next/nova-cloud-controller + num_units: 1 + options: + openstack-origin: *source + to: + - '11' + nova-compute: + charm: cs:~openstack-charmers-next/nova-compute + num_units: 1 + options: + openstack-origin: *source + to: + - '12' + ceilometer: + charm: cs:~openstack-charmers-next/ceilometer + num_units: 1 + options: + openstack-origin: *source + to: + - '13' + gnocchi: + charm: cs:~openstack-charmers-next/gnocchi + num_units: 1 + options: + openstack-origin: *source + to: + - '14' + ceilometer-agent: {} + +relations: +- - 'ceilometer:amqp' + - 'rabbitmq-server:amqp' +- - 'ceilometer:identity-notifications' + - 'keystone:identity-notifications' +- - 'ceilometer:ceilometer-service' + - 'ceilometer-agent:ceilometer-service' +- - 'ceilometer:metric-service' + - 'gnocchi:metric-service' +- - 'ceilometer:identity-credentials' + - 'keystone:identity-credentials' +- - 'keystone:shared-db' + - 'percona-cluster:shared-db' +- - 'ceilometer-agent:amqp' + - 'rabbitmq-server:amqp' +- - 'nova-compute:nova-ceilometer' + - 'ceilometer-agent:nova-ceilometer' +- - 'nova-compute:amqp' + - 'rabbitmq-server:amqp' +- - 'glance:identity-service' + - 'keystone:identity-service' +- - 'glance:shared-db' + - 'percona-cluster:shared-db' +- - 'glance:amqp' + - 'rabbitmq-server:amqp' +- - 'nova-compute:image-service' + - 'glance:image-service' +- - 'nova-cloud-controller:shared-db' + - 'percona-cluster:shared-db' +- - 'nova-cloud-controller:amqp' + - 'rabbitmq-server:amqp' +- - 'nova-cloud-controller:identity-service' + - 'keystone:identity-service' +- - 'nova-cloud-controller:cloud-compute' + - 'nova-compute:cloud-compute' +- - 'nova-cloud-controller:image-service' + - 'glance:image-service' +- - 'ceph-mon:osd' + - 'ceph-osd:mon' +- - 'gnocchi:shared-db' + - 'percona-cluster:shared-db' +- - 'gnocchi:storage-ceph' + - 'ceph-mon:client' +- - 'gnocchi:coordinator-memcached' + - 'memcached:cache' +- - 'gnocchi:identity-service' + - 'keystone:identity-service' \ No newline at end of file diff --git a/tests/bundles/bionic-train.yaml b/tests/bundles/bionic-train.yaml new file mode 100644 index 0000000..c5ce086 --- /dev/null +++ b/tests/bundles/bionic-train.yaml @@ -0,0 +1,167 @@ +options: + source: &source cloud:bionic-train + +series: bionic + +machines: + 0: {} + 1: {} + 2: {} + 3: {} + 4: {} + 5: {} + 6: {} + 7: {} + 8: {} + 9: {} + 10: {} + 11: {} + 12: {} + 13: {} + 14: {} + 15: {} + +applications: + percona-cluster: + charm: cs:~openstack-charmers-next/percona-cluster + num_units: 1 + options: + max-connections: 1000 + innodb-buffer-pool-size: 256M + to: + - '0' + rabbitmq-server: + charm: cs:~openstack-charmers-next/rabbitmq-server + num_units: 1 + to: + - '1' + memcached: + charm: cs:~memcached-team/memcached + num_units: 1 + to: + - '2' + ceph-osd: + charm: cs:~openstack-charmers-next/ceph-osd + num_units: 3 + storage: + osd-devices: 'cinder,10G' + options: + source: *source + to: + - '3' + - '4' + - '5' + ceph-mon: + charm: cs:~openstack-charmers-next/ceph-mon + num_units: 3 + options: + source: *source + to: + - '6' + - '7' + - '8' + keystone: + charm: cs:~openstack-charmers-next/keystone + num_units: 1 + options: + openstack-origin: *source + to: + - '9' + glance: + charm: cs:~openstack-charmers-next/glance + num_units: 1 + options: + openstack-origin: *source + to: + - '10' + nova-cloud-controller: + charm: cs:~openstack-charmers-next/nova-cloud-controller + num_units: 1 + options: + openstack-origin: *source + to: + - '11' + nova-compute: + charm: cs:~openstack-charmers-next/nova-compute + num_units: 1 + options: + openstack-origin: *source + to: + - '12' + ceilometer: + charm: cs:~openstack-charmers-next/ceilometer + num_units: 1 + options: + openstack-origin: *source + to: + - '13' + gnocchi: + charm: cs:~openstack-charmers-next/gnocchi + num_units: 1 + options: + openstack-origin: *source + to: + - '14' + placement: + charm: cs:~openstack-charmers-next/placement + num_units: 1 + constraints: mem=1G + options: + openstack-origin: *source + to: + - '15' + ceilometer-agent: {} + +relations: +- - 'ceilometer:amqp' + - 'rabbitmq-server:amqp' +- - 'ceilometer:identity-notifications' + - 'keystone:identity-notifications' +- - 'ceilometer:ceilometer-service' + - 'ceilometer-agent:ceilometer-service' +- - 'ceilometer:metric-service' + - 'gnocchi:metric-service' +- - 'ceilometer:identity-credentials' + - 'keystone:identity-credentials' +- - 'keystone:shared-db' + - 'percona-cluster:shared-db' +- - 'ceilometer-agent:amqp' + - 'rabbitmq-server:amqp' +- - 'nova-compute:nova-ceilometer' + - 'ceilometer-agent:nova-ceilometer' +- - 'nova-compute:amqp' + - 'rabbitmq-server:amqp' +- - 'placement:shared-db' + - 'percona-cluster:shared-db' +- - 'placement:identity-service' + - 'keystone:identity-service' +- - 'placement:placement' + - 'nova-cloud-controller:placement' +- - 'glance:identity-service' + - 'keystone:identity-service' +- - 'glance:shared-db' + - 'percona-cluster:shared-db' +- - 'glance:amqp' + - 'rabbitmq-server:amqp' +- - 'nova-compute:image-service' + - 'glance:image-service' +- - 'nova-cloud-controller:shared-db' + - 'percona-cluster:shared-db' +- - 'nova-cloud-controller:amqp' + - 'rabbitmq-server:amqp' +- - 'nova-cloud-controller:identity-service' + - 'keystone:identity-service' +- - 'nova-cloud-controller:cloud-compute' + - 'nova-compute:cloud-compute' +- - 'nova-cloud-controller:image-service' + - 'glance:image-service' +- - 'ceph-mon:osd' + - 'ceph-osd:mon' +- - 'gnocchi:shared-db' + - 'percona-cluster:shared-db' +- - 'gnocchi:storage-ceph' + - 'ceph-mon:client' +- - 'gnocchi:coordinator-memcached' + - 'memcached:cache' +- - 'gnocchi:identity-service' + - 'keystone:identity-service' diff --git a/tests/bundles/trusty-mitaka.yaml b/tests/bundles/trusty-mitaka.yaml new file mode 100644 index 0000000..fe40723 --- /dev/null +++ b/tests/bundles/trusty-mitaka.yaml @@ -0,0 +1,105 @@ +options: + source: &source cloud:trusty-mitaka + +series: trusty + +machines: + 0: {} + 1: {} + 2: {} + 3: {} + 4: {} + 5: {} + 6: {} + 7: {} + +applications: + percona-cluster: + charm: cs:trusty/percona-cluster + num_units: 1 + to: + - '0' + rabbitmq-server: + charm: cs:~openstack-charmers-next/rabbitmq-server + num_units: 1 + to: + - '1' + mongodb: + charm: cs:trusty/mongodb + num_units: 1 + to: + - '2' + keystone: + charm: cs:~openstack-charmers-next/keystone + num_units: 1 + options: + openstack-origin: *source + to: + - '3' + glance: + charm: cs:~openstack-charmers-next/glance + num_units: 1 + options: + openstack-origin: *source + to: + - '4' + nova-cloud-controller: + charm: cs:~openstack-charmers-next/nova-cloud-controller + num_units: 1 + options: + openstack-origin: *source + to: + - '5' + nova-compute: + charm: cs:~openstack-charmers-next/nova-compute + num_units: 1 + options: + openstack-origin: *source + to: + - '6' + ceilometer: + charm: cs:~openstack-charmers-next/ceilometer + num_units: 1 + options: + openstack-origin: *source + to: + - '7' + ceilometer-agent: {} + +relations: +- - 'ceilometer:amqp' + - 'rabbitmq-server:amqp' +- - 'ceilometer:identity-notifications' + - 'keystone:identity-notifications' +- - 'ceilometer:ceilometer-service' + - 'ceilometer-agent:ceilometer-service' +- - 'ceilometer:identity-service' + - 'keystone:identity-service' +- - 'ceilometer:shared-db' + - 'mongodb:database' +- - 'keystone:shared-db' + - 'percona-cluster:shared-db' +- - 'ceilometer-agent:amqp' + - 'rabbitmq-server:amqp' +- - 'nova-compute:nova-ceilometer' + - 'ceilometer-agent:nova-ceilometer' +- - 'nova-compute:amqp' + - 'rabbitmq-server:amqp' +- - 'glance:identity-service' + - 'keystone:identity-service' +- - 'glance:shared-db' + - 'percona-cluster:shared-db' +- - 'glance:amqp' + - 'rabbitmq-server:amqp' +- - 'nova-compute:image-service' + - 'glance:image-service' +- - 'nova-cloud-controller:shared-db' + - 'percona-cluster:shared-db' +- - 'nova-cloud-controller:amqp' + - 'rabbitmq-server:amqp' +- - 'nova-cloud-controller:identity-service' + - 'keystone:identity-service' +- - 'nova-cloud-controller:cloud-compute' + - 'nova-compute:cloud-compute' +- - 'nova-cloud-controller:image-service' + - 'glance:image-service' diff --git a/tests/bundles/xenial-mitaka.yaml b/tests/bundles/xenial-mitaka.yaml new file mode 100644 index 0000000..5ba0c66 --- /dev/null +++ b/tests/bundles/xenial-mitaka.yaml @@ -0,0 +1,92 @@ +series: xenial + +machines: + 0: {} + 1: {} + 2: {} + 3: {} + 4: {} + 5: {} + 6: {} + 7: {} + +applications: + percona-cluster: + charm: cs:~openstack-charmers-next/percona-cluster + num_units: 1 + to: + - '0' + rabbitmq-server: + charm: cs:~openstack-charmers-next/rabbitmq-server + num_units: 1 + to: + - '1' + mongodb: + charm: cs:xenial/mongodb + num_units: 1 + to: + - '2' + keystone: + charm: cs:~openstack-charmers-next/keystone + num_units: 1 + to: + - '3' + glance: + charm: cs:~openstack-charmers-next/glance + num_units: 1 + to: + - '4' + nova-cloud-controller: + charm: cs:~openstack-charmers-next/nova-cloud-controller + num_units: 1 + to: + - '5' + nova-compute: + charm: cs:~openstack-charmers-next/nova-compute + num_units: 1 + to: + - '6' + ceilometer: + charm: cs:~openstack-charmers-next/ceilometer + num_units: 1 + to: + - '7' + ceilometer-agent: {} + +relations: +- - 'ceilometer:amqp' + - 'rabbitmq-server:amqp' +- - 'ceilometer:identity-notifications' + - 'keystone:identity-notifications' +- - 'ceilometer:ceilometer-service' + - 'ceilometer-agent:ceilometer-service' +- - 'ceilometer:identity-service' + - 'keystone:identity-service' +- - 'ceilometer:shared-db' + - 'mongodb:database' +- - 'keystone:shared-db' + - 'percona-cluster:shared-db' +- - 'ceilometer-agent:amqp' + - 'rabbitmq-server:amqp' +- - 'nova-compute:nova-ceilometer' + - 'ceilometer-agent:nova-ceilometer' +- - 'nova-compute:amqp' + - 'rabbitmq-server:amqp' +- - 'glance:identity-service' + - 'keystone:identity-service' +- - 'glance:shared-db' + - 'percona-cluster:shared-db' +- - 'glance:amqp' + - 'rabbitmq-server:amqp' +- - 'nova-compute:image-service' + - 'glance:image-service' +- - 'nova-cloud-controller:shared-db' + - 'percona-cluster:shared-db' +- - 'nova-cloud-controller:amqp' + - 'rabbitmq-server:amqp' +- - 'nova-cloud-controller:identity-service' + - 'keystone:identity-service' +- - 'nova-cloud-controller:cloud-compute' + - 'nova-compute:cloud-compute' +- - 'nova-cloud-controller:image-service' + - 'glance:image-service' diff --git a/tests/bundles/xenial-ocata.yaml b/tests/bundles/xenial-ocata.yaml new file mode 100644 index 0000000..ec91b3d --- /dev/null +++ b/tests/bundles/xenial-ocata.yaml @@ -0,0 +1,105 @@ +options: + source: &source cloud:xenial-ocata + +series: xenial + +machines: + 0: {} + 1: {} + 2: {} + 3: {} + 4: {} + 5: {} + 6: {} + 7: {} + +applications: + percona-cluster: + charm: cs:~openstack-charmers-next/percona-cluster + num_units: 1 + to: + - '0' + rabbitmq-server: + charm: cs:~openstack-charmers-next/rabbitmq-server + num_units: 1 + to: + - '1' + mongodb: + charm: cs:xenial/mongodb + num_units: 1 + to: + - '2' + keystone: + charm: cs:~openstack-charmers-next/keystone + num_units: 1 + options: + openstack-origin: *source + to: + - '3' + glance: + charm: cs:~openstack-charmers-next/glance + num_units: 1 + options: + openstack-origin: *source + to: + - '4' + nova-cloud-controller: + charm: cs:~openstack-charmers-next/nova-cloud-controller + num_units: 1 + options: + openstack-origin: *source + to: + - '5' + nova-compute: + charm: cs:~openstack-charmers-next/nova-compute + num_units: 1 + options: + openstack-origin: *source + to: + - '6' + ceilometer: + charm: cs:~openstack-charmers-next/ceilometer + num_units: 1 + options: + openstack-origin: *source + to: + - '7' + ceilometer-agent: {} + +relations: +- - 'ceilometer:amqp' + - 'rabbitmq-server:amqp' +- - 'ceilometer:identity-notifications' + - 'keystone:identity-notifications' +- - 'ceilometer:ceilometer-service' + - 'ceilometer-agent:ceilometer-service' +- - 'ceilometer:identity-service' + - 'keystone:identity-service' +- - 'ceilometer:shared-db' + - 'mongodb:database' +- - 'keystone:shared-db' + - 'percona-cluster:shared-db' +- - 'ceilometer-agent:amqp' + - 'rabbitmq-server:amqp' +- - 'nova-compute:nova-ceilometer' + - 'ceilometer-agent:nova-ceilometer' +- - 'nova-compute:amqp' + - 'rabbitmq-server:amqp' +- - 'glance:identity-service' + - 'keystone:identity-service' +- - 'glance:shared-db' + - 'percona-cluster:shared-db' +- - 'glance:amqp' + - 'rabbitmq-server:amqp' +- - 'nova-compute:image-service' + - 'glance:image-service' +- - 'nova-cloud-controller:shared-db' + - 'percona-cluster:shared-db' +- - 'nova-cloud-controller:amqp' + - 'rabbitmq-server:amqp' +- - 'nova-cloud-controller:identity-service' + - 'keystone:identity-service' +- - 'nova-cloud-controller:cloud-compute' + - 'nova-compute:cloud-compute' +- - 'nova-cloud-controller:image-service' + - 'glance:image-service' diff --git a/tests/bundles/xenial-pike.yaml b/tests/bundles/xenial-pike.yaml new file mode 100644 index 0000000..96dff2e --- /dev/null +++ b/tests/bundles/xenial-pike.yaml @@ -0,0 +1,152 @@ +options: + source: &source cloud:xenial-pike + +series: xenial + +machines: + 0: {} + 1: {} + 2: {} + 3: {} + 4: {} + 5: {} + 6: {} + 7: {} + 8: {} + 9: {} + 10: {} + 11: {} + 12: {} + 13: {} + 14: {} + +applications: + percona-cluster: + charm: cs:~openstack-charmers-next/percona-cluster + num_units: 1 + options: + max-connections: 1000 + innodb-buffer-pool-size: 256M + to: + - '0' + rabbitmq-server: + charm: cs:~openstack-charmers-next/rabbitmq-server + num_units: 1 + to: + - '1' + memcached: + charm: cs:~memcached-team/memcached + num_units: 1 + to: + - '2' + ceph-osd: + charm: cs:~openstack-charmers-next/ceph-osd + num_units: 3 + storage: + osd-devices: 'cinder,10G' + options: + source: *source + to: + - '3' + - '4' + - '5' + ceph-mon: + charm: cs:~openstack-charmers-next/ceph-mon + num_units: 3 + options: + source: *source + to: + - '6' + - '7' + - '8' + keystone: + charm: cs:~openstack-charmers-next/keystone + num_units: 1 + options: + openstack-origin: *source + to: + - '9' + glance: + charm: cs:~openstack-charmers-next/glance + num_units: 1 + options: + openstack-origin: *source + to: + - '10' + nova-cloud-controller: + charm: cs:~openstack-charmers-next/nova-cloud-controller + num_units: 1 + options: + openstack-origin: *source + to: + - '11' + nova-compute: + charm: cs:~openstack-charmers-next/nova-compute + num_units: 1 + options: + openstack-origin: *source + to: + - '12' + ceilometer: + charm: cs:~openstack-charmers-next/ceilometer + num_units: 1 + options: + openstack-origin: *source + to: + - '13' + gnocchi: + charm: cs:~openstack-charmers-next/gnocchi + num_units: 1 + options: + openstack-origin: *source + to: + - '14' + ceilometer-agent: {} + +relations: +- - 'ceilometer:amqp' + - 'rabbitmq-server:amqp' +- - 'ceilometer:identity-notifications' + - 'keystone:identity-notifications' +- - 'ceilometer:ceilometer-service' + - 'ceilometer-agent:ceilometer-service' +- - 'ceilometer:metric-service' + - 'gnocchi:metric-service' +- - 'ceilometer:identity-service' + - 'keystone:identity-service' +- - 'keystone:shared-db' + - 'percona-cluster:shared-db' +- - 'ceilometer-agent:amqp' + - 'rabbitmq-server:amqp' +- - 'nova-compute:nova-ceilometer' + - 'ceilometer-agent:nova-ceilometer' +- - 'nova-compute:amqp' + - 'rabbitmq-server:amqp' +- - 'glance:identity-service' + - 'keystone:identity-service' +- - 'glance:shared-db' + - 'percona-cluster:shared-db' +- - 'glance:amqp' + - 'rabbitmq-server:amqp' +- - 'nova-compute:image-service' + - 'glance:image-service' +- - 'nova-cloud-controller:shared-db' + - 'percona-cluster:shared-db' +- - 'nova-cloud-controller:amqp' + - 'rabbitmq-server:amqp' +- - 'nova-cloud-controller:identity-service' + - 'keystone:identity-service' +- - 'nova-cloud-controller:cloud-compute' + - 'nova-compute:cloud-compute' +- - 'nova-cloud-controller:image-service' + - 'glance:image-service' +- - 'ceph-mon:osd' + - 'ceph-osd:mon' +- - 'gnocchi:shared-db' + - 'percona-cluster:shared-db' +- - 'gnocchi:storage-ceph' + - 'ceph-mon:client' +- - 'gnocchi:coordinator-memcached' + - 'memcached:cache' +- - 'gnocchi:identity-service' + - 'keystone:identity-service' diff --git a/tests/bundles/xenial-queens.yaml b/tests/bundles/xenial-queens.yaml new file mode 100644 index 0000000..0b3aa34 --- /dev/null +++ b/tests/bundles/xenial-queens.yaml @@ -0,0 +1,152 @@ +options: + source: &source cloud:xenial-queens + +series: xenial + +machines: + 0: {} + 1: {} + 2: {} + 3: {} + 4: {} + 5: {} + 6: {} + 7: {} + 8: {} + 9: {} + 10: {} + 11: {} + 12: {} + 13: {} + 14: {} + +applications: + percona-cluster: + charm: cs:~openstack-charmers-next/percona-cluster + num_units: 1 + options: + max-connections: 1000 + innodb-buffer-pool-size: 256M + to: + - '0' + rabbitmq-server: + charm: cs:~openstack-charmers-next/rabbitmq-server + num_units: 1 + to: + - '1' + memcached: + charm: cs:~memcached-team/memcached + num_units: 1 + to: + - '2' + ceph-osd: + charm: cs:~openstack-charmers-next/ceph-osd + num_units: 3 + storage: + osd-devices: 'cinder,10G' + options: + source: *source + to: + - '3' + - '4' + - '5' + ceph-mon: + charm: cs:~openstack-charmers-next/ceph-mon + num_units: 3 + options: + source: *source + to: + - '6' + - '7' + - '8' + keystone: + charm: cs:~openstack-charmers-next/keystone + num_units: 1 + options: + openstack-origin: *source + to: + - '9' + glance: + charm: cs:~openstack-charmers-next/glance + num_units: 1 + options: + openstack-origin: *source + to: + - '10' + nova-cloud-controller: + charm: cs:~openstack-charmers-next/nova-cloud-controller + num_units: 1 + options: + openstack-origin: *source + to: + - '11' + nova-compute: + charm: cs:~openstack-charmers-next/nova-compute + num_units: 1 + options: + openstack-origin: *source + to: + - '12' + ceilometer: + charm: cs:~openstack-charmers-next/ceilometer + num_units: 1 + options: + openstack-origin: *source + to: + - '13' + gnocchi: + charm: cs:~openstack-charmers-next/gnocchi + num_units: 1 + options: + openstack-origin: *source + to: + - '14' + ceilometer-agent: {} + +relations: +- - 'ceilometer:amqp' + - 'rabbitmq-server:amqp' +- - 'ceilometer:identity-notifications' + - 'keystone:identity-notifications' +- - 'ceilometer:ceilometer-service' + - 'ceilometer-agent:ceilometer-service' +- - 'ceilometer:metric-service' + - 'gnocchi:metric-service' +- - 'ceilometer:identity-credentials' + - 'keystone:identity-credentials' +- - 'keystone:shared-db' + - 'percona-cluster:shared-db' +- - 'ceilometer-agent:amqp' + - 'rabbitmq-server:amqp' +- - 'nova-compute:nova-ceilometer' + - 'ceilometer-agent:nova-ceilometer' +- - 'nova-compute:amqp' + - 'rabbitmq-server:amqp' +- - 'glance:identity-service' + - 'keystone:identity-service' +- - 'glance:shared-db' + - 'percona-cluster:shared-db' +- - 'glance:amqp' + - 'rabbitmq-server:amqp' +- - 'nova-compute:image-service' + - 'glance:image-service' +- - 'nova-cloud-controller:shared-db' + - 'percona-cluster:shared-db' +- - 'nova-cloud-controller:amqp' + - 'rabbitmq-server:amqp' +- - 'nova-cloud-controller:identity-service' + - 'keystone:identity-service' +- - 'nova-cloud-controller:cloud-compute' + - 'nova-compute:cloud-compute' +- - 'nova-cloud-controller:image-service' + - 'glance:image-service' +- - 'ceph-mon:osd' + - 'ceph-osd:mon' +- - 'gnocchi:shared-db' + - 'percona-cluster:shared-db' +- - 'gnocchi:storage-ceph' + - 'ceph-mon:client' +- - 'gnocchi:coordinator-memcached' + - 'memcached:cache' +- - 'gnocchi:identity-service' + - 'keystone:identity-service' diff --git a/tests/dev-basic-cosmic-rocky b/tests/dev-basic-cosmic-rocky deleted file mode 100755 index 593aa57..0000000 --- a/tests/dev-basic-cosmic-rocky +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2016 Canonical Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Amulet tests on a basic ceilometer-agent deployment on cosmic-rocky.""" - -from basic_deployment import CeiloAgentBasicDeployment - -if __name__ == '__main__': - deployment = CeiloAgentBasicDeployment(series='cosmic') - deployment.run_tests() diff --git a/tests/gate-basic-bionic-queens b/tests/gate-basic-bionic-queens deleted file mode 100755 index 137cbe2..0000000 --- a/tests/gate-basic-bionic-queens +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2016 Canonical Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Amulet tests on a basic ceilometer-agent deployment on bionic-queens.""" - -from basic_deployment import CeiloAgentBasicDeployment - -if __name__ == '__main__': - deployment = CeiloAgentBasicDeployment(series='bionic') - deployment.run_tests() diff --git a/tests/gate-basic-bionic-rocky b/tests/gate-basic-bionic-rocky deleted file mode 100755 index 7a91f82..0000000 --- a/tests/gate-basic-bionic-rocky +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2016 Canonical Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Amulet tests on a basic ceilometer-agent deployment on bionic-rocky.""" - -from basic_deployment import CeiloAgentBasicDeployment - -if __name__ == '__main__': - deployment = CeiloAgentBasicDeployment(series='bionic', - openstack='cloud:bionic-rocky') - deployment.run_tests() diff --git a/tests/gate-basic-bionic-stein b/tests/gate-basic-bionic-stein deleted file mode 100755 index a5b3f2b..0000000 --- a/tests/gate-basic-bionic-stein +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2016 Canonical Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Amulet tests on a basic ceilometer-agent deployment on bionic-stein.""" - -from basic_deployment import CeiloAgentBasicDeployment - -if __name__ == '__main__': - deployment = CeiloAgentBasicDeployment(series='bionic', - openstack='cloud:bionic-stein') - deployment.run_tests() diff --git a/tests/gate-basic-bionic-train b/tests/gate-basic-bionic-train deleted file mode 100755 index 205f300..0000000 --- a/tests/gate-basic-bionic-train +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2019 Canonical Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Amulet tests on a basic ceilometer-agent deployment on bionic-train.""" - -from basic_deployment import CeiloAgentBasicDeployment - -if __name__ == '__main__': - deployment = CeiloAgentBasicDeployment(series='bionic', - openstack='cloud:bionic-train') - deployment.run_tests() diff --git a/tests/gate-basic-disco-stein b/tests/gate-basic-disco-stein deleted file mode 100755 index b1ce670..0000000 --- a/tests/gate-basic-disco-stein +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2016 Canonical Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Amulet tests on a basic ceilometer-agent deployment on disco-stein.""" - -from basic_deployment import CeiloAgentBasicDeployment - -if __name__ == '__main__': - deployment = CeiloAgentBasicDeployment(series='disco') - deployment.run_tests() diff --git a/tests/gate-basic-trusty-mitaka b/tests/gate-basic-trusty-mitaka deleted file mode 100755 index c1e96f5..0000000 --- a/tests/gate-basic-trusty-mitaka +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2016 Canonical Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Amulet tests on a basic ceilometer-agent deployment on trusty-mitaka.""" - -from basic_deployment import CeiloAgentBasicDeployment - -if __name__ == '__main__': - deployment = CeiloAgentBasicDeployment(series='trusty', - openstack='cloud:trusty-mitaka', - source='cloud:trusty-updates/mitaka') - deployment.run_tests() diff --git a/tests/gate-basic-xenial-mitaka b/tests/gate-basic-xenial-mitaka deleted file mode 100755 index fed35f1..0000000 --- a/tests/gate-basic-xenial-mitaka +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2016 Canonical Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Amulet tests on a basic ceilometer-agent deployment on xenial-mitaka.""" - -from basic_deployment import CeiloAgentBasicDeployment - -if __name__ == '__main__': - deployment = CeiloAgentBasicDeployment(series='xenial') - deployment.run_tests() diff --git a/tests/gate-basic-xenial-ocata b/tests/gate-basic-xenial-ocata deleted file mode 100755 index b4bc988..0000000 --- a/tests/gate-basic-xenial-ocata +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2016 Canonical Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Amulet tests on a basic ceilometer-agent deployment on xenial-ocata.""" - -from basic_deployment import CeiloAgentBasicDeployment - -if __name__ == '__main__': - deployment = CeiloAgentBasicDeployment(series='xenial', - openstack='cloud:xenial-ocata') - deployment.run_tests() diff --git a/tests/gate-basic-xenial-pike b/tests/gate-basic-xenial-pike deleted file mode 100755 index 77f5823..0000000 --- a/tests/gate-basic-xenial-pike +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2016 Canonical Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Amulet tests on a basic ceilometer-agent deployment on xenial-pike.""" - -from basic_deployment import CeiloAgentBasicDeployment - -if __name__ == '__main__': - deployment = CeiloAgentBasicDeployment(series='xenial', - openstack='cloud:xenial-pike') - deployment.run_tests() diff --git a/tests/gate-basic-xenial-queens b/tests/gate-basic-xenial-queens deleted file mode 100755 index 9f8a51f..0000000 --- a/tests/gate-basic-xenial-queens +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2016 Canonical Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Amulet tests on a basic ceilometer-agent deployment on xenial-queens.""" - -from basic_deployment import CeiloAgentBasicDeployment - -if __name__ == '__main__': - deployment = CeiloAgentBasicDeployment(series='xenial', - openstack='cloud:xenial-queens') - deployment.run_tests() diff --git a/tests/tests.yaml b/tests/tests.yaml index a03e7ba..a73a078 100644 --- a/tests/tests.yaml +++ b/tests/tests.yaml @@ -1,18 +1,23 @@ -# Bootstrap the model if necessary. -bootstrap: True -# Re-use bootstrap node. -reset: True -# Use tox/requirements to drive the venv instead of bundletester's venv feature. -virtualenv: False -# Leave makefile empty, otherwise unit/lint tests will rerun ahead of amulet. -makefile: [] -# Do not specify juju PPA sources. Juju is presumed to be pre-installed -# and configured in all test runner environments. -#sources: -# Do not specify or rely on system packages. -#packages: -# Do not specify python packages here. Use test-requirements.txt -# and tox instead. ie. The venv is constructed before bundletester -# is invoked. -#python-packages: -reset_timeout: 600 +charm_name: ceilometer-agent +configure: + - zaza.openstack.charm_tests.ceilometer.setup.basic_setup +gate_bundles: + - trusty-mitaka + - xenial-mitaka + - xenial-ocata + - xenial-pike + - xenial-queens + - bionic-queens + - bionic-rocky + - bionic-stein + - bionic-train +smoke_bundles: + - bionic-train +dev_bundles: + - bionic-train +tests: + - zaza.openstack.charm_tests.ceilometer.tests.CeilometerTest +target_deploy_status: + ceilometer: + workload-status: blocked + workload-status-message: "Run the ceilometer-upgrade action on the leader to initialize ceilometer and gnocchi" diff --git a/tox.ini b/tox.ini index b625434..20dbbfc 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,12 @@ -# Classic charm (with amulet): ./tox.ini +# Classic charm (with zaza): ./tox.ini # This file is managed centrally by release-tools and should not be modified # within individual charm repos. See the 'global' dir contents for available # choices of tox.ini for OpenStack Charms: # https://github.com/openstack-charmers/release-tools +# +# TODO: Distill the func test requirements from the lint/unit test +# requirements. They are intertwined. Also, Zaza itself should specify +# all of its own requirements and if it doesn't, fix it there. [tox] envlist = pep8,py3 skipsdist = True @@ -15,17 +19,12 @@ skip_missing_interpreters = False setenv = VIRTUAL_ENV={envdir} PYTHONHASHSEED=0 CHARM_DIR={envdir} - AMULET_SETUP_TIMEOUT=5400 install_command = pip install {opts} {packages} commands = stestr run --slowest {posargs} whitelist_externals = juju -passenv = HOME TERM AMULET_* CS_* OS_* TEST_* - -[testenv:py3] -basepython = python3 -deps = -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt +passenv = HOME TERM CS_* OS_* TEST_* +deps = -r{toxinidir}/test-requirements.txt [testenv:py35] basepython = python3.5 @@ -42,6 +41,11 @@ basepython = python3.7 deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt +[testenv:py3] +basepython = python3 +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + [testenv:pep8] basepython = python3 deps = -r{toxinidir}/requirements.txt @@ -82,39 +86,29 @@ basepython = python3 commands = {posargs} [testenv:func-noop] -# DRY RUN - For Debug -basepython = python2.7 -deps = -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt +basepython = python3 commands = - bundletester -vl DEBUG -r json -o func-results.json --test-pattern "gate-*" -n --no-destroy + functest-run-suite --help [testenv:func] -# Charm Functional Test -# Run all gate tests which are +x (expected to always pass) -basepython = python2.7 -deps = -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt +basepython = python3 commands = - bundletester -vl DEBUG -r json -o func-results.json --test-pattern "gate-*" --no-destroy + functest-run-suite --keep-model [testenv:func-smoke] -# Charm Functional Test -# Run a specific test as an Amulet smoke test (expected to always pass) -basepython = python2.7 -deps = -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt +basepython = python3 commands = - bundletester -vl DEBUG -r json -o func-results.json gate-basic-bionic-train --no-destroy + functest-run-suite --keep-model --smoke [testenv:func-dev] -# Charm Functional Test -# Run all development test targets which are +x (may not always pass!) -basepython = python2.7 -deps = -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt +basepython = python3 commands = - bundletester -vl DEBUG -r json -o func-results.json --test-pattern "dev-*" --no-destroy + functest-run-suite --keep-model --dev + +[testenv:func-target] +basepython = python3 +commands = + functest-run-suite --keep-model --bundle {posargs} [flake8] ignore = E402,E226