From 7284097079aa664a3bbfecab80a091df1bc1fe04 Mon Sep 17 00:00:00 2001 From: Simon Pasquier Date: Tue, 17 May 2016 13:52:27 +0200 Subject: [PATCH] Homogenize Elasticsearch/Kibana test cases Change-Id: Ib60e4656fb04690162e5cdd7030a1a0a3441b17b --- .../elasticsearch_kibana/test_smoke_bvt.py | 51 +++++------ .../elasticsearch_kibana/test_system.py | 88 +++++++++---------- 2 files changed, 64 insertions(+), 75 deletions(-) diff --git a/stacklight_tests/elasticsearch_kibana/test_smoke_bvt.py b/stacklight_tests/elasticsearch_kibana/test_smoke_bvt.py index 50f51db..aa736c8 100644 --- a/stacklight_tests/elasticsearch_kibana/test_smoke_bvt.py +++ b/stacklight_tests/elasticsearch_kibana/test_smoke_bvt.py @@ -13,7 +13,6 @@ # under the License. from fuelweb_test.helpers.decorators import log_snapshot_after_test -from fuelweb_test.tests import base_test_case from proboscis import test from stacklight_tests.elasticsearch_kibana import api @@ -23,18 +22,18 @@ from stacklight_tests.elasticsearch_kibana import api class TestElasticsearchPlugin(api.ElasticsearchPluginApi): """Class for smoke testing the Elasticsearch-Kibana plugin.""" - @test(depends_on=[base_test_case.SetupEnvironment.prepare_slaves_3], + @test(depends_on_groups=['prepare_slaves_3'], groups=["install_elasticsearch_kibana", "install", "elasticsearch_kibana", "smoke"]) @log_snapshot_after_test - def install_elasticsearch_kibana_plugin(self): + def install_elasticsearch_kibana(self): """Install Elasticsearch-Kibana plugin and check it exists Scenario: - 1. Upload plugin to the master node - 2. Install plugin - 3. Create cluster - 4. Check that plugin exists + 1. Upload the Elasticsearch/Kibana plugin to the master node + 2. Install the plugin + 3. Create a cluster + 4. Check that the plugin can be enabled Duration 20m """ @@ -46,28 +45,28 @@ class TestElasticsearchPlugin(api.ElasticsearchPluginApi): self.activate_plugin() - @test(depends_on=[base_test_case.SetupEnvironment.prepare_slaves_3], + @test(depends_on_groups=['prepare_slaves_3'], groups=["deploy_elasticsearch_kibana", "deploy", "elasticsearch_kibana", "smoke"]) @log_snapshot_after_test - def deploy_elasticsearch_kibana_plugin(self): + def deploy_elasticsearch_kibana(self): """Deploy a cluster with the Elasticsearch-Kibana plugin Scenario: - 1. Upload plugin to the master node - 2. Install plugin - 3. Create cluster + 1. Upload the Elasticsearch/Kibana plugin to the master node + 2. Install the plugin + 3. Create the cluster 4. Add 1 node with controller role 5. Add 1 node with compute and cinder roles 6. Add 1 node with elasticsearch_kibana role 7. Deploy the cluster - 8. Check that plugin is working + 8. Check that Elasticsearch/Kibana are running 9. Run OSTF Duration 60m - Snapshot deploy_elasticsearch_kibana_plugin + Snapshot deploy_elasticsearch_kibana """ - self.check_run("deploy_elasticsearch_kibana_plugin") + self.check_run("deploy_elasticsearch_kibana") self.env.revert_snapshot("ready_with_3_slaves") self.prepare_plugin() @@ -82,31 +81,30 @@ class TestElasticsearchPlugin(api.ElasticsearchPluginApi): self.helpers.run_ostf() - self.env.make_snapshot("deploy_elasticsearch_kibana_plugin", - is_make=True) + self.env.make_snapshot("deploy_elasticsearch_kibana", is_make=True) - @test(depends_on=[base_test_case.SetupEnvironment.prepare_slaves_9], + @test(depends_on_groups=['prepare_slaves_9'], groups=["deploy_ha_elasticsearch_kibana", "deploy", "deploy_ha" "elasticsearch_kibana", "smoke"]) @log_snapshot_after_test - def deploy_ha_elasticsearch_kibana_plugin(self): + def deploy_ha_elasticsearch_kibana(self): """Deploy a cluster with the Elasticsearch-Kibana plugin in HA mode Scenario: - 1. Upload plugin to the master node - 2. Install plugin - 3. Create cluster + 1. Upload the Elasticsearch/Kibana plugin to the master node + 2. Install the plugin + 3. Create the cluster 4. Add 3 nodes with controller role 5. Add 3 nodes with compute and cinder roles 6. Add 3 nodes with elasticsearch_kibana role 7. Deploy the cluster - 8. Check that plugin is working + 8. Check that Elasticsearch/Kibana are running 9. Run OSTF Duration 120m - Snapshot deploy_ha_elasticsearch_kibana_plugin + Snapshot deploy_ha_elasticsearch_kibana """ - self.check_run("deploy_ha_elasticsearch_kibana_plugin") + self.check_run("deploy_ha_elasticsearch_kibana") self.env.revert_snapshot("ready_with_9_slaves") self.prepare_plugin() @@ -121,5 +119,4 @@ class TestElasticsearchPlugin(api.ElasticsearchPluginApi): self.helpers.run_ostf() - self.env.make_snapshot("deploy_ha_elasticsearch_kibana_plugin", - is_make=True) + self.env.make_snapshot("deploy_ha_elasticsearch_kibana", is_make=True) diff --git a/stacklight_tests/elasticsearch_kibana/test_system.py b/stacklight_tests/elasticsearch_kibana/test_system.py index 7398d01..27afe50 100644 --- a/stacklight_tests/elasticsearch_kibana/test_system.py +++ b/stacklight_tests/elasticsearch_kibana/test_system.py @@ -20,129 +20,122 @@ from stacklight_tests.elasticsearch_kibana import api @test(groups=["plugins"]) -class TestNodesElasticsearshPlugin(api.ElasticsearchPluginApi): +class TestNodesElasticsearchPlugin(api.ElasticsearchPluginApi): """Class for system tests for Elasticsearch-Kibana plugin.""" - @test(depends_on_groups=['deploy_ha_elasticsearch_kibana_plugin'], + @test(depends_on_groups=['deploy_ha_elasticsearch_kibana'], groups=["check_scaling_elasticsearch_kibana", "scaling", "elasticsearch_kibana", "system", - "add_remove_controller_elasticsearch_kibana_plugin"]) + "add_remove_controller_elasticsearch_kibana"]) @log_snapshot_after_test - def add_remove_controller_elasticsearch_kibana_plugin(self): + def add_remove_controller_elasticsearch_kibana(self): """Verify that the number of controllers 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 + 2. Remove one controller node and redeploy the cluster + 3. Check that Elasticsearch/Kibana are running 4. Run OSTF 5. Add one controller node (return previous state) and - update the cluster - 6. Check that plugin is working + redeploy the cluster + 6. Check that Elasticsearch/Kibana are running 7. Run OSTF Duration 120m + Snapshot add_remove_controller_elasticsearch_kibana """ - self.env.revert_snapshot("deploy_ha_elasticsearch_kibana_plugin") + self.env.revert_snapshot("deploy_ha_elasticsearch_kibana") target_node = {'slave-03': ['controller']} - # NOTE(vgusev): We set "check_services=False" and - # "should_fail=1" parameters in deploy_cluster_wait and run_ostf - # methods because after removing one node - # nova has been keeping it in service list - - # Remove controller + # Remove a controller self.helpers.remove_node_from_cluster(target_node) self.check_plugin_online() + # After removing a controller, one OSTF test should fail self.helpers.run_ostf(should_fail=1) - # Add controller + # Add a controller self.helpers.add_node_to_cluster(target_node) self.check_plugin_online() self.helpers.run_ostf(should_fail=1) - self.env.make_snapshot( - "add_remove_controller_elasticsearch_kibana_plugin") + self.env.make_snapshot("add_remove_controller_elasticsearch_kibana") - @test(depends_on_groups=['deploy_ha_elasticsearch_kibana_plugin'], + @test(depends_on_groups=['deploy_ha_elasticsearch_kibana'], groups=["check_scaling_elasticsearch_kibana", "scaling", "elasticsearch_kibana", "system", - "add_remove_compute_elasticsearch_kibana_plugin"]) + "add_remove_compute_elasticsearch_kibana"]) @log_snapshot_after_test - def add_remove_compute_elasticsearch_kibana_plugin(self): + def add_remove_compute_elasticsearch_kibana(self): """Verify that the number of computes can scale up and down Scenario: 1. Revert snapshot with 9 deployed nodes in HA configuration - 2. Remove one compute node and update the cluster - 3. Check that plugin is working + 2. Remove one compute node and redeploy the cluster + 3. Check that Elasticsearch/Kibana are running 4. Run OSTF 5. Add one compute node (return previous state) and - update the cluster - 6. Check that plugin is working + redeploy the cluster + 6. Check that Elasticsearch/Kibana are running 7. Run OSTF Duration 120m + Snapshot add_remove_compute_elasticsearch_kibana """ - self.env.revert_snapshot("deploy_ha_elasticsearch_kibana_plugin") + self.env.revert_snapshot("deploy_ha_elasticsearch_kibana") target_node = {'slave-04': ['compute', 'cinder']} - # NOTE(vgusev): We set "check_services=False" and - # "should_fail=1" parameters in deploy_cluster_wait and run_ostf - # methods because after removing one node - # nova has been keeping it in service list - - # Remove compute + # Remove a compute node self.helpers.remove_node_from_cluster(target_node) self.check_plugin_online() + # After removing a controller, one OSTF test should fail self.helpers.run_ostf(should_fail=1) - # Add compute + # Add a compute node self.helpers.add_node_to_cluster(target_node) self.check_plugin_online() self.helpers.run_ostf(should_fail=1) - self.env.make_snapshot( - "add_remove_compute_elasticsearch_kibana_plugin") + self.env.make_snapshot("add_remove_compute_elasticsearch_kibana") - @test(depends_on_groups=['deploy_ha_elasticsearch_kibana_plugin'], + @test(depends_on_groups=['deploy_ha_elasticsearch_kibana'], groups=["check_scaling_elasticsearch_kibana", "scaling", "elasticsearch_kibana", "system", - "add_remove_node_with_elasticsearch_kibana_plugin"]) + "add_remove_elasticsearch_kibana_node"]) @log_snapshot_after_test - def add_remove_node_with_elasticsearch_kibana_plugin(self): + def add_remove_elasticsearch_kibana_node(self): """Verify that the number of Elasticsearch-Kibana nodes can scale up and down Scenario: - 1. Revert snapshot with 9 deployed nodes in HA configuration - 2. Remove one Elasticsearch-Kibana node and update the cluster - 3. Check that plugin is working + 1. Revert the snapshot with 9 deployed nodes in HA configuration + 2. Remove one Elasticsearch-Kibana node and redeploy the cluster + 3. Check that Elasticsearch/Kibana are running 4. Run OSTF 5. Add one Elasticsearch-Kibana node (return previous state) and - update the cluster - 6. Check that plugin is working + redeploy the cluster + 6. Check that Elasticsearch/Kibana are running 7. Run OSTF Duration 120m + Snapshot add_remove_elasticsearch_kibana_node """ - self.env.revert_snapshot("deploy_ha_elasticsearch_kibana_plugin") + self.env.revert_snapshot("deploy_ha_elasticsearch_kibana") self.check_elasticsearch_nodes_count(3) target_node = {'slave-07': self.settings.role_name} - # Remove Elasticsearch-Kibana node + # Remove an Elasticsearch-Kibana node self.helpers.remove_node_from_cluster(target_node) self.check_plugin_online() @@ -151,7 +144,7 @@ class TestNodesElasticsearshPlugin(api.ElasticsearchPluginApi): self.fuel_web.run_ostf() - # Add Elasticsearch-Kibana node + # Add an Elasticsearch-Kibana node self.helpers.add_node_to_cluster(target_node) self.check_plugin_online() @@ -160,5 +153,4 @@ class TestNodesElasticsearshPlugin(api.ElasticsearchPluginApi): self.helpers.run_ostf() - self.env.make_snapshot( - "add_remove_node_with_elasticsearch_kibana_plugin") + self.env.make_snapshot("add_remove_elasticsearch_kibana_node")