Add more tests for Elasticsearch/Kibana plugin

Added uninstall tests
Added test with fuel-createmirror

Change-Id: Ia84360bc50b072b46f862b4e9fd4da37951552d9
This commit is contained in:
vgusev 2016-05-25 16:06:16 +03:00
parent f0c9161580
commit c8089f6193
7 changed files with 99 additions and 14 deletions

View File

@ -61,3 +61,11 @@ class ElasticsearchPluginApi(base_test.PluginApi):
msg = ("Expected count of elasticsearch nodes {}, "
"actual count {}".format(expected_count, nodes_count))
asserts.assert_equal(expected_count, nodes_count, msg)
def uninstall_plugin(self):
return self.helpers.uninstall_plugin(
self.settings.name, self.settings.version)
def check_uninstall_failure(self):
return self.helpers.check_plugin_cannot_be_uninstalled(
self.settings.name, self.settings.version)

View File

@ -20,14 +20,14 @@ from stacklight_tests.elasticsearch_kibana import api
@test(groups=["plugins"])
class TestElasticsearchPlugin(api.ElasticsearchPluginApi):
"""Class for smoke testing the Elasticsearch-Kibana plugin."""
"""Class for smoke testing the Elasticsearch/Kibana plugin."""
@test(depends_on_groups=['prepare_slaves_3'],
groups=["install_elasticsearch_kibana", "install",
"elasticsearch_kibana", "smoke"])
@log_snapshot_after_test
def install_elasticsearch_kibana(self):
"""Install Elasticsearch-Kibana plugin and check it exists
"""Install Elasticsearch/Kibana plugin and check it exists
Scenario:
1. Upload the Elasticsearch/Kibana plugin to the master node
@ -50,7 +50,7 @@ class TestElasticsearchPlugin(api.ElasticsearchPluginApi):
"elasticsearch_kibana", "smoke"])
@log_snapshot_after_test
def deploy_elasticsearch_kibana(self):
"""Deploy a cluster with the Elasticsearch-Kibana plugin
"""Deploy a cluster with the Elasticsearch/Kibana plugin
Scenario:
1. Upload the Elasticsearch/Kibana plugin to the master node
@ -88,7 +88,7 @@ class TestElasticsearchPlugin(api.ElasticsearchPluginApi):
"elasticsearch_kibana", "smoke"])
@log_snapshot_after_test
def deploy_ha_elasticsearch_kibana(self):
"""Deploy a cluster with the Elasticsearch-Kibana plugin in HA mode
"""Deploy a cluster with the Elasticsearch/Kibana plugin in HA mode
Scenario:
1. Upload the Elasticsearch/Kibana plugin to the master node
@ -120,3 +120,46 @@ class TestElasticsearchPlugin(api.ElasticsearchPluginApi):
self.helpers.run_ostf()
self.env.make_snapshot("deploy_ha_elasticsearch_kibana", is_make=True)
@test(depends_on_groups=["prepare_slaves_3"],
groups=["uninstall_elasticsearch_kibana", "uninstall",
"elasticsearch_kibana", "smoke"])
@log_snapshot_after_test
def uninstall_elasticsearch_kibana(self):
"""Uninstall the Elasticsearch/Kibana plugin
Scenario:
1. Install the plugin.
2. Remove the plugin.
Duration 5m
"""
self.env.revert_snapshot("ready_with_3_slaves")
self.prepare_plugin()
self.uninstall_plugin()
@test(depends_on=[deploy_elasticsearch_kibana],
groups=["uninstall_deployed_elasticsearch_kibana", "uninstall",
"elasticsearch_kibana", "smoke"])
@log_snapshot_after_test
def uninstall_deployed_elasticsearch_kibana(self):
"""Uninstall the Elasticsearch/Kibana plugin with a deployed
environment
Scenario:
1. Try to remove the plugin using the Fuel CLI
2. Check plugin can't be uninstalled on deployed cluster.
3. Remove the environment.
4. Remove the plugin.
Duration 20m
"""
self.env.revert_snapshot("deploy_elasticsearch_kibana")
self.check_uninstall_failure()
self.fuel_web.delete_env_wait(self.helpers.cluster_id)
self.uninstall_plugin()

View File

@ -117,7 +117,7 @@ class TestNodesElasticsearchPlugin(api.ElasticsearchPluginApi):
Scenario:
1. Revert the snapshot with 9 deployed nodes in HA configuration
2. Remove one Elasticsearch-Kibana node and redeploy the cluster
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
@ -153,3 +153,37 @@ class TestNodesElasticsearchPlugin(api.ElasticsearchPluginApi):
self.helpers.run_ostf()
self.env.make_snapshot("add_remove_elasticsearch_kibana_node")
@test(depends_on_groups=['prepare_slaves_3'],
groups=["elasticsearch_kibana_createmirror_deploy_plugin",
"system", "elasticsearch_kibana", "createmirror"])
@log_snapshot_after_test
def elasticsearch_kibana_createmirror_deploy_plugin(self):
"""Run fuel-createmirror and deploy environment
Scenario:
1. Copy the Elasticsearch/Kibana plugin to the Fuel Master node and
install the plugin.
2. Run the following command on the master node:
fuel-createmirror
3. Create an environment with enabled plugins in the
Fuel Web UI and deploy it.
4. Run OSTF.
Duration 60m
"""
self.env.revert_snapshot("ready_with_3_slaves")
self.prepare_plugin()
self.helpers.fuel_createmirror()
self.helpers.create_cluster(name=self.__class__.__name__)
self.activate_plugin()
self.helpers.deploy_cluster(self.base_nodes)
self.check_plugin_online()
self.helpers.run_ostf()

View File

@ -126,7 +126,7 @@ class TestInfluxdbPlugin(api.InfluxdbPluginApi):
"influxdb_grafana", "smoke"])
@log_snapshot_after_test
def uninstall_influxdb_grafana(self):
"""Uninstall the InfluxDB-Grafana plugin plugin
"""Uninstall the InfluxDB-Grafana plugin
Scenario:
1. Install the plugin.
@ -149,7 +149,7 @@ class TestInfluxdbPlugin(api.InfluxdbPluginApi):
environment
Scenario:
1. Try to remove the plugins using the Fuel CLI
1. Try to remove the plugin using the Fuel CLI
2. Check plugin can't be uninstalled on deployed cluster.
3. Remove the environment.
4. Remove the plugin.

View File

@ -96,7 +96,7 @@ class TestLMACollectorPlugin(api.LMACollectorPluginApi):
"""Uninstall the plugin with deployed environment
Scenario:
1. Try to remove the plugins using the Fuel CLI
1. Try to remove the plugin using the Fuel CLI
2. Check plugin can't be uninstalled on deployed cluster.
3. Remove the environment.
4. Remove the plugin.

View File

@ -53,7 +53,7 @@ class TestLMAInfraAlertingPlugin(api.InfraAlertingPluginApi):
"""Deploy a cluster with the LMA Infrastructure Alerting plugin
Scenario:
1. Upload the LMA Infrastructure Alering plugin to the master node
1. Upload the LMA Infrastructure Alerting plugin to the master node
2. Install the plugin
3. Create the cluster
4. Add 1 node with controller role
@ -101,7 +101,7 @@ class TestLMAInfraAlertingPlugin(api.InfraAlertingPluginApi):
configuration
Scenario:
1. Upload the LMA Infrastructure Alering plugin to the master node
1. Upload the LMA Infrastructure Alerting plugin to the master node
2. Install the plugin
3. Create the cluster
4. Add 3 nodes with controller role
@ -153,7 +153,7 @@ class TestLMAInfraAlertingPlugin(api.InfraAlertingPluginApi):
environment
Scenario:
1. Try to remove the plugins using the Fuel CLI
1. Try to remove the plugin using the Fuel CLI
2. Check plugin can't be uninstalled on deployed cluster.
3. Remove the environment.
4. Remove the plugin.

View File

@ -176,11 +176,11 @@ class TestLMAInfraAlertingPluginSystem(api.InfraAlertingPluginApi):
"""Run fuel-createmirror and deploy environment
Scenario:
1. Copy the plugins to the Fuel Master node and
install the plugins.
1. Copy the LMA Infrastructure Alerting plugin to the Fuel Master
node and install the plugin.
2. Run the following command on the master node:
fuel-createmirror
3. Create an environment with enabled plugins in the
3. Create an environment with enabled plugin in the
Fuel Web UI and deploy it.
4. Run OSTF.