Fixes for consistency
Hacking fixes about modules imports. Fix fuel-qa branch naming. Remove unneeded base class. Change-Id: I136adc73b926ba0be4851f70053c72604ff0e687
This commit is contained in:
parent
172968f5ab
commit
ae6cd29346
|
@ -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
|
|
|
@ -12,7 +12,7 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from contextlib import closing
|
import contextlib
|
||||||
import socket
|
import socket
|
||||||
|
|
||||||
from proboscis import asserts
|
from proboscis import asserts
|
||||||
|
@ -69,5 +69,6 @@ def check_port(address, port):
|
||||||
:param port: server port
|
:param port: server port
|
||||||
:type port: str
|
: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
|
return sock.connect_ex((address, port)) == 0
|
||||||
|
|
|
@ -181,6 +181,8 @@ class PluginHelper(object):
|
||||||
:type name: str
|
:type name: str
|
||||||
:param settings: optional dict containing the cluster's configuration.
|
:param settings: optional dict containing the cluster's configuration.
|
||||||
:type settings: dict
|
:type settings: dict
|
||||||
|
:param ssl: parameter, that shows, use SSL or not.
|
||||||
|
:type ssl: bool
|
||||||
:returns: the cluster's id
|
:returns: the cluster's id
|
||||||
:rtype: str
|
:rtype: str
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -12,18 +12,50 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# 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
|
from murano_plugin_tests.murano_plugin import plugin_settings
|
||||||
|
|
||||||
|
|
||||||
class MuranoPluginApi(base_test.PluginApi):
|
class MuranoPluginApi(object):
|
||||||
def get_plugin_vip(self):
|
"""Class to manage Murano Detach plugin."""
|
||||||
pass
|
|
||||||
|
|
||||||
def get_plugin_settings(self):
|
def __init__(self):
|
||||||
return plugin_settings
|
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):
|
def prepare_plugin(self):
|
||||||
|
"""Upload and install the plugin on the Fuel master node."""
|
||||||
self.helpers.prepare_plugin(self.settings.plugin_path)
|
self.helpers.prepare_plugin(self.settings.plugin_path)
|
||||||
|
|
||||||
def run_ostf(self):
|
def run_ostf(self):
|
||||||
|
@ -31,11 +63,13 @@ class MuranoPluginApi(base_test.PluginApi):
|
||||||
'tests_platform'])
|
'tests_platform'])
|
||||||
|
|
||||||
def activate_plugin(self, options=None):
|
def activate_plugin(self, options=None):
|
||||||
|
"""Enable and configure the plugin in the environment."""
|
||||||
if options is None:
|
if options is None:
|
||||||
options = self.settings.default_options
|
options = self.settings.default_options
|
||||||
self.helpers.activate_plugin(
|
self.helpers.activate_plugin(
|
||||||
self.settings.name, self.settings.version, options)
|
self.settings.name, self.settings.version, options)
|
||||||
|
|
||||||
def uninstall_plugin(self):
|
def uninstall_plugin(self):
|
||||||
|
"""Uninstall plugin from Fuel."""
|
||||||
return self.helpers.uninstall_plugin(self.settings.name,
|
return self.helpers.uninstall_plugin(self.settings.name,
|
||||||
self.settings.version)
|
self.settings.version)
|
||||||
|
|
|
@ -17,7 +17,7 @@ from murano_plugin_tests import settings
|
||||||
|
|
||||||
|
|
||||||
name = 'detach-murano'
|
name = 'detach-murano'
|
||||||
role_name = 'murano-node'
|
role_name = ['murano-node']
|
||||||
plugin_path = settings.MURANO_PLUGIN_PATH
|
plugin_path = settings.MURANO_PLUGIN_PATH
|
||||||
version = helpers.get_plugin_version(plugin_path)
|
version = helpers.get_plugin_version(plugin_path)
|
||||||
|
|
||||||
|
@ -30,11 +30,3 @@ default_options = {
|
||||||
}
|
}
|
||||||
|
|
||||||
murano_options = 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],
|
|
||||||
}
|
|
||||||
|
|
|
@ -13,10 +13,10 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from fuelweb_test.helpers.decorators import log_snapshot_after_test
|
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 proboscis import test
|
||||||
|
|
||||||
|
from murano_plugin_tests.murano_plugin import api
|
||||||
|
|
||||||
|
|
||||||
@test(groups=["plugins"])
|
@test(groups=["plugins"])
|
||||||
class TestMuranoPluginBvt(api.MuranoPluginApi):
|
class TestMuranoPluginBvt(api.MuranoPluginApi):
|
||||||
|
@ -50,7 +50,7 @@ class TestMuranoPluginBvt(api.MuranoPluginApi):
|
||||||
|
|
||||||
self.activate_plugin()
|
self.activate_plugin()
|
||||||
|
|
||||||
self.helpers.deploy_cluster(base_nodes)
|
self.helpers.deploy_cluster(self.ha_nodes)
|
||||||
|
|
||||||
self.run_ostf()
|
self.run_ostf()
|
||||||
|
|
||||||
|
|
|
@ -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
|
import os
|
||||||
|
|
||||||
from fuelweb_test.settings import * # noqa
|
from fuelweb_test.settings import * # noqa
|
||||||
|
|
|
@ -9,6 +9,9 @@ export ADMIN_NODE_MEMORY=4096
|
||||||
export ADMIN_NODE_CPU=2
|
export ADMIN_NODE_CPU=2
|
||||||
export SLAVE_NODE_MEMORY=6144
|
export SLAVE_NODE_MEMORY=6144
|
||||||
|
|
||||||
# Locations for fuel-qa, MOS and plugins artefacts
|
# Locations for fuel-qa, MOS and plugins artifacts
|
||||||
export FUELQA_GITREF=stable/9.0
|
export FUELQA_GITREF=stable/mitaka
|
||||||
export ISO_PATH=$HOME/iso/MirantisOpenStack-9.0.iso
|
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
|
|
@ -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
|
oslo.i18n>=3.1.0 # the more recent python-*client (dependencies of fuel-qa) require at least this version of oslo.i18n
|
||||||
PyYAML
|
PyYAML
|
||||||
requests
|
requests
|
||||||
|
|
|
@ -11,7 +11,7 @@ def read(fname):
|
||||||
def get_requirements_list(requirements):
|
def get_requirements_list(requirements):
|
||||||
all_requirements = read(requirements)
|
all_requirements = read(requirements)
|
||||||
all_requirements = [req for req in all_requirements.splitlines()
|
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
|
return all_requirements
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue