blob: c6832a287f3c75e0fcea1caf86f918808996537e [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
23 It ensures response status and main plugins availability.
24 """
25 resp, plugins = self.client.list_plugins()
26
27 self.assertEqual(200, resp.status)
28
29 plugins_names = list([plugin['name'] for plugin in plugins])
30 self.assertIn('vanilla', plugins_names)
31 self.assertIn('hdp', plugins_names)
32
33 return plugins_names
34
Matthew Treinish5c660ab2014-05-18 21:14:36 -040035 @test.attr(type='smoke')
Sergey Lukjanovdad26cc2014-02-06 19:58:31 +040036 def test_plugin_list(self):
37 self._list_all_plugin_names()
38
Matthew Treinish5c660ab2014-05-18 21:14:36 -040039 @test.attr(type='smoke')
Sergey Lukjanovdad26cc2014-02-06 19:58:31 +040040 def test_plugin_get(self):
41 for plugin_name in self._list_all_plugin_names():
42 resp, plugin = self.client.get_plugin(plugin_name)
43
44 self.assertEqual(200, resp.status)
45 self.assertEqual(plugin_name, plugin['name'])
46
47 for plugin_version in plugin['versions']:
48 resp, detailed_plugin = self.client.get_plugin(plugin_name,
49 plugin_version)
50
51 self.assertEqual(200, resp.status)
52 self.assertEqual(plugin_name, detailed_plugin['name'])
53
54 # check that required image tags contains name and version
55 image_tags = detailed_plugin['required_image_tags']
56 self.assertIn(plugin_name, image_tags)
57 self.assertIn(plugin_version, image_tags)