Browse Source

Adding idempotency test

Change-Id: Ic2a5833d560ba7ca697c72c247dd95f4020130e8
Oleksii Zhurba 2 years ago
parent
commit
55794d9d95
1 changed files with 101 additions and 0 deletions
  1. 101
    0
      murano_plugin_tests/murano_plugin/test_murano_plugin_bvt.py

+ 101
- 0
murano_plugin_tests/murano_plugin/test_murano_plugin_bvt.py View File

@@ -245,3 +245,104 @@ class TestMuranoPluginBvt(api.MuranoPluginApi):
245 245
         self.prepare_plugin()
246 246
 
247 247
         self.uninstall_plugin()
248
+
249
+    @test(depends_on_groups=["deploy_murano_plugin_on_controller"],
250
+          groups=["check_plugin_idempotency_on_controller", "deploy",
251
+                  "murano", "idempotency"])
252
+    @log_snapshot_after_test
253
+    def check_plugin_idempotency_on_controller(self):
254
+        """Rerun puppet apply on controller and check plugin idempotency.
255
+
256
+        Scenario:
257
+            1. Revert snapshot with deployed cluster (controller + compute)
258
+            2. Run puppet apply for controller
259
+
260
+        Duration 10m
261
+        """
262
+
263
+        self.env.revert_snapshot("deploy_murano_plugin_on_controller")
264
+
265
+        plugin_path = '/etc/fuel/plugins/detach-murano-1.0/'
266
+        modules_path = plugin_path + 'modules:/etc/puppet/modules/'
267
+        plugin_manifest_path = plugin_path + 'manifests/'
268
+
269
+        cluster_id = self.fuel_web.get_last_created_cluster()
270
+        attr = self.fuel_web.client.get_cluster_attributes(cluster_id)
271
+        cfapi = attr['editable']['detach-murano']['metadata']['versions'][0]['murano_cfapi']
272
+
273
+        contr_node = self.fuel_web.get_nailgun_node_by_name('slave-01')
274
+
275
+        list_controller_manifests = ['murano_hiera_override.pp',
276
+                                     'pin_murano_plugin_repo.pp',
277
+                                     'murano.pp',
278
+                                     'murano_rabbitmq.pp',
279
+                                     'murano_keystone.pp',
280
+                                     'murano_db.pp',
281
+                                     'murano_dashboard.pp'
282
+                                     'import_murano_package.pp',
283
+                                     'murano_logging.pp',
284
+                                     'update_openrc.pp',
285
+                                     'murano_haproxy.pp']
286
+        if cfapi['value']:
287
+            list_controller_manifests.insert(4, 'murano_cfapi.pp')
288
+
289
+        for manifest in list_controller_manifests:
290
+            cmd = 'puppet apply --modulepath={0} {1} {2}'.format(
291
+                modules_path, plugin_manifest_path + manifest, '-d --test')
292
+            self.ssh_manager.check_call(ip=contr_node['ip'],
293
+                                        command=cmd,
294
+                                        expected=[0])
295
+
296
+    @test(depends_on_groups=["deploy_murano_plugin"],
297
+          groups=["check_plugin_idempotency_on_murano_node", "deploy",
298
+                  "murano", "idempotency"])
299
+    @log_snapshot_after_test
300
+    def check_plugin_idempotency_on_murano_node(self):
301
+            """Rerun puppet apply on murano node and check plugin idempotency.
302
+
303
+            Scenario:
304
+                1. Revert snapshot with deployed cluster
305
+                2. Run puppet apply for murano node
306
+
307
+            Duration 10m
308
+            """
309
+
310
+            self.env.revert_snapshot("deploy_murano_plugin")
311
+
312
+            plugin_path = '/etc/fuel/plugins/detach-murano-1.0/'
313
+            modules_path = plugin_path + 'modules:/etc/puppet/modules/'
314
+            plugin_manifest_path = plugin_path + 'manifests/'
315
+            ssl_path = '/etc/puppet/modules/osnailyfacter/modular/ssl/'
316
+
317
+            cluster_id = self.fuel_web.get_last_created_cluster()
318
+            attr = self.fuel_web.client.get_cluster_attributes(cluster_id)
319
+            cfapi = attr['editable']['detach-murano']['metadata']['versions'][0]['murano_cfapi']
320
+
321
+            murano_node = self.fuel_web.get_nailgun_node_by_name('slave-03')
322
+
323
+            list_murano_manifests = ['murano_hiera_override.pp',
324
+                                     'pin_murano_plugin_repo.pp',
325
+                                     'murano.pp',
326
+                                     'murano_rabbitmq.pp',
327
+                                     'import_murano_package.pp',
328
+                                     'murano_logging.pp']
329
+            if cfapi['value']:
330
+                list_murano_manifests.insert(4, 'murano_cfapi.pp')
331
+
332
+            list_ssl_manifests = ['ssl_keys_saving.pp',
333
+                                  'ssl_add_trust_chain.pp',
334
+                                  'ssl_dns_setup.pp']
335
+
336
+            for manifest in list_murano_manifests:
337
+                cmd = 'puppet apply --modulepath={0} {1} {2}'.format(
338
+                    modules_path, plugin_manifest_path + manifest, '-d --test')
339
+                self.ssh_manager.check_call(ip=murano_node['ip'],
340
+                                            command=cmd,
341
+                                            expected=[0])
342
+
343
+            for manifest in list_ssl_manifests:
344
+                cmd = 'puppet apply --modulepath={0} {1} {2}'.format(
345
+                    modules_path, ssl_path + manifest, '-d --test')
346
+                self.ssh_manager.check_call(ip=murano_node['ip'],
347
+                                            command=cmd,
348
+                                            expected=[0])

Loading…
Cancel
Save