diff --git a/TODO.md b/TODO.md index 59dee11..8fdcc23 100644 --- a/TODO.md +++ b/TODO.md @@ -5,7 +5,6 @@ TODO * Add a manila-backend-plugin interface * Split the generic configuration into manila-generic-backend charm * Add unit tests - * Add amulet tests * Put the manual testing bits into charm-openstack-testing so that the bundles are available diff --git a/src/README.md b/src/README.md index 84ca0c3..cc955fa 100644 --- a/src/README.md +++ b/src/README.md @@ -1,7 +1,7 @@ # Overview -This charm exists to provide an example back-end for Manila, for the purpose -of test and reference. It is not intended for production use in any case. +This charm exists to provide an example backend for Manila, for the purpose +of test and reference. It is NOT intended for production use in any case. It configures the generic backend in the related manila charm in an OpenStack cloud. This provides NFS shares using Cinder as a backing store. It @@ -9,7 +9,7 @@ should be used for testing and development purposes only. # Usage -The charm relies on the prinical manila charm, and is a subordinate to it. It +The charm relies on the principal manila charm, and is a subordinate to it. It provides configuration data to the manila-share service (which is provided by the manila charm with a role that includes 'share'). diff --git a/src/metadata.yaml b/src/metadata.yaml index a13b2a9..3f4cb1f 100644 --- a/src/metadata.yaml +++ b/src/metadata.yaml @@ -2,7 +2,7 @@ name: manila-generic summary: A generic backend configuration charm for manila. maintainer: OpenStack Charmers description: | - The Manil share file system service provides a set of services for management + The Manila share file system service provides a set of services for management of shared file systems in a multi-tenant cloud environment. The service resembles OpenStack block-based storage management from the OpenStack Block Storage service project. With the Shared File Systems service, you can create diff --git a/src/test-requirements.txt b/src/test-requirements.txt index a4b77a5..d3c9be8 100644 --- a/src/test-requirements.txt +++ b/src/test-requirements.txt @@ -1,33 +1,8 @@ -# This file is managed centrally. If you find the need to modify this as a -# one-off, please don't. Intead, consult #openstack-charms and ask about -# requirements management in charms via bot-control. Thank you. -charm-tools>=2.4.4 -coverage>=3.6 -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' -aodhclient>=0.1.0 -gnocchiclient>=3.1.0,<3.2.0 -python-barbicanclient>=4.0.1 -python-ceilometerclient>=1.5.0 -python-cinderclient>=1.4.0,<5.0.0 -python-designateclient>=1.5 -python-glanceclient>=1.1.0 -python-heatclient>=0.8.0 -python-keystoneclient>=1.7.1 -python-manilaclient>=1.8.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 -pytz # workaround for 14.04 pip/tox -pyudev # for ceph-* charm unit tests (not mocked?) +# 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 *requirements.txt files for OpenStack Charms: +# https://github.com/openstack-charmers/release-tools +# +# Functional Test Requirements (let Zaza's dependencies solve all dependencies here!) +git+https://github.com/openstack-charmers/zaza.git#egg=zaza +git+https://github.com/openstack-charmers/zaza-openstack-tests.git#egg=zaza.openstack diff --git a/src/tests/README.md b/src/tests/README.md index 046be7f..856c4f9 100644 --- a/src/tests/README.md +++ b/src/tests/README.md @@ -1,6 +1,6 @@ # Overview -This directory provides Amulet tests to verify basic deployment functionality +This directory provides Zaza 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. diff --git a/src/tests/basic_deployment.py b/src/tests/basic_deployment.py deleted file mode 100644 index 7ab3195..0000000 --- a/src/tests/basic_deployment.py +++ /dev/null @@ -1,287 +0,0 @@ -import amulet - -import keystoneclient.exceptions -from manilaclient.v1 import client as manila_client - -from charmhelpers.contrib.openstack.amulet.deployment import ( - OpenStackAmuletDeployment -) - -from charmhelpers.contrib.openstack.amulet.utils import ( - OpenStackAmuletUtils, - DEBUG, -) - -# Use DEBUG to turn on debug logging -u = OpenStackAmuletUtils(DEBUG) - - -class ManilaGenericBasicDeployment(OpenStackAmuletDeployment): - """Amulet tests on a basic Manila Generic deployment. - - Note that these tests don't attempt to do a functional test on Manila, - merely to demonstrate that the relations work and that they transfer the - correct information across them. It verifies that the configuration goes - across to the manila main charm. - - A functional test will be performed by a mojo or tempest test. - """ - - def __init__(self, series, openstack=None, source=None, stable=False, - keystone_version='2'): - """Deploy the entire test environment. - """ - super(ManilaGenericBasicDeployment, self).__init__( - series, openstack, source, stable) - self._keystone_version = keystone_version - self._add_services() - self._add_relations() - self._configure_services() - self._deploy() - - u.log.info('Waiting on extended status checks...') - exclude_services = [] - self._auto_wait_for_status(exclude_services=exclude_services) - - self._initialize_tests() - - def _add_services(self): - """Add services - - Add the services that we're testing, where manila is local, - and the rest of the service are from lp branches that are - compatible with the local charm (e.g. stable or next). - """ - this_service = {'name': 'manila-generic'} - other_services = [ - {'name': 'percona-cluster', - 'constraints': {'mem': '3072M'}}, - {'name': 'rabbitmq-server'}, - {'name': 'keystone'}, - {'name': 'manila'} - ] - super(ManilaGenericBasicDeployment, self)._add_services( - this_service, other_services) - - def _add_relations(self): - """Add all of the relations for the services.""" - relations = { - 'manila:shared-db': 'percona-cluster:shared-db', - 'manila:amqp': 'rabbitmq-server:amqp', - 'manila:identity-service': 'keystone:identity-service', - 'manila:manila-plugin': 'manila-generic:manila-plugin', - 'keystone:shared-db': 'percona-cluster:shared-db', - } - super(ManilaGenericBasicDeployment, self)._add_relations(relations) - - def _configure_services(self): - """Configure all of the services.""" - keystone_config = { - 'admin-password': 'openstack', - } - manila_config = { - 'default-share-backend': 'generic', - } - manila_generic_config = { - 'driver-handles-share-servers': False, - } - configs = { - 'keystone': keystone_config, - 'manila': manila_config, - 'manila-generic': manila_generic_config, - } - super(ManilaGenericBasicDeployment, self)._configure_services(configs) - - def _initialize_tests(self): - """Perform final initialization before tests get run.""" - # Access the sentries for inspecting service units - self.manila_sentry = self.d.sentry['manila'][0] - self.manila_generic_sentry = self.d.sentry['manila-generic'][0] - self.percona_cluster_sentry = self.d.sentry['percona-cluster'][0] - self.keystone_sentry = self.d.sentry['keystone'][0] - self.rabbitmq_sentry = self.d.sentry['rabbitmq-server'][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 - self.keystone_session, self.keystone = u.get_default_keystone_session( - self.keystone_sentry, - openstack_release=self._get_openstack_release()) - - def test_205_manila_to_manila_generic(self): - """Verify that the manila to manila-generic config is working""" - u.log.debug('Checking the manila:manila-generic relation data...') - manila = self.manila_sentry - relation = ['manila-plugin', 'manila-generic:manila-plugin'] - expected = { - 'private-address': u.valid_ip, - '_authentication_data': u.not_null, - } - ret = u.validate_relation_data(manila, relation, expected) - if ret: - message = u.relation_error('manila manila_generic', ret) - amulet.raise_status(amulet.FAIL, msg=message) - u.log.debug('OK') - - def test_206_manila_generic_to_manila(self): - """Verify that the manila-generic to manila config is working""" - u.log.debug('Checking the manila-generic:manila relation data...') - manila_generic = self.manila_generic_sentry - relation = ['manila-plugin', 'manila:manila-plugin'] - expected = { - 'private-address': u.valid_ip, - '_configuration_data': u.not_null, - '_name': 'generic' - } - ret = u.validate_relation_data(manila_generic, relation, expected) - if ret: - message = u.relation_error('manila manila_generic', ret) - amulet.raise_status(amulet.FAIL, msg=message) - u.log.debug('OK') - - @staticmethod - def _find_or_create(items, key, create): - """Find or create the thing in the items - - :param items: the items to search using the key - :param key: a function that key(item) -> boolean if found. - :param create: a function to call if the key() never was true. - :returns: the item that was either found or created. - """ - for i in items: - if key(i): - return i - return create() - - def test_400_api_connection(self): - """Simple api calls to check service is up and responding""" - u.log.debug('Checking api functionality...') - - # This handles both keystone v2 and v3. - # For keystone v2 we need a user: - # - 'demo' user - # - has a project 'demo' - # - in the 'demo' project - # - with an 'admin' role - # For keystone v3 we need a user: - # - 'default' domain - # - 'demo' user - # - 'demo' project - # - 'admin' role -- to be able to delete. - - # manila requires a user with creator or admin role on the project - # when creating a secret (which this test does). Therefore, we create - # a demo user, demo project, and then get a demo manila client and do - # the secret. ensure that the default domain is created. - - keystone_ip = self.keystone_sentry.info['public-address'] - if self._keystone_version == '2': - # find or create the 'demo' tenant (project) - tenant = self._find_or_create( - items=self.keystone.tenants.list(), - key=lambda t: t.name == 'demo', - create=lambda: self.keystone.tenants.create( - tenant_name="demo", - description="Demo for testing manila", - enabled=True)) - # find or create the demo user - demo_user = self._find_or_create( - items=self.keystone.users.list(), - key=lambda u: u.name == 'demo', - create=lambda: self.keystone.users.create( - name='demo', - password='pass', - tenant_id=tenant.id)) - # find the admin role - # already be created - if not, then this will fail later. - admin_role = self._find_or_create( - items=self.keystone.roles.list(), - key=lambda r: r.name.lower() == 'admin', - create=lambda: None) - # grant the role if it isn't already created. - # now grant the creator role to the demo user. - self._find_or_create( - items=self.keystone.roles.roles_for_user( - demo_user, tenant=tenant), - key=lambda r: r.name.lower() == admin_role.name.lower(), - create=lambda: self.keystone.roles.add_user_role( - demo_user, admin_role, tenant=tenant)) - - # Authenticate demo user with keystone - self.demo_user_session, _ = u.get_keystone_session( - keystone_ip, - 'demo', - 'pass', - api_version=2, - project_name='demo', - ) - else: - # find or create the 'default' domain - domain = self._find_or_create( - items=self.keystone.domains.list(), - key=lambda u: u.name == 'Default', - create=lambda: self.keystone.domains.create( - "Default", - description="domain for manila testing", - enabled=True)) - # find or create the 'demo' user - demo_user = self._find_or_create( - items=self.keystone.users.list(domain=domain.id), - key=lambda u: u.name == 'demo', - create=lambda: self.keystone.users.create( - 'demo', - domain=domain.id, - description="Demo user for manila tests", - enabled=True, - email="demo@example.com", - password="pass")) - # find or create the 'demo' project - demo_project = self._find_or_create( - items=self.keystone.projects.list(domain=domain.id), - key=lambda x: x.name == 'demo', - create=lambda: self.keystone.projects.create( - 'demo', - domain=domain.id, - description='manila testing project', - enabled=True)) - # create the role for the user - needs to be admin so that the - # secret can be deleted - note there is only one admin role, and it - # should already be created - if not, then this will fail later. - admin_role = self._find_or_create( - items=self.keystone.roles.list(), - key=lambda r: r.name.lower() == 'admin', - create=lambda: None) - # now grant the creator role to the demo user. - try: - self.keystone.roles.check( - role=admin_role, - user=demo_user, - project=demo_project) - except keystoneclient.exceptions.NotFound: - # create it if it isn't found - self.keystone.roles.grant( - role=admin_role, - user=demo_user, - project=demo_project) - self.demo_user_session, _ = u.get_keystone_session( - keystone_ip, - 'demo', - 'pass', - api_version=3, - project_name='demo', - user_domain_name='default', - project_domain_name='default', - ) - - # Authenticate admin with manila endpoint - manila_ep = self.keystone.service_catalog.url_for( - service_type='share', interface='publicURL') - manila = manila_client.Client(session=self.demo_user_session, - endpoint=manila_ep) - # now just try a list the shares - # NOTE(AJK) the 'search_opts={}' is needed to work around Bug#1707303 - manila.shares.list(search_opts={}) - u.log.debug('OK') - u.log.debug('OK') diff --git a/src/tests/bundles/bionic-queens.yaml b/src/tests/bundles/bionic-queens.yaml new file mode 100644 index 0000000..4cc72e5 --- /dev/null +++ b/src/tests/bundles/bionic-queens.yaml @@ -0,0 +1,32 @@ +series: bionic +services: + manila: + charm: cs:~openstack-charmers-next/manila + num_units: 1 + options: + default-share-backend: generic + manila-generic: + charm: ../../../manila-generic + options: + driver-handles-share-servers: False + rabbitmq-server: + charm: cs:~openstack-charmers-next/rabbitmq-server + num_units: 1 + percona-cluster: + charm: cs:~openstack-charmers-next/percona-cluster + num_units: 1 + keystone: + charm: cs:~openstack-charmers-next/keystone + num_units: 1 + +relations: + - - manila:manila-plugin + - manila-generic + - - manila + - rabbitmq-server + - - manila + - keystone + - - keystone + - percona-cluster + - - manila + - percona-cluster diff --git a/src/tests/bundles/bionic-rocky.yaml b/src/tests/bundles/bionic-rocky.yaml new file mode 100644 index 0000000..f1cdeb0 --- /dev/null +++ b/src/tests/bundles/bionic-rocky.yaml @@ -0,0 +1,41 @@ +series: bionic +options: + source: &source cloud:bionic-rocky +services: + manila: + charm: cs:~openstack-charmers-next/manila + num_units: 1 + options: + default-share-backend: generic + openstack-origin: *source + manila-generic: + charm: ../../../manila-generic + options: + driver-handles-share-servers: False + rabbitmq-server: + charm: cs:~openstack-charmers-next/rabbitmq-server + num_units: 1 + options: + source: *source + percona-cluster: + charm: cs:~openstack-charmers-next/percona-cluster + num_units: 1 + options: + source: *source + keystone: + charm: cs:~openstack-charmers-next/keystone + num_units: 1 + options: + openstack-origin: *source + +relations: + - - manila:manila-plugin + - manila-generic + - - manila + - rabbitmq-server + - - manila + - keystone + - - keystone + - percona-cluster + - - manila + - percona-cluster diff --git a/src/tests/bundles/bionic-stein.yaml b/src/tests/bundles/bionic-stein.yaml new file mode 100644 index 0000000..d0164da --- /dev/null +++ b/src/tests/bundles/bionic-stein.yaml @@ -0,0 +1,41 @@ +series: bionic +options: + source: &source cloud:bionic-stein +services: + manila: + charm: cs:~openstack-charmers-next/manila + num_units: 1 + options: + default-share-backend: generic + openstack-origin: *source + manila-generic: + charm: ../../../manila-generic + options: + driver-handles-share-servers: False + rabbitmq-server: + charm: cs:~openstack-charmers-next/rabbitmq-server + num_units: 1 + options: + source: *source + percona-cluster: + charm: cs:~openstack-charmers-next/percona-cluster + num_units: 1 + options: + source: *source + keystone: + charm: cs:~openstack-charmers-next/keystone + num_units: 1 + options: + openstack-origin: *source + +relations: + - - manila:manila-plugin + - manila-generic + - - manila + - rabbitmq-server + - - manila + - keystone + - - keystone + - percona-cluster + - - manila + - percona-cluster diff --git a/src/tests/bundles/bionic-train.yaml b/src/tests/bundles/bionic-train.yaml new file mode 100644 index 0000000..75f1076 --- /dev/null +++ b/src/tests/bundles/bionic-train.yaml @@ -0,0 +1,41 @@ +series: bionic +options: + source: &source cloud:bionic-train +services: + manila: + charm: cs:~openstack-charmers-next/manila + num_units: 1 + options: + default-share-backend: generic + openstack-origin: *source + manila-generic: + charm: ../../../manila-generic + options: + driver-handles-share-servers: False + rabbitmq-server: + charm: cs:~openstack-charmers-next/rabbitmq-server + num_units: 1 + options: + source: *source + percona-cluster: + charm: cs:~openstack-charmers-next/percona-cluster + num_units: 1 + options: + source: *source + keystone: + charm: cs:~openstack-charmers-next/keystone + num_units: 1 + options: + openstack-origin: *source + +relations: + - - manila:manila-plugin + - manila-generic + - - manila + - rabbitmq-server + - - manila + - keystone + - - keystone + - percona-cluster + - - manila + - percona-cluster diff --git a/src/tests/bundles/xenial-pike.yaml b/src/tests/bundles/xenial-pike.yaml new file mode 100644 index 0000000..c767957 --- /dev/null +++ b/src/tests/bundles/xenial-pike.yaml @@ -0,0 +1,41 @@ +series: xenial +options: + source: &source cloud:xenial-pike +services: + manila: + charm: cs:~openstack-charmers-next/manila + num_units: 1 + options: + default-share-backend: generic + openstack-origin: *source + manila-generic: + charm: ../../../manila-generic + options: + driver-handles-share-servers: False + rabbitmq-server: + charm: cs:~openstack-charmers-next/rabbitmq-server + num_units: 1 + options: + source: *source + percona-cluster: + charm: cs:~openstack-charmers-next/percona-cluster + num_units: 1 + options: + source: *source + keystone: + charm: cs:~openstack-charmers-next/keystone + num_units: 1 + options: + openstack-origin: *source + +relations: + - - manila:manila-plugin + - manila-generic + - - manila + - rabbitmq-server + - - manila + - keystone + - - keystone + - percona-cluster + - - manila + - percona-cluster diff --git a/src/tests/bundles/xenial-queens.yaml b/src/tests/bundles/xenial-queens.yaml new file mode 100644 index 0000000..7205f97 --- /dev/null +++ b/src/tests/bundles/xenial-queens.yaml @@ -0,0 +1,41 @@ +series: xenial +options: + source: &source cloud:xenial-queens +services: + manila: + charm: cs:~openstack-charmers-next/manila + num_units: 1 + options: + default-share-backend: generic + openstack-origin: *source + manila-generic: + charm: ../../../manila-generic + options: + driver-handles-share-servers: False + rabbitmq-server: + charm: cs:~openstack-charmers-next/rabbitmq-server + num_units: 1 + options: + source: *source + percona-cluster: + charm: cs:~openstack-charmers-next/percona-cluster + num_units: 1 + options: + source: *source + keystone: + charm: cs:~openstack-charmers-next/keystone + num_units: 1 + options: + openstack-origin: *source + +relations: + - - manila:manila-plugin + - manila-generic + - - manila + - rabbitmq-server + - - manila + - keystone + - - keystone + - percona-cluster + - - manila + - percona-cluster diff --git a/src/tests/dev-basic-xenial-mitaka b/src/tests/dev-basic-xenial-mitaka deleted file mode 100755 index 8919873..0000000 --- a/src/tests/dev-basic-xenial-mitaka +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env python - -"""Amulet tests on a basic barbican deployment on xenial-mitaka for keystone v2. -""" - -from basic_deployment import ManilaGenericBasicDeployment - -if __name__ == '__main__': - deployment = ManilaGenericBasicDeployment(series='xenial', keystone_version='2') - deployment.run_tests() diff --git a/src/tests/dev-basic-xenial-ocata b/src/tests/dev-basic-xenial-ocata deleted file mode 100755 index 04208d6..0000000 --- a/src/tests/dev-basic-xenial-ocata +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python - -"""Amulet tests on a basic barbican deployment on xenial-ocata for keystone v2. -""" - -from basic_deployment import ManilaGenericBasicDeployment - -if __name__ == '__main__': - deployment = ManilaGenericBasicDeployment( - series='xenial', keystone_version='2', - openstack='cloud:xenial-mitaka', - source='cloud:xenial-mitaka') - deployment.run_tests() diff --git a/src/tests/gate-basic-bionic-queens b/src/tests/gate-basic-bionic-queens deleted file mode 100755 index 97e2754..0000000 --- a/src/tests/gate-basic-bionic-queens +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env python - -"""Amulet tests on a basic barbican deployment on bionic-queens for keystone v2 -""" - -from basic_deployment import ManilaGenericBasicDeployment - -if __name__ == '__main__': - deployment = ManilaGenericBasicDeployment( - series='bionic', keystone_version='3') - deployment.run_tests() diff --git a/src/tests/gate-basic-bionic-rocky b/src/tests/gate-basic-bionic-rocky deleted file mode 100755 index c3108b2..0000000 --- a/src/tests/gate-basic-bionic-rocky +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python - -"""Amulet tests on a basic barbican deployment on bionic-rocky for keystone v3 -""" - -from basic_deployment import ManilaGenericBasicDeployment - -if __name__ == '__main__': - deployment = ManilaGenericBasicDeployment( - series='bionic', keystone_version='3', - openstack='cloud:bionic-rocky', - source='cloud:bionic-rocky') - deployment.run_tests() diff --git a/src/tests/gate-basic-bionic-stein b/src/tests/gate-basic-bionic-stein deleted file mode 100755 index c69df3c..0000000 --- a/src/tests/gate-basic-bionic-stein +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python - -"""Amulet tests on a basic barbican deployment on bionic-stein for keystone v3 -""" - -from basic_deployment import ManilaGenericBasicDeployment - -if __name__ == '__main__': - deployment = ManilaGenericBasicDeployment( - series='bionic', keystone_version='3', - openstack='cloud:bionic-stein', - source='cloud:bionic-train') - deployment.run_tests() diff --git a/src/tests/gate-basic-bionic-train b/src/tests/gate-basic-bionic-train deleted file mode 100755 index 8d83cc1..0000000 --- a/src/tests/gate-basic-bionic-train +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python - -"""Amulet tests on a basic barbican deployment on bionic-train for keystone v3 -""" - -from basic_deployment import ManilaGenericBasicDeployment - -if __name__ == '__main__': - deployment = ManilaGenericBasicDeployment( - series='bionic', keystone_version='3', - openstack='cloud:bionic-train', - source='cloud:bionic-train') - deployment.run_tests() diff --git a/src/tests/gate-basic-xenial-pike b/src/tests/gate-basic-xenial-pike deleted file mode 100755 index ada1915..0000000 --- a/src/tests/gate-basic-xenial-pike +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python - -"""Amulet tests on a basic barbican deployment on xenial-pike for keystone v2. -""" - -from basic_deployment import ManilaGenericBasicDeployment - -if __name__ == '__main__': - deployment = ManilaGenericBasicDeployment( - series='xenial', keystone_version='2', - openstack='cloud:xenial-pike', - source='cloud:xenial-pike') - deployment.run_tests() diff --git a/src/tests/gate-basic-xenial-queens b/src/tests/gate-basic-xenial-queens deleted file mode 100755 index 89482ae..0000000 --- a/src/tests/gate-basic-xenial-queens +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python - -"""Amulet tests on a basic barbican deployment on xenial-queens for keystone v3 -""" - -from basic_deployment import ManilaGenericBasicDeployment - -if __name__ == '__main__': - deployment = ManilaGenericBasicDeployment( - series='xenial', keystone_version='3', - openstack='cloud:xenial-queens', - source='cloud:xenial-queens') - deployment.run_tests() diff --git a/src/tests/tests.yaml b/src/tests/tests.yaml index af79ff1..8e0524e 100644 --- a/src/tests/tests.yaml +++ b/src/tests/tests.yaml @@ -1,18 +1,15 @@ -# Bootstrap the model if necessary. -bootstrap: True -# Re-use bootstrap node instead of destroying/re-bootstrapping. -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: manila-generic +gate_bundles: + - xenial-pike + - xenial-queens + - bionic-queens + - bionic-stein + - bionic-train + - bionic-rocky +smoke_bundles: + - bionic-queens +target_deploy_status: {} +tests: + - zaza.openstack.charm_tests.manila.tests.ManilaTests +configure: + - zaza.openstack.charm_tests.keystone.setup.add_demo_user diff --git a/src/tox.ini b/src/tox.ini index dd17ae5..07a7adc 100644 --- a/src/tox.ini +++ b/src/tox.ini @@ -1,4 +1,4 @@ -# Source charm (with amulet): ./src/tox.ini +# Source charm (with zaza): ./src/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: @@ -15,41 +15,36 @@ skip_missing_interpreters = False [testenv] setenv = VIRTUAL_ENV={envdir} PYTHONHASHSEED=0 - CHARM_DIR={envdir} - AMULET_SETUP_TIMEOUT=5400 whitelist_externals = juju -passenv = HOME TERM AMULET_* CS_* OS_* TEST_* +passenv = HOME TERM CS_* OS_* TEST_* deps = -r{toxinidir}/test-requirements.txt install_command = pip install {opts} {packages} [testenv:pep8] basepython = python3 +deps=charm-tools commands = charm-proof [testenv:func-noop] -# DRY RUN - For Debug -basepython = python2.7 +basepython = python3 commands = - bundletester -vl DEBUG -r json -o func-results.json --test-pattern "gate-*" -n --no-destroy + functest-run-suite --help [testenv:func] -# Run all gate tests which are +x (expected to always pass) -basepython = python2.7 +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] -# Run a specific test as an Amulet smoke test (expected to always pass) -basepython = python2.7 +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] -# Run all development test targets which are +x (may not always pass!) -basepython = python2.7 +[testenv:func-target] +basepython = python3 commands = - bundletester -vl DEBUG -r json -o func-results.json --test-pattern "dev-*" --no-destroy + functest-run-suite --keep-model --bundle {posargs} [testenv:venv] commands = {posargs} diff --git a/test-requirements.txt b/test-requirements.txt index 14b380e..0ab97f6 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,7 @@ -# This file is managed centrally. If you find the need to modify this as a -# one-off, please don't. Intead, consult #openstack-charms and ask about -# requirements management in charms via bot-control. Thank you. +# 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 *requirements.txt files for OpenStack Charms: +# https://github.com/openstack-charmers/release-tools # # Lint and unit test requirements flake8>=2.2.4,<=2.4.1 @@ -11,3 +12,12 @@ mock>=1.2 nose>=1.3.7 coverage>=3.6 git+https://github.com/openstack/charms.openstack.git#egg=charms.openstack +# +# Revisit for removal / mock improvement: +netifaces # vault +psycopg2-binary # vault +tenacity # vault +pbr # vault +cryptography # vault, keystone-saml-mellon +lxml # keystone-saml-mellon +hvac # vault, barbican-vault diff --git a/tox.ini b/tox.ini index 5b41c1d..afd48f0 100644 --- a/tox.ini +++ b/tox.ini @@ -50,6 +50,11 @@ basepython = python3.7 deps = -r{toxinidir}/test-requirements.txt commands = stestr run --slowest {posargs} +[testenv:py38] +basepython = python3.8 +deps = -r{toxinidir}/test-requirements.txt +commands = stestr run --slowest {posargs} + [testenv:pep8] basepython = python3 deps = -r{toxinidir}/test-requirements.txt