Browse Source

Fixes for consistency

Hacking fixes about modules imports.
Fix fuel-qa branch naming.
Remove unneeded base class.

Change-Id: I136adc73b926ba0be4851f70053c72604ff0e687
Rodion Promyshlennikov 2 years ago
parent
commit
ae6cd29346

+ 0
- 80
murano_plugin_tests/base_test.py View File

@@ -1,80 +0,0 @@
1
-#    Copyright 2016 Mirantis, Inc.
2
-#
3
-#    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
6
-#
7
-#         http://www.apache.org/licenses/LICENSE-2.0
8
-#
9
-#    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.
14
-
15
-import abc
16
-
17
-from fuelweb_test.tests import base_test_case
18
-import six
19
-
20
-from murano_plugin_tests.helpers import checkers
21
-from murano_plugin_tests.helpers import helpers
22
-from murano_plugin_tests.helpers import remote_ops
23
-
24
-
25
-@six.add_metaclass(abc.ABCMeta)
26
-class PluginApi(object):
27
-    """Base class to manage StackLight plugins with Fuel."""
28
-
29
-    def __init__(self):
30
-        self.test = base_test_case.TestBasic()
31
-        self.env = self.test.env
32
-        self.settings = self.get_plugin_settings()
33
-        self.helpers = helpers.PluginHelper(self.env)
34
-        self.checkers = checkers
35
-        self.remote_ops = remote_ops
36
-
37
-    def __getattr__(self, item):
38
-        return getattr(self.test, item)
39
-
40
-    @property
41
-    def base_nodes(self):
42
-        """Return a dict mapping nodes to Fuel roles without HA."""
43
-        return {
44
-            'slave-01': ['controller'],
45
-            'slave-02': ['compute', 'cinder'],
46
-            'slave-03': self.settings.role_name,
47
-        }
48
-
49
-    @property
50
-    def full_ha_nodes(self):
51
-        """Return a dict mapping nodes to Fuel roles with HA."""
52
-        return {
53
-            'slave-01': ['controller'],
54
-            'slave-02': ['controller'],
55
-            'slave-03': ['controller'],
56
-            'slave-04': ['compute', 'cinder'],
57
-            'slave-05': ['compute', 'cinder'],
58
-            'slave-06': ['compute', 'cinder'],
59
-            'slave-07': self.settings.role_name,
60
-            'slave-08': self.settings.role_name,
61
-            'slave-09': self.settings.role_name,
62
-        }
63
-
64
-    @abc.abstractmethod
65
-    def get_plugin_settings(self):
66
-        """Return a dict with the default plugin's settings.
67
-        """
68
-        pass
69
-
70
-    @abc.abstractmethod
71
-    def prepare_plugin(self):
72
-        """Upload and install the plugin on the Fuel master node.
73
-        """
74
-        pass
75
-
76
-    @abc.abstractmethod
77
-    def activate_plugin(self):
78
-        """Enable and configure the plugin in the environment.
79
-        """
80
-        pass

+ 3
- 2
murano_plugin_tests/helpers/checkers.py View File

@@ -12,7 +12,7 @@
12 12
 #    License for the specific language governing permissions and limitations
13 13
 #    under the License.
14 14
 
15
-from contextlib import closing
15
+import contextlib
16 16
 import socket
17 17
 
18 18
 from proboscis import asserts
@@ -69,5 +69,6 @@ def check_port(address, port):
69 69
     :param port: server port
70 70
     :type port: str
71 71
     """
72
-    with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as sock:
72
+    with contextlib.closing(
73
+            socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as sock:
73 74
         return sock.connect_ex((address, port)) == 0

+ 2
- 0
murano_plugin_tests/helpers/helpers.py View File

@@ -181,6 +181,8 @@ class PluginHelper(object):
181 181
         :type name: str
182 182
         :param settings: optional dict containing the cluster's configuration.
183 183
         :type settings: dict
184
+        :param ssl: parameter, that shows, use SSL or not.
185
+        :type ssl: bool
184 186
         :returns: the cluster's id
185 187
         :rtype: str
186 188
         """

+ 40
- 6
murano_plugin_tests/murano_plugin/api.py View File

@@ -12,18 +12,50 @@
12 12
 #    License for the specific language governing permissions and limitations
13 13
 #    under the License.
14 14
 
15
-from murano_plugin_tests import base_test
15
+from fuelweb_test.tests import base_test_case
16
+
17
+from murano_plugin_tests.helpers import checkers
18
+from murano_plugin_tests.helpers import helpers
19
+from murano_plugin_tests.helpers import remote_ops
16 20
 from murano_plugin_tests.murano_plugin import plugin_settings
17 21
 
18 22
 
19
-class MuranoPluginApi(base_test.PluginApi):
20
-    def get_plugin_vip(self):
21
-        pass
23
+class MuranoPluginApi(object):
24
+    """Class to manage Murano Detach plugin."""
25
+
26
+    def __init__(self):
27
+        self.test = base_test_case.TestBasic()
28
+        self.env = self.test.env
29
+        self.settings = plugin_settings
30
+        self.helpers = helpers.PluginHelper(self.env)
31
+        self.checkers = checkers
32
+        self.remote_ops = remote_ops
33
+
34
+    def __getattr__(self, item):
35
+        return getattr(self.test, item)
36
+
37
+    @property
38
+    def base_nodes(self):
39
+        """Return a dict mapping nodes to Fuel roles without HA."""
40
+        return {
41
+            'slave-01': ['controller'],
42
+            'slave-02': ['compute', 'cinder'],
43
+            'slave-03': self.settings.role_name,
44
+        }
22 45
 
23
-    def get_plugin_settings(self):
24
-        return plugin_settings
46
+    @property
47
+    def ha_nodes(self):
48
+        """Return a dict mapping nodes to Fuel roles with HA."""
49
+        return {
50
+            'slave-01': ['controller'],
51
+            'slave-02': ['controller'],
52
+            'slave-03': ['controller'],
53
+            'slave-04': ['compute', 'cinder'],
54
+            'slave-05': ['compute'] + self.settings.role_name,
55
+        }
25 56
 
26 57
     def prepare_plugin(self):
58
+        """Upload and install the plugin on the Fuel master node."""
27 59
         self.helpers.prepare_plugin(self.settings.plugin_path)
28 60
 
29 61
     def run_ostf(self):
@@ -31,11 +63,13 @@ class MuranoPluginApi(base_test.PluginApi):
31 63
                                          'tests_platform'])
32 64
 
33 65
     def activate_plugin(self, options=None):
66
+        """Enable and configure the plugin in the environment."""
34 67
         if options is None:
35 68
             options = self.settings.default_options
36 69
         self.helpers.activate_plugin(
37 70
             self.settings.name, self.settings.version, options)
38 71
 
39 72
     def uninstall_plugin(self):
73
+        """Uninstall plugin from Fuel."""
40 74
         return self.helpers.uninstall_plugin(self.settings.name,
41 75
                                              self.settings.version)

+ 1
- 9
murano_plugin_tests/murano_plugin/plugin_settings.py View File

@@ -17,7 +17,7 @@ from murano_plugin_tests import settings
17 17
 
18 18
 
19 19
 name = 'detach-murano'
20
-role_name = 'murano-node'
20
+role_name = ['murano-node']
21 21
 plugin_path = settings.MURANO_PLUGIN_PATH
22 22
 version = helpers.get_plugin_version(plugin_path)
23 23
 
@@ -30,11 +30,3 @@ default_options = {
30 30
 }
31 31
 
32 32
 murano_options = default_options
33
-
34
-base_nodes = {
35
-    'slave-01': ['controller'],
36
-    'slave-02': ['controller'],
37
-    'slave-03': ['controller'],
38
-    'slave-04': ['compute', 'cinder'],
39
-    'slave-05': ['compute', role_name],
40
-}

+ 3
- 3
murano_plugin_tests/murano_plugin/test_murano_plugin_bvt.py View File

@@ -13,10 +13,10 @@
13 13
 #    under the License.
14 14
 
15 15
 from fuelweb_test.helpers.decorators import log_snapshot_after_test
16
-from murano_plugin_tests.murano_plugin import api
17
-from plugin_settings import base_nodes
18 16
 from proboscis import test
19 17
 
18
+from murano_plugin_tests.murano_plugin import api
19
+
20 20
 
21 21
 @test(groups=["plugins"])
22 22
 class TestMuranoPluginBvt(api.MuranoPluginApi):
@@ -50,7 +50,7 @@ class TestMuranoPluginBvt(api.MuranoPluginApi):
50 50
 
51 51
         self.activate_plugin()
52 52
 
53
-        self.helpers.deploy_cluster(base_nodes)
53
+        self.helpers.deploy_cluster(self.ha_nodes)
54 54
 
55 55
         self.run_ostf()
56 56
 

+ 14
- 0
murano_plugin_tests/settings.py View File

@@ -1,3 +1,17 @@
1
+#    Copyright 2016 Mirantis, Inc.
2
+#
3
+#    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
6
+#
7
+#         http://www.apache.org/licenses/LICENSE-2.0
8
+#
9
+#    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.
14
+
1 15
 import os
2 16
 
3 17
 from fuelweb_test.settings import *  # noqa

+ 5
- 2
openrc.default View File

@@ -9,6 +9,9 @@ export ADMIN_NODE_MEMORY=4096
9 9
 export ADMIN_NODE_CPU=2
10 10
 export SLAVE_NODE_MEMORY=6144
11 11
 
12
-# Locations for fuel-qa, MOS and plugins artefacts
13
-export FUELQA_GITREF=stable/9.0
12
+# Locations for fuel-qa, MOS and plugins artifacts
13
+export FUELQA_GITREF=stable/mitaka
14 14
 export ISO_PATH=$HOME/iso/MirantisOpenStack-9.0.iso
15
+
16
+# Location of the plugin
17
+export MURANO_PLUGIN_PATH=$HOME/plugins/detach-murano-1.0-1.0.0-1.noarch.rpm

+ 1
- 1
requirements.txt View File

@@ -1,4 +1,4 @@
1
-git+git://github.com/openstack/fuel-devops.git@2.9.20
1
+git+git://github.com/openstack/fuel-devops.git@2.9.21
2 2
 oslo.i18n>=3.1.0  # the more recent python-*client (dependencies of fuel-qa) require at least this version of oslo.i18n
3 3
 PyYAML
4 4
 requests

+ 1
- 1
utils/fuel-qa-builder/setup.py View File

@@ -11,7 +11,7 @@ def read(fname):
11 11
 def get_requirements_list(requirements):
12 12
     all_requirements = read(requirements)
13 13
     all_requirements = [req for req in all_requirements.splitlines()
14
-                        if 'devops' not in req and 'launchpadlib' not in req]
14
+                        if 'launchpadlib' not in req]
15 15
     return all_requirements
16 16
 
17 17
 

Loading…
Cancel
Save