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: I4e6101711fe8ae5fa8d0f7351c4ace8cc260b157
This commit is contained in:
Ryan Beisner 2016-09-22 17:59:51 +00:00
parent c8c0089e15
commit 67be5eefef
9 changed files with 71 additions and 36 deletions

View File

@ -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(

View File

@ -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"

View File

@ -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

View File

@ -62,7 +62,7 @@ class RmqBasicDeployment(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)
@ -70,6 +70,7 @@ class RmqBasicDeployment(OpenStackAmuletDeployment):
# Specifically wait for rmq cluster status msgs
u.rmq_wait_for_cluster(self, init_sleep=0)
self.d.sentry.wait()
self._initialize_tests()
def _add_services(self):
@ -83,10 +84,12 @@ class RmqBasicDeployment(OpenStackAmuletDeployment):
'name': 'rabbitmq-server',
'units': 3
}
other_services = [{'name': 'cinder'},
{'name': 'mysql'}, # satisfy workload status
{'name': 'keystone'}, # satisfy workload status
{'name': 'nrpe'}]
other_services = [
{'name': 'cinder'},
{'name': 'percona-cluster', 'constraints': {'mem': '3072M'}},
{'name': 'keystone'},
{'name': 'nrpe'}
]
super(RmqBasicDeployment, self)._add_services(this_service,
other_services)
@ -95,10 +98,10 @@ class RmqBasicDeployment(OpenStackAmuletDeployment):
"""Add relations for the services."""
relations = {
'cinder:amqp': 'rabbitmq-server:amqp',
'cinder:shared-db': 'mysql:shared-db',
'cinder:shared-db': 'percona-cluster:shared-db',
'cinder:identity-service': 'keystone:identity-service',
'cinder:amqp': 'rabbitmq-server:amqp',
'keystone:shared-db': 'mysql:shared-db',
'keystone:shared-db': 'percona-cluster:shared-db',
'nrpe:nrpe-external-master': 'rabbitmq-server:'
'nrpe-external-master'
}
@ -115,18 +118,25 @@ class RmqBasicDeployment(OpenStackAmuletDeployment):
'stats_cron_schedule': '*/1 * * * *'
}
mysql_config = {'dataset-size': '50%'}
pxc_config = {
'dataset-size': '25%',
'max-connections': 1000,
'root-password': 'ChangeMe123',
'sst-password': 'ChangeMe123',
}
keystone_config = {'admin-password': 'openstack',
'admin-token': 'ubuntutesting'}
keystone_config = {
'admin-password': 'openstack',
'admin-token': 'ubuntutesting',
}
cinder_config = {}
configs = {
'rabbitmq-server': rmq_config,
'mysql': mysql_config,
'percona-cluster': pxc_config,
'keystone': keystone_config,
'cinder': cinder_config
'cinder': cinder_config,
}
super(RmqBasicDeployment, self)._configure_services(configs)
@ -137,7 +147,7 @@ class RmqBasicDeployment(OpenStackAmuletDeployment):
self.rmq1_sentry = self.d.sentry['rabbitmq-server'][1]
self.rmq2_sentry = self.d.sentry['rabbitmq-server'][2]
self.keystone_sentry = self.d.sentry['keystone'][0]
self.mysql_sentry = self.d.sentry['mysql'][0]
self.pxc_sentry = self.d.sentry['percona-cluster'][0]
self.cinder_sentry = self.d.sentry['cinder'][0]
self.nrpe_sentry = self.d.sentry['nrpe'][0]
u.log.debug('openstack release val: {}'.format(
@ -497,6 +507,7 @@ class RmqBasicDeployment(OpenStackAmuletDeployment):
u.log.debug('Enabling management_plugin charm config option...')
config = {'management_plugin': 'True'}
self.d.configure('rabbitmq-server', config)
self.d.sentry.wait()
u.rmq_wait_for_cluster(self)
# Check tcp connect to management plugin port
@ -518,6 +529,7 @@ class RmqBasicDeployment(OpenStackAmuletDeployment):
u.log.debug('Disabling management_plugin charm config option...')
config = {'management_plugin': 'False'}
self.d.configure('rabbitmq-server', config)
self.d.sentry.wait()
u.rmq_wait_for_cluster(self)
# Negative check - tcp connect to management plugin port
@ -591,6 +603,7 @@ class RmqBasicDeployment(OpenStackAmuletDeployment):
u.log.debug('Setting cluster-partition-handling to autoheal...')
self.d.configure('rabbitmq-server', set_alternate)
self.d.sentry.wait()
u.rmq_wait_for_cluster(self)
cmds = ["grep autoheal /etc/rabbitmq/rabbitmq.config"]
@ -600,6 +613,7 @@ class RmqBasicDeployment(OpenStackAmuletDeployment):
u.log.debug('Setting cluster-partition-handling back to default...')
self.d.configure('rabbitmq-server', set_default)
self.d.sentry.wait()
u.rmq_wait_for_cluster(self)
u.log.info('OK\n')
@ -616,4 +630,7 @@ class RmqBasicDeployment(OpenStackAmuletDeployment):
action_id = u.run_action(self.rmq0_sentry, "resume")
assert u.wait_on_action(action_id), "Resume action failed."
assert u.status_get(self.rmq0_sentry)[0] == "active"
self.d.sentry.wait()
u.rmq_wait_for_cluster(self)
u.log.debug('OK')

View File

@ -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(

View File

@ -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"

View File

@ -14,12 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Amulet tests on a basic rabbitmq-server deployment on precise-icehouse."""
"""Amulet tests on a basic rabbitmq-server deployment on xenial-newton."""
from basic_deployment import RmqBasicDeployment
if __name__ == '__main__':
deployment = RmqBasicDeployment(series='precise',
openstack='cloud:precise-icehouse',
source='cloud:precise-updates/icehouse')
deployment = RmqBasicDeployment(series='xenial',
openstack='cloud:xenial-newton',
source='cloud:xenial-updates/newton')
deployment.run_tests()

View File

@ -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 rabbitmq-server deployment on yakkety-newton."""
from basic_deployment import RmqBasicDeployment
if __name__ == '__main__':
deployment = RmqBasicDeployment(series='yakkety')
deployment.run_tests()

View File

@ -1,6 +1,6 @@
# Bootstrap the model if necessary.
bootstrap: True
# Re-use bootstrap node instead of destroying/re-bootstrapping.
# Re-use bootstrap node.
reset: True
# Use tox/requirements to drive the venv instead of bundletester's venv feature.
virtualenv: False