diff --git a/setup.py b/setup.py index 6ae126b..9cf78b9 100644 --- a/setup.py +++ b/setup.py @@ -46,6 +46,7 @@ install_require = [ 'gnocchiclient>=7.0.5,<8.0.0', 'pika>=1.1.0,<2.0.0', 'python-barbicanclient>=4.0.1,<5.0.0', + 'python-cloudkittyclient', 'python-designateclient>=1.5,<3.0.0', 'python-heatclient<2.0.0', 'python-ironicclient', diff --git a/zaza/openstack/charm_tests/cloudkitty/__init__.py b/zaza/openstack/charm_tests/cloudkitty/__init__.py new file mode 100644 index 0000000..288ce37 --- /dev/null +++ b/zaza/openstack/charm_tests/cloudkitty/__init__.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 + +# Copyright 2019 Canonical Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Collection of code for setting up and testing cloudkitty.""" diff --git a/zaza/openstack/charm_tests/cloudkitty/setup.py b/zaza/openstack/charm_tests/cloudkitty/setup.py new file mode 100644 index 0000000..86e697f --- /dev/null +++ b/zaza/openstack/charm_tests/cloudkitty/setup.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 + +# Copyright 2019 Canonical Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Code for configuring Cloudkitty.""" + + +def basic_setup(): + """Run setup for testing Cloudkitty. + + Setup for testing Cloudkitty is currently part of functional + tests. + """ + pass diff --git a/zaza/openstack/charm_tests/cloudkitty/tests.py b/zaza/openstack/charm_tests/cloudkitty/tests.py new file mode 100644 index 0000000..7f14151 --- /dev/null +++ b/zaza/openstack/charm_tests/cloudkitty/tests.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 + +# Copyright 2019 Canonical Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Encapsulate Cloudkitty testing.""" + +import logging + +import zaza.openstack.charm_tests.test_utils as test_utils +import zaza.openstack.utilities.openstack as openstack_utils + +from cloudkittyclient import client + + +class CloudkittyTest(test_utils.OpenStackBaseTest): + """Encapsulate Cloudkitty tests.""" + + CONF_FILE = '/etc/cloudkitty/cloudkitty.conf' + + @classmethod + def setUpClass(cls): + """Run class setup for running Cloudkitty tests.""" + super(CloudkittyTest, cls).setUpClass() + cls.current_release = openstack_utils.get_os_release() + + def test_400_api_connection(self): + """Simple api calls to check service is up and responding.""" + logging.info('Instantiating cloudkitty client...') + client_version = '1' + cloudkitty = client.Client( + client_version, + session=openstack_utils.get_overcloud_keystone_session() + ) + cloudkitty.report.get_summary() + pass