Add system tests

Add test to check controllers and computes scaling.
Add test to check murano nodes scaling.

Change-Id: I65887aac3e290dd8cd2b710285d42b7a593be274
This commit is contained in:
Rodion Promyshlennikov 2016-07-25 17:11:11 +03:00
parent 7ccad19159
commit 73d0e1adcd
4 changed files with 190 additions and 2 deletions

View File

@ -54,6 +54,21 @@ class MuranoPluginApi(object):
'slave-05': ['compute'] + self.settings.role_name,
}
@property
def full_ha_nodes(self):
"""Return a dict mapping nodes to Fuel roles with full 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,
}
def prepare_plugin(self):
"""Upload and install the plugin on the Fuel master node."""
self.helpers.prepare_plugin(self.settings.plugin_path)
@ -69,6 +84,15 @@ class MuranoPluginApi(object):
self.helpers.activate_plugin(
self.settings.name, self.settings.version, options)
def check_plugin_online(self):
"""Checks that plugin is working."""
test_name = ('fuel_health.tests.tests_platform.test_murano_linux.'
'MuranoDeployLinuxServicesTests.'
'test_deploy_dummy_app_with_glare')
self.helpers.run_single_ostf(test_sets=['tests_platform'],
test_name=test_name,
timeout=60 * 20)
def uninstall_plugin(self):
"""Uninstall plugin from Fuel."""
return self.helpers.uninstall_plugin(self.settings.name,

View File

@ -27,7 +27,7 @@ class TestMuranoPluginBvt(api.MuranoPluginApi):
"murano", "bvt"])
@log_snapshot_after_test
def deploy_murano_plugin(self):
"""Deploy a cluster with the Murano plugin
"""Deploy a cluster with the Murano plugin.
Scenario:
1. Upload the Murano plugin to the master node
@ -63,7 +63,7 @@ class TestMuranoPluginBvt(api.MuranoPluginApi):
"murano", "bvt"])
@log_snapshot_after_test
def deploy_murano_plugin_ha(self):
"""Deploy a cluster with the Murano plugin
"""Deploy a cluster with the Murano plugin in HA mode.
Scenario:
1. Upload the Murano plugin to the master node
@ -94,6 +94,42 @@ class TestMuranoPluginBvt(api.MuranoPluginApi):
self.env.make_snapshot("deploy_murano_plugin_ha", is_make=True)
@test(depends_on_groups=['prepare_slaves_9'],
groups=["deploy_murano_plugin_full_ha", "deploy",
"murano", "bvt"])
@log_snapshot_after_test
def deploy_murano_plugin_full_ha(self):
"""Deploy a cluster with the Murano plugin in full HA mode.
Scenario:
1. Upload the Murano plugin to the master node
2. Install the plugin
3. Create the cluster
4. Add 3 node with controller role
5. Add 3 node with compute and cinder roles
6. Add 3 node with murano-node role
7. Deploy the cluster
8. Run OSTF
Duration 150m
Snapshot deploy_murano_plugin_full_ha
"""
self.check_run("deploy_murano_plugin_full_ha")
self.env.revert_snapshot("ready_with_9_slaves")
self.prepare_plugin()
self.helpers.create_cluster(name=self.__class__.__name__)
self.activate_plugin()
self.helpers.deploy_cluster(self.full_ha_nodes)
self.run_ostf()
self.env.make_snapshot("deploy_murano_plugin_full_ha", is_make=True)
@test(depends_on=[deploy_murano_plugin],
groups=["uninstall_deployed_murano_plugin", "uninstall",
"murano_plugin", "smoke"])

View File

@ -0,0 +1,127 @@
# 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.
from fuelweb_test.helpers.decorators import log_snapshot_after_test
from proboscis import test
from murano_plugin_tests.murano_plugin import api
@test(groups=["plugins"])
class TestSystemMuranoPlugin(api.MuranoPluginApi):
"""Class for system tests for Murano Detach plugin."""
@test(depends_on_groups=["deploy_murano_plugin_full_ha"],
groups=["check_scaling_murano", "scaling",
"murano", "system",
"add_remove_controller_compute_murano"])
@log_snapshot_after_test
def add_remove_controller_compute_murano(self):
"""Verify that the number of controllers and
computes can scale up and down.
Scenario:
1. Revert snapshot with 9 deployed nodes in HA configuration
2. Remove one controller node and update the cluster
3. Check that plugin is working
4. Run OSTF
5. Add one controller node (return previous state) and
update the cluster
6. Check that plugin is working
7. Run OSTF
8. Remove one compute node and update the cluster
9. Check that plugin is working
10. Run OSTF
11. Add one compute node (return previous state) and
update the cluster
12. Check that plugin is working
13. Run OSTF
Duration 240m
"""
self.env.revert_snapshot("deploy_murano_plugin_full_ha")
controller_manipulated_node = {'slave-03': ['controller']}
# Remove controller
self.helpers.remove_nodes_from_cluster(controller_manipulated_node)
self.check_plugin_online()
self.run_ostf()
compute_manipulated_node = {'slave-04': ['compute', 'cinder']}
# Remove compute
self.helpers.remove_nodes_from_cluster(compute_manipulated_node)
self.check_plugin_online()
self.run_ostf()
# Add controller
# NOTE(rpromyshlennikov): test can fail here before
# bug https://bugs.launchpad.net/fuel/+bug/1603480 isn't fixed
# and not merged in devops, here and elsewhere on node adding.
self.helpers.add_nodes_to_cluster(controller_manipulated_node)
self.check_plugin_online()
self.run_ostf()
# Add compute
self.helpers.add_nodes_to_cluster(compute_manipulated_node)
self.check_plugin_online()
self.run_ostf()
@test(depends_on_groups=["deploy_murano_plugin_full_ha"],
groups=["check_scaling_murano", "scaling",
"murano", "system",
"add_remove_murano_node"])
@log_snapshot_after_test
def add_remove_murano_node(self):
"""Verify that the number of Murano Detach nodes
can scale up and down.
Scenario:
1. Revert snapshot with 9 deployed nodes in HA configuration
2. Remove one Murano Detach node and update the cluster
3. Check that plugin is working
4. Run OSTF
5. Add one Murano Detach node (return previous state) and
update the cluster
6. Check that plugin is working
7. Run OSTF
Duration 120m
"""
self.env.revert_snapshot("deploy_murano_plugin_full_ha")
manipulated_node = {'slave-07': self.settings.role_name}
# Remove Murano Detach node
self.helpers.remove_nodes_from_cluster(manipulated_node)
self.check_plugin_online()
self.run_ostf()
# Add Murano Detach node
self.helpers.add_nodes_to_cluster(manipulated_node)
self.check_plugin_online()
self.run_ostf()

View File

@ -40,6 +40,7 @@ class CloseSSHConnectionsPlugin(plugins.Plugin):
def import_tests():
from murano_plugin import test_murano_plugin_bvt # noqa
from murano_plugin import test_system # noqa
def run_tests():