Update amulet test definitions for Newton
- Remove Precise-Icehouse Amulet test definitions if they exist. - Add Xenial-Newton Amulet test definitions. - Add Yakkety-Newton Amulet test definitions. - Use the percona-cluster charm in tests instead of the mysql charm. Change-Id: I9482772b45ad6a46b88a65cad35598583985fcf1
This commit is contained in:
parent
9442db9c05
commit
3d3fd7885e
hooks/charmhelpers/contrib/openstack
tests
basic_deployment.py
charmhelpers/contrib/openstack/amulet
gate-basic-precise-icehousegate-basic-xenial-newtongate-basic-yakkety-newton@ -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(
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -49,11 +49,12 @@ class CinderCephBasicDeployment(OpenStackAmuletDeployment):
|
||||
self._deploy()
|
||||
|
||||
u.log.info('Waiting on extended status checks...')
|
||||
exclude_services = ['mysql', 'nrpe']
|
||||
exclude_services = ['nrpe']
|
||||
|
||||
# Wait for deployment ready msgs, except exclusions
|
||||
self._auto_wait_for_status(exclude_services=exclude_services)
|
||||
|
||||
self.d.sentry.wait()
|
||||
self._initialize_tests()
|
||||
|
||||
def _add_services(self):
|
||||
@ -64,7 +65,7 @@ class CinderCephBasicDeployment(OpenStackAmuletDeployment):
|
||||
# Note: cinder-ceph becomes a cinder subordinate unit.
|
||||
this_service = {'name': 'cinder-ceph'}
|
||||
other_services = [
|
||||
{'name': 'mysql'},
|
||||
{'name': 'percona-cluster', 'constraints': {'mem': '3072M'}},
|
||||
{'name': 'keystone'},
|
||||
{'name': 'rabbitmq-server'},
|
||||
{'name': 'ceph', 'units': 3},
|
||||
@ -79,8 +80,8 @@ class CinderCephBasicDeployment(OpenStackAmuletDeployment):
|
||||
relations = {
|
||||
'ceph:client': 'cinder-ceph:ceph',
|
||||
'cinder:storage-backend': 'cinder-ceph:storage-backend',
|
||||
'keystone:shared-db': 'mysql:shared-db',
|
||||
'cinder:shared-db': 'mysql:shared-db',
|
||||
'keystone:shared-db': 'percona-cluster:shared-db',
|
||||
'cinder:shared-db': 'percona-cluster:shared-db',
|
||||
'cinder:identity-service': 'keystone:identity-service',
|
||||
'cinder:amqp': 'rabbitmq-server:amqp',
|
||||
'cinder:ceph': 'ceph:client',
|
||||
@ -93,8 +94,11 @@ class CinderCephBasicDeployment(OpenStackAmuletDeployment):
|
||||
'admin-password': 'openstack',
|
||||
'admin-token': 'ubuntutesting'
|
||||
}
|
||||
mysql_config = {
|
||||
'dataset-size': '50%'
|
||||
pxc_config = {
|
||||
'dataset-size': '25%',
|
||||
'max-connections': 1000,
|
||||
'root-password': 'ChangeMe123',
|
||||
'sst-password': 'ChangeMe123',
|
||||
}
|
||||
cinder_config = {
|
||||
'block-device': 'None',
|
||||
@ -114,7 +118,7 @@ class CinderCephBasicDeployment(OpenStackAmuletDeployment):
|
||||
}
|
||||
configs = {
|
||||
'keystone': keystone_config,
|
||||
'mysql': mysql_config,
|
||||
'percona-cluster': pxc_config,
|
||||
'cinder': cinder_config,
|
||||
'ceph': ceph_config,
|
||||
'cinder-ceph': cinder_ceph_config
|
||||
@ -124,7 +128,7 @@ class CinderCephBasicDeployment(OpenStackAmuletDeployment):
|
||||
def _initialize_tests(self):
|
||||
"""Perform final initialization before tests get run."""
|
||||
# Access the sentries for inspecting service units
|
||||
self.mysql_sentry = self.d.sentry['mysql'][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.cinder_sentry = self.d.sentry['cinder'][0]
|
||||
@ -199,7 +203,6 @@ class CinderCephBasicDeployment(OpenStackAmuletDeployment):
|
||||
def test_102_services(self):
|
||||
"""Verify the expected services are running on the service units."""
|
||||
services = {
|
||||
self.mysql_sentry: ['mysql'],
|
||||
self.rabbitmq_sentry: ['rabbitmq-server'],
|
||||
self.keystone_sentry: ['keystone'],
|
||||
self.cinder_sentry: ['cinder-api',
|
||||
@ -421,7 +424,7 @@ class CinderCephBasicDeployment(OpenStackAmuletDeployment):
|
||||
def test_204_mysql_cinder_db_relation(self):
|
||||
"""Verify the mysql:glance shared-db relation data"""
|
||||
u.log.debug('Checking mysql:cinder db relation data...')
|
||||
unit = self.mysql_sentry
|
||||
unit = self.pxc_sentry
|
||||
relation = ['shared-db', 'cinder:shared-db']
|
||||
expected = {
|
||||
'private-address': u.valid_ip,
|
||||
@ -436,7 +439,7 @@ class CinderCephBasicDeployment(OpenStackAmuletDeployment):
|
||||
"""Verify the cinder:mysql shared-db relation data"""
|
||||
u.log.debug('Checking cinder:mysql db relation data...')
|
||||
unit = self.cinder_sentry
|
||||
relation = ['shared-db', 'mysql:shared-db']
|
||||
relation = ['shared-db', 'percona-cluster:shared-db']
|
||||
expected = {
|
||||
'private-address': u.valid_ip,
|
||||
'hostname': u.valid_ip,
|
||||
|
@ -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(
|
||||
|
@ -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"
|
||||
|
@ -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 cinder-ceph deployment on precise-icehouse."""
|
||||
|
||||
from basic_deployment import CinderCephBasicDeployment
|
||||
|
||||
if __name__ == '__main__':
|
||||
deployment = CinderCephBasicDeployment(series='precise',
|
||||
openstack='cloud:precise-icehouse',
|
||||
source='cloud:precise-updates/icehouse')
|
||||
deployment.run_tests()
|
6
tests/dev-basic-yakkety-newton → tests/gate-basic-yakkety-newton
Executable file → Normal file
6
tests/dev-basic-yakkety-newton → tests/gate-basic-yakkety-newton
Executable file → Normal file
@ -14,10 +14,10 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""Amulet tests on a basic ceilometer deployment on yakkety-newton."""
|
||||
"""Amulet tests on a basic cinder-ceph deployment on yakkety-newton."""
|
||||
|
||||
from basic_deployment import CeilometerBasicDeployment
|
||||
from basic_deployment import CinderCephBasicDeployment
|
||||
|
||||
if __name__ == '__main__':
|
||||
deployment = CeilometerBasicDeployment(series='yakkety')
|
||||
deployment = CinderCephBasicDeployment(series='yakkety')
|
||||
deployment.run_tests()
|
Loading…
x
Reference in New Issue
Block a user