diff --git a/metadata.yaml b/metadata.yaml index 13d1fd0..6900041 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -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 diff --git a/tests/00-setup b/tests/00-setup index 0d723ec..2bcf76d 100755 --- a/tests/00-setup +++ b/tests/00-setup @@ -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 diff --git a/tests/014-basic-precise-icehouse b/tests/014-basic-precise-icehouse index cbc84ec..f045add 100755 --- a/tests/014-basic-precise-icehouse +++ b/tests/014-basic-precise-icehouse @@ -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 diff --git a/tests/015-basic-trusty-icehouse b/tests/015-basic-trusty-icehouse index 9d47a2c..1b63bd8 100755 --- a/tests/015-basic-trusty-icehouse +++ b/tests/015-basic-trusty-icehouse @@ -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 diff --git a/tests/016-basic-trusty-juno b/tests/016-basic-trusty-juno index 91aff1f..123fa32 100755 --- a/tests/016-basic-trusty-juno +++ b/tests/016-basic-trusty-juno @@ -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 diff --git a/tests/017-basic-trusty-kilo b/tests/017-basic-trusty-kilo index 7d48587..fc2e482 100755 --- a/tests/017-basic-trusty-kilo +++ b/tests/017-basic-trusty-kilo @@ -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 diff --git a/tests/018-basic-utopic-juno b/tests/018-basic-utopic-juno index 1e8b999..f74b7ed 100755 --- a/tests/018-basic-utopic-juno +++ b/tests/018-basic-utopic-juno @@ -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 diff --git a/tests/019-basic-vivid-kilo b/tests/019-basic-vivid-kilo index e93e953..bb9bbcc 100755 --- a/tests/019-basic-vivid-kilo +++ b/tests/019-basic-vivid-kilo @@ -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 diff --git a/tests/020-basic-trusty-liberty b/tests/020-basic-trusty-liberty index 91eac59..3a274f7 100644 --- a/tests/020-basic-trusty-liberty +++ b/tests/020-basic-trusty-liberty @@ -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 diff --git a/tests/021-basic-wily-liberty b/tests/021-basic-wily-liberty index a6e03b4..854225b 100644 --- a/tests/021-basic-wily-liberty +++ b/tests/021-basic-wily-liberty @@ -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 diff --git a/tests/basic_deployment.py b/tests/basic_deployment.py index ea6ce49..3b665cb 100644 --- a/tests/basic_deployment.py +++ b/tests/basic_deployment.py @@ -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.""" diff --git a/tests/tests.yaml b/tests/tests.yaml index 5c49329..b7f1da8 100644 --- a/tests/tests.yaml +++ b/tests/tests.yaml @@ -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