Enable bionic/stein and disco/stein functional tests

Gate ``glance-registry`` checks on < ``bionic-stein``

Change-Id: Id6314c34a33da09f69297454b7b16abc5da0590e
This commit is contained in:
Frode Nordahl 2019-04-03 12:17:19 +02:00
parent 2347e2c742
commit b5c36ecd5e
No known key found for this signature in database
GPG Key ID: 6A5D59A3BA48373F
3 changed files with 72 additions and 10 deletions

View File

@ -40,8 +40,6 @@ class GlanceBasicDeployment(OpenStackAmuletDeployment):
relations, service status, endpoint service catalog, create and
delete new image."""
SERVICES = ('apache2', 'haproxy', 'glance-api', 'glance-registry')
def __init__(self, series=None, openstack=None, source=None,
stable=False):
"""Deploy the entire test environment."""
@ -60,8 +58,13 @@ class GlanceBasicDeployment(OpenStackAmuletDeployment):
self._initialize_tests()
def _assert_services(self, should_run):
if self._get_openstack_release() >= self.bionic_stein:
services = ('apache2', 'haproxy', 'glance-api')
else:
services = ('apache2', 'haproxy', 'glance-api', 'glance-registry')
u.get_unit_process_ids(
{self.glance_sentry: self.SERVICES},
{self.glance_sentry: services},
expect_success=should_run)
def _add_services(self):
@ -143,9 +146,14 @@ class GlanceBasicDeployment(OpenStackAmuletDeployment):
corresponding service units."""
services = {
self.keystone_sentry: ['keystone'],
self.glance_sentry: ['glance-api', 'glance-registry'],
self.rabbitmq_sentry: ['rabbitmq-server']
self.rabbitmq_sentry: ['rabbitmq-server'],
}
if self._get_openstack_release() >= self.bionic_stein:
services.update(
{self.glance_sentry: ['glance-api']})
else:
services.update(
{self.glance_sentry: ['glance-api', 'glance-registry']})
if self._get_openstack_release() >= self.trusty_liberty:
services[self.keystone_sentry] = ['apache2']
ret = u.validate_services_by_name(services)
@ -262,10 +270,11 @@ class GlanceBasicDeployment(OpenStackAmuletDeployment):
'/etc/glance/glance-api.conf',
self._get_openstack_release(),
earliest_release=self.trusty_mitaka)
u.validate_memcache(self.glance_sentry,
'/etc/glance/glance-registry.conf',
self._get_openstack_release(),
earliest_release=self.trusty_mitaka)
if self._get_openstack_release() < self.bionic_stein:
u.validate_memcache(self.glance_sentry,
'/etc/glance/glance-registry.conf',
self._get_openstack_release(),
earliest_release=self.trusty_mitaka)
def test_200_mysql_glance_db_relation(self):
"""Verify the mysql:glance shared-db relation data"""
@ -373,6 +382,10 @@ class GlanceBasicDeployment(OpenStackAmuletDeployment):
def test_302_glance_registry_default_config(self):
"""Verify configs in glance-registry.conf"""
if self._get_openstack_release() >= self.bionic_stein:
u.log.debug('Skipping check of glance registry config file for '
'>= bionic-stein')
return
u.log.debug('Checking glance registry config file...')
unit = self.glance_sentry
rel_my_gl = self.pxc_sentry.relation('shared-db', 'glance:shared-db')
@ -491,8 +504,9 @@ class GlanceBasicDeployment(OpenStackAmuletDeployment):
# Services which are expected to restart upon config change
services = {
'glance-api': conf_file,
'glance-registry': conf_file,
}
if self._get_openstack_release() < self.bionic_stein:
services.update({'glance-registry': conf_file})
# Make config change, check for service restarts
u.log.debug('Making config change on {}...'.format(juju_service))

23
tests/dev-basic-disco-stein Executable file
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 Glance deployment on disco-stein."""
from basic_deployment import GlanceBasicDeployment
if __name__ == '__main__':
deployment = GlanceBasicDeployment(series='disco')
deployment.run_tests()

25
tests/gate-basic-bionic-stein Executable file
View File

@ -0,0 +1,25 @@
#!/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 glance deployment on bionic-stein."""
from basic_deployment import GlanceBasicDeployment
if __name__ == '__main__':
deployment = GlanceBasicDeployment(series='bionic',
openstack='cloud:bionic-stein',
source='cloud:bionic-stein')
deployment.run_tests()