Rewrite check_nodes_count method
When InfluxDB node is removed from cluster it doesn't removed from InfluxDB database. It causes failure of test with scaling of plugin cluster. Rewrited check_nodes_count method to avoid this situation. Also changed the call of run_ostf method where it needed Change-Id: I0fe107e3e3b351527ff501c24763b12d36d89e01
This commit is contained in:
parent
349346069d
commit
6469a44d0c
@ -134,7 +134,7 @@ class TestNodesElasticsearchPlugin(api.ElasticsearchPluginApi):
|
||||
|
||||
self.check_elasticsearch_nodes_count(2)
|
||||
|
||||
self.fuel_web.run_ostf()
|
||||
self.helpers.run_ostf()
|
||||
|
||||
# Add an Elasticsearch-Kibana node
|
||||
self.helpers.add_nodes_to_cluster(target_node)
|
||||
|
@ -144,7 +144,7 @@ class TestNodesInfluxdbPlugin(api.InfluxdbPluginApi):
|
||||
# but it'll be fixed in next releases
|
||||
self.check_influxdb_nodes_count(2)
|
||||
|
||||
self.fuel_web.run_ostf()
|
||||
self.helpers.run_ostf()
|
||||
|
||||
# Add InfluxDB-Grafana node
|
||||
self.helpers.add_nodes_to_cluster(manipulated_node)
|
||||
|
@ -102,17 +102,21 @@ class ToolchainApi(object):
|
||||
plugin.get_plugin_settings().name))
|
||||
plugin.check_plugin_online()
|
||||
|
||||
def check_nodes_count(self, count, hostname, state):
|
||||
def check_nodes_count(self, count, hostname, state, ignored_plugins=()):
|
||||
"""Check that all nodes are present in the different backends."""
|
||||
self.call_plugin_method(
|
||||
self.ELASTICSEARCH_KIBANA,
|
||||
lambda x: x.check_elasticsearch_nodes_count(count))
|
||||
self.call_plugin_method(
|
||||
self.INFLUXDB_GRAFANA,
|
||||
lambda x: x.check_influxdb_nodes_count(count))
|
||||
self.call_plugin_method(
|
||||
self.LMA_INFRASTRUCTURE_ALERTING,
|
||||
lambda x: x.check_node_in_nagios(hostname, state))
|
||||
check_nodes_methods = {
|
||||
self.ELASTICSEARCH_KIBANA:
|
||||
lambda x: x.check_elasticsearch_nodes_count(count),
|
||||
self.INFLUXDB_GRAFANA:
|
||||
lambda x: x.check_influxdb_nodes_count(count),
|
||||
self.LMA_INFRASTRUCTURE_ALERTING:
|
||||
lambda x: x.check_node_in_nagios(hostname, state)
|
||||
}
|
||||
for plugin, method in check_nodes_methods.items():
|
||||
if plugin not in ignored_plugins:
|
||||
logger.info("Check node count for {} plugin".format(
|
||||
plugin.settings.name))
|
||||
self.call_plugin_method(plugin, method)
|
||||
|
||||
def uninstall_plugins(self):
|
||||
"""Uninstall the plugins from the environment."""
|
||||
|
@ -130,9 +130,12 @@ class TestNodesToolchain(api.ToolchainApi):
|
||||
|
||||
self.check_plugins_online()
|
||||
|
||||
self.check_nodes_count(2, manipulated_node_hostname, False)
|
||||
# NOTE(vgusev): Do not check influxdb node count because node is not
|
||||
# removed from database and the number 3 is always returned
|
||||
self.check_nodes_count(2, manipulated_node_hostname, False,
|
||||
ignored_plugins=[self.INFLUXDB_GRAFANA])
|
||||
|
||||
self.fuel_web.run_ostf()
|
||||
self.helpers.run_ostf()
|
||||
|
||||
# Add node with StackLight roles
|
||||
self.helpers.add_nodes_to_cluster(manipulated_node)
|
||||
|
Loading…
x
Reference in New Issue
Block a user