From 2af6f86f1b708d3679310caf50f4edc86924482e Mon Sep 17 00:00:00 2001 From: Ryan Beisner Date: Thu, 1 Nov 2018 20:43:43 -0500 Subject: [PATCH] Retire project Leave README around for those that follow. http://lists.openstack.org/pipermail/openstack-discuss/2019-February/003186.html http://lists.openstack.org/pipermail/openstack-discuss/2018-November/000057.html Change-Id: I26328db6e404147e99415df4c0ebf863c1ad5661 --- .gitignore | 7 - .testr.conf | 8 - .zuul.yaml | 3 +- LICENSE | 202 ----- README.md | 35 +- copyright | 16 - icon.svg | 692 ------------------ requirements.txt | 6 - src/README.md | 22 - src/config.yaml | 47 -- src/copyright | 16 - src/icon.svg | 450 ------------ src/layer.yaml | 5 - src/lib/charm/openstack/__init__.py | 0 src/lib/charm/openstack/murano.py | 76 -- src/metadata.yaml | 26 - src/reactive/murano_handlers.py | 61 -- src/templates/mitaka/.keep | 0 src/templates/mitaka/murano.conf | 45 -- src/templates/parts/rabbitmq | 10 - src/test-requirements.txt | 16 - src/tests/README.md | 9 - src/tests/basic_deployment.py | 367 ---------- src/tests/gate-basic-xenial-mitaka | 23 - src/tests/tests.yaml | 17 - src/tox.ini | 53 -- test-requirements.txt | 6 - tox.ini | 47 -- unit_tests/__init__.py | 22 - unit_tests/test_lib_charm_openstack_murano.py | 78 -- 30 files changed, 6 insertions(+), 2359 deletions(-) delete mode 100644 .gitignore delete mode 100644 .testr.conf delete mode 100644 LICENSE delete mode 100644 copyright delete mode 100644 icon.svg delete mode 100644 requirements.txt delete mode 100644 src/README.md delete mode 100644 src/config.yaml delete mode 100644 src/copyright delete mode 100644 src/icon.svg delete mode 100644 src/layer.yaml delete mode 100644 src/lib/charm/openstack/__init__.py delete mode 100644 src/lib/charm/openstack/murano.py delete mode 100644 src/metadata.yaml delete mode 100644 src/reactive/murano_handlers.py delete mode 100644 src/templates/mitaka/.keep delete mode 100644 src/templates/mitaka/murano.conf delete mode 100644 src/templates/parts/rabbitmq delete mode 100644 src/test-requirements.txt delete mode 100644 src/tests/README.md delete mode 100644 src/tests/basic_deployment.py delete mode 100755 src/tests/gate-basic-xenial-mitaka delete mode 100644 src/tests/tests.yaml delete mode 100644 src/tox.ini delete mode 100644 test-requirements.txt delete mode 100644 tox.ini delete mode 100644 unit_tests/__init__.py delete mode 100644 unit_tests/test_lib_charm_openstack_murano.py diff --git a/.gitignore b/.gitignore deleted file mode 100644 index a0b2628..0000000 --- a/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -build -layers -.tox -interfaces -.testrepository -*__pycache__* -*.pyc diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 801646b..0000000 --- a/.testr.conf +++ /dev/null @@ -1,8 +0,0 @@ -[DEFAULT] -test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ - OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ - OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \ - ${PYTHON:-python} -m subunit.run discover -t ./ ./unit_tests $LISTOPT $IDOPTION - -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/.zuul.yaml b/.zuul.yaml index 5e75d94..e7c200a 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,4 +1,3 @@ - project: templates: - - python-charm-jobs - - openstack-python35-jobs + - noop-jobs diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 7a4a3ea..0000000 --- a/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. \ No newline at end of file diff --git a/README.md b/README.md index 43cca73..b72ee4f 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,6 @@ -# Overview +This project is no longer maintained. -Murano charm provides a catalog of applications deployable on Openstack cloud. - -# Usage - -Murano relies on services from the mysql/percona, rabbitmq-server and keystone charms: - - $ juju deploy murano - $ juju deploy keystone - $ juju deploy mysql - $ juju deploy rabbitmq-server - $ juju add-relation murano rabbitmq-server - $ juju add-relation murano mysql - $ juju add-relation murano keystone - -# Build - $ git clone https://github.com/viswesn/charm-murano - $ cd charm-murano - $ charm build -s xenial -o build src - -# Config - $ juju config murano ext-network=my_ext_net - $ juju config murano router=my_router - $ juju config murano default_dns=10.166.62.1 - -# Bugs - -Please report bugs on [Launchpad](https://bugs.launchpad.net/charm-murano/+filebug). - -For general questions please refer to the OpenStack [Charm Guide](https://github.com/openstack/charm-guide). +The contents of this repository are still available in the Git +source code management system. To see the contents of this +repository before it reached its end of life, please check out the +previous commit with "git checkout HEAD^1". diff --git a/copyright b/copyright deleted file mode 100644 index 6f8a25f..0000000 --- a/copyright +++ /dev/null @@ -1,16 +0,0 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0 - -Files: * -Copyright: 2015, Canonical Ltd. -License: Apache-2.0 - 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. \ No newline at end of file diff --git a/icon.svg b/icon.svg deleted file mode 100644 index b481490..0000000 --- a/icon.svg +++ /dev/null @@ -1,692 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 604b8c1..0000000 --- a/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -# The order of packages is significant, because pip processes them in the order -# of appearance. Changing the order has an impact on the overall integration -# process, which may cause wedges in the gate later. -simplejson -charm-tools -flake8 diff --git a/src/README.md b/src/README.md deleted file mode 100644 index b30ff03..0000000 --- a/src/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# Overview - -Murano charm provides a catalog of applications deployable on Openstack cloud. - -# Usage - -Murano relies on services from the mysql/percona, rabbitmq-server and keystone charms: - - juju deploy murano - juju deploy keystone - juju deploy mysql - juju deploy rabbitmq-server - juju add-relation murano rabbitmq-server - juju add-relation murano mysql - juju add-relation murano keystone - - -# Bugs - -Please report bugs on [Launchpad](https://bugs.launchpad.net/charm-murano/+filebug). - -For general questions please refer to the OpenStack [Charm Guide](https://github.com/openstack/charm-guide). diff --git a/src/config.yaml b/src/config.yaml deleted file mode 100644 index 22d85fc..0000000 --- a/src/config.yaml +++ /dev/null @@ -1,47 +0,0 @@ -options: - rabbit-user: - default: murano - type: string - description: Username used to access rabbitmq queue. - rabbit-vhost: - default: openstack - type: string - description: RabbitMQ virtual host to request access on rabbitmq-server. - database-user: - default: murano - type: string - description: Database username. - database: - default: murano - type: string - description: Murano database name. - debug: - default: False - type: boolean - description: Enable debug logging - verbose: - default: False - type: boolean - description: Enable verbose logging - region: - default: RegionOne - type: string - description: OpenStack Region - ext-network: - default: ext_net - type: string - description: | - The external network to connect for downloading the application packages - on launch of VMs spawned by Murano. - router: - default: default_router - type: string - description: | - The default router is to bridge the external network and isolated network - created by Murano for each environment. - default_dns: - default: 8.8.8.8 - type: string - description: | - The default DNS used by the VMs spawned by Murano to download the - application packages on poweron. diff --git a/src/copyright b/src/copyright deleted file mode 100644 index 6f8a25f..0000000 --- a/src/copyright +++ /dev/null @@ -1,16 +0,0 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0 - -Files: * -Copyright: 2015, Canonical Ltd. -License: Apache-2.0 - 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. \ No newline at end of file diff --git a/src/icon.svg b/src/icon.svg deleted file mode 100644 index c90ecfc..0000000 --- a/src/icon.svg +++ /dev/null @@ -1,450 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/layer.yaml b/src/layer.yaml deleted file mode 100644 index 7777bf1..0000000 --- a/src/layer.yaml +++ /dev/null @@ -1,5 +0,0 @@ -includes: ['layer:openstack-api'] -options: - basic: - use_venv: True - include_system_packages: True diff --git a/src/lib/charm/openstack/__init__.py b/src/lib/charm/openstack/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/lib/charm/openstack/murano.py b/src/lib/charm/openstack/murano.py deleted file mode 100644 index af548b1..0000000 --- a/src/lib/charm/openstack/murano.py +++ /dev/null @@ -1,76 +0,0 @@ -import charmhelpers.contrib.openstack.utils as ch_utils -import charmhelpers.core.hookenv as hookenv -import charms_openstack.charm -import charms_openstack.ip as os_ip - - -class MuranoCharm(charms_openstack.charm.HAOpenStackCharm): - # Internal name of charm - service_name = name = 'murano' - - # First release supported - release = 'mitaka' - - # List of packages to install for this charm - packages = ['murano-api', 'murano-engine', 'python-pymysql', 'python-apt'] - - # Init services the charm manages - services = ['haproxy', 'murano-api', 'murano-engine'] - - # Ports that need exposing. - default_service = 'murano-api' - api_ports = { - 'murano-api': { - os_ip.PUBLIC: 8082, - os_ip.ADMIN: 8082, - os_ip.INTERNAL: 8082, - } - } - - service_type = 'murano' - required_relations = ['shared-db', 'amqp', 'identity-service'] - - restart_map = { - '/etc/murano/murano.conf': services, - } - - ha_resources = ['vips', 'haproxy'] - - sync_cmd = ['murano-db-manage', '--config-file', - '/etc/murano/murano.conf', 'upgrade'] - - def __init__(self, release=None, **kwargs): - """Custom initialiser for class - If no release is passed, then the charm determines the release from the - ch_utils.os_release() function. - """ - if release is None: - release = ch_utils.os_release('python-keystonemiddleware') - super().__init__(release=release, **kwargs) - - def get_amqp_credentials(self): - """Provide the default amqp username and vhost as a tuple. - - :returns (username, host): two strings to send to the amqp provider. - """ - return (self.config['rabbit-user'], self.config['rabbit-vhost']) - - def get_database_setup(self): - """Provide the default database credentials as a list of 3-tuples - - returns a structure of: - [ - {'database': , - 'username': , - 'hostname': - 'prefix': , }, - ] - - :returns [{'database': ...}, ...]: credentials for multiple databases - """ - return [ - dict( - database=self.config['database'], - username=self.config['database-user'], - hostname=hookenv.unit_private_ip(), ) - ] diff --git a/src/metadata.yaml b/src/metadata.yaml deleted file mode 100644 index 5383e78..0000000 --- a/src/metadata.yaml +++ /dev/null @@ -1,26 +0,0 @@ -name: murano -summary: OpenStack Application Catalog Service -maintainer: OpenStack Charmers -description: | - The Murano Project introduces an application catalog to OpenStack, - enabling application developers and cloud administrators to publish various - cloud-ready applications in a browsable categorized catalog -tags: -- openstack -series: -- xenial -- trusty -- yakkety -requires: - shared-db: - interface: mysql-shared - amqp: - interface: rabbitmq - identity-service: - interface: keystone - ha: - interface: hacluster - scope: container -peers: - cluster: - interface: openstack-ha diff --git a/src/reactive/murano_handlers.py b/src/reactive/murano_handlers.py deleted file mode 100644 index fed0d82..0000000 --- a/src/reactive/murano_handlers.py +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright 2016 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. - -import charms_openstack.charm as charm -import charms.reactive as reactive - -# We need to import charm.openstack.murano to avoid -# No derived OpenStackCharm() classes registered -import charm.openstack.murano as murano -assert murano - -charm.use_defaults( - 'charm.installed', - 'amqp.connected', - 'shared-db.connected', - 'identity-service.connected', - 'identity-service.available', # enables SSL support - 'config.changed', - 'update-status') - -COMPLETE_INTERFACE_STATES = [ - 'shared-db.available', - 'identity-service.available', - 'amqp.available', -] - - -@reactive.when(*COMPLETE_INTERFACE_STATES) -def render_config(*args): - """Render the configuration for charm when all the interfaces are - available. - """ - with charm.provide_charm_instance() as charm_class: - charm_class.render_with_interfaces(args) - charm_class.assess_status() - reactive.set_state('config.rendered') - - -# db_sync checks if sync has been done so rerunning is a noop -@reactive.when('config.rendered') -def init_db(): - with charm.provide_charm_instance() as charm_class: - charm_class.db_sync() - - -@reactive.when('ha.connected') -def cluster_connected(hacluster): - with charm.provide_charm_instance() as charm_class: - charm_class.configure_ha_resources(hacluster) - charm_class.assess_status() diff --git a/src/templates/mitaka/.keep b/src/templates/mitaka/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/src/templates/mitaka/murano.conf b/src/templates/mitaka/murano.conf deleted file mode 100644 index 08735d7..0000000 --- a/src/templates/mitaka/murano.conf +++ /dev/null @@ -1,45 +0,0 @@ -[DEFAULT] -debug = {{ options.debug }} -bind_host = {{ options.service_listen_info.murano_api.ip }} -bind_port = {{ options.service_listen_info.murano_api.port }} -{% include "parts/rabbitmq" %} - -[oslo_messaging_notifications] -driver=messagingv2 - -[database] -connection = {{ shared_db.uri }} - -{% include "parts/section-keystone-authtoken" %} -{% if identity_service.auth_host -%} -admin_user = {{ identity_service.service_username }} -admin_password = {{ identity_service.service_password }} -admin_tenant_name = {{ identity_service.service_tenant }} -{% endif -%} - -[service_credentials] -{% if identity_service.auth_host -%} -auth_type = password -region_name = {{ options.region }} -auth_url = {{ identity_service.auth_protocol }}://{{ identity_service.auth_host }}:{{ identity_service.auth_port }} -project_name = {{ identity_service.service_tenant }} -username = {{ identity_service.service_username }} -password = {{ identity_service.service_password }} -{%- endif %} - -[rabbitmq] -host = {{ amqp.host }} -login = {{ amqp.username }} -password = {{ amqp.password }} -virtual_host = {{ amqp.vhost }} - -{% include "parts/section-rabbitmq-oslo" %} - -[murano] -url = {{ options.external_endpoints.murano_api.url }} - -[networking] -external_network = {{ options.ext_network }} -router_name = {{ options.router }} -create_router = true -default_dns = {{ options.default_dns }} diff --git a/src/templates/parts/rabbitmq b/src/templates/parts/rabbitmq deleted file mode 100644 index 2131143..0000000 --- a/src/templates/parts/rabbitmq +++ /dev/null @@ -1,10 +0,0 @@ -{% if amqp.host or amqp.hosts -%} -{% if amqp.hosts -%} -rabbit_hosts = {{ amqp.hosts }} -{% else -%} -rabbit_host = {{ amqp.host }} -{% endif -%} -rabbit_userid = {{ amqp.username }} -rabbit_password = {{ amqp.password }} -rabbit_virtual_host = {{ amqp.vhost }} -{% endif -%} diff --git a/src/test-requirements.txt b/src/test-requirements.txt deleted file mode 100644 index 9d66a11..0000000 --- a/src/test-requirements.txt +++ /dev/null @@ -1,16 +0,0 @@ -# charm-proof -charm-tools>=2.0.0 -# amulet deployment helpers -bzr+lp:charm-helpers#egg=charmhelpers -# BEGIN: Amulet OpenStack Charm Helper Requirements -# Liberty client lower constraints -amulet>=1.14.3,<2.0 -bundletester>=0.6.1,<1.0 -python-keystoneclient>=1.7.1,<2.0 -python-muranoclient>=0.8.3,<=0.9.0 -python-cinderclient>=1.4.0,<2.0 -python-heatclient>=0.8.0,<1.0 -python-novaclient>=2.30.1,<3.0 -pika>=0.10.0,<1.0 -distro-info -# END: Amulet OpenStack Charm Helper Requirements \ No newline at end of file diff --git a/src/tests/README.md b/src/tests/README.md deleted file mode 100644 index a8d9e14..0000000 --- a/src/tests/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Overview - -This directory provides Amulet tests to verify basic deployment functionality -from the perspective of this charm, its requirements and its features, as -exercised in a subset of the full OpenStack deployment test bundle topology. - -For full details on functional testing of OpenStack charms please refer to -the [functional testing](http://docs.openstack.org/developer/charm-guide/testing.html#functional-testing) -section of the OpenStack Charm Guide. \ No newline at end of file diff --git a/src/tests/basic_deployment.py b/src/tests/basic_deployment.py deleted file mode 100644 index 14c87eb..0000000 --- a/src/tests/basic_deployment.py +++ /dev/null @@ -1,367 +0,0 @@ -import subprocess -import amulet -import json -import time - -import muranoclient.client as murano_client -from keystoneclient import session as keystone_session -from keystoneclient.auth import identity as keystone_identity - -from charmhelpers.contrib.openstack.amulet.deployment import ( - OpenStackAmuletDeployment -) - -from charmhelpers.contrib.openstack.amulet.utils import ( - OpenStackAmuletUtils, - DEBUG, -) - -# Use DEBUG to turn on debug logging -u = OpenStackAmuletUtils(DEBUG) - - -class MuranoBasicDeployment(OpenStackAmuletDeployment): - """Amulet tests on a basic murano deployment.""" - - def __init__(self, series, openstack=None, source=None, stable=False): - """Deploy the entire test environment.""" - super(MuranoBasicDeployment, self).__init__(series, openstack, - source, stable) - self._add_services() - self._add_relations() - self._configure_services() - self._deploy() - - u.log.info('Waiting on extended status checks...') - exclude_services = [] - self._auto_wait_for_status(exclude_services=exclude_services) - - self.d.sentry.wait() - self._initialize_tests() - - def _add_services(self): - """Add services - - Add the services that we're testing, where murano is local, - and the rest of the service are from lp branches that are - compatible with the local charm (e.g. stable or next). - """ - this_service = {'name': 'murano'} - other_services = [ - {'name': 'percona-cluster', 'constraints': {'mem': '3072M'}}, - {'name': 'rabbitmq-server'}, - {'name': 'keystone'}, - ] - super(MuranoBasicDeployment, self)._add_services(this_service, - other_services) - - def _add_relations(self): - """Add all of the relations for the services.""" - relations = { - 'murano:shared-db': 'percona-cluster:shared-db', - 'murano:amqp': 'rabbitmq-server:amqp', - 'murano:identity-service': 'keystone:identity-service', - 'keystone:shared-db': 'percona-cluster:shared-db', - - } - super(MuranoBasicDeployment, self)._add_relations(relations) - - def _configure_services(self): - """Configure all of the services.""" - keystone_config = { - 'admin-password': 'openstack', - 'admin-token': 'ubuntutesting' - } - pxc_config = { - 'dataset-size': '25%', - 'max-connections': 1000, - 'root-password': 'ChangeMe123', - 'sst-password': 'ChangeMe123', - } - configs = { - 'keystone': keystone_config, - 'percona-cluster': pxc_config, - } - super(MuranoBasicDeployment, self)._configure_services(configs) - - def _get_token(self): - return self.keystone.service_catalog.catalog['token']['id'] - - def _initialize_tests(self): - """Perform final initialization before tests get run.""" - # Access the sentries for inspecting service units - self.murano_sentry = self.d.sentry['murano'][0] - self.pxc_sentry = self.d.sentry['percona-cluster'][0] - self.keystone_sentry = self.d.sentry['keystone'][0] - self.rabbitmq_sentry = self.d.sentry['rabbitmq-server'][0] - u.log.debug('openstack release val: {}'.format( - self._get_openstack_release())) - u.log.debug('openstack release str: {}'.format( - self._get_openstack_release_string())) - - # Authenticate admin with keystone endpoint - self.keystone = u.authenticate_keystone_admin(self.keystone_sentry, - user='admin', - password='openstack', - tenant='admin') - - # Authenticate admin with murano endpoint - murano_ep = self.keystone.service_catalog.url_for( - service_type='application-catalog', - endpoint_type='publicURL') - - keystone_ep = self.keystone.service_catalog.url_for( - service_type='identity', - endpoint_type='publicURL') - - auth = keystone_identity.V2Token(auth_url=keystone_ep, - token=self.keystone.auth_token) - sess = keystone_session.Session(auth=auth) - self.murano = murano_client.Client(version=1, session=sess, - endpoint_override=murano_ep) - - def _run_action(self, unit_id, action, *args): - command = ["juju", "action", "do", "--format=json", unit_id, action] - command.extend(args) - print("Running command: %s\n" % " ".join(command)) - output = subprocess.check_output(command) - output_json = output.decode(encoding="UTF-8") - data = json.loads(output_json) - action_id = data[u'Action queued with id'] - return action_id - - def _wait_on_action(self, action_id): - command = ["juju", "action", "fetch", "--format=json", action_id] - while True: - try: - output = subprocess.check_output(command) - except Exception as e: - print(e) - return False - output_json = output.decode(encoding="UTF-8") - data = json.loads(output_json) - if data[u"status"] == "completed": - return True - elif data[u"status"] == "failed": - return False - time.sleep(2) - - def test_100_services(self): - """Verify the expected services are running on the corresponding - service units.""" - u.log.debug('Checking system services on units...') - - murano_svcs = [ - 'murano-api', 'murano-engine' - ] - - service_names = { - self.murano_sentry: murano_svcs, - } - - ret = u.validate_services_by_name(service_names) - if ret: - amulet.raise_status(amulet.FAIL, msg=ret) - - u.log.debug('OK') - - def test_110_service_catalog(self): - """Verify that the service catalog endpoint data is valid.""" - u.log.debug('Checking keystone service catalog data...') - endpoint_check = { - 'adminURL': u.valid_url, - 'id': u.not_null, - 'region': 'RegionOne', - 'publicURL': u.valid_url, - 'internalURL': u.valid_url - } - expected = { - 'application-catalog': [endpoint_check], - } - actual = self.keystone.service_catalog.get_endpoints() - - ret = u.validate_svc_catalog_endpoint_data(expected, actual) - if ret: - amulet.raise_status(amulet.FAIL, msg=ret) - - u.log.debug('OK') - - def test_114_murano_api_endpoint(self): - """Verify the murano api endpoint data.""" - u.log.debug('Checking murano api endpoint data...') - endpoints = self.keystone.endpoints.list() - u.log.debug(endpoints) - admin_port = internal_port = public_port = '8082' - expected = {'id': u.not_null, - 'region': 'RegionOne', - 'adminurl': u.valid_url, - 'internalurl': u.valid_url, - 'publicurl': u.valid_url, - 'service_id': u.not_null} - - ret = u.validate_endpoint_data(endpoints, admin_port, internal_port, - public_port, expected) - if ret: - message = 'murano endpoint: {}'.format(ret) - amulet.raise_status(amulet.FAIL, msg=message) - - u.log.debug('OK') - - def test_200_murano_identity_relation(self): - """Verify the murano to keystone identity-service relation data""" - u.log.debug('Checking murano to keystone identity-service ' - 'relation data...') - unit = self.murano_sentry - relation = ['identity-service', 'keystone:identity-service'] - murano_relation = unit.relation('identity-service', - 'keystone:identity-service') - murano_ip = murano_relation['private-address'] - murano_endpoint = "http://%s:8082" % (murano_ip) - - expected = { - 'admin_url': murano_endpoint, - 'internal_url': murano_endpoint, - 'private-address': murano_ip, - 'public_url': murano_endpoint, - 'region': 'RegionOne', - 'service': 'murano', - } - - ret = u.validate_relation_data(unit, relation, expected) - if ret: - message = u.relation_error('murano identity-service', ret) - amulet.raise_status(amulet.FAIL, msg=message) - - u.log.debug('OK') - - def test_201_keystone_murano_identity_relation(self): - """Verify the keystone to murano identity-service relation data""" - u.log.debug('Checking keystone:murano identity relation data...') - unit = self.keystone_sentry - relation = ['identity-service', 'murano:identity-service'] - id_relation = unit.relation('identity-service', - 'murano:identity-service') - id_ip = id_relation['private-address'] - expected = { - 'admin_token': 'ubuntutesting', - 'auth_host': id_ip, - 'auth_port': "35357", - 'auth_protocol': 'http', - 'private-address': id_ip, - 'service_host': id_ip, - 'service_password': u.not_null, - 'service_port': "5000", - 'service_protocol': 'http', - 'service_tenant': 'services', - 'service_tenant_id': u.not_null, - 'service_username': 'murano', - } - ret = u.validate_relation_data(unit, relation, expected) - if ret: - message = u.relation_error('keystone identity-service', ret) - amulet.raise_status(amulet.FAIL, msg=message) - - u.log.debug('OK') - - def test_203_murano_amqp_relation(self): - """Verify the murano to rabbitmq-server amqp relation data""" - u.log.debug('Checking murano:rabbitmq amqp relation data...') - unit = self.murano_sentry - relation = ['amqp', 'rabbitmq-server:amqp'] - expected = { - 'username': 'murano', - 'private-address': u.valid_ip, - 'vhost': 'openstack' - } - - ret = u.validate_relation_data(unit, relation, expected) - if ret: - message = u.relation_error('murano amqp', ret) - amulet.raise_status(amulet.FAIL, msg=message) - - u.log.debug('OK') - - def test_204_amqp_murano_relation(self): - """Verify the rabbitmq-server to murano amqp relation data""" - u.log.debug('Checking rabbitmq:murano amqp relation data...') - unit = self.rabbitmq_sentry - relation = ['amqp', 'murano:amqp'] - expected = { - 'hostname': u.valid_ip, - 'private-address': u.valid_ip, - 'password': u.not_null, - } - - ret = u.validate_relation_data(unit, relation, expected) - if ret: - message = u.relation_error('rabbitmq amqp', ret) - amulet.raise_status(amulet.FAIL, msg=message) - - u.log.debug('OK') - - u.log.debug('OK') - - def test_900_restart_on_config_change(self): - """Verify that the specified services are restarted when the config - is changed. - """ - sentry = self.murano_sentry - juju_service = 'murano' - - # Expected default and alternate values - set_default = {'debug': 'False'} - set_alternate = {'debug': 'True'} - - # Services which are expected to restart upon config change, - # and corresponding config files affected by the change - conf_file = '/etc/murano/murano.conf' - services = { - 'murano-api': conf_file, - 'murano-engine': conf_file, - } - - # Make config change, check for service restarts - u.log.debug('Making config change on {}...'.format(juju_service)) - mtime = u.get_sentry_time(sentry) - self.d.configure(juju_service, set_alternate) - - sleep_time = 40 - for s, conf_file in services.iteritems(): - u.log.debug("Checking that service restarted: {}".format(s)) - if not u.validate_service_config_changed(sentry, mtime, s, - conf_file, - retry_count=4, - retry_sleep_time=20, - sleep_time=sleep_time): - self.d.configure(juju_service, set_default) - msg = "service {} didn't restart after config change".format(s) - amulet.raise_status(amulet.FAIL, msg=msg) - sleep_time = 0 - - self.d.configure(juju_service, set_default) - u.log.debug('OK') - - def _test_910_pause_and_resume(self): - """The services can be paused and resumed. """ - u.log.debug('Checking pause and resume actions...') - unit_name = "murano/0" - unit = self.d.sentry['murano'][0] - juju_service = 'murano' - - assert u.status_get(unit)[0] == "active" - - action_id = self._run_action(unit_name, "pause") - assert self._wait_on_action(action_id), "Pause action failed." - assert u.status_get(unit)[0] == "maintenance" - - # trigger config-changed to ensure that services are still stopped - u.log.debug("Making config change on murano ...") - self.d.configure(juju_service, {'debug': 'True'}) - assert u.status_get(unit)[0] == "maintenance" - self.d.configure(juju_service, {'debug': 'False'}) - assert u.status_get(unit)[0] == "maintenance" - - action_id = self._run_action(unit_name, "resume") - assert self._wait_on_action(action_id), "Resume action failed." - assert u.status_get(unit)[0] == "active" - u.log.debug('OK') diff --git a/src/tests/gate-basic-xenial-mitaka b/src/tests/gate-basic-xenial-mitaka deleted file mode 100755 index 7182977..0000000 --- a/src/tests/gate-basic-xenial-mitaka +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2016 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. - -"""Amulet tests on a basic Murano Charm deployment on xenial-mitaka.""" - -from basic_deployment import MuranoBasicDeployment - -if __name__ == '__main__': - deployment = MuranoBasicDeployment(series='xenial') - deployment.run_tests() diff --git a/src/tests/tests.yaml b/src/tests/tests.yaml deleted file mode 100644 index 8ba143b..0000000 --- a/src/tests/tests.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# Bootstrap the model if necessary. -bootstrap: True -# Re-use bootstrap node instead of destroying/re-bootstrapping. -reset: True -# Use tox/requirements to drive the venv instead of bundletester's venv feature. -virtualenv: False -# Leave makefile empty, otherwise unit/lint tests will rerun ahead of amulet. -makefile: [] -# Do not specify juju PPA sources. Juju is presumed to be pre-installed -# and configured in all test runner environments. -#sources: -# Do not specify or rely on system packages. -#packages: -# Do not specify python packages here. Use test-requirements.txt -# and tox instead. ie. The venv is constructed before bundletester -# is invoked. -#python-packages: \ No newline at end of file diff --git a/src/tox.ini b/src/tox.ini deleted file mode 100644 index 479d7bb..0000000 --- a/src/tox.ini +++ /dev/null @@ -1,53 +0,0 @@ -# Source charm: ./src/tox.ini -# This file is managed centrally by release-tools and should not be modified -# within individual charm repos. -[tox] -envlist = pep8 -skipsdist = True - -[testenv] -setenv = VIRTUAL_ENV={envdir} - PYTHONHASHSEED=0 - AMULET_SETUP_TIMEOUT=2700 -whitelist_externals = juju -passenv = HOME TERM AMULET_* -deps = -r{toxinidir}/test-requirements.txt -install_command = - pip install --allow-unverified python-apt {opts} {packages} - -[testenv:pep8] -basepython = python2.7 -commands = charm-proof - -[testenv:func27-noop] -# DRY RUN - For Debug -basepython = python2.7 -commands = - bundletester -vl DEBUG -r json -o func-results.json --test-pattern "gate-*" -n --no-destroy - -[testenv:func27] -# Run all gate tests which are +x (expected to always pass) -basepython = python2.7 -commands = - bundletester -vl DEBUG -r json -o func-results.json --test-pattern "gate-*" --no-destroy - -[testenv:func27-smoke] -# Run a specific test as an Amulet smoke test (expected to always pass) -basepython = python2.7 -commands = - bundletester -vl DEBUG -r json -o func-results.json gate-basic-xenial-mitaka --no-destroy - -[testenv:func27-dfs] -# Run all deploy-from-source tests which are +x (may not always pass!) -basepython = python2.7 -commands = - bundletester -vl DEBUG -r json -o func-results.json --test-pattern "dfs-*" --no-destroy - -[testenv:func27-dev] -# Run all development test targets which are +x (may not always pass!) -basepython = python2.7 -commands = - bundletester -vl DEBUG -r json -o func-results.json --test-pattern "dev-*" --no-destroy - -[testenv:venv] -commands = {posargs} diff --git a/test-requirements.txt b/test-requirements.txt deleted file mode 100644 index 9f03b45..0000000 --- a/test-requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -# Lint and unit test requirements -flake8 -os-testr>=0.4.1 -charms.reactive -mock>=1.2 -git+https://github.com/openstack/charms.openstack.git#egg=charms-openstack diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 8b9f734..0000000 --- a/tox.ini +++ /dev/null @@ -1,47 +0,0 @@ -# Source charm: ./tox.ini -# This file is managed centrally by release-tools and should not be modified -# within individual charm repos. -[tox] -skipsdist = True -envlist = pep8,py34,py35 -skip_missing_interpreters = True - -[testenv] -setenv = VIRTUAL_ENV={envdir} - PYTHONHASHSEED=0 - TERM=linux - LAYER_PATH={toxinidir}/layers - INTERFACE_PATH={toxinidir}/interfaces - JUJU_REPOSITORY={toxinidir}/build -passenv = http_proxy https_proxy -install_command = - pip install {opts} {packages} -deps = - -r{toxinidir}/requirements.txt - -[testenv:build] -basepython = python2.7 -commands = - charm-build --log-level DEBUG -o {toxinidir}/build src {posargs} - -[testenv:py34] -basepython = python3.4 -deps = -r{toxinidir}/test-requirements.txt -commands = ostestr {posargs} - -[testenv:py35] -basepython = python3.5 -deps = -r{toxinidir}/test-requirements.txt -commands = ostestr {posargs} - -[testenv:pep8] -basepython = python2.7 -deps = -r{toxinidir}/test-requirements.txt -commands = flake8 {posargs} src unit_tests - -[testenv:venv] -commands = {posargs} - -[flake8] -# E402 ignore necessary for path append before sys module import in actions -ignore = E402 \ No newline at end of file diff --git a/unit_tests/__init__.py b/unit_tests/__init__.py deleted file mode 100644 index 3a5e9a3..0000000 --- a/unit_tests/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2016 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. - -import sys - -sys.path.append('src') -sys.path.append('src/lib') - -# Mock out charmhelpers so that we can test without it. -import charms_openstack.test_mocks # noqa -charms_openstack.test_mocks.mock_charmhelpers() diff --git a/unit_tests/test_lib_charm_openstack_murano.py b/unit_tests/test_lib_charm_openstack_murano.py deleted file mode 100644 index 692880f..0000000 --- a/unit_tests/test_lib_charm_openstack_murano.py +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright 2016 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. - -from __future__ import absolute_import -from __future__ import print_function - -import unittest - -import mock - -import charm.openstack.murano as murano - - -def FakeConfig(init_dict): - - def _config(key=None): - return init_dict[key] if key else init_dict - - return _config - - -class Helper(unittest.TestCase): - - def setUp(self): - self._patches = {} - self._patches_start = {} - self.ch_config_patch = mock.patch('charmhelpers.core.hookenv.config') - self.ch_config = self.ch_config_patch.start() - self.ch_config.side_effect = lambda: {'ssl_param': None} - - def tearDown(self): - for k, v in self._patches.items(): - v.stop() - setattr(self, k, None) - self._patches = None - self._patches_start = None - self.ch_config_patch.stop() - - def patch(self, obj, attr, return_value=None, **kwargs): - mocked = mock.patch.object(obj, attr, **kwargs) - self._patches[attr] = mocked - started = mocked.start() - started.return_value = return_value - self._patches_start[attr] = started - setattr(self, attr, started) - - def patch_object(self, obj, attr, return_value=None, name=None, new=None): - if name is None: - name = attr - if new is not None: - mocked = mock.patch.object(obj, attr, new=new) - else: - mocked = mock.patch.object(obj, attr) - self._patches[name] = mocked - started = mocked.start() - if new is None: - started.return_value = return_value - self._patches_start[name] = started - setattr(self, name, started) - - -class TestMuranoCharm(Helper): - - def test__init__(self): - self.patch(murano.ch_utils, 'os_release') - murano.MuranoCharm() - self.os_release.assert_called_once_with('python-keystonemiddleware')