Browse Source

Add retry to check_plugin_online

Add retry decorator to cope with race-condition and overly optimistic
tests timeouts for environment deletion. Also replace tests_platform
with check_plugin_online ostf
Add lightweight sanity check function 'check_plugin_sanity' to use it
with failover tests to determine that nodes with murano come back from
reboots.

Change-Id: I6dfd40820cea74c45d33c57672ba555d0fa04372
Closes-Bug: #1630594
Kirill Zaitsev 2 years ago
parent
commit
c6516412d5

+ 16
- 3
murano_plugin_tests/murano_plugin/api.py View File

@@ -15,6 +15,7 @@
15 15
 import functools
16 16
 
17 17
 from devops.helpers import helpers as devops_helpers
18
+from fuelweb_test.helpers.decorators import retry
18 19
 from fuelweb_test import logger
19 20
 from fuelweb_test.tests import base_test_case
20 21
 
@@ -105,8 +106,9 @@ class MuranoPluginApi(object):
105 106
         self.helpers.activate_plugin(
106 107
             self.settings.name, self.settings.version, options)
107 108
 
109
+    @retry(count=3, delay=120)
108 110
     def check_plugin_online(self):
109
-        """Checks that plugin is working."""
111
+        """Checks that plugin is working. Runs platform Murano OSTF."""
110 112
         test_name = ('fuel_health.tests.tests_platform.test_murano_linux.'
111 113
                      'MuranoDeployLinuxServicesTests.'
112 114
                      'test_deploy_dummy_app_with_glare')
@@ -114,6 +116,17 @@ class MuranoPluginApi(object):
114 116
                                      test_name=test_name,
115 117
                                      timeout=60 * 20)
116 118
 
119
+    @retry(count=3, delay=120)
120
+    def check_plugin_sanity(self):
121
+        """Checks that plugin is working. Runs sanity Murano OSTF."""
122
+        test_name = ('fuel_health.tests.sanity.test_sanity_murano.'
123
+                     'MuranoSanityTests.'
124
+                     'test_create_and_delete_service')
125
+
126
+        self.helpers.run_single_ostf(test_sets=['tests_platform'],
127
+                                     test_name=test_name,
128
+                                     timeout=5 * 10)
129
+
117 130
     def uninstall_plugin(self):
118 131
         """Uninstall plugin from Fuel."""
119 132
         return self.helpers.uninstall_plugin(self.settings.name,
@@ -123,13 +136,13 @@ class MuranoPluginApi(object):
123 136
         return self.helpers.check_plugin_cannot_be_uninstalled(
124 137
             self.settings.name, self.settings.version)
125 138
 
126
-    def wait_plugin_online(self, timeout=5 * 60):
139
+    def wait_plugin_online(self, timeout=5 * 120):
127 140
         """Wait until the plugin will start working properly.
128 141
         """
129 142
 
130 143
         def check_availability():
131 144
             try:
132
-                self.check_plugin_online()
145
+                self.check_plugin_sanity()
133 146
                 return True
134 147
             except AssertionError:
135 148
                 return False

+ 2
- 1
murano_plugin_tests/murano_plugin/test_failover.py View File

@@ -29,7 +29,8 @@ class TestMuranoFailover(api.MuranoPluginApi):
29 29
 
30 30
         self.check_plugin_failover(operation, role_name)
31 31
 
32
-        self.run_ostf(['sanity', 'smoke', 'tests_platform'])
32
+        self.run_ostf(['sanity', 'smoke'])
33
+        self.check_plugin_online()
33 34
 
34 35
     @test(depends_on_groups=["deploy_murano_plugin"],
35 36
           groups=["failover", "murano", "system", "destructive",

+ 10
- 5
murano_plugin_tests/murano_plugin/test_murano_plugin_bvt.py View File

@@ -52,7 +52,8 @@ class TestMuranoPluginBvt(api.MuranoPluginApi):
52 52
 
53 53
         self.helpers.deploy_cluster(self.only_controllers)
54 54
 
55
-        self.run_ostf(['sanity', 'smoke', 'tests_platform'])
55
+        self.run_ostf(['sanity', 'smoke'])
56
+        self.check_plugin_online()
56 57
 
57 58
         self.env.make_snapshot("deploy_murano_plugin_on_controller",
58 59
                                is_make=True)
@@ -87,7 +88,8 @@ class TestMuranoPluginBvt(api.MuranoPluginApi):
87 88
 
88 89
         self.helpers.deploy_cluster(self.only_controllers_ha)
89 90
 
90
-        self.run_ostf(['sanity', 'smoke', 'tests_platform'])
91
+        self.run_ostf(['sanity', 'smoke'])
92
+        self.check_plugin_online()
91 93
 
92 94
         self.env.make_snapshot("deploy_murano_plugin_on_controller_ha",
93 95
                                is_make=True)
@@ -123,7 +125,8 @@ class TestMuranoPluginBvt(api.MuranoPluginApi):
123 125
 
124 126
         self.helpers.deploy_cluster(self.base_nodes)
125 127
 
126
-        self.run_ostf(['sanity', 'smoke', 'tests_platform'])
128
+        self.run_ostf(['sanity', 'smoke'])
129
+        self.check_plugin_online()
127 130
 
128 131
         self.env.make_snapshot("deploy_murano_plugin", is_make=True)
129 132
 
@@ -158,7 +161,8 @@ class TestMuranoPluginBvt(api.MuranoPluginApi):
158 161
 
159 162
         self.helpers.deploy_cluster(self.ha_nodes)
160 163
 
161
-        self.run_ostf(['sanity', 'smoke', 'ha', 'tests_platform'])
164
+        self.run_ostf(['sanity', 'smoke', 'ha'])
165
+        self.check_plugin_online()
162 166
 
163 167
         self.env.make_snapshot("deploy_murano_plugin_ha", is_make=True)
164 168
 
@@ -193,7 +197,8 @@ class TestMuranoPluginBvt(api.MuranoPluginApi):
193 197
 
194 198
         self.helpers.deploy_cluster(self.full_ha_nodes)
195 199
 
196
-        self.run_ostf(['sanity', 'smoke', 'ha', 'tests_platform'])
200
+        self.run_ostf(['sanity', 'smoke', 'ha'])
201
+        self.check_plugin_online()
197 202
 
198 203
         self.env.make_snapshot("deploy_murano_plugin_full_ha", is_make=True)
199 204
 

+ 6
- 3
murano_plugin_tests/murano_plugin/test_murano_plugin_update.py View File

@@ -44,7 +44,8 @@ class TestMuranoPluginUpdate(api.MuranoPluginApi):
44 44
 
45 45
         self.helpers.deploy_cluster(self.only_controllers)
46 46
 
47
-        self.helpers.run_ostf(['sanity', 'smoke', 'tests_platform'])
47
+        self.helpers.run_ostf(['sanity', 'smoke'])
48
+        self.check_plugin_online()
48 49
 
49 50
         self.env.make_snapshot("deploy_murano_out_of_the_box", is_make=True)
50 51
 
@@ -75,7 +76,8 @@ class TestMuranoPluginUpdate(api.MuranoPluginApi):
75 76
 
76 77
         self.helpers.apply_changes()
77 78
 
78
-        self.helpers.run_ostf(['sanity', 'smoke', 'tests_platform'])
79
+        self.helpers.run_ostf(['sanity', 'smoke'])
80
+        self.check_plugin_online()
79 81
 
80 82
         self.env.make_snapshot(
81 83
             "deploy_murano_plugin_in_environment_with_murano",
@@ -112,7 +114,8 @@ class TestMuranoPluginUpdate(api.MuranoPluginApi):
112 114
             'slave-03': plugin_settings.role_name,
113 115
         })
114 116
 
115
-        self.helpers.run_ostf(['sanity', 'smoke', 'tests_platform'])
117
+        self.helpers.run_ostf(['sanity', 'smoke'])
118
+        self.check_plugin_online()
116 119
 
117 120
         self.env.make_snapshot("deploy_murano_node_in_environment_with_murano",
118 121
                                is_make=False)

+ 2
- 1
murano_plugin_tests/murano_plugin/test_post_install.py View File

@@ -48,7 +48,8 @@ class TestMuranoPostInstallation(api.MuranoPluginApi):
48 48
 
49 49
         self.helpers.deploy_cluster(self.only_controllers)
50 50
 
51
-        self.run_ostf(['sanity', 'smoke', 'tests_platform'])
51
+        self.run_ostf(['sanity', 'smoke'])
52
+        self.check_plugin_online()
52 53
 
53 54
         self.env.make_snapshot("deploy_environment_without_murano_plugin",
54 55
                                is_make=True)

+ 6
- 6
murano_plugin_tests/murano_plugin/test_system.py View File

@@ -60,7 +60,7 @@ class TestSystemMuranoPlugin(api.MuranoPluginApi):
60 60
 
61 61
         self.check_plugin_online()
62 62
 
63
-        self.run_ostf(['sanity', 'smoke', 'ha', 'tests_platform'])
63
+        self.run_ostf(['sanity', 'smoke', 'ha'])
64 64
 
65 65
         compute_manipulated_node = {'slave-04': ['compute', 'cinder']}
66 66
 
@@ -69,7 +69,7 @@ class TestSystemMuranoPlugin(api.MuranoPluginApi):
69 69
 
70 70
         self.check_plugin_online()
71 71
 
72
-        self.run_ostf(['sanity', 'smoke', 'ha', 'tests_platform'])
72
+        self.run_ostf(['sanity', 'smoke', 'ha'])
73 73
 
74 74
         # Add controller
75 75
         # NOTE(rpromyshlennikov): test can fail here before
@@ -79,14 +79,14 @@ class TestSystemMuranoPlugin(api.MuranoPluginApi):
79 79
 
80 80
         self.check_plugin_online()
81 81
 
82
-        self.run_ostf(['sanity', 'smoke', 'ha', 'tests_platform'])
82
+        self.run_ostf(['sanity', 'smoke', 'ha'])
83 83
 
84 84
         # Add compute
85 85
         self.helpers.add_nodes_to_cluster(compute_manipulated_node)
86 86
 
87 87
         self.check_plugin_online()
88 88
 
89
-        self.run_ostf(['sanity', 'smoke', 'ha', 'tests_platform'])
89
+        self.run_ostf(['sanity', 'smoke', 'ha'])
90 90
 
91 91
         self.env.make_snapshot("add_remove_controller_compute_murano",
92 92
                                is_make=False)
@@ -122,13 +122,13 @@ class TestSystemMuranoPlugin(api.MuranoPluginApi):
122 122
 
123 123
         self.check_plugin_online()
124 124
 
125
-        self.run_ostf(['sanity', 'smoke', 'ha', 'tests_platform'])
125
+        self.run_ostf(['sanity', 'smoke', 'ha'])
126 126
 
127 127
         # Add Murano Detach node
128 128
         self.helpers.add_nodes_to_cluster(manipulated_node)
129 129
 
130 130
         self.check_plugin_online()
131 131
 
132
-        self.run_ostf(['sanity', 'smoke', 'ha', 'tests_platform'])
132
+        self.run_ostf(['sanity', 'smoke', 'ha'])
133 133
 
134 134
         self.env.make_snapshot("add_remove_murano_node", is_make=False)

Loading…
Cancel
Save