summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodion Promyshlennikov <rpromyshlennikov@mirantis.com>2016-07-25 17:11:11 +0300
committerRodion Promyshlennikov <rpromyshlennikov@mirantis.com>2016-07-25 17:11:11 +0300
commit73d0e1adcdf300d108755cb166a2b88acf41144a (patch)
tree10fcf13c5fb8f0f734597d173da41a49e7a1a50a
parent7ccad191593580ff0e561295bfd9d0b1473513fe (diff)
Add system tests
Add test to check controllers and computes scaling. Add test to check murano nodes scaling. Change-Id: I65887aac3e290dd8cd2b710285d42b7a593be274
Notes
Notes (review): Code-Review+2: Victor Ryzhenkin (freerunner) <vryzhenkin@mirantis.com> Workflow+1: Victor Ryzhenkin (freerunner) <vryzhenkin@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Thu, 28 Jul 2016 23:32:59 +0000 Reviewed-on: https://review.openstack.org/346838 Project: openstack/fuel-plugin-murano-tests Branch: refs/heads/master
-rw-r--r--murano_plugin_tests/murano_plugin/api.py24
-rw-r--r--murano_plugin_tests/murano_plugin/test_murano_plugin_bvt.py40
-rw-r--r--murano_plugin_tests/murano_plugin/test_system.py127
-rw-r--r--murano_plugin_tests/run_tests.py1
4 files changed, 190 insertions, 2 deletions
diff --git a/murano_plugin_tests/murano_plugin/api.py b/murano_plugin_tests/murano_plugin/api.py
index 8846b80..b24bb65 100644
--- a/murano_plugin_tests/murano_plugin/api.py
+++ b/murano_plugin_tests/murano_plugin/api.py
@@ -54,6 +54,21 @@ class MuranoPluginApi(object):
54 'slave-05': ['compute'] + self.settings.role_name, 54 'slave-05': ['compute'] + self.settings.role_name,
55 } 55 }
56 56
57 @property
58 def full_ha_nodes(self):
59 """Return a dict mapping nodes to Fuel roles with full HA."""
60 return {
61 'slave-01': ['controller'],
62 'slave-02': ['controller'],
63 'slave-03': ['controller'],
64 'slave-04': ['compute', 'cinder'],
65 'slave-05': ['compute', 'cinder'],
66 'slave-06': ['compute', 'cinder'],
67 'slave-07': self.settings.role_name,
68 'slave-08': self.settings.role_name,
69 'slave-09': self.settings.role_name,
70 }
71
57 def prepare_plugin(self): 72 def prepare_plugin(self):
58 """Upload and install the plugin on the Fuel master node.""" 73 """Upload and install the plugin on the Fuel master node."""
59 self.helpers.prepare_plugin(self.settings.plugin_path) 74 self.helpers.prepare_plugin(self.settings.plugin_path)
@@ -69,6 +84,15 @@ class MuranoPluginApi(object):
69 self.helpers.activate_plugin( 84 self.helpers.activate_plugin(
70 self.settings.name, self.settings.version, options) 85 self.settings.name, self.settings.version, options)
71 86
87 def check_plugin_online(self):
88 """Checks that plugin is working."""
89 test_name = ('fuel_health.tests.tests_platform.test_murano_linux.'
90 'MuranoDeployLinuxServicesTests.'
91 'test_deploy_dummy_app_with_glare')
92 self.helpers.run_single_ostf(test_sets=['tests_platform'],
93 test_name=test_name,
94 timeout=60 * 20)
95
72 def uninstall_plugin(self): 96 def uninstall_plugin(self):
73 """Uninstall plugin from Fuel.""" 97 """Uninstall plugin from Fuel."""
74 return self.helpers.uninstall_plugin(self.settings.name, 98 return self.helpers.uninstall_plugin(self.settings.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 f1df560..899a693 100644
--- a/murano_plugin_tests/murano_plugin/test_murano_plugin_bvt.py
+++ b/murano_plugin_tests/murano_plugin/test_murano_plugin_bvt.py
@@ -27,7 +27,7 @@ class TestMuranoPluginBvt(api.MuranoPluginApi):
27 "murano", "bvt"]) 27 "murano", "bvt"])
28 @log_snapshot_after_test 28 @log_snapshot_after_test
29 def deploy_murano_plugin(self): 29 def deploy_murano_plugin(self):
30 """Deploy a cluster with the Murano plugin 30 """Deploy a cluster with the Murano plugin.
31 31
32 Scenario: 32 Scenario:
33 1. Upload the Murano plugin to the master node 33 1. Upload the Murano plugin to the master node
@@ -63,7 +63,7 @@ class TestMuranoPluginBvt(api.MuranoPluginApi):
63 "murano", "bvt"]) 63 "murano", "bvt"])
64 @log_snapshot_after_test 64 @log_snapshot_after_test
65 def deploy_murano_plugin_ha(self): 65 def deploy_murano_plugin_ha(self):
66 """Deploy a cluster with the Murano plugin 66 """Deploy a cluster with the Murano plugin in HA mode.
67 67
68 Scenario: 68 Scenario:
69 1. Upload the Murano plugin to the master node 69 1. Upload the Murano plugin to the master node
@@ -94,6 +94,42 @@ class TestMuranoPluginBvt(api.MuranoPluginApi):
94 94
95 self.env.make_snapshot("deploy_murano_plugin_ha", is_make=True) 95 self.env.make_snapshot("deploy_murano_plugin_ha", is_make=True)
96 96
97 @test(depends_on_groups=['prepare_slaves_9'],
98 groups=["deploy_murano_plugin_full_ha", "deploy",
99 "murano", "bvt"])
100 @log_snapshot_after_test
101 def deploy_murano_plugin_full_ha(self):
102 """Deploy a cluster with the Murano plugin in full HA mode.
103
104 Scenario:
105 1. Upload the Murano plugin to the master node
106 2. Install the plugin
107 3. Create the cluster
108 4. Add 3 node with controller role
109 5. Add 3 node with compute and cinder roles
110 6. Add 3 node with murano-node role
111 7. Deploy the cluster
112 8. Run OSTF
113
114 Duration 150m
115 Snapshot deploy_murano_plugin_full_ha
116 """
117 self.check_run("deploy_murano_plugin_full_ha")
118
119 self.env.revert_snapshot("ready_with_9_slaves")
120
121 self.prepare_plugin()
122
123 self.helpers.create_cluster(name=self.__class__.__name__)
124
125 self.activate_plugin()
126
127 self.helpers.deploy_cluster(self.full_ha_nodes)
128
129 self.run_ostf()
130
131 self.env.make_snapshot("deploy_murano_plugin_full_ha", is_make=True)
132
97 @test(depends_on=[deploy_murano_plugin], 133 @test(depends_on=[deploy_murano_plugin],
98 groups=["uninstall_deployed_murano_plugin", "uninstall", 134 groups=["uninstall_deployed_murano_plugin", "uninstall",
99 "murano_plugin", "smoke"]) 135 "murano_plugin", "smoke"])
diff --git a/murano_plugin_tests/murano_plugin/test_system.py b/murano_plugin_tests/murano_plugin/test_system.py
new file mode 100644
index 0000000..610d245
--- /dev/null
+++ b/murano_plugin_tests/murano_plugin/test_system.py
@@ -0,0 +1,127 @@
1# Copyright 2016 Mirantis, Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
15from fuelweb_test.helpers.decorators import log_snapshot_after_test
16from proboscis import test
17
18from murano_plugin_tests.murano_plugin import api
19
20
21@test(groups=["plugins"])
22class TestSystemMuranoPlugin(api.MuranoPluginApi):
23 """Class for system tests for Murano Detach plugin."""
24
25 @test(depends_on_groups=["deploy_murano_plugin_full_ha"],
26 groups=["check_scaling_murano", "scaling",
27 "murano", "system",
28 "add_remove_controller_compute_murano"])
29 @log_snapshot_after_test
30 def add_remove_controller_compute_murano(self):
31 """Verify that the number of controllers and
32 computes can scale up and down.
33
34 Scenario:
35 1. Revert snapshot with 9 deployed nodes in HA configuration
36 2. Remove one controller node and update the cluster
37 3. Check that plugin is working
38 4. Run OSTF
39 5. Add one controller node (return previous state) and
40 update the cluster
41 6. Check that plugin is working
42 7. Run OSTF
43 8. Remove one compute node and update the cluster
44 9. Check that plugin is working
45 10. Run OSTF
46 11. Add one compute node (return previous state) and
47 update the cluster
48 12. Check that plugin is working
49 13. Run OSTF
50
51 Duration 240m
52 """
53 self.env.revert_snapshot("deploy_murano_plugin_full_ha")
54
55 controller_manipulated_node = {'slave-03': ['controller']}
56
57 # Remove controller
58 self.helpers.remove_nodes_from_cluster(controller_manipulated_node)
59
60 self.check_plugin_online()
61
62 self.run_ostf()
63
64 compute_manipulated_node = {'slave-04': ['compute', 'cinder']}
65
66 # Remove compute
67 self.helpers.remove_nodes_from_cluster(compute_manipulated_node)
68
69 self.check_plugin_online()
70
71 self.run_ostf()
72
73 # Add controller
74 # NOTE(rpromyshlennikov): test can fail here before
75 # bug https://bugs.launchpad.net/fuel/+bug/1603480 isn't fixed
76 # and not merged in devops, here and elsewhere on node adding.
77 self.helpers.add_nodes_to_cluster(controller_manipulated_node)
78
79 self.check_plugin_online()
80
81 self.run_ostf()
82
83 # Add compute
84 self.helpers.add_nodes_to_cluster(compute_manipulated_node)
85
86 self.check_plugin_online()
87
88 self.run_ostf()
89
90 @test(depends_on_groups=["deploy_murano_plugin_full_ha"],
91 groups=["check_scaling_murano", "scaling",
92 "murano", "system",
93 "add_remove_murano_node"])
94 @log_snapshot_after_test
95 def add_remove_murano_node(self):
96 """Verify that the number of Murano Detach nodes
97 can scale up and down.
98
99 Scenario:
100 1. Revert snapshot with 9 deployed nodes in HA configuration
101 2. Remove one Murano Detach node and update the cluster
102 3. Check that plugin is working
103 4. Run OSTF
104 5. Add one Murano Detach node (return previous state) and
105 update the cluster
106 6. Check that plugin is working
107 7. Run OSTF
108
109 Duration 120m
110 """
111 self.env.revert_snapshot("deploy_murano_plugin_full_ha")
112
113 manipulated_node = {'slave-07': self.settings.role_name}
114
115 # Remove Murano Detach node
116 self.helpers.remove_nodes_from_cluster(manipulated_node)
117
118 self.check_plugin_online()
119
120 self.run_ostf()
121
122 # Add Murano Detach node
123 self.helpers.add_nodes_to_cluster(manipulated_node)
124
125 self.check_plugin_online()
126
127 self.run_ostf()
diff --git a/murano_plugin_tests/run_tests.py b/murano_plugin_tests/run_tests.py
index bf1ad81..0b96d2c 100644
--- a/murano_plugin_tests/run_tests.py
+++ b/murano_plugin_tests/run_tests.py
@@ -40,6 +40,7 @@ class CloseSSHConnectionsPlugin(plugins.Plugin):
40 40
41def import_tests(): 41def import_tests():
42 from murano_plugin import test_murano_plugin_bvt # noqa 42 from murano_plugin import test_murano_plugin_bvt # noqa
43 from murano_plugin import test_system # noqa
43 44
44 45
45def run_tests(): 46def run_tests():