Browse Source

Add tests on upgrade murano plugin via new version

This patch adding tests for upgrade fuel murano plugin via new version
of the plugin. The logic of tests is:
1. deploy env with old version of the murano plugin
2. install and enable new version of the murano plugin
3. deploy chages(upgrade murano plugin)
4. run OSTF

Change-Id: I096d53e776ab49133bae22a7b6c3a5e39faf75f0
Aleksandr Kholkin 2 years ago
parent
commit
98efb8b507

+ 16
- 0
murano_plugin_tests/helpers/helpers.py View File

@@ -802,3 +802,19 @@ class PluginHelper(object):
802 802
     def wait_os_cluster_readiness(self, timeout=15 * 60):
803 803
         self.fuel_web.assert_os_services_ready(self.cluster_id,
804 804
                                                timeout=timeout)
805
+
806
+    def add_and_enable_yum_repo_with_detach_plugin(self):
807
+        cmd = ('yum-config-manager --add-repo'
808
+               'http://mirror.seed-cz1.fuel-infra.org/'
809
+               'mos-plugins/centos/9.0/')
810
+        self.ssh_manager.check_call(
811
+            ip=self.ssh_manager.admin_ip,
812
+            command=cmd)
813
+
814
+    def install_detach_murano_plugin_from_repository(self, plugin_name):
815
+        cmds = ["yum install -y {}".format(plugin_name),
816
+                'fuel plugins --sync']
817
+        for cmd in cmds:
818
+            self.ssh_manager.check_call(
819
+                ip=self.ssh_manager.admin_ip,
820
+                command=cmd)

+ 6
- 3
murano_plugin_tests/murano_plugin/api.py View File

@@ -105,12 +105,15 @@ class MuranoPluginApi(object):
105 105
     def run_ostf(self, test_sets):
106 106
         self.helpers.run_ostf(test_sets=test_sets)
107 107
 
108
-    def activate_plugin(self, options=None):
108
+    def activate_plugin(self, name=None, version=None, options=None):
109 109
         """Enable and configure the plugin in the environment."""
110
+        if name is None:
111
+            name = self.settings.name
112
+        if version is None:
113
+            version = self.settings.version
110 114
         if options is None:
111 115
             options = self.settings.default_options
112
-        self.helpers.activate_plugin(
113
-            self.settings.name, self.settings.version, options)
116
+        self.helpers.activate_plugin(name, version, options)
114 117
 
115 118
     @retry(count=3, delay=120)
116 119
     def check_plugin_online(self):

+ 178
- 0
murano_plugin_tests/murano_plugin/test_murano_plugin_upgrade.py View File

@@ -0,0 +1,178 @@
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
+
15
+from fuelweb_test.helpers.decorators import log_snapshot_after_test
16
+from proboscis import test
17
+
18
+from murano_plugin_tests.murano_plugin import api
19
+from murano_plugin_tests.murano_plugin import plugin_settings
20
+
21
+
22
+@test(groups=["plugins"])
23
+class TestMuranoPluginUpgrade(api.MuranoPluginApi):
24
+    """Class for upgrade testing the Murano plugin."""
25
+
26
+    @test(depends_on_groups=["prepare_slaves_3"],
27
+          groups=["upgrade_murano_plugin_on_controller",
28
+                  "deploy", "murano_plugin", "upgrade", 'murano'])
29
+    @log_snapshot_after_test
30
+    def upgrade_murano_plugin_on_controller(self):
31
+        """Upgrade old Murano Plugin via the new one on controller.
32
+
33
+        Scenario:
34
+            1. Upload the Murano plugin(version 1.1.0) to the master node
35
+            2. Install the plugin
36
+            3. Create the cluster
37
+            4. Add 1 node with controller role
38
+            5. Add 1 node with compute and cinder roles
39
+            6. Deploy the cluster
40
+            7. Run OSTF
41
+            8. Upload new version of the Murano plugin to the master node
42
+            9. Install new plugin
43
+            10. Upgrade old version of the plugin on the controller
44
+            11. Update cluster
45
+            12. Run OSTF
46
+
47
+        Duration 120m
48
+        Snapshot upgrade_murano_plugin_on_controller
49
+        """
50
+
51
+        self.env.revert_snapshot("ready_with_3_slaves")
52
+
53
+        self.helpers.add_and_enable_yum_repo_with_detach_plugin()
54
+
55
+        self.helpers.install_detach_murano_plugin_from_repository(
56
+            'detach-murano-1.1.noarch')
57
+
58
+        self.helpers.create_cluster(name=self.__class__.__name__)
59
+
60
+        self.activate_plugin('detach-murano', '1.1.0')
61
+
62
+        self.helpers.deploy_cluster(self.only_controllers)
63
+
64
+        self.run_ostf(['sanity', 'smoke'])
65
+        self.check_plugin_online()
66
+
67
+        self.prepare_plugin()
68
+
69
+        self.activate_plugin()
70
+
71
+        self.helpers.apply_changes()
72
+
73
+        self.run_ostf(['sanity', 'smoke'])
74
+        self.check_plugin_online()
75
+
76
+    @test(depends_on_groups=["prepare_slaves_3"],
77
+          groups=["upgrade_murano_plugin_add_murano_node",
78
+                  "deploy", "murano_plugin", "upgrade", 'murano'])
79
+    @log_snapshot_after_test
80
+    def upgrade_murano_plugin_add_murano_node(self):
81
+        """Upgrade old Murano Plugin via the new one with adding murano-node.
82
+
83
+        Scenario:
84
+            1. Upload the Murano plugin(version 1.1.0) to the master node
85
+            2. Install the plugin
86
+            3. Create the cluster
87
+            4. Add 1 node with controller role
88
+            5. Add 1 node with compute and cinder roles
89
+            6. Deploy the cluster
90
+            7. Run OSTF
91
+            8. Upload new version of the Murano plugin to the master node
92
+            9. Install new plugin
93
+            10. Add 1 node with compute and murano-node roles
94
+            11. Upgrade old version of the plugin
95
+            12. Update cluster
96
+            13. Run OSTF
97
+
98
+        Duration 120m
99
+        Snapshot upgrade_murano_plugin_add_murano_node
100
+        """
101
+
102
+        self.env.revert_snapshot("ready_with_3_slaves")
103
+
104
+        self.helpers.add_and_enable_yum_repo_with_detach_plugin()
105
+
106
+        self.helpers.install_detach_murano_plugin_from_repository(
107
+            'detach-murano-1.1.noarch')
108
+
109
+        self.helpers.create_cluster(name=self.__class__.__name__)
110
+
111
+        self.activate_plugin('detach-murano', '1.1.0')
112
+
113
+        self.helpers.deploy_cluster(self.only_controllers)
114
+
115
+        self.run_ostf(['sanity', 'smoke'])
116
+        self.check_plugin_online()
117
+
118
+        self.prepare_plugin()
119
+
120
+        self.activate_plugin()
121
+
122
+        self.helpers.deploy_cluster({
123
+            'slave-03': plugin_settings.role_name,
124
+        })
125
+
126
+        self.run_ostf(['sanity', 'smoke'])
127
+        self.check_plugin_online()
128
+
129
+    @test(depends_on_groups=["prepare_slaves_3"],
130
+          groups=["upgrade_murano_plugin_on_murano_node",
131
+                  "deploy", "murano_plugin", "upgrade", 'murano'])
132
+    @log_snapshot_after_test
133
+    def upgrade_murano_plugin_on_murano_node(self):
134
+        """Upgrade old Murano Plugin via the new one on murano-node.
135
+
136
+        Scenario:
137
+            1. Upload the Murano plugin(version 1.1.0) to the master node
138
+            2. Install the plugin
139
+            3. Create the cluster
140
+            4. Add 1 node with controller role
141
+            5. Add 1 node with compute and cinder roles
142
+            6. Add 1 node with murano-node roles
143
+            7. Deploy the cluster
144
+            8. Run OSTF
145
+            9. Upload new version of the Murano plugin to the master node
146
+            10. Install new plugin
147
+            11. Upgrade old version of the plugin
148
+            12. Update cluster
149
+            13. Run OSTF
150
+
151
+        Duration 120m
152
+        Snapshot upgrade_murano_plugin_on_murano_node
153
+        """
154
+
155
+        self.env.revert_snapshot("ready_with_3_slaves")
156
+
157
+        self.helpers.add_and_enable_yum_repo_with_detach_plugin()
158
+
159
+        self.helpers.install_detach_murano_plugin_from_repository(
160
+            'detach-murano-1.1.noarch')
161
+
162
+        self.helpers.create_cluster(name=self.__class__.__name__)
163
+
164
+        self.activate_plugin('detach-murano', '1.1.0')
165
+
166
+        self.helpers.deploy_cluster(self.base_nodes)
167
+
168
+        self.run_ostf(['sanity', 'smoke'])
169
+        self.check_plugin_online()
170
+
171
+        self.prepare_plugin()
172
+
173
+        self.activate_plugin()
174
+
175
+        self.helpers.apply_changes()
176
+
177
+        self.run_ostf(['sanity', 'smoke'])
178
+        self.check_plugin_online()

+ 4
- 4
murano_plugin_tests/murano_plugin/test_post_install.py View File

@@ -116,11 +116,11 @@ class TestMuranoPostInstallation(api.MuranoPluginApi):
116 116
         self.check_plugin_online()
117 117
 
118 118
     @test(depends_on_groups=["deploy_murano_plugin_on_controller"],
119
-          groups=["move_murano_plugin_on_environment_from_controller"
119
+          groups=["move_murano_plugin_on_env_from_controller"
120 120
                   "_to_murano_node", "deploy", "murano_plugin",
121 121
                   "post_installation", 'murano'])
122 122
     @log_snapshot_after_test
123
-    def move_murano_plugin_on_environment_from_controller_to_murano_node(self):
123
+    def move_murano_plugin_on_env_from_controller_to_murano_node(self):
124 124
         """Move Murano plugin on environment from controller to murano-node.
125 125
         Scenario:
126 126
             1. Revert snapshot with deployed non-ha cluster with Murano plugin
@@ -128,7 +128,7 @@ class TestMuranoPostInstallation(api.MuranoPluginApi):
128 128
             3. Deploy changes
129 129
             4. Run OSTF
130 130
         Duration 120m
131
-        Snapshot move_murano_plugin_on_environment_from_controller_to_murano_node
131
+        Snapshot move_murano_plugin_on_env_from_controller_to_murano_node
132 132
         """
133 133
 
134 134
         self.env.revert_snapshot("deploy_murano_plugin_on_controller")
@@ -138,4 +138,4 @@ class TestMuranoPostInstallation(api.MuranoPluginApi):
138 138
         })
139 139
 
140 140
         self.run_ostf(['sanity', 'smoke'])
141
-        self.check_plugin_online()
141
+        self.check_plugin_online()

+ 1
- 0
murano_plugin_tests/run_system_test.py View File

@@ -44,6 +44,7 @@ def import_tests():
44 44
     from murano_plugin import test_murano_maintenance_update  # noqa
45 45
     from murano_plugin import test_murano_plugin_bvt  # noqa
46 46
     from murano_plugin import test_murano_plugin_update  # noqa
47
+    from murano_plugin import test_murano_plugin_upgrade  # noqa
47 48
     from murano_plugin import test_post_install  # noqa
48 49
     from murano_plugin import test_system  # noqa
49 50
 

Loading…
Cancel
Save