Tidy amulet tests a bit

This commit is contained in:
James Page 2017-07-11 11:49:55 +01:00
parent b85c2266f6
commit e164be0a40
6 changed files with 61 additions and 24 deletions

View File

@ -40,7 +40,7 @@ class GnocchiCharmDeployment(amulet_deployment.OpenStackAmuletDeployment):
self._deploy()
u.log.info('Waiting on extended status checks...')
exclude_services = ['mysql', 'mongodb']
exclude_services = ['mysql', 'mongodb', 'memcache']
self._auto_wait_for_status(exclude_services=exclude_services)
self._initialize_tests()
@ -55,8 +55,13 @@ class GnocchiCharmDeployment(amulet_deployment.OpenStackAmuletDeployment):
this_service = {'name': 'gnocchi'}
other_services = [
{'name': 'mysql'},
{'name': 'rabbitmq-server'},
{'name': 'mongodb'},
{'name': 'ceilometer'},
{'name': 'keystone'},
{'name': 'rabbitmq-server'},
{'name': 'memcache'},
{'name': 'ceph-mon', 'num_units': 3},
{'name': 'ceph-osd', 'num_units': 3},
]
super(GnocchiCharmDeployment, self)._add_services(this_service,
other_services)
@ -65,9 +70,15 @@ class GnocchiCharmDeployment(amulet_deployment.OpenStackAmuletDeployment):
"""Add all of the relations for the services."""
relations = {
'keystone:shared-db': 'mysql:shared-db',
'gnocchi:amqp': 'rabbitmq-server:amqp',
'gnocchi:identity-service': 'keystone:identity-service',
'gnocchi:shared-db': 'mysql:shared-db',
'gnocchi:ceph-client': 'ceph-mon:ceph-client',
'gnocchi:metric-service': 'ceilometer:metric-service',
'gnocchi:coordinator:': 'memcache:',
'ceilometer:identity-service': 'keystone:identity-service',
'ceilometer:shared-db': 'monogdb:database',
'ceilometer:amqp': 'rabbitmq-server:amqp',
'ceph-mon:osd': 'ceph-osd:mon',
}
super(GnocchiCharmDeployment, self)._add_relations(relations)
@ -75,7 +86,11 @@ class GnocchiCharmDeployment(amulet_deployment.OpenStackAmuletDeployment):
"""Configure all of the services."""
keystone_config = {'admin-password': 'openstack',
'admin-token': 'ubuntutesting'}
configs = {'keystone': keystone_config}
ceph_osd_config = {'osd-devices': '/dev/vdb',
'osd-reformat': True,
'ephemeral-unmount': '/mnt'}
configs = {'keystone': keystone_config,
'ceph-osd': ceph_osd_config}
super(GnocchiCharmDeployment, self)._configure_services(configs)
def _get_token(self):
@ -87,8 +102,7 @@ class GnocchiCharmDeployment(amulet_deployment.OpenStackAmuletDeployment):
self.gnocchi_sentry = self.d.sentry['gnocchi'][0]
self.mysql_sentry = self.d.sentry['mysql'][0]
self.keystone_sentry = self.d.sentry['keystone'][0]
self.rabbitmq_sentry = self.d.sentry['rabbitmq-server'][0]
self.gnocchi_svcs = ['haproxy', 'apache2 gnocchi-metricd', 'apache2']
self.gnocchi_svcs = ['haproxy', 'gnocchi-metricd', 'apache2']
# Authenticate admin with keystone endpoint
self.keystone = u.authenticate_keystone_admin(self.keystone_sentry,

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 SDN Charm deployment on trusty-mitaka."""
"""Amulet tests on a basic Gnocchi Charm deployment on trusty-mitaka."""
from basic_deployment import SDNCharmDeployment
from basic_deployment import GnocchiCharmDeployment
if __name__ == '__main__':
deployment = SDNCharmDeployment(series='trusty',
openstack='cloud:trusty-mitaka',
source='cloud:trusty-updates/mitaka')
deployment.run_tests()
deployment = GnocchiCharmDeployment(series='trusty',
openstack='cloud:trusty-mitaka',
source='cloud:trusty-updates/mitaka')
deployment.run_tests()

View File

@ -14,10 +14,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Amulet tests on a basic SDN Charm deployment on xenial-mitaka."""
"""Amulet tests on a basic Gnocchi Charm deployment on xenial-mitaka."""
from basic_deployment import GnocchiCharmDeployment
if __name__ == '__main__':
deployment = GnocchiCharmDeployment(series='xenial')
deployment.run_tests()
deployment.run_tests()

View File

@ -14,12 +14,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Amulet tests on a basic SDN Charm deployment on trusty-liberty."""
"""Amulet tests on a basic Gnocchi Charm deployment on xenial-newton."""
from basic_deployment import SDNCharmDeployment
from basic_deployment import GnocchiCharmDeployment
if __name__ == '__main__':
deployment = SDNCharmDeployment(series='trusty',
openstack='cloud:trusty-liberty',
source='cloud:trusty-updates/liberty')
deployment.run_tests()
deployment = GnocchiCharmDeployment(series='xenial',
openstack='cloud:xenial-newton')
deployment.run_tests()

View File

@ -0,0 +1,24 @@
#!/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 Gnocchi Charm deployment on xenial-ocata."""
from basic_deployment import GnocchiCharmDeployment
if __name__ == '__main__':
deployment = GnocchiCharmDeployment(series='xenial',
openstack='cloud:xenial-ocata')
deployment.run_tests()

View File

@ -14,10 +14,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Amulet tests on a basic SDN Charm deployment on trusty-icehouse."""
"""Amulet tests on a basic Gnocchi Charm deployment on zesty-ocata."""
from basic_deployment import SDNCharmDeployment
from basic_deployment import GnocchiCharmDeployment
if __name__ == '__main__':
deployment = SDNCharmDeployment(series='trusty')
deployment.run_tests()
deployment = GnocchiCharmDeployment(series='zesty')
deployment.run_tests()