Merge "Support Murano plugin in fuel-qa framework"

This commit is contained in:
Jenkins 2016-06-10 21:25:24 +00:00 committed by Gerrit Code Review
commit 4acdf370d1
5 changed files with 155 additions and 24 deletions

View File

@ -551,6 +551,11 @@ Zabbix tests
.. automodule:: fuelweb_test.tests.plugins.plugin_zabbix.test_plugin_zabbix
:members:
Murano Tests
------------
.. automodule:: fuelweb_test.tests.plugins.plugin_murano.test_plugin_murano
:members:
Patching tests
==============

View File

@ -494,6 +494,7 @@ SEPARATE_SERVICE_HAPROXY_PLUGIN_PATH = os.environ.get(
'SEPARATE_SERVICE_HAPROXY_PLUGIN_PATH')
SEPARATE_SERVICE_BALANCER_PLUGIN_PATH = os.environ.get(
'SEPARATE_SERVICE_BALANCER_PLUGIN_PATH')
MURANO_PLUGIN_PATH = os.environ.get('MURANO_PLUGIN_PATH')
FUEL_STATS_CHECK = get_var_as_bool('FUEL_STATS_CHECK', False)
FUEL_STATS_ENABLED = get_var_as_bool('FUEL_STATS_ENABLED', True)

View File

@ -0,0 +1,133 @@
# 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 proboscis.asserts import assert_true
from proboscis import test
from fuelweb_test.helpers.checkers import check_plugin_path_env
from fuelweb_test.helpers import utils
from fuelweb_test.helpers.decorators import log_snapshot_after_test
from fuelweb_test import settings
from fuelweb_test import logger
from fuelweb_test.tests.base_test_case import SetupEnvironment
from fuelweb_test.tests.base_test_case import TestBasic
@test(groups=["plugins", "murano_plugin"])
class MuranoPlugin(TestBasic):
"""Murano Plugin Tests."""
def __init__(self):
super(MuranoPlugin, self).__init__()
check_plugin_path_env(
var_name='MURANO_PLUGIN_PATH',
plugin_path=settings.MURANO_PLUGIN_PATH
)
def setup_murano_plugin(self,
cluster_id,
murano_user='murano',
murano_db_password='murano_password',
cfapi=False,
glare=False,
apps_url='http://storage.apps.openstack.org/'):
plugin_name = 'detach_murano'
assert_true(
self.fuel_web.check_plugin_exists(cluster_id, plugin_name),
"Plugin couldn't be enabled. Check plugin version. Test aborted")
plugin_options = {
'metadata/enabled': True,
'metadata/versions/murano_user_password': murano_user,
'metadata/versions/murano_db_password': murano_db_password,
'metadata/versions/murano_glance_artifacts/value': glare,
'metadata/versions/murano_cfapi/value': cfapi,
'metadata/versions/murano_repo_url/value': apps_url
}
self.fuel_web.update_plugin_data(
cluster_id, plugin_name, plugin_options)
@test(depends_on=[SetupEnvironment.prepare_slaves_5],
groups=["deploy_murano_with_glare_ha_one_controller"])
@log_snapshot_after_test
def deploy_murano_with_glare_ha_one_controller(self):
"""Deploy cluster in ha mode with murano plugin
Scenario:
1. Upload plugin to the master node
2. Install plugin
3. Create cluster
4. Add 1 nodes with controller role
5. Add 1 node with compute role
6. Add 1 node with cinder role
7. Add 1 node with murano role
8. Deploy the cluster
9. Run network verification
10. Run sanity OSTF
11. Run Murano Platform OSTF
Duration 150m
Snapshot deploy_murano_with_glare_ha_one_controller
"""
self.env.revert_snapshot("ready_with_5_slaves")
utils.upload_tarball(
ip=self.ssh_manager.admin_ip,
tar_path=settings.MURANO_PLUGIN_PATH,
tar_target="/var")
utils.install_plugin_check_code(
ip=self.ssh_manager.admin_ip,
plugin=os.path.basename(settings.MURANO_PLUGIN_PATH))
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,
mode=settings.DEPLOYMENT_MODE,
configure_ssl=False
)
self.setup_murano_plugin(cluster_id, glare=True)
self.fuel_web.update_nodes(
cluster_id,
{
"slave-01": ["controller"],
"slave-02": ["compute"],
"slave-03": ["cinder"],
"slave-04": ["murano-node"]
}
)
self.fuel_web.deploy_cluster_wait(cluster_id)
self.fuel_web.verify_network(cluster_id)
self.fuel_web.run_ostf(cluster_id=cluster_id, test_sets=['sanity'])
logger.debug('Run OSTF platform tests')
test_class_main = ('fuel_health.tests.tests_platform'
'.test_murano_linux.MuranoDeployLinuxServicesTests')
tests_names = ['test_deploy_dummy_app_with_glare']
test_classes = []
for test_name in tests_names:
test_classes.append('{0}.{1}'.format(test_class_main,
test_name))
for test_name in test_classes:
self.fuel_web.run_single_ostf_test(
cluster_id=cluster_id, test_sets=['tests_platform'],
test_name=test_name, timeout=60 * 20)
self.env.make_snapshot("deploy_murano_with_glare_ha_one_controller")

View File

@ -276,7 +276,12 @@ class MuranoHAOneController(TestBasic):
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,
mode=settings.DEPLOYMENT_MODE,
settings=data)
settings=data,
configure_ssl=False
)
# TODO(freerunner): Need to configure SSL again when root cause for
# TODO(freerunner): https://bugs.launchpad.net/fuel/+bug/1590633
# TODO(freerunner): will be found and fixed
self.fuel_web.update_nodes(
cluster_id,
@ -287,26 +292,17 @@ class MuranoHAOneController(TestBasic):
)
self.fuel_web.deploy_cluster_wait(cluster_id)
os_conn = os_actions.OpenStackActions(
self.fuel_web.get_public_vip(cluster_id),
data['user'], data['password'], data['tenant'])
self.fuel_web.assert_cluster_ready(os_conn, smiles_count=5)
_ip = self.fuel_web.get_nailgun_node_by_name("slave-01")['ip']
checkers.verify_service(_ip, service_name='murano-api')
logger.debug('Run sanity and functional Murano OSTF tests')
self.fuel_web.run_single_ostf_test(
cluster_id=self.fuel_web.get_last_created_cluster(),
test_sets=['sanity'],
test_name=('fuel_health.tests.sanity.test_sanity_murano.'
'MuranoSanityTests.test_create_and_delete_service')
)
self.fuel_web.run_ostf(cluster_id=cluster_id, test_sets=['sanity'])
logger.debug('Run OSTF platform tests')
test_class_main = ('fuel_health.tests.tests_platform'
'.test_murano_linux.MuranoDeployLinuxServicesTests')
tests_names = ['test_deploy_dummy_app', ]
tests_names = ['test_deploy_dummy_app_with_glare', ]
test_classes = []
@ -360,7 +356,12 @@ class MuranoHA(TestBasic):
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,
mode=settings.DEPLOYMENT_MODE,
settings=data)
settings=data,
configure_ssl=False
)
# TODO(freerunner): Need to configure SSL again when root cause for
# TODO(freerunner): https://bugs.launchpad.net/fuel/+bug/1590633
# TODO(freerunner): will be found and fixed
self.fuel_web.update_nodes(
cluster_id,
@ -372,27 +373,18 @@ class MuranoHA(TestBasic):
}
)
self.fuel_web.deploy_cluster_wait(cluster_id)
cluster_vip = self.fuel_web.get_public_vip(cluster_id)
os_conn = os_actions.OpenStackActions(
cluster_vip, data['user'], data['password'], data['tenant'])
self.fuel_web.assert_cluster_ready(os_conn, smiles_count=13)
for slave in ["slave-01", "slave-02", "slave-03"]:
_ip = self.fuel_web.get_nailgun_node_by_name(slave)['ip']
checkers.verify_service(_ip, service_name='murano-api')
logger.debug('Run sanity and functional Murano OSTF tests')
self.fuel_web.run_single_ostf_test(
cluster_id=self.fuel_web.get_last_created_cluster(),
test_sets=['sanity'],
test_name=('fuel_health.tests.sanity.test_sanity_murano.'
'MuranoSanityTests.test_create_and_delete_service')
)
self.fuel_web.run_ostf(cluster_id=cluster_id, test_sets=['sanity'])
logger.debug('Run OSTF platform tests')
test_class_main = ('fuel_health.tests.tests_platform'
'.test_murano_linux.MuranoDeployLinuxServicesTests')
tests_names = ['test_deploy_dummy_app', ]
tests_names = ['test_deploy_dummy_app_with_glare']
test_classes = []