update ceilometer nova conf check
This commit is contained in:
parent
58bab5e73a
commit
6b64cc6ac0
|
@ -12,8 +12,9 @@ description: |
|
|||
This charm should be used in conjunction with the ceilometer and nova charm to collect
|
||||
Openstack measures.
|
||||
tags:
|
||||
- miscellaneous
|
||||
- openstack
|
||||
- telemetry
|
||||
- misc
|
||||
provides:
|
||||
nrpe-external-master:
|
||||
interface: nrpe-external-master
|
||||
|
|
|
@ -5,6 +5,11 @@ set -ex
|
|||
sudo add-apt-repository --yes ppa:juju/stable
|
||||
sudo apt-get update --yes
|
||||
sudo apt-get install --yes python-amulet \
|
||||
python-ceilometerclient \
|
||||
python-cinderclient \
|
||||
python-distro-info \
|
||||
python-glanceclient \
|
||||
python-heatclient \
|
||||
python-keystoneclient \
|
||||
python-ceilometerclient
|
||||
python-novaclient \
|
||||
python-swiftclient
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
"""Amulet tests on a basic ceilometer deployment on precise-icehouse."""
|
||||
"""Amulet tests on a basic ceilometer-agent deployment on precise-icehouse."""
|
||||
|
||||
from basic_deployment import CeiloAgentBasicDeployment
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
"""Amulet tests on a basic ceilometer deployment on trusty-icehouse."""
|
||||
"""Amulet tests on a basic ceilometer-agent deployment on trusty-icehouse."""
|
||||
|
||||
from basic_deployment import CeiloAgentBasicDeployment
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
"""Amulet tests on a basic ceilometer deployment on trusty-juno."""
|
||||
"""Amulet tests on a basic ceilometer-agent deployment on trusty-juno."""
|
||||
|
||||
from basic_deployment import CeiloAgentBasicDeployment
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
"""Amulet tests on a basic ceilometer deployment on trusty-kilo."""
|
||||
"""Amulet tests on a basic ceilometer-agent deployment on trusty-kilo."""
|
||||
|
||||
from basic_deployment import CeiloAgentBasicDeployment
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
"""Amulet tests on a basic ceilometer deployment on utopic-juno."""
|
||||
"""Amulet tests on a basic ceilometer-agent deployment on utopic-juno."""
|
||||
|
||||
from basic_deployment import CeiloAgentBasicDeployment
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
"""Amulet tests on a basic ceilometer deployment on vivid-kilo."""
|
||||
"""Amulet tests on a basic ceilometer-agent deployment on vivid-kilo."""
|
||||
|
||||
from basic_deployment import CeiloAgentBasicDeployment
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
"""Amulet tests on a basic ceilometer deployment on trusty-liberty."""
|
||||
"""Amulet tests on a basic ceilometer-agent deployment on trusty-liberty."""
|
||||
|
||||
from basic_deployment import CeiloAgentBasicDeployment
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
"""Amulet tests on a basic ceilometer deployment on wily-liberty."""
|
||||
"""Amulet tests on a basic ceilometer-agent deployment on wily-liberty."""
|
||||
|
||||
from basic_deployment import CeiloAgentBasicDeployment
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
"""
|
||||
Basic ceilometer-agent functional tests.
|
||||
"""
|
||||
import amulet
|
||||
import time
|
||||
from ceilometerclient.v2 import client as ceilclient
|
||||
|
@ -449,12 +452,6 @@ class CeiloAgentBasicDeployment(OpenStackAmuletDeployment):
|
|||
u.log.debug('Checking nova compute config file...')
|
||||
unit = self.nova_sentry
|
||||
conf = '/etc/nova/nova.conf'
|
||||
mysql_rel = self.mysql_sentry.relation('shared-db',
|
||||
'nova-compute:shared-db')
|
||||
db_uri = "mysql://{}:{}@{}/{}".format('nova',
|
||||
mysql_rel['nova_password'],
|
||||
mysql_rel['db_host'],
|
||||
'nova')
|
||||
expected = {
|
||||
'DEFAULT': {
|
||||
'verbose': 'False',
|
||||
|
@ -465,27 +462,40 @@ class CeiloAgentBasicDeployment(OpenStackAmuletDeployment):
|
|||
'dhcpbridge': '/usr/bin/nova-dhcpbridge',
|
||||
'logdir': '/var/log/nova',
|
||||
'state_path': '/var/lib/nova',
|
||||
'lock_path': '/var/lock/nova',
|
||||
'api_paste_config': '/etc/nova/api-paste.ini',
|
||||
'enabled_apis': 'ec2,osapi_compute,metadata',
|
||||
'auth_strategy': 'keystone',
|
||||
'compute_driver': 'libvirt.LibvirtDriver',
|
||||
'sql_connection': db_uri,
|
||||
'instance_usage_audit': 'True',
|
||||
'instance_usage_audit_period': 'hour',
|
||||
'notify_on_state_change': 'vm_and_task_state',
|
||||
'notification_driver': 'ceilometer.compute.nova_notifier',
|
||||
'notification_driver': 'nova.openstack.common'
|
||||
'.notifier.rpc_notifier'
|
||||
}
|
||||
}
|
||||
|
||||
# NOTE(beisner): notification_driver is not checked like the
|
||||
# others, as configparser does not support duplicate config
|
||||
# options, and dicts cant have duplicate keys.
|
||||
for section, pairs in expected.iteritems():
|
||||
ret = u.validate_config_data(unit, conf, section, pairs)
|
||||
if ret:
|
||||
message = "ceilometer config error: {}".format(ret)
|
||||
amulet.raise_status(amulet.FAIL, msg=message)
|
||||
|
||||
# Check notification_driver existence via simple grep cmd
|
||||
lines = [('notification_driver = '
|
||||
'ceilometer.compute.nova_notifier'),
|
||||
('notification_driver = '
|
||||
'nova.openstack.common.notifier.rpc_notifier')]
|
||||
|
||||
sentry_units = [unit]
|
||||
cmds = []
|
||||
for line in lines:
|
||||
cmds.append('grep "{}" {}'.format(line, conf))
|
||||
|
||||
ret = u.check_commands_on_units(cmds, sentry_units)
|
||||
if ret:
|
||||
amulet.raise_status(amulet.FAIL, msg=ret)
|
||||
|
||||
def test_302_nova_ceilometer_config(self):
|
||||
"""Verify data in the ceilometer config file on the
|
||||
nova-compute (ceilometer-agent) unit."""
|
||||
|
|
|
@ -9,6 +9,11 @@ sources:
|
|||
packages:
|
||||
- amulet
|
||||
- python-amulet
|
||||
- python-distro-info
|
||||
- python-keystoneclient
|
||||
- python-ceilometerclient
|
||||
- python-cinderclient
|
||||
- python-distro-info
|
||||
- python-glanceclient
|
||||
- python-heatclient
|
||||
- python-keystoneclient
|
||||
- python-novaclient
|
||||
- python-swiftclient
|
||||
|
|
Loading…
Reference in New Issue