diff --git a/stacklight_tests/lma_collector/api.py b/stacklight_tests/lma_collector/api.py new file mode 100644 index 0000000..7bcfa44 --- /dev/null +++ b/stacklight_tests/lma_collector/api.py @@ -0,0 +1,34 @@ +# Copyright 2016 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from stacklight_tests import base_test +from stacklight_tests.lma_collector import plugin_settings + + +class LMACollectorPluginApi(base_test.PluginApi): + def get_plugin_settings(self): + return plugin_settings + + def prepare_plugin(self): + self.helpers.prepare_plugin(self.settings.plugin_path) + + def activate_plugin(self): + self.helpers.activate_plugin( + self.settings.name, self.settings.version, self.settings.options) + + def get_plugin_vip(self): + pass + + def check_plugin_online(self): + pass diff --git a/stacklight_tests/lma_collector/plugin_settings.py b/stacklight_tests/lma_collector/plugin_settings.py new file mode 100644 index 0000000..d4ad252 --- /dev/null +++ b/stacklight_tests/lma_collector/plugin_settings.py @@ -0,0 +1,29 @@ +# Copyright 2016 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from stacklight_tests import settings + + +name = 'lma_collector' +version = '0.9.0' +role_name = [] # NOTE(rpromyshlennikov): there is no role name +# because lma collector is installed on all nodes in cluster +plugin_path = settings.LMA_COLLECTOR_PLUGIN_PATH + +options = { + 'environment_label/value': 'deploy_lma_toolchain', + 'elasticsearch_mode/value': 'local', + 'influxdb_mode/value': 'local', + 'alerting_mode/value': 'local', +} diff --git a/stacklight_tests/lma_collector/test_smoke_bvt.py b/stacklight_tests/lma_collector/test_smoke_bvt.py new file mode 100644 index 0000000..979e28f --- /dev/null +++ b/stacklight_tests/lma_collector/test_smoke_bvt.py @@ -0,0 +1,47 @@ +# Copyright 2016 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# 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.lma_collector import api + + +@test(groups=["plugins"]) +class TestInfluxdbPlugin(api.LMACollectorPluginApi): + """Class for smoke testing the LMA Collector plugin.""" + + @test(depends_on=[base_test_case.SetupEnvironment.prepare_slaves_3], + groups=["install_lma_collector", "install", + "lma_collector", "smoke"]) + @log_snapshot_after_test + def install_lma_collector_plugin(self): + """Install LMA Collector plugin and check it exists + + Scenario: + 1. Upload plugin to the master node + 2. Install plugin + 3. Create cluster + 4. Check that plugin exists + + Duration 20m + """ + self.env.revert_snapshot("ready_with_3_slaves") + + self.prepare_plugin() + + self.create_cluster() + + self.activate_plugin() diff --git a/stacklight_tests/run_tests.py b/stacklight_tests/run_tests.py index 1796929..11c0d31 100644 --- a/stacklight_tests/run_tests.py +++ b/stacklight_tests/run_tests.py @@ -44,6 +44,7 @@ def import_tests(): from stacklight_tests.influxdb_grafana import test_destructive # noqa from stacklight_tests.influxdb_grafana import test_smoke_bvt # noqa from stacklight_tests.influxdb_grafana import test_system # noqa + from stacklight_tests.lma_collector import test_smoke_bvt # noqa def run_tests(): diff --git a/stacklight_tests/toolchain/base_test.py b/stacklight_tests/toolchain/base_test.py index 970e882..0c424cd 100644 --- a/stacklight_tests/toolchain/base_test.py +++ b/stacklight_tests/toolchain/base_test.py @@ -14,12 +14,14 @@ from stacklight_tests import base_test from stacklight_tests.influxdb_grafana import api as influx_grafana_api +from stacklight_tests.lma_collector import api as lma_collector_api -class Collector(base_test.PluginApi): +class ToolchainApi(base_test.PluginApi): def __init__(self): - super(Collector, self).__init__() - self.plugins = [influx_grafana_api.InfluxdbPluginApi()] + super(ToolchainApi, self).__init__() + self.plugins = [influx_grafana_api.InfluxdbPluginApi(), + lma_collector_api.LMACollectorPluginApi()] def get_plugin_settings(self): pass diff --git a/stacklight_tests/toolchain/plugin_settings.py b/stacklight_tests/toolchain/plugin_settings.py index e4b0c5b..1583210 100644 --- a/stacklight_tests/toolchain/plugin_settings.py +++ b/stacklight_tests/toolchain/plugin_settings.py @@ -14,8 +14,13 @@ from stacklight_tests.influxdb_grafana import ( plugin_settings as influxdb_grafana_settings) +from stacklight_tests.lma_collector import ( + plugin_settings as lma_collector_settings) name = 'toolchain' version = '0.9.0' -# NOTE(rpromyshlennikov): use list(set(plugin1.role_name + plugin2.role_name)) -role_name = influxdb_grafana_settings.role_name + +role_name = list(set( + influxdb_grafana_settings.role_name + + lma_collector_settings.role_name +))