Rebuild for sync charm-helpers

Run ceilometer upgrade action in functional tests.

Switch to using proposed packages pending LP: #1813582

Closes-Bug: #1813982
Related-Bug: #1813582
Change-Id: Ie4bce16994fee7a3c4a546e0d7450dd44e92373d
This commit is contained in:
Corey Bryant 2019-01-17 17:02:46 +00:00 committed by Frode Nordahl
parent 32d17c3426
commit 329beab239
No known key found for this signature in database
GPG Key ID: 6A5D59A3BA48373F
3 changed files with 36 additions and 4 deletions

View File

@ -2,4 +2,4 @@
# when dependencies of the charm change,
# but nothing in the charm needs to.
# simply change the uuid to something new
f992a562-03a0-11e9-8a41-af644219de17
85c5499c-1a79-11e9-8864-470f2a69c15e

View File

@ -48,10 +48,16 @@ class GnocchiCharmDeployment(amulet_deployment.OpenStackAmuletDeployment):
self._deploy()
u.log.info('Waiting on extended status checks...')
exclude_services = ['mysql', 'mongodb', 'memcached']
self._auto_wait_for_status(exclude_services=exclude_services)
self.exclude_services = ['mysql', 'mongodb', 'memcached']
if self._get_openstack_release() >= self.xenial_pike:
# Ceilometer will come up blocked until the ceilometer-upgrade
# action is run
self.exclude_services.append("ceilometer")
self._auto_wait_for_status(exclude_services=self.exclude_services)
self._initialize_tests()
if self._get_openstack_release() >= self.xenial_pike:
self.run_ceilometer_upgrade_action()
def _add_services(self):
"""Add services
@ -109,6 +115,9 @@ class GnocchiCharmDeployment(amulet_deployment.OpenStackAmuletDeployment):
gnocchi_config = {}
if self.snap_source:
gnocchi_config['openstack-origin'] = self.snap_source
elif self.series == 'bionic' and self.openstack is None:
# pending release of LP: #1813582
gnocchi_config['openstack-origin'] = 'distro-proposed'
configs = {'keystone': keystone_config,
'gnocchi': gnocchi_config}
super(GnocchiCharmDeployment, self)._configure_services(configs)
@ -122,6 +131,7 @@ class GnocchiCharmDeployment(amulet_deployment.OpenStackAmuletDeployment):
self.gnocchi_sentry = self.d.sentry['gnocchi'][0]
self.mysql_sentry = self.d.sentry['percona-cluster'][0]
self.keystone_sentry = self.d.sentry['keystone'][0]
self.ceil_sentry = self.d.sentry['ceilometer'][0]
# Authenticate admin with keystone endpoint
self.keystone_session, self.keystone = u.get_default_keystone_session(
@ -172,6 +182,23 @@ class GnocchiCharmDeployment(amulet_deployment.OpenStackAmuletDeployment):
return False
time.sleep(2)
def run_ceilometer_upgrade_action(self):
"""Run ceilometer-upgrade
This action will be run early to initialize ceilometer
when gnocchi is related.
Ceilometer will be in a blocked state until this runs.
"""
u.log.debug('Checking ceilometer-upgrade')
unit = self.ceil_sentry
action_id = unit.run_action("ceilometer-upgrade")
assert u.wait_on_action(action_id), "ceilometer-upgrade action failed"
# Wait for acivte Unit is ready on ceilometer
self.exclude_services.remove('ceilometer')
self._auto_wait_for_status(exclude_services=self.exclude_services)
u.log.debug('OK')
def test_100_services(self):
"""Verify the expected services are running on the corresponding
service units."""

View File

@ -3,7 +3,7 @@
# within individual charm repos.
[tox]
skipsdist = True
envlist = pep8,py34,py35,py27
envlist = pep8,py3
skip_missing_interpreters = True
[bundleenv]
@ -44,6 +44,11 @@ basepython = python2.7
whitelist_externals = true
commands = true
[testenv:py3]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt
commands = ostestr {posargs}
[testenv:py34]
basepython = python3.4
deps = -r{toxinidir}/test-requirements.txt