diff --git a/murano_plugin_tests/base_test.py b/murano_plugin_tests/base_test.py deleted file mode 100644 index 492c5ee..0000000 --- a/murano_plugin_tests/base_test.py +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright 2016 Mirantis, Inc. -# -# 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 abc - -from fuelweb_test.tests import base_test_case -import six - -from murano_plugin_tests.helpers import checkers -from murano_plugin_tests.helpers import helpers -from murano_plugin_tests.helpers import remote_ops - - -@six.add_metaclass(abc.ABCMeta) -class PluginApi(object): - """Base class to manage StackLight plugins with Fuel.""" - - def __init__(self): - self.test = base_test_case.TestBasic() - self.env = self.test.env - self.settings = self.get_plugin_settings() - self.helpers = helpers.PluginHelper(self.env) - self.checkers = checkers - self.remote_ops = remote_ops - - def __getattr__(self, item): - return getattr(self.test, item) - - @property - def base_nodes(self): - """Return a dict mapping nodes to Fuel roles without HA.""" - return { - 'slave-01': ['controller'], - 'slave-02': ['compute', 'cinder'], - 'slave-03': self.settings.role_name, - } - - @property - def full_ha_nodes(self): - """Return a dict mapping nodes to Fuel roles with HA.""" - return { - 'slave-01': ['controller'], - 'slave-02': ['controller'], - 'slave-03': ['controller'], - 'slave-04': ['compute', 'cinder'], - 'slave-05': ['compute', 'cinder'], - 'slave-06': ['compute', 'cinder'], - 'slave-07': self.settings.role_name, - 'slave-08': self.settings.role_name, - 'slave-09': self.settings.role_name, - } - - @abc.abstractmethod - def get_plugin_settings(self): - """Return a dict with the default plugin's settings. - """ - pass - - @abc.abstractmethod - def prepare_plugin(self): - """Upload and install the plugin on the Fuel master node. - """ - pass - - @abc.abstractmethod - def activate_plugin(self): - """Enable and configure the plugin in the environment. - """ - pass diff --git a/murano_plugin_tests/helpers/checkers.py b/murano_plugin_tests/helpers/checkers.py index 3fe7ea9..208a830 100644 --- a/murano_plugin_tests/helpers/checkers.py +++ b/murano_plugin_tests/helpers/checkers.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from contextlib import closing +import contextlib import socket from proboscis import asserts @@ -69,5 +69,6 @@ def check_port(address, port): :param port: server port :type port: str """ - with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as sock: + with contextlib.closing( + socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as sock: return sock.connect_ex((address, port)) == 0 diff --git a/murano_plugin_tests/helpers/helpers.py b/murano_plugin_tests/helpers/helpers.py index debc201..b702653 100644 --- a/murano_plugin_tests/helpers/helpers.py +++ b/murano_plugin_tests/helpers/helpers.py @@ -181,6 +181,8 @@ class PluginHelper(object): :type name: str :param settings: optional dict containing the cluster's configuration. :type settings: dict + :param ssl: parameter, that shows, use SSL or not. + :type ssl: bool :returns: the cluster's id :rtype: str """ diff --git a/murano_plugin_tests/murano_plugin/api.py b/murano_plugin_tests/murano_plugin/api.py index 1b71b2c..0d2cd37 100644 --- a/murano_plugin_tests/murano_plugin/api.py +++ b/murano_plugin_tests/murano_plugin/api.py @@ -12,18 +12,50 @@ # License for the specific language governing permissions and limitations # under the License. -from murano_plugin_tests import base_test +from fuelweb_test.tests import base_test_case + +from murano_plugin_tests.helpers import checkers +from murano_plugin_tests.helpers import helpers +from murano_plugin_tests.helpers import remote_ops from murano_plugin_tests.murano_plugin import plugin_settings -class MuranoPluginApi(base_test.PluginApi): - def get_plugin_vip(self): - pass +class MuranoPluginApi(object): + """Class to manage Murano Detach plugin.""" - def get_plugin_settings(self): - return plugin_settings + def __init__(self): + self.test = base_test_case.TestBasic() + self.env = self.test.env + self.settings = plugin_settings + self.helpers = helpers.PluginHelper(self.env) + self.checkers = checkers + self.remote_ops = remote_ops + + def __getattr__(self, item): + return getattr(self.test, item) + + @property + def base_nodes(self): + """Return a dict mapping nodes to Fuel roles without HA.""" + return { + 'slave-01': ['controller'], + 'slave-02': ['compute', 'cinder'], + 'slave-03': self.settings.role_name, + } + + @property + def ha_nodes(self): + """Return a dict mapping nodes to Fuel roles with HA.""" + return { + 'slave-01': ['controller'], + 'slave-02': ['controller'], + 'slave-03': ['controller'], + 'slave-04': ['compute', 'cinder'], + 'slave-05': ['compute'] + self.settings.role_name, + } def prepare_plugin(self): + """Upload and install the plugin on the Fuel master node.""" self.helpers.prepare_plugin(self.settings.plugin_path) def run_ostf(self): @@ -31,11 +63,13 @@ class MuranoPluginApi(base_test.PluginApi): 'tests_platform']) def activate_plugin(self, options=None): + """Enable and configure the plugin in the environment.""" if options is None: options = self.settings.default_options self.helpers.activate_plugin( self.settings.name, self.settings.version, options) def uninstall_plugin(self): + """Uninstall plugin from Fuel.""" return self.helpers.uninstall_plugin(self.settings.name, self.settings.version) diff --git a/murano_plugin_tests/murano_plugin/plugin_settings.py b/murano_plugin_tests/murano_plugin/plugin_settings.py index 0a2a09e..dc29842 100644 --- a/murano_plugin_tests/murano_plugin/plugin_settings.py +++ b/murano_plugin_tests/murano_plugin/plugin_settings.py @@ -17,7 +17,7 @@ from murano_plugin_tests import settings name = 'detach-murano' -role_name = 'murano-node' +role_name = ['murano-node'] plugin_path = settings.MURANO_PLUGIN_PATH version = helpers.get_plugin_version(plugin_path) @@ -30,11 +30,3 @@ default_options = { } murano_options = default_options - -base_nodes = { - 'slave-01': ['controller'], - 'slave-02': ['controller'], - 'slave-03': ['controller'], - 'slave-04': ['compute', 'cinder'], - 'slave-05': ['compute', role_name], -} diff --git a/murano_plugin_tests/murano_plugin/test_murano_plugin_bvt.py b/murano_plugin_tests/murano_plugin/test_murano_plugin_bvt.py index 19ba411..2f9adcc 100644 --- a/murano_plugin_tests/murano_plugin/test_murano_plugin_bvt.py +++ b/murano_plugin_tests/murano_plugin/test_murano_plugin_bvt.py @@ -13,10 +13,10 @@ # under the License. from fuelweb_test.helpers.decorators import log_snapshot_after_test -from murano_plugin_tests.murano_plugin import api -from plugin_settings import base_nodes from proboscis import test +from murano_plugin_tests.murano_plugin import api + @test(groups=["plugins"]) class TestMuranoPluginBvt(api.MuranoPluginApi): @@ -50,7 +50,7 @@ class TestMuranoPluginBvt(api.MuranoPluginApi): self.activate_plugin() - self.helpers.deploy_cluster(base_nodes) + self.helpers.deploy_cluster(self.ha_nodes) self.run_ostf() diff --git a/murano_plugin_tests/settings.py b/murano_plugin_tests/settings.py index 86547f5..5a43f9d 100644 --- a/murano_plugin_tests/settings.py +++ b/murano_plugin_tests/settings.py @@ -1,3 +1,17 @@ +# Copyright 2016 Mirantis, Inc. +# +# 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 os from fuelweb_test.settings import * # noqa diff --git a/openrc.default b/openrc.default index 7cb5e90..e01ecdf 100644 --- a/openrc.default +++ b/openrc.default @@ -9,6 +9,9 @@ export ADMIN_NODE_MEMORY=4096 export ADMIN_NODE_CPU=2 export SLAVE_NODE_MEMORY=6144 -# Locations for fuel-qa, MOS and plugins artefacts -export FUELQA_GITREF=stable/9.0 +# Locations for fuel-qa, MOS and plugins artifacts +export FUELQA_GITREF=stable/mitaka export ISO_PATH=$HOME/iso/MirantisOpenStack-9.0.iso + +# Location of the plugin +export MURANO_PLUGIN_PATH=$HOME/plugins/detach-murano-1.0-1.0.0-1.noarch.rpm \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 0daedfa..551378d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -git+git://github.com/openstack/fuel-devops.git@2.9.20 +git+git://github.com/openstack/fuel-devops.git@2.9.21 oslo.i18n>=3.1.0 # the more recent python-*client (dependencies of fuel-qa) require at least this version of oslo.i18n PyYAML requests diff --git a/utils/fuel-qa-builder/setup.py b/utils/fuel-qa-builder/setup.py index e343d0b..22f28d8 100644 --- a/utils/fuel-qa-builder/setup.py +++ b/utils/fuel-qa-builder/setup.py @@ -11,7 +11,7 @@ def read(fname): def get_requirements_list(requirements): all_requirements = read(requirements) all_requirements = [req for req in all_requirements.splitlines() - if 'devops' not in req and 'launchpadlib' not in req] + if 'launchpadlib' not in req] return all_requirements