diff --git a/config.yaml b/config.yaml index 2986fc5e..3182a8a2 100644 --- a/config.yaml +++ b/config.yaml @@ -23,6 +23,7 @@ options: the corresponding OpenStack github branch will be used: * liberty * mitaka + * newton * master The YAML must minimally include requirements, neutron-fwaas, diff --git a/hooks/charmhelpers/contrib/openstack/amulet/deployment.py b/hooks/charmhelpers/contrib/openstack/amulet/deployment.py index 6fe8cf88..9e0b07fb 100644 --- a/hooks/charmhelpers/contrib/openstack/amulet/deployment.py +++ b/hooks/charmhelpers/contrib/openstack/amulet/deployment.py @@ -156,7 +156,7 @@ class OpenStackAmuletDeployment(AmuletDeployment): use_source = list(set( use_source + ['mysql', 'mongodb', 'rabbitmq-server', 'ceph', 'ceph-osd', 'ceph-radosgw', 'ceph-mon', - 'ceph-proxy'])) + 'ceph-proxy', 'percona-cluster', 'lxd'])) # Charms which can not use openstack-origin, ie. many subordinates no_origin = list(set( diff --git a/hooks/charmhelpers/contrib/openstack/amulet/utils.py b/hooks/charmhelpers/contrib/openstack/amulet/utils.py index 24b353ee..e4546c8c 100644 --- a/hooks/charmhelpers/contrib/openstack/amulet/utils.py +++ b/hooks/charmhelpers/contrib/openstack/amulet/utils.py @@ -306,10 +306,8 @@ class OpenStackAmuletUtils(AmuletUtils): password, tenant): """Authenticates admin user with cinder.""" # NOTE(beisner): cinder python client doesn't accept tokens. - service_ip = \ - keystone_sentry.relation('shared-db', - 'mysql:shared-db')['private-address'] - ept = "http://{}:5000/v2.0".format(service_ip.strip().decode('utf-8')) + keystone_ip = keystone_sentry.info['public-address'] + ept = "http://{}:5000/v2.0".format(keystone_ip.strip().decode('utf-8')) return cinder_client.Client(username, password, tenant, ept) def authenticate_keystone_admin(self, keystone_sentry, user, password, @@ -317,10 +315,9 @@ class OpenStackAmuletUtils(AmuletUtils): keystone_ip=None): """Authenticates admin user with the keystone admin endpoint.""" self.log.debug('Authenticating keystone admin...') - unit = keystone_sentry if not keystone_ip: - keystone_ip = unit.relation('shared-db', - 'mysql:shared-db')['private-address'] + keystone_ip = keystone_sentry.info['public-address'] + base_ep = "http://{}:35357".format(keystone_ip.strip().decode('utf-8')) if not api_version or api_version == 2: ep = base_ep + "/v2.0" diff --git a/hooks/charmhelpers/contrib/openstack/utils.py b/hooks/charmhelpers/contrib/openstack/utils.py index 9abd4c31..8c89c3a3 100644 --- a/hooks/charmhelpers/contrib/openstack/utils.py +++ b/hooks/charmhelpers/contrib/openstack/utils.py @@ -229,6 +229,7 @@ GIT_DEFAULT_REPOS = { GIT_DEFAULT_BRANCHES = { 'liberty': 'stable/liberty', 'mitaka': 'stable/mitaka', + 'newton': 'stable/newton', 'master': 'master', } @@ -735,12 +736,12 @@ def git_os_codename_install_source(projects_yaml): if projects in GIT_DEFAULT_BRANCHES.keys(): if projects == 'master': - return 'newton' + return 'ocata' return projects if 'release' in projects: if projects['release'] == 'master': - return 'newton' + return 'ocata' return projects['release'] return None diff --git a/tests/basic_deployment.py b/tests/basic_deployment.py index d37a3928..32631cdc 100644 --- a/tests/basic_deployment.py +++ b/tests/basic_deployment.py @@ -54,9 +54,10 @@ class NeutronOVSBasicDeployment(OpenStackAmuletDeployment): self._deploy() u.log.info('Waiting on extended status checks...') - exclude_services = ['mysql'] + exclude_services = [] self._auto_wait_for_status(exclude_services=exclude_services) + self.d.sentry.wait() self._initialize_tests() def _add_services(self): @@ -69,12 +70,14 @@ class NeutronOVSBasicDeployment(OpenStackAmuletDeployment): # Services and relations which are present merely to satisfy required_interfaces # and workload status are not inspected. Fix me. Inspect those too. this_service = {'name': 'neutron-openvswitch'} - other_services = [{'name': 'nova-compute'}, - {'name': 'rabbitmq-server'}, - {'name': 'keystone'}, # satisfy workload stat - {'name': 'mysql'}, # satisfy workload stat - {'name': 'glance'}, # satisfy workload stat - {'name': 'neutron-api'}] + other_services = [ + {'name': 'nova-compute'}, + {'name': 'rabbitmq-server'}, + {'name': 'keystone'}, + {'name': 'glance'}, + {'name': 'neutron-api'}, + {'name': 'percona-cluster', 'constraints': {'mem': '3072M'}}, + ] super(NeutronOVSBasicDeployment, self)._add_services(this_service, other_services) @@ -88,14 +91,14 @@ class NeutronOVSBasicDeployment(OpenStackAmuletDeployment): 'neutron-api:neutron-plugin-api', # Satisfy workload stat: 'neutron-api:identity-service': 'keystone:identity-service', - 'neutron-api:shared-db': 'mysql:shared-db', + 'neutron-api:shared-db': 'percona-cluster:shared-db', 'neutron-api:amqp': 'rabbitmq-server:amqp', 'nova-compute:amqp': 'rabbitmq-server:amqp', 'nova-compute:image-service': 'glance:image-service', 'glance:identity-service': 'keystone:identity-service', - 'glance:shared-db': 'mysql:shared-db', + 'glance:shared-db': 'percona-cluster:shared-db', 'glance:amqp': 'rabbitmq-server:amqp', - 'keystone:shared-db': 'mysql:shared-db', + 'keystone:shared-db': 'percona-cluster:shared-db', } super(NeutronOVSBasicDeployment, self)._add_relations(relations) @@ -151,7 +154,17 @@ class NeutronOVSBasicDeployment(OpenStackAmuletDeployment): 'https_proxy': amulet_http_proxy, } neutron_ovs_config['openstack-origin-git'] = yaml.dump(openstack_origin_git) - configs = {'neutron-openvswitch': neutron_ovs_config} + + pxc_config = { + 'dataset-size': '25%', + 'max-connections': 1000, + 'root-password': 'ChangeMe123', + 'sst-password': 'ChangeMe123', + } + configs = { + 'neutron-openvswitch': neutron_ovs_config, + 'percona-cluster': pxc_config, + } super(NeutronOVSBasicDeployment, self)._configure_services(configs) def _initialize_tests(self): diff --git a/tests/charmhelpers/contrib/openstack/amulet/deployment.py b/tests/charmhelpers/contrib/openstack/amulet/deployment.py index 6fe8cf88..9e0b07fb 100644 --- a/tests/charmhelpers/contrib/openstack/amulet/deployment.py +++ b/tests/charmhelpers/contrib/openstack/amulet/deployment.py @@ -156,7 +156,7 @@ class OpenStackAmuletDeployment(AmuletDeployment): use_source = list(set( use_source + ['mysql', 'mongodb', 'rabbitmq-server', 'ceph', 'ceph-osd', 'ceph-radosgw', 'ceph-mon', - 'ceph-proxy'])) + 'ceph-proxy', 'percona-cluster', 'lxd'])) # Charms which can not use openstack-origin, ie. many subordinates no_origin = list(set( diff --git a/tests/charmhelpers/contrib/openstack/amulet/utils.py b/tests/charmhelpers/contrib/openstack/amulet/utils.py index 24b353ee..e4546c8c 100644 --- a/tests/charmhelpers/contrib/openstack/amulet/utils.py +++ b/tests/charmhelpers/contrib/openstack/amulet/utils.py @@ -306,10 +306,8 @@ class OpenStackAmuletUtils(AmuletUtils): password, tenant): """Authenticates admin user with cinder.""" # NOTE(beisner): cinder python client doesn't accept tokens. - service_ip = \ - keystone_sentry.relation('shared-db', - 'mysql:shared-db')['private-address'] - ept = "http://{}:5000/v2.0".format(service_ip.strip().decode('utf-8')) + keystone_ip = keystone_sentry.info['public-address'] + ept = "http://{}:5000/v2.0".format(keystone_ip.strip().decode('utf-8')) return cinder_client.Client(username, password, tenant, ept) def authenticate_keystone_admin(self, keystone_sentry, user, password, @@ -317,10 +315,9 @@ class OpenStackAmuletUtils(AmuletUtils): keystone_ip=None): """Authenticates admin user with the keystone admin endpoint.""" self.log.debug('Authenticating keystone admin...') - unit = keystone_sentry if not keystone_ip: - keystone_ip = unit.relation('shared-db', - 'mysql:shared-db')['private-address'] + keystone_ip = keystone_sentry.info['public-address'] + base_ep = "http://{}:35357".format(keystone_ip.strip().decode('utf-8')) if not api_version or api_version == 2: ep = base_ep + "/v2.0" diff --git a/tests/gate-basic-precise-icehouse b/tests/gate-basic-xenial-newton similarity index 70% rename from tests/gate-basic-precise-icehouse rename to tests/gate-basic-xenial-newton index 045574bb..0e8abaa5 100755 --- a/tests/gate-basic-precise-icehouse +++ b/tests/gate-basic-xenial-newton @@ -15,12 +15,12 @@ # limitations under the License. # NeutronOVSBasicDeployment -"""Amulet tests on a basic neutron-openvswitch deployment on precise-icehouse.""" +"""Amulet tests on a basic neutron-openvswitch deployment on xenial-newton.""" from basic_deployment import NeutronOVSBasicDeployment if __name__ == '__main__': - deployment = NeutronOVSBasicDeployment(series='precise', - openstack='cloud:precise-icehouse', - source='cloud:precise-updates/icehouse') + deployment = NeutronOVSBasicDeployment(series='xenial', + openstack='cloud:xenial-newton', + source='cloud:xenial-updates/newton') deployment.run_tests() diff --git a/tests/gate-basic-yakkety-newton b/tests/gate-basic-yakkety-newton new file mode 100644 index 00000000..1879d8f0 --- /dev/null +++ b/tests/gate-basic-yakkety-newton @@ -0,0 +1,23 @@ +#!/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 neutron-openvswitch deployment on yakkety-newton.""" + +from basic_deployment import NeutronOVSBasicDeployment + +if __name__ == '__main__': + deployment = NeutronOVSBasicDeployment(series='yakkety') + deployment.run_tests()