From 12334e7031b4f61dce80d51da29ed6eeef39b212 Mon Sep 17 00:00:00 2001 From: Swann Croiset Date: Fri, 20 Jan 2017 13:25:54 +0100 Subject: [PATCH] Skip node count test when using InfluxDB 1.1 Change-Id: Ide10fe7cff611b65a801d221564f110481ab687d --- stacklight_tests/influxdb_grafana/api.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/stacklight_tests/influxdb_grafana/api.py b/stacklight_tests/influxdb_grafana/api.py index 642694c..96f9f07 100644 --- a/stacklight_tests/influxdb_grafana/api.py +++ b/stacklight_tests/influxdb_grafana/api.py @@ -133,19 +133,21 @@ class InfluxdbPluginApi(base_test.PluginApi): auth=(plugin_settings.grafana_user, 'rogue'), expected_code=401) def check_influxdb_nodes_count(self, count=1): - # TODO(all): this is broken with InfluxDB 1.1 - logger.debug('Check the number of InfluxDB servers') - response = self.do_influxdb_query( - "show servers", - user=self.settings.influxdb_rootuser, - password=self.settings.influxdb_rootpass) + # This test is only executed for plugins 0.x, because + # cluster has been removed with plugin 1.0 (InfluxDB 1.1) + if self.settings.version.startswith("0."): + logger.debug('Check the number of InfluxDB servers') + response = self.do_influxdb_query( + "show servers", + user=self.settings.influxdb_rootuser, + password=self.settings.influxdb_rootpass) - nodes_count_responsed = len( - response.json()["results"][0]["series"][0]["values"]) + nodes_count_responsed = len( + response.json()["results"][0]["series"][0]["values"]) - msg = "Expected {0} InfluxDB nodes, got {1}".format( - count, nodes_count_responsed) - asserts.assert_equal(count, nodes_count_responsed, msg) + msg = "Expected {0} InfluxDB nodes, got {1}".format( + count, nodes_count_responsed) + asserts.assert_equal(count, nodes_count_responsed, msg) def uninstall_plugin(self): return self.helpers.uninstall_plugin(self.settings.name,