Add test to check lma collector plugin install.

Change-Id: Ie754a615836c867cfa4a1286f258504881057fb5
This commit is contained in:
Rodion Promyshlennikov 2016-05-06 11:43:29 +03:00
parent 0ef4188eab
commit f54f1580cc
6 changed files with 123 additions and 5 deletions

View File

@ -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

View File

@ -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',
}

View File

@ -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()

View File

@ -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():

View File

@ -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

View File

@ -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
))