Fix the service entry of evaluator and notifier

The location of evaluator and notifier services code has been changed,
that has broken the the two services launching.

Change-Id: Id3edbad7272e1dfcc1ad9751c025cc35ab673079
This commit is contained in:
liu-sheng 2015-07-25 17:02:23 +08:00
parent 61717e7a8d
commit 447b916ca6
2 changed files with 39 additions and 2 deletions

View File

@ -18,6 +18,8 @@
from oslo_config import cfg
from oslo_service import service as os_service
from aodh import evaluator as evaluator_svc
from aodh import notifier as notifier_svc
from aodh import service
CONF = cfg.CONF
@ -25,9 +27,9 @@ CONF = cfg.CONF
def notifier():
service.prepare_service()
os_service.launch(CONF, service.AlarmNotifierService(CONF)).wait()
os_service.launch(CONF, notifier_svc.AlarmNotifierService(CONF)).wait()
def evaluator():
service.prepare_service()
os_service.launch(CONF, service.AlarmEvaluationService(CONF)).wait()
os_service.launch(CONF, evaluator_svc.AlarmEvaluationService(CONF)).wait()

View File

@ -166,3 +166,38 @@ class BinApiTestCase(base.BaseTestCase):
if six.PY3:
content = content.decode('utf-8')
self.assertEqual([], json.loads(content))
class BinEvaluatorTestCase(base.BaseTestCase):
def setUp(self):
super(BinEvaluatorTestCase, self).setUp()
content = ("[DEFAULT]\n"
"rpc_backend=fake\n"
"[database]\n"
"connection=log://localhost\n")
if six.PY3:
content = content.encode('utf-8')
self.tempfile = fileutils.write_to_tempfile(content=content,
prefix='aodh',
suffix='.conf')
self.subp = None
def tearDown(self):
super(BinEvaluatorTestCase, self).tearDown()
if self.subp:
self.subp.kill()
os.remove(self.tempfile)
def test_starting_evaluator(self):
self.subp = subprocess.Popen(['aodh-evaluator',
"--config-file=%s" % self.tempfile],
stderr=subprocess.PIPE)
self.assertIsNone(self.subp.poll())
class BinNotifierTestCase(BinEvaluatorTestCase):
def test_starting_notifier(self):
self.subp = subprocess.Popen(['aodh-notifier',
"--config-file=%s" % self.tempfile],
stderr=subprocess.PIPE)
self.assertIsNone(self.subp.poll())