summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Dmitriev <ddmitriev@mirantis.com>2016-11-17 13:23:29 +0200
committerDennis Dmitriev <ddmitriev@mirantis.com>2016-11-18 12:38:23 +0200
commita736489db94a0a4f064a5bf71a3704cf618820de (patch)
tree60cc3b4d4787b4ff82d5ccf59b56fa04d3811ebc
parentcc292bdd50b0b39ffcdfbe36b7309b02c07f0eb1 (diff)
Revert only the latest snapshot that matches the test requirements
- add pytest marks 'revert_snapshot' to all required fixtures instead of reverting the snapshots inside them - add get_top_fixtures_marks() that extracts all the marks 'revert_snapshot' from the test and it's fixtures, order the marks in the same way as the fixtures depends on each other, - in the fixture 'revert_snapshot' try to find the most suitable snapshot for reverting, from latest to earliest. - mark 'revert_snapshot' removed from system tests which use fixtures with the same mark (for example, 'k8s_deployed' mark removed from system tests where the fixture 'k8scluster' is used as a top fixture) Change-Id: Iad9e56d96d870aa4204ba23e76a5b4df01d4385b Co-Authored-By: Dmitry Tyzhnenko <dtyzhnenko@mirantis.com>
Notes
Notes (review): Verified+1: Mirantis CCP CI <mirantis-fuel-ccp-ci@mirantis.com> Code-Review+2: Dmitry Tyzhnenko <dtyzhnenko@mirantis.com> Code-Review+1: Artem Grechanichenko <agrechanichenko@mirantis.com> Workflow+1: Dennis Dmitriev <ddmitriev@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Mon, 05 Dec 2016 08:44:27 +0000 Reviewed-on: https://review.openstack.org/398945 Project: openstack/fuel-ccp-tests Branch: refs/heads/master
-rw-r--r--fuel_ccp_tests/fixtures/ccp_fixtures.py9
-rw-r--r--fuel_ccp_tests/fixtures/k8s_fixtures.py9
-rw-r--r--fuel_ccp_tests/fixtures/os_fixtures.py9
-rw-r--r--fuel_ccp_tests/fixtures/underlay_fixtures.py50
-rw-r--r--fuel_ccp_tests/helpers/utils.py72
-rw-r--r--fuel_ccp_tests/tests/component/k8s/test_appcontroller.py2
-rw-r--r--fuel_ccp_tests/tests/component/k8s/test_dashboard.py2
-rw-r--r--fuel_ccp_tests/tests/component/k8s/test_k8s_lvm_plugin_usage.py2
-rw-r--r--fuel_ccp_tests/tests/system/test_ccp_install_k8s.py11
-rw-r--r--fuel_ccp_tests/tests/system/test_daemonsets.py14
-rw-r--r--fuel_ccp_tests/tests/system/test_deploy.py3
-rw-r--r--fuel_ccp_tests/tests/system/test_few_os.py4
-rw-r--r--fuel_ccp_tests/tests/system/test_lcm_scale_k8s.py1
13 files changed, 91 insertions, 97 deletions
diff --git a/fuel_ccp_tests/fixtures/ccp_fixtures.py b/fuel_ccp_tests/fixtures/ccp_fixtures.py
index b2b41e1..ef4a822 100644
--- a/fuel_ccp_tests/fixtures/ccp_fixtures.py
+++ b/fuel_ccp_tests/fixtures/ccp_fixtures.py
@@ -33,6 +33,7 @@ def ccp_actions(config, underlay):
33 return ccpmanager.CCPManager(config, underlay) 33 return ccpmanager.CCPManager(config, underlay)
34 34
35 35
36@pytest.mark.revert_snapshot(ext.SNAPSHOT.ccp_deployed)
36@pytest.fixture(scope='function') 37@pytest.fixture(scope='function')
37def ccpcluster(revert_snapshot, config, hardware, 38def ccpcluster(revert_snapshot, config, hardware,
38 underlay, k8scluster, ccp_actions): 39 underlay, k8scluster, ccp_actions):
@@ -61,14 +62,6 @@ def ccpcluster(revert_snapshot, config, hardware,
61 62
62 ccp_actions.default_params = settings.CCP_CLI_PARAMS 63 ccp_actions.default_params = settings.CCP_CLI_PARAMS
63 64
64 # If no snapshot was reverted, then try to revert the snapshot
65 # that belongs to the fixture.
66 # Note: keep fixtures in strict dependences from each other!
67 if not revert_snapshot:
68 if hardware.has_snapshot(ext.SNAPSHOT.ccp_deployed) and \
69 hardware.has_snapshot_config(ext.SNAPSHOT.ccp_deployed):
70 hardware.revert_snapshot(ext.SNAPSHOT.ccp_deployed)
71
72 # Install CCP 65 # Install CCP
73 if config.ccp.os_host == '0.0.0.0': 66 if config.ccp.os_host == '0.0.0.0':
74 ccp_actions.install_ccp() 67 ccp_actions.install_ccp()
diff --git a/fuel_ccp_tests/fixtures/k8s_fixtures.py b/fuel_ccp_tests/fixtures/k8s_fixtures.py
index e177027..068b452 100644
--- a/fuel_ccp_tests/fixtures/k8s_fixtures.py
+++ b/fuel_ccp_tests/fixtures/k8s_fixtures.py
@@ -36,6 +36,7 @@ def k8s_actions(config, underlay):
36 return k8smanager.K8SManager(config, underlay) 36 return k8smanager.K8SManager(config, underlay)
37 37
38 38
39@pytest.mark.revert_snapshot(ext.SNAPSHOT.k8s_deployed)
39@pytest.fixture(scope='function') 40@pytest.fixture(scope='function')
40def k8scluster(revert_snapshot, request, config, 41def k8scluster(revert_snapshot, request, config,
41 hardware, underlay, k8s_actions): 42 hardware, underlay, k8s_actions):
@@ -61,14 +62,6 @@ def k8scluster(revert_snapshot, request, config,
61 If you want to revert 'k8s_deployed' snapshot, please use mark: 62 If you want to revert 'k8s_deployed' snapshot, please use mark:
62 @pytest.mark.revert_snapshot("k8s_deployed") 63 @pytest.mark.revert_snapshot("k8s_deployed")
63 """ 64 """
64 # If no snapshot was reverted, then try to revert the snapshot
65 # that belongs to the fixture.
66 # Note: keep fixtures in strict dependences from each other!
67 if not revert_snapshot:
68 if hardware.has_snapshot(ext.SNAPSHOT.k8s_deployed) and \
69 hardware.has_snapshot_config(ext.SNAPSHOT.k8s_deployed):
70 hardware.revert_snapshot(ext.SNAPSHOT.k8s_deployed)
71
72 # Create k8s cluster 65 # Create k8s cluster
73 if config.k8s.kube_host == '0.0.0.0': 66 if config.k8s.kube_host == '0.0.0.0':
74 kube_settings = getattr(request.instance, 'kube_settings', 67 kube_settings = getattr(request.instance, 'kube_settings',
diff --git a/fuel_ccp_tests/fixtures/os_fixtures.py b/fuel_ccp_tests/fixtures/os_fixtures.py
index b23d14b..27d221e 100644
--- a/fuel_ccp_tests/fixtures/os_fixtures.py
+++ b/fuel_ccp_tests/fixtures/os_fixtures.py
@@ -21,6 +21,7 @@ from fuel_ccp_tests.managers.osmanager import OSManager
21LOG = logger.logger 21LOG = logger.logger
22 22
23 23
24@pytest.mark.revert_snapshot(ext.SNAPSHOT.os_deployed)
24@pytest.fixture(scope='function') 25@pytest.fixture(scope='function')
25def os_deployed(ccpcluster, 26def os_deployed(ccpcluster,
26 hardware, 27 hardware,
@@ -30,14 +31,6 @@ def os_deployed(ccpcluster,
30 k8s_actions): 31 k8s_actions):
31 """Deploy openstack 32 """Deploy openstack
32 """ 33 """
33 # If no snapshot was reverted, then try to revert the snapshot
34 # that belongs to the fixture.
35 # Note: keep fixtures in strict dependences from each other!
36 if not revert_snapshot:
37 if hardware.has_snapshot(ext.SNAPSHOT.os_deployed) and \
38 hardware.has_snapshot_config(ext.SNAPSHOT.os_deployed):
39 hardware.revert_snapshot(ext.SNAPSHOT.os_deployed)
40
41 osmanager = OSManager(config, underlay, k8s_actions, ccpcluster) 34 osmanager = OSManager(config, underlay, k8s_actions, ccpcluster)
42 if not config.os.running: 35 if not config.os.running:
43 LOG.info("Preparing openstack log collector fixture...") 36 LOG.info("Preparing openstack log collector fixture...")
diff --git a/fuel_ccp_tests/fixtures/underlay_fixtures.py b/fuel_ccp_tests/fixtures/underlay_fixtures.py
index 7b9d0ed..66e4a15 100644
--- a/fuel_ccp_tests/fixtures/underlay_fixtures.py
+++ b/fuel_ccp_tests/fixtures/underlay_fixtures.py
@@ -16,6 +16,7 @@ import pytest
16from datetime import datetime 16from datetime import datetime
17 17
18from fuel_ccp_tests.helpers import ext 18from fuel_ccp_tests.helpers import ext
19from fuel_ccp_tests.helpers import utils
19from fuel_ccp_tests import logger 20from fuel_ccp_tests import logger
20from fuel_ccp_tests import settings 21from fuel_ccp_tests import settings
21from fuel_ccp_tests.managers import envmanager_devops 22from fuel_ccp_tests.managers import envmanager_devops
@@ -25,20 +26,6 @@ from fuel_ccp_tests.managers import underlay_ssh_manager
25LOG = logger.logger 26LOG = logger.logger
26 27
27 28
28def extract_name_from_mark(mark):
29 """Simple function to extract name from mark
30
31 :param mark: pytest.mark.MarkInfo
32 :rtype: string or None
33 """
34 if mark:
35 if len(mark.args) > 0:
36 return mark.args[0]
37 elif 'name' in mark.kwargs:
38 return mark.kwargs['name']
39 return None
40
41
42@pytest.fixture(scope="session") 29@pytest.fixture(scope="session")
43def hardware(request, config): 30def hardware(request, config):
44 """Fixture for manage the hardware layer. 31 """Fixture for manage the hardware layer.
@@ -110,17 +97,19 @@ def revert_snapshot(request, hardware):
110 97
111 :rtype string: name of the reverted snapshot or None 98 :rtype string: name of the reverted snapshot or None
112 """ 99 """
113 revert_snapshot = request.keywords.get('revert_snapshot', None) 100 top_fixtures_snapshots = utils.get_top_fixtures_marks(
114 snapshot_name = extract_name_from_mark(revert_snapshot) 101 request, 'revert_snapshot')
115 102
116 if snapshot_name and \ 103 # Try to revert the best matches snapshot for the test
117 hardware.has_snapshot(snapshot_name) and \ 104 for snapshot_name in top_fixtures_snapshots:
118 hardware.has_snapshot_config(snapshot_name): 105 if hardware.has_snapshot(snapshot_name) and \
119 hardware.revert_snapshot(snapshot_name) 106 hardware.has_snapshot_config(snapshot_name):
120 return snapshot_name 107 hardware.revert_snapshot(snapshot_name)
121 else: 108 return snapshot_name
122 hardware.revert_snapshot(ext.SNAPSHOT.hardware) 109
123 return None 110 # Fallback to the basic snapshot
111 hardware.revert_snapshot(ext.SNAPSHOT.hardware)
112 return None
124 113
125 114
126@pytest.fixture(scope='function', autouse=True) 115@pytest.fixture(scope='function', autouse=True)
@@ -146,7 +135,7 @@ def snapshot(request, hardware):
146 request.node.function.__name__) 135 request.node.function.__name__)
147 if hasattr(request.node, 'rep_call') and request.node.rep_call.passed \ 136 if hasattr(request.node, 'rep_call') and request.node.rep_call.passed \
148 and snapshot_needed: 137 and snapshot_needed:
149 snapshot_name = extract_name_from_mark(snapshot_needed) or \ 138 snapshot_name = utils.extract_name_from_mark(snapshot_needed) or \
150 "{}_passed".format(default_snapshot_name) 139 "{}_passed".format(default_snapshot_name)
151 hardware.create_snapshot(snapshot_name) 140 hardware.create_snapshot(snapshot_name)
152 141
@@ -163,6 +152,7 @@ def snapshot(request, hardware):
163 request.addfinalizer(test_fin) 152 request.addfinalizer(test_fin)
164 153
165 154
155@pytest.mark.revert_snapshot(ext.SNAPSHOT.underlay)
166@pytest.fixture(scope="function") 156@pytest.fixture(scope="function")
167def underlay(revert_snapshot, config, hardware): 157def underlay(revert_snapshot, config, hardware):
168 """Fixture that should provide SSH access to underlay objects. 158 """Fixture that should provide SSH access to underlay objects.
@@ -179,14 +169,6 @@ def underlay(revert_snapshot, config, hardware):
179 - provide SSH access to underlay nodes using 169 - provide SSH access to underlay nodes using
180 node names or node IPs. 170 node names or node IPs.
181 """ 171 """
182 # If no snapshot was reverted, then try to revert the snapshot
183 # that belongs to the fixture.
184 # Note: keep fixtures in strict dependences from each other!
185 if not revert_snapshot:
186 if hardware.has_snapshot(ext.SNAPSHOT.underlay) and \
187 hardware.has_snapshot_config(ext.SNAPSHOT.underlay):
188 hardware.revert_snapshot(ext.SNAPSHOT.underlay)
189
190 # Create Underlay 172 # Create Underlay
191 if not config.underlay.ssh: 173 if not config.underlay.ssh:
192 # If config.underlay.ssh wasn't provided from external config, then 174 # If config.underlay.ssh wasn't provided from external config, then
diff --git a/fuel_ccp_tests/helpers/utils.py b/fuel_ccp_tests/helpers/utils.py
index be88e06..8cd40f7 100644
--- a/fuel_ccp_tests/helpers/utils.py
+++ b/fuel_ccp_tests/helpers/utils.py
@@ -411,3 +411,75 @@ class YamlEditor(object):
411 if self.content == self.__original_content: 411 if self.content == self.__original_content:
412 return 412 return
413 self.write_content() 413 self.write_content()
414
415
416def extract_name_from_mark(mark):
417 """Simple function to extract name from pytest mark
418
419 :param mark: pytest.mark.MarkInfo
420 :rtype: string or None
421 """
422 if mark:
423 if len(mark.args) > 0:
424 return mark.args[0]
425 elif 'name' in mark.kwargs:
426 return mark.kwargs['name']
427 return None
428
429
430def get_top_fixtures_marks(request, mark_name):
431 """Order marks according to fixtures order
432
433 When a test use fixtures that depend on each other in some order,
434 that fixtures can have the same pytest mark.
435
436 This method extracts such marks from fixtures that are used in the
437 current test and return the content of the marks ordered by the
438 fixture dependences.
439 If the test case have the same mark, than the content of this mark
440 will be the first element in the resulting list.
441
442 :param request: pytest 'request' fixture
443 :param mark_name: name of the mark to search on the fixtures and the test
444
445 :rtype list: marks content, from last to first executed.
446 """
447
448 fixtureinfo = request.session._fixturemanager.getfixtureinfo(
449 request.node, request.function, request.cls)
450
451 top_fixtures_names = []
452 for _ in enumerate(fixtureinfo.name2fixturedefs):
453 parent_fixtures = set()
454 child_fixtures = set()
455 for name in sorted(fixtureinfo.name2fixturedefs):
456 if name in top_fixtures_names:
457 continue
458 parent_fixtures.add(name)
459 child_fixtures.update(
460 fixtureinfo.name2fixturedefs[name][0].argnames)
461 top_fixtures_names.extend(list(parent_fixtures - child_fixtures))
462
463 top_fixtures_marks = []
464
465 if mark_name in request.function.func_dict:
466 # The top priority is the 'revert_snapshot' mark on the test
467 top_fixtures_marks.append(
468 extract_name_from_mark(
469 request.function.func_dict[mark_name]))
470
471 for top_fixtures_name in top_fixtures_names:
472 fd = fixtureinfo.name2fixturedefs[top_fixtures_name][0]
473 if mark_name in fd.func.func_dict:
474 fixture_mark = extract_name_from_mark(
475 fd.func.func_dict[mark_name])
476 # Append the snapshot names in the order that fixtures are called
477 # starting from the last called fixture to the first one
478 top_fixtures_marks.append(fixture_mark)
479
480 LOG.debug("Fixtures ordered from last to first called: {0}"
481 .format(top_fixtures_names))
482 LOG.debug("Marks ordered from most to least preffered: {0}"
483 .format(top_fixtures_marks))
484
485 return top_fixtures_marks
diff --git a/fuel_ccp_tests/tests/component/k8s/test_appcontroller.py b/fuel_ccp_tests/tests/component/k8s/test_appcontroller.py
index c94247c..989731d 100644
--- a/fuel_ccp_tests/tests/component/k8s/test_appcontroller.py
+++ b/fuel_ccp_tests/tests/component/k8s/test_appcontroller.py
@@ -20,7 +20,6 @@ import yaml
20 20
21from fuel_ccp_tests import logger 21from fuel_ccp_tests import logger
22from fuel_ccp_tests import settings 22from fuel_ccp_tests import settings
23from fuel_ccp_tests.helpers import ext
24 23
25LOG = logger.logger 24LOG = logger.logger
26 25
@@ -141,7 +140,6 @@ class TestAppController(object):
141 } 140 }
142 141
143 @pytest.mark.ac_linear_test 142 @pytest.mark.ac_linear_test
144 @pytest.mark.revert_snapshot(ext.SNAPSHOT.k8s_deployed)
145 @pytest.mark.skipif(settings.AC_PATH is None, 143 @pytest.mark.skipif(settings.AC_PATH is None,
146 reason="ApplicationController repo path is not set!") 144 reason="ApplicationController repo path is not set!")
147 def test_linear(self, underlay, k8scluster, show_step): 145 def test_linear(self, underlay, k8scluster, show_step):
diff --git a/fuel_ccp_tests/tests/component/k8s/test_dashboard.py b/fuel_ccp_tests/tests/component/k8s/test_dashboard.py
index 40b3ec3..9fc1d52 100644
--- a/fuel_ccp_tests/tests/component/k8s/test_dashboard.py
+++ b/fuel_ccp_tests/tests/component/k8s/test_dashboard.py
@@ -13,7 +13,6 @@
13# under the License. 13# under the License.
14import pytest 14import pytest
15 15
16from fuel_ccp_tests.helpers import ext
17from fuel_ccp_tests import logger 16from fuel_ccp_tests import logger
18from fuel_ccp_tests import settings 17from fuel_ccp_tests import settings
19 18
@@ -30,7 +29,6 @@ class TestK8sDashboard(object):
30 "searchdomains": settings.SEARCH_DOMAINS, 29 "searchdomains": settings.SEARCH_DOMAINS,
31 } 30 }
32 31
33 @pytest.mark.revert_snapshot(ext.SNAPSHOT.k8s_deployed)
34 @pytest.mark.fail_snapshot 32 @pytest.mark.fail_snapshot
35 @pytest.mark.dashboard_exists 33 @pytest.mark.dashboard_exists
36 def test_k8s_dashboard_exists(self, k8scluster): 34 def test_k8s_dashboard_exists(self, k8scluster):
diff --git a/fuel_ccp_tests/tests/component/k8s/test_k8s_lvm_plugin_usage.py b/fuel_ccp_tests/tests/component/k8s/test_k8s_lvm_plugin_usage.py
index ee9718c..bbae6fa 100644
--- a/fuel_ccp_tests/tests/component/k8s/test_k8s_lvm_plugin_usage.py
+++ b/fuel_ccp_tests/tests/component/k8s/test_k8s_lvm_plugin_usage.py
@@ -14,7 +14,6 @@
14import pytest 14import pytest
15 15
16from fuel_ccp_tests import logger 16from fuel_ccp_tests import logger
17from fuel_ccp_tests.helpers import ext
18 17
19LOG = logger.logger 18LOG = logger.logger
20 19
@@ -38,7 +37,6 @@ class TestLVMPluginUsage(object):
38 timeout=120) 37 timeout=120)
39 38
40 @pytest.mark.nginx_with_lvm 39 @pytest.mark.nginx_with_lvm
41 @pytest.mark.revert_snapshot(ext.SNAPSHOT.k8s_deployed)
42 def test_create_nginx_with_lvm(self, underlay, k8scluster): 40 def test_create_nginx_with_lvm(self, underlay, k8scluster):
43 """Test creating pod with LVM plugin 41 """Test creating pod with LVM plugin
44 42
diff --git a/fuel_ccp_tests/tests/system/test_ccp_install_k8s.py b/fuel_ccp_tests/tests/system/test_ccp_install_k8s.py
index 625f0af..e5d8b9a 100644
--- a/fuel_ccp_tests/tests/system/test_ccp_install_k8s.py
+++ b/fuel_ccp_tests/tests/system/test_ccp_install_k8s.py
@@ -17,7 +17,6 @@ import pytest
17 17
18import base_test 18import base_test
19from fuel_ccp_tests import settings 19from fuel_ccp_tests import settings
20from fuel_ccp_tests.helpers import ext
21 20
22 21
23class FuelCCPInstallerConfigMixin: 22class FuelCCPInstallerConfigMixin:
@@ -77,7 +76,6 @@ class TestFuelCCPInstaller(base_test.SystemBaseTest,
77 76
78 @pytest.mark.k8s_installed_default 77 @pytest.mark.k8s_installed_default
79 @pytest.mark.snapshot_needed 78 @pytest.mark.snapshot_needed
80 @pytest.mark.revert_snapshot(ext.SNAPSHOT.underlay)
81 @pytest.mark.fail_snapshot 79 @pytest.mark.fail_snapshot
82 def test_k8s_installed_default(self, underlay, k8s_actions): 80 def test_k8s_installed_default(self, underlay, k8s_actions):
83 """Test for deploying an k8s environment and check it 81 """Test for deploying an k8s environment and check it
@@ -107,7 +105,6 @@ class TestFuelCCPInstaller(base_test.SystemBaseTest,
107 105
108 @pytest.mark.k8s_installed_custom 106 @pytest.mark.k8s_installed_custom
109 @pytest.mark.snapshot_needed 107 @pytest.mark.snapshot_needed
110 @pytest.mark.revert_snapshot(ext.SNAPSHOT.underlay)
111 @pytest.mark.fail_snapshot 108 @pytest.mark.fail_snapshot
112 @pytest.mark.bvt 109 @pytest.mark.bvt
113 def test_k8s_installed_custom(self, underlay, k8s_actions, show_step): 110 def test_k8s_installed_custom(self, underlay, k8s_actions, show_step):
@@ -151,7 +148,6 @@ class TestFuelCCPInstaller(base_test.SystemBaseTest,
151 148
152 @pytest.mark.k8s_installed_with_etcd_on_host 149 @pytest.mark.k8s_installed_with_etcd_on_host
153 @pytest.mark.snapshot_needed 150 @pytest.mark.snapshot_needed
154 @pytest.mark.revert_snapshot(ext.SNAPSHOT.underlay)
155 @pytest.mark.fail_snapshot 151 @pytest.mark.fail_snapshot
156 def test_k8s_installed_with_etcd_on_host(self, underlay, k8s_actions): 152 def test_k8s_installed_with_etcd_on_host(self, underlay, k8s_actions):
157 """Test for deploying an k8s environment and check it 153 """Test for deploying an k8s environment and check it
@@ -192,7 +188,6 @@ class TestFuelCCPInstaller(base_test.SystemBaseTest,
192 188
193 @pytest.mark.k8s_installed_with_etcd_in_container 189 @pytest.mark.k8s_installed_with_etcd_in_container
194 @pytest.mark.snapshot_needed 190 @pytest.mark.snapshot_needed
195 @pytest.mark.revert_snapshot(ext.SNAPSHOT.underlay)
196 @pytest.mark.fail_snapshot 191 @pytest.mark.fail_snapshot
197 def test_k8s_installed_with_etcd_in_container(self, underlay, k8s_actions): 192 def test_k8s_installed_with_etcd_in_container(self, underlay, k8s_actions):
198 """Test for deploying an k8s environment and check it 193 """Test for deploying an k8s environment and check it
@@ -233,7 +228,6 @@ class TestFuelCCPInstaller(base_test.SystemBaseTest,
233 228
234 @pytest.mark.k8s_installed_with_ready_ssh_keys 229 @pytest.mark.k8s_installed_with_ready_ssh_keys
235 @pytest.mark.snapshot_needed 230 @pytest.mark.snapshot_needed
236 @pytest.mark.revert_snapshot(ext.SNAPSHOT.underlay)
237 @pytest.mark.fail_snapshot 231 @pytest.mark.fail_snapshot
238 def test_k8s_installed_with_ready_ssh_keys(self, ssh_keys_dir, 232 def test_k8s_installed_with_ready_ssh_keys(self, ssh_keys_dir,
239 underlay, k8s_actions): 233 underlay, k8s_actions):
@@ -267,7 +261,6 @@ class TestFuelCCPInstaller(base_test.SystemBaseTest,
267 k8s_actions.check_pod_delete(pod) 261 k8s_actions.check_pod_delete(pod)
268 262
269 @pytest.mark.test_k8s_installed_with_ipip 263 @pytest.mark.test_k8s_installed_with_ipip
270 @pytest.mark.revert_snapshot(ext.SNAPSHOT.underlay)
271 @pytest.mark.fail_snapshot 264 @pytest.mark.fail_snapshot
272 def test_k8s_installed_with_ipip(self, underlay, k8s_actions, show_step): 265 def test_k8s_installed_with_ipip(self, underlay, k8s_actions, show_step):
273 """Test for deploying an k8s environment with IPIP tunnels for Calico 266 """Test for deploying an k8s environment with IPIP tunnels for Calico
@@ -326,7 +319,6 @@ class TestFuelCCPInstallerIdempotency(base_test.SystemBaseTest,
326 319
327 @pytest.mark.ccp_idempotency_default 320 @pytest.mark.ccp_idempotency_default
328 @pytest.mark.snapshot_needed 321 @pytest.mark.snapshot_needed
329 @pytest.mark.revert_snapshot(ext.SNAPSHOT.underlay)
330 @pytest.mark.fail_snapshot 322 @pytest.mark.fail_snapshot
331 def test_k8s_ccp_idempotency_default(self, config, underlay, k8s_actions): 323 def test_k8s_ccp_idempotency_default(self, config, underlay, k8s_actions):
332 """Test for deploying an k8s environment and check it 324 """Test for deploying an k8s environment and check it
@@ -350,7 +342,6 @@ class TestFuelCCPInstallerIdempotency(base_test.SystemBaseTest,
350 342
351 @pytest.mark.ccp_idempotency_with_etcd_on_host 343 @pytest.mark.ccp_idempotency_with_etcd_on_host
352 @pytest.mark.snapshot_needed 344 @pytest.mark.snapshot_needed
353 @pytest.mark.revert_snapshot(ext.SNAPSHOT.underlay)
354 @pytest.mark.fail_snapshot 345 @pytest.mark.fail_snapshot
355 def test_ccp_idempotency_with_etcd_on_host(self, config, underlay, 346 def test_ccp_idempotency_with_etcd_on_host(self, config, underlay,
356 k8s_actions): 347 k8s_actions):
@@ -383,7 +374,6 @@ class TestFuelCCPInstallerIdempotency(base_test.SystemBaseTest,
383 374
384 @pytest.mark.ccp_idempotency_with_etcd_in_container 375 @pytest.mark.ccp_idempotency_with_etcd_in_container
385 @pytest.mark.snapshot_needed 376 @pytest.mark.snapshot_needed
386 @pytest.mark.revert_snapshot(ext.SNAPSHOT.underlay)
387 @pytest.mark.fail_snapshot 377 @pytest.mark.fail_snapshot
388 def test_ccp_idempotency_with_etcd_in_container(self, config, underlay, 378 def test_ccp_idempotency_with_etcd_in_container(self, config, underlay,
389 k8s_actions): 379 k8s_actions):
@@ -418,7 +408,6 @@ class TestFuelCCPInstallerIdempotency(base_test.SystemBaseTest,
418 408
419 @pytest.mark.ccp_idempotency_with_ready_ssh_keys 409 @pytest.mark.ccp_idempotency_with_ready_ssh_keys
420 @pytest.mark.snapshot_needed 410 @pytest.mark.snapshot_needed
421 @pytest.mark.revert_snapshot(ext.SNAPSHOT.underlay)
422 @pytest.mark.fail_snapshot 411 @pytest.mark.fail_snapshot
423 def test_ccp_idempotency_with_ready_ssh_keys(self, ssh_keys_dir, 412 def test_ccp_idempotency_with_ready_ssh_keys(self, ssh_keys_dir,
424 config, underlay, 413 config, underlay,
diff --git a/fuel_ccp_tests/tests/system/test_daemonsets.py b/fuel_ccp_tests/tests/system/test_daemonsets.py
index 612d4ce..8abe78d 100644
--- a/fuel_ccp_tests/tests/system/test_daemonsets.py
+++ b/fuel_ccp_tests/tests/system/test_daemonsets.py
@@ -17,7 +17,6 @@ import time
17from devops.helpers import helpers 17from devops.helpers import helpers
18import pytest 18import pytest
19 19
20from fuel_ccp_tests.helpers import ext
21from fuel_ccp_tests import logger 20from fuel_ccp_tests import logger
22 21
23LOG = logger.logger 22LOG = logger.logger
@@ -173,7 +172,6 @@ class TestDaemonsetsUpdates():
173 start_time_after_rollout) 172 start_time_after_rollout)
174 ) 173 )
175 174
176 @pytest.mark.revert_snapshot(ext.SNAPSHOT.k8s_deployed)
177 @pytest.mark.fail_snapshot 175 @pytest.mark.fail_snapshot
178 @pytest.mark.snapshot_needed 176 @pytest.mark.snapshot_needed
179 def test_daemonset_rollingupdate_noop(self, k8scluster, show_step): 177 def test_daemonset_rollingupdate_noop(self, k8scluster, show_step):
@@ -254,7 +252,6 @@ class TestDaemonsetsUpdates():
254 # Pods should have the new image version 252 # Pods should have the new image version
255 self.check_nginx_pods_image(k8sclient, self.to_nginx_image) 253 self.check_nginx_pods_image(k8sclient, self.to_nginx_image)
256 254
257 @pytest.mark.revert_snapshot(ext.SNAPSHOT.k8s_deployed)
258 @pytest.mark.fail_snapshot 255 @pytest.mark.fail_snapshot
259 @pytest.mark.snapshot_needed 256 @pytest.mark.snapshot_needed
260 def test_daemonset_rollingupdate(self, k8scluster, show_step): 257 def test_daemonset_rollingupdate(self, k8scluster, show_step):
@@ -322,7 +319,6 @@ class TestDaemonsetsUpdates():
322 self.to_nginx_image), 319 self.to_nginx_image),
323 timeout=2 * 60) 320 timeout=2 * 60)
324 321
325 @pytest.mark.revert_snapshot(ext.SNAPSHOT.k8s_deployed)
326 @pytest.mark.fail_snapshot 322 @pytest.mark.fail_snapshot
327 @pytest.mark.snapshot_needed 323 @pytest.mark.snapshot_needed
328 def test_daemonset_rollout_rollingupdate(self, underlay, 324 def test_daemonset_rollout_rollingupdate(self, underlay,
@@ -373,7 +369,6 @@ class TestDaemonsetsUpdates():
373 timeout=2 * 60 369 timeout=2 * 60
374 ) 370 )
375 371
376 @pytest.mark.revert_snapshot(ext.SNAPSHOT.k8s_deployed)
377 @pytest.mark.fail_snapshot 372 @pytest.mark.fail_snapshot
378 @pytest.mark.snapshot_needed 373 @pytest.mark.snapshot_needed
379 def test_daemonset_rollout_noop(self, underlay, 374 def test_daemonset_rollout_noop(self, underlay,
@@ -441,7 +436,6 @@ class TestDaemonsetsUpdates():
441 # Pods should have the old image version 436 # Pods should have the old image version
442 self.check_nginx_pods_image(k8sclient, self.from_nginx_image) 437 self.check_nginx_pods_image(k8sclient, self.from_nginx_image)
443 438
444 @pytest.mark.revert_snapshot(ext.SNAPSHOT.k8s_deployed)
445 @pytest.mark.fail_snapshot 439 @pytest.mark.fail_snapshot
446 @pytest.mark.snapshot_needed 440 @pytest.mark.snapshot_needed
447 def test_daemonset_multirollout_rollingupdate(self, underlay, k8scluster, 441 def test_daemonset_multirollout_rollingupdate(self, underlay, k8scluster,
@@ -523,7 +517,6 @@ class TestDaemonsetsUpdates():
523 timeout=2 * 60 517 timeout=2 * 60
524 ) 518 )
525 519
526 @pytest.mark.revert_snapshot(ext.SNAPSHOT.k8s_deployed)
527 @pytest.mark.fail_snapshot 520 @pytest.mark.fail_snapshot
528 @pytest.mark.snapshot_needed 521 @pytest.mark.snapshot_needed
529 def test_daemonset_multirollout_rollingupdate_revision(self, 522 def test_daemonset_multirollout_rollingupdate_revision(self,
@@ -688,7 +681,6 @@ class TestDaemonsetsUpdates():
688 timeout=2 * 60 681 timeout=2 * 60
689 ) 682 )
690 683
691 @pytest.mark.revert_snapshot(ext.SNAPSHOT.k8s_deployed)
692 @pytest.mark.fail_snapshot 684 @pytest.mark.fail_snapshot
693 @pytest.mark.snapshot_needed 685 @pytest.mark.snapshot_needed
694 def test_daemonset_multirollout_rollingupdate_default(self, underlay, 686 def test_daemonset_multirollout_rollingupdate_default(self, underlay,
@@ -772,7 +764,6 @@ class TestDaemonsetsUpdates():
772 timeout=2 * 60 764 timeout=2 * 60
773 ) 765 )
774 766
775 @pytest.mark.revert_snapshot(ext.SNAPSHOT.k8s_deployed)
776 @pytest.mark.fail_snapshot 767 @pytest.mark.fail_snapshot
777 @pytest.mark.snapshot_needed 768 @pytest.mark.snapshot_needed
778 def test_daemonset_skip_rollout(self, underlay, k8scluster, 769 def test_daemonset_skip_rollout(self, underlay, k8scluster,
@@ -821,7 +812,6 @@ class TestDaemonsetsUpdates():
821 show_step(6) 812 show_step(6)
822 self.check_rollout_skipping(k8sclient, config.k8s.kube_host, underlay) 813 self.check_rollout_skipping(k8sclient, config.k8s.kube_host, underlay)
823 814
824 @pytest.mark.revert_snapshot(ext.SNAPSHOT.k8s_deployed)
825 @pytest.mark.fail_snapshot 815 @pytest.mark.fail_snapshot
826 @pytest.mark.snapshot_needed 816 @pytest.mark.snapshot_needed
827 def test_daemonset_skip_rollout_revision(self, underlay, k8scluster, 817 def test_daemonset_skip_rollout_revision(self, underlay, k8scluster,
@@ -871,7 +861,6 @@ class TestDaemonsetsUpdates():
871 self.check_rollout_skipping(k8sclient, config.k8s.kube_host, 861 self.check_rollout_skipping(k8sclient, config.k8s.kube_host,
872 underlay, revision=True) 862 underlay, revision=True)
873 863
874 @pytest.mark.revert_snapshot(ext.SNAPSHOT.k8s_deployed)
875 @pytest.mark.fail_snapshot 864 @pytest.mark.fail_snapshot
876 @pytest.mark.snapshot_needed 865 @pytest.mark.snapshot_needed
877 def test_daemonset_rollout_revision_negative_1(self, underlay, k8scluster, 866 def test_daemonset_rollout_revision_negative_1(self, underlay, k8scluster,
@@ -930,7 +919,6 @@ class TestDaemonsetsUpdates():
930 pods_start_time_after_cmd) 919 pods_start_time_after_cmd)
931 ) 920 )
932 921
933 @pytest.mark.revert_snapshot(ext.SNAPSHOT.k8s_deployed)
934 @pytest.mark.fail_snapshot 922 @pytest.mark.fail_snapshot
935 @pytest.mark.snapshot_needed 923 @pytest.mark.snapshot_needed
936 def test_daemonset_rollout_revision_negative_2(self, underlay, k8scluster, 924 def test_daemonset_rollout_revision_negative_2(self, underlay, k8scluster,
@@ -990,7 +978,6 @@ class TestDaemonsetsUpdates():
990 pods_start_time_after_cmd) 978 pods_start_time_after_cmd)
991 ) 979 )
992 980
993 @pytest.mark.revert_snapshot(ext.SNAPSHOT.k8s_deployed)
994 @pytest.mark.fail_snapshot 981 @pytest.mark.fail_snapshot
995 @pytest.mark.snapshot_needed 982 @pytest.mark.snapshot_needed
996 def test_daemonset_rollout_revision_negative_3(self, underlay, k8scluster, 983 def test_daemonset_rollout_revision_negative_3(self, underlay, k8scluster,
@@ -1049,7 +1036,6 @@ class TestDaemonsetsUpdates():
1049 pods_start_time_after_cmd) 1036 pods_start_time_after_cmd)
1050 ) 1037 )
1051 1038
1052 @pytest.mark.revert_snapshot(ext.SNAPSHOT.k8s_deployed)
1053 @pytest.mark.fail_snapshot 1039 @pytest.mark.fail_snapshot
1054 @pytest.mark.snapshot_needed 1040 @pytest.mark.snapshot_needed
1055 def test_daemonset_rollout_revision_negative_4(self, underlay, k8scluster, 1041 def test_daemonset_rollout_revision_negative_4(self, underlay, k8scluster,
diff --git a/fuel_ccp_tests/tests/system/test_deploy.py b/fuel_ccp_tests/tests/system/test_deploy.py
index 7c9f8db..3ae740b 100644
--- a/fuel_ccp_tests/tests/system/test_deploy.py
+++ b/fuel_ccp_tests/tests/system/test_deploy.py
@@ -21,7 +21,6 @@ import base_test
21from fuel_ccp_tests import logger 21from fuel_ccp_tests import logger
22from fuel_ccp_tests import settings 22from fuel_ccp_tests import settings
23from fuel_ccp_tests.helpers import post_os_deploy_checks 23from fuel_ccp_tests.helpers import post_os_deploy_checks
24from fuel_ccp_tests.helpers import ext
25 24
26LOG = logger.logger 25LOG = logger.logger
27 26
@@ -32,7 +31,6 @@ class TestDeployOpenstack(base_test.SystemBaseTest):
32 pytest.mark: deploy_openstack 31 pytest.mark: deploy_openstack
33 """ 32 """
34 33
35 @pytest.mark.revert_snapshot(ext.SNAPSHOT.ccp_deployed)
36 @pytest.mark.deploy_openstack 34 @pytest.mark.deploy_openstack
37 @pytest.mark.fail_snapshot 35 @pytest.mark.fail_snapshot
38 @pytest.mark.smoke 36 @pytest.mark.smoke
@@ -70,7 +68,6 @@ class TestDeployOpenstack(base_test.SystemBaseTest):
70 settings.IFACES['public']), 68 settings.IFACES['public']),
71 timeout=600) 69 timeout=600)
72 70
73 @pytest.mark.revert_snapshot(ext.SNAPSHOT.ccp_deployed)
74 @pytest.mark.fail_snapshot 71 @pytest.mark.fail_snapshot
75 @pytest.mark.openstack_tempest 72 @pytest.mark.openstack_tempest
76 def test_deploy_openstack_run_tempest(self, underlay, config, 73 def test_deploy_openstack_run_tempest(self, underlay, config,
diff --git a/fuel_ccp_tests/tests/system/test_few_os.py b/fuel_ccp_tests/tests/system/test_few_os.py
index 91cd637..90b1dff 100644
--- a/fuel_ccp_tests/tests/system/test_few_os.py
+++ b/fuel_ccp_tests/tests/system/test_few_os.py
@@ -18,7 +18,6 @@ import pytest
18import base_test 18import base_test
19from fuel_ccp_tests import logger 19from fuel_ccp_tests import logger
20from fuel_ccp_tests import settings 20from fuel_ccp_tests import settings
21from fuel_ccp_tests.helpers import ext
22from fuel_ccp_tests.helpers import post_os_deploy_checks 21from fuel_ccp_tests.helpers import post_os_deploy_checks
23 22
24LOG = logger.logger 23LOG = logger.logger
@@ -28,7 +27,6 @@ class TestDeployTwoOS(base_test.SystemBaseTest):
28 """Deploy Two OpenStack clusters with CCP 27 """Deploy Two OpenStack clusters with CCP
29 28
30 """ 29 """
31 @pytest.mark.revert_snapshot(ext.SNAPSHOT.ccp_deployed)
32 @pytest.mark.deploy_two_os 30 @pytest.mark.deploy_two_os
33 @pytest.mark.fail_snapshot 31 @pytest.mark.fail_snapshot
34 @pytest.mark.system_few_os 32 @pytest.mark.system_few_os
@@ -97,7 +95,6 @@ class TestDeployTwoOS(base_test.SystemBaseTest):
97 settings.IFACES['public']), 95 settings.IFACES['public']),
98 timeout=600) 96 timeout=600)
99 97
100 @pytest.mark.revert_snapshot(ext.SNAPSHOT.ccp_deployed)
101 @pytest.mark.snapshot_needed(name="two_os") 98 @pytest.mark.snapshot_needed(name="two_os")
102 @pytest.mark.deploy_two_os 99 @pytest.mark.deploy_two_os
103 @pytest.mark.fail_snapshot 100 @pytest.mark.fail_snapshot
@@ -168,7 +165,6 @@ class TestDeployTwoOS(base_test.SystemBaseTest):
168 settings.IFACES['public']), 165 settings.IFACES['public']),
169 timeout=600) 166 timeout=600)
170 167
171 @pytest.mark.revert_snapshot(ext.SNAPSHOT.ccp_deployed)
172 @pytest.mark.deploy_two_os 168 @pytest.mark.deploy_two_os
173 @pytest.mark.fail_snapshot 169 @pytest.mark.fail_snapshot
174 @pytest.mark.system_few_os 170 @pytest.mark.system_few_os
diff --git a/fuel_ccp_tests/tests/system/test_lcm_scale_k8s.py b/fuel_ccp_tests/tests/system/test_lcm_scale_k8s.py
index dab077e..1a8b9e1 100644
--- a/fuel_ccp_tests/tests/system/test_lcm_scale_k8s.py
+++ b/fuel_ccp_tests/tests/system/test_lcm_scale_k8s.py
@@ -26,7 +26,6 @@ class TestLCMScaleK8s(base_test.SystemBaseTest):
26 """ 26 """
27 27
28 @pytest.mark.snapshot_needed 28 @pytest.mark.snapshot_needed
29 @pytest.mark.revert_snapshot(ext.SNAPSHOT.k8s_deployed)
30 @pytest.mark.fail_snapshot 29 @pytest.mark.fail_snapshot
31 def test_lcm_k8s_scale_up(self, hardware, underlay, k8scluster): 30 def test_lcm_k8s_scale_up(self, hardware, underlay, k8scluster):
32 """Test for scale an k8s environment 31 """Test for scale an k8s environment