Skip to content

Commit

Permalink
Merge pull request openstack-charmers#71 from gnuoy/check-aodh-api-af…
Browse files Browse the repository at this point in the history
…ter-resume

Check aodh api after a change.
  • Loading branch information
fnordahl committed Sep 30, 2019
2 parents 725f2f6 + ea84bf9 commit 65bb49e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions zaza/openstack/charm_tests/aodh/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"""Encapsulate Aodh testing."""

import logging
import tenacity

import zaza.model
import zaza.openstack.charm_tests.test_utils as test_utils
Expand Down Expand Up @@ -59,6 +60,12 @@ def tearDown(cls):
logging.info('Waiting for alarm cache to clear')
telemetry_utils.alarm_cache_wait()

@tenacity.retry(wait=tenacity.wait_exponential(multiplier=1, max=60),
reraise=True, stop=tenacity.stop_after_attempt(8))
def query_aodh_api(self):
"""Check that aodh api is responding."""
self.aodh_client.alarm.list()

@property
def services(self):
"""Return a list of the service that should be running."""
Expand Down Expand Up @@ -122,6 +129,7 @@ def test_900_restart_on_config_change(self):
{'DEFAULT': {'debug': ['False']}},
{'DEFAULT': {'debug': ['True']}},
self.services)
self.query_aodh_api()

def test_901_pause_resume(self):
"""Run pause and resume tests.
Expand All @@ -133,3 +141,4 @@ def test_901_pause_resume(self):
self.services,
pgrep_full=False):
logging.info("Testing pause resume")
self.query_aodh_api()

0 comments on commit 65bb49e

Please sign in to comment.