blob: 9fd7a176df8538a82ce5a93ac674aeafd84a3a96 [file] [log] [blame]
Yaroslav Lobankov18544b02014-04-24 20:17:49 +04001# Copyright (c) 2014 Mirantis Inc.
Sergey Lukjanovdad26cc2014-02-06 19:58:31 +04002#
Yaroslav Lobankov18544b02014-04-24 20:17:49 +04003# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
Sergey Lukjanovdad26cc2014-02-06 19:58:31 +04006#
Yaroslav Lobankov18544b02014-04-24 20:17:49 +04007# http://www.apache.org/licenses/LICENSE-2.0
Sergey Lukjanovdad26cc2014-02-06 19:58:31 +04008#
Yaroslav Lobankov18544b02014-04-24 20:17:49 +04009# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
Sergey Lukjanovdad26cc2014-02-06 19:58:31 +040014
15from tempest.api.data_processing import base as dp_base
Matthew Treinish5c660ab2014-05-18 21:14:36 -040016from tempest import test
Sergey Lukjanovdad26cc2014-02-06 19:58:31 +040017
18
19class PluginsTest(dp_base.BaseDataProcessingTest):
20 def _list_all_plugin_names(self):
21 """Returns all enabled plugin names.
22
Yaroslav Lobankov2f8525e2014-07-21 16:40:23 +040023 It ensures main plugins availability.
Sergey Lukjanovdad26cc2014-02-06 19:58:31 +040024 """
Yaroslav Lobankov2f8525e2014-07-21 16:40:23 +040025 _, plugins = self.client.list_plugins()
Yaroslav Lobankov89c639f2014-04-24 19:36:05 +040026 plugins_names = [plugin['name'] for plugin in plugins]
Sergey Lukjanovdad26cc2014-02-06 19:58:31 +040027 self.assertIn('vanilla', plugins_names)
28 self.assertIn('hdp', plugins_names)
29
30 return plugins_names
31
Matthew Treinish5c660ab2014-05-18 21:14:36 -040032 @test.attr(type='smoke')
Sergey Lukjanovdad26cc2014-02-06 19:58:31 +040033 def test_plugin_list(self):
34 self._list_all_plugin_names()
35
Matthew Treinish5c660ab2014-05-18 21:14:36 -040036 @test.attr(type='smoke')
Sergey Lukjanovdad26cc2014-02-06 19:58:31 +040037 def test_plugin_get(self):
38 for plugin_name in self._list_all_plugin_names():
Yaroslav Lobankov2f8525e2014-07-21 16:40:23 +040039 _, plugin = self.client.get_plugin(plugin_name)
Sergey Lukjanovdad26cc2014-02-06 19:58:31 +040040 self.assertEqual(plugin_name, plugin['name'])
41
42 for plugin_version in plugin['versions']:
Yaroslav Lobankov2f8525e2014-07-21 16:40:23 +040043 _, detailed_plugin = self.client.get_plugin(plugin_name,
44 plugin_version)
Sergey Lukjanovdad26cc2014-02-06 19:58:31 +040045 self.assertEqual(plugin_name, detailed_plugin['name'])
46
47 # check that required image tags contains name and version
48 image_tags = detailed_plugin['required_image_tags']
49 self.assertIn(plugin_name, image_tags)
50 self.assertIn(plugin_version, image_tags)