From 2535cae8fbfdfa3eeb9b1c4462f01b8802be96f2 Mon Sep 17 00:00:00 2001 From: vamahaja Date: Thu, 12 Mar 2020 10:08:03 +0530 Subject: [TestFix] Add pytest marker for tier0 test cases Change-Id: I29093a09c3f0cc09eaa9c6d94bad882c0bafd91c Signed-off-by: vamahaja --- .../functional/provisioning/test_dynamic_provisioning_block.py | 7 +++++++ .../functional/provisioning/test_dynamic_provisioning_file.py | 10 ++++++++++ tests/functional/provisioning/test_pv_resize.py | 2 ++ tests/functional/provisioning/test_storage_class_cases.py | 5 +++++ 4 files changed, 24 insertions(+) (limited to 'tests/functional/provisioning') diff --git a/tests/functional/provisioning/test_dynamic_provisioning_block.py b/tests/functional/provisioning/test_dynamic_provisioning_block.py index d8a7fca8..4677527a 100644 --- a/tests/functional/provisioning/test_dynamic_provisioning_block.py +++ b/tests/functional/provisioning/test_dynamic_provisioning_block.py @@ -3,6 +3,7 @@ import random from unittest import skip from glusto.core import Glusto as g +import pytest from openshiftstoragelibs.baseclass import GlusterBlockBaseClass from openshiftstoragelibs.command import cmd_run @@ -86,6 +87,7 @@ class TestDynamicProvisioningBlockP0(GlusterBlockBaseClass): ret, 0, "Failed to execute '%s' command on '%s'." % (cmd, self.node)) + @pytest.mark.tier0 def test_dynamic_provisioning_glusterblock_hacount_true(self): """Validate dynamic provisioning for glusterblock """ @@ -96,6 +98,7 @@ class TestDynamicProvisioningBlockP0(GlusterBlockBaseClass): """ self.dynamic_provisioning_glusterblock(set_hacount=False) + @pytest.mark.tier0 def test_dynamic_provisioning_glusterblock_heketipod_failure(self): """Validate PVC with glusterblock creation when heketi pod is down""" datafile_path = '/mnt/fake_file_for_%s' % self.id() @@ -264,6 +267,7 @@ class TestDynamicProvisioningBlockP0(GlusterBlockBaseClass): self.ocp_client[0], cmd % log, gluster_node=g_host) self.assertTrue(out, "Command '%s' output is empty." % cmd) + @pytest.mark.tier0 def test_dynamic_provisioning_glusterblock_heketidown_pvc_delete(self): """Validate PVC deletion when heketi is down""" @@ -301,6 +305,7 @@ class TestDynamicProvisioningBlockP0(GlusterBlockBaseClass): # create a new PVC self.create_and_wait_for_pvc() + @pytest.mark.tier0 def test_recreate_app_pod_with_attached_block_pv(self): """Validate app pod attached block device I/O after restart""" datafile_path = '/mnt/temporary_test_file' @@ -329,6 +334,7 @@ class TestDynamicProvisioningBlockP0(GlusterBlockBaseClass): # Perform I/O on the new POD self.cmd_run(write_cmd % (new_pod_name, datafile_path)) + @pytest.mark.tier0 def test_volname_prefix_glusterblock(self): """Validate custom volname prefix blockvol""" @@ -348,6 +354,7 @@ class TestDynamicProvisioningBlockP0(GlusterBlockBaseClass): self.assertTrue(vol_name.startswith( self.sc.get('volumenameprefix', 'autotest'))) + @pytest.mark.tier0 def test_dynamic_provisioning_glusterblock_reclaim_policy_retain(self): """Validate retain policy for gluster-block after PVC deletion""" diff --git a/tests/functional/provisioning/test_dynamic_provisioning_file.py b/tests/functional/provisioning/test_dynamic_provisioning_file.py index d771b635..f62fa5fe 100644 --- a/tests/functional/provisioning/test_dynamic_provisioning_file.py +++ b/tests/functional/provisioning/test_dynamic_provisioning_file.py @@ -1,6 +1,7 @@ import time from glusto.core import Glusto as g +import pytest from openshiftstoragelibs.baseclass import BaseClass from openshiftstoragelibs.exceptions import ExecutionError @@ -107,11 +108,13 @@ class TestDynamicProvisioningP0(BaseClass): ret, 0, "Failed to execute '%s' command on %s" % (cmd, self.node)) + @pytest.mark.tier0 def test_dynamic_provisioning_glusterfile(self): """Validate dynamic provisioning for gluster file""" g.log.info("test_dynamic_provisioning_glusterfile") self.dynamic_provisioning_glusterfile(False) + @pytest.mark.tier0 def test_dynamic_provisioning_glusterfile_volname_prefix(self): """Validate dynamic provisioning for gluster file with vol name prefix """ @@ -123,6 +126,7 @@ class TestDynamicProvisioningP0(BaseClass): g.log.info("test_dynamic_provisioning_glusterfile volname prefix") self.dynamic_provisioning_glusterfile(True) + @pytest.mark.tier0 def test_dynamic_provisioning_glusterfile_heketipod_failure(self): """Validate dynamic provisioning for gluster file when heketi pod down """ @@ -205,6 +209,7 @@ class TestDynamicProvisioningP0(BaseClass): ret, 0, "Failed to execute command %s on %s" % (write_data_cmd, self.node)) + @pytest.mark.tier0 def test_dynamic_provisioning_glusterfile_gluster_pod_or_node_failure( self): """Create glusterblock PVC when gluster pod or node is down.""" @@ -281,6 +286,7 @@ class TestDynamicProvisioningP0(BaseClass): ret, out, err = async_io.async_communicate() self.assertEqual(ret, 0, "IO %s failed on %s" % (io_cmd, self.node)) + @pytest.mark.tier0 def test_storage_class_mandatory_params_glusterfile(self): """Validate storage-class creation with mandatory parameters""" @@ -330,6 +336,7 @@ class TestDynamicProvisioningP0(BaseClass): self.assertEqual( ret, 0, "Failed to execute command %s on %s" % (cmd, self.node)) + @pytest.mark.tier0 def test_dynamic_provisioning_glusterfile_heketidown_pvc_delete(self): """Validate deletion of PVC's when heketi is down""" @@ -367,6 +374,7 @@ class TestDynamicProvisioningP0(BaseClass): # create a new PVC self.create_and_wait_for_pvc() + @pytest.mark.tier0 def test_validate_pvc_in_multiple_app_pods(self): """Validate the use of a same claim in multiple app pods""" replicas = 5 @@ -396,6 +404,7 @@ class TestDynamicProvisioningP0(BaseClass): for pod_name in pod_names: self.assertIn("temp_%s" % pod_name, ls_out) + @pytest.mark.tier0 def test_pvc_deletion_while_pod_is_running(self): """Validate PVC deletion while pod is running""" if get_openshift_version() <= "3.9": @@ -423,6 +432,7 @@ class TestDynamicProvisioningP0(BaseClass): self.assertEqual( ret, 0, "Failed to execute command %s on %s" % (cmd, self.node)) + @pytest.mark.tier0 def test_dynamic_provisioning_glusterfile_reclaim_policy_retain(self): """Validate retain policy for glusterfs after deletion of pvc""" diff --git a/tests/functional/provisioning/test_pv_resize.py b/tests/functional/provisioning/test_pv_resize.py index 5ac956a2..520e9463 100644 --- a/tests/functional/provisioning/test_pv_resize.py +++ b/tests/functional/provisioning/test_pv_resize.py @@ -2,6 +2,7 @@ from unittest import skip import ddt from glusto.core import Glusto as g +import pytest from openshiftstoragelibs.baseclass import BaseClass from openshiftstoragelibs.openshift_storage_libs import enable_pvc_resize @@ -228,6 +229,7 @@ class TestPvResizeClass(BaseClass): self._pv_resize(exceed_free_space=True) + @pytest.mark.tier0 def test_pv_resize_by_exact_free_space(self): """Validate PVC resize when resized by exact available free space""" self._pv_resize(exceed_free_space=False) diff --git a/tests/functional/provisioning/test_storage_class_cases.py b/tests/functional/provisioning/test_storage_class_cases.py index ef4728b6..2955feca 100644 --- a/tests/functional/provisioning/test_storage_class_cases.py +++ b/tests/functional/provisioning/test_storage_class_cases.py @@ -1,5 +1,6 @@ import ddt from glusto.core import Glusto as g +import pytest from openshiftstoragelibs.exceptions import ExecutionError from openshiftstoragelibs.heketi_ops import ( @@ -204,6 +205,7 @@ class TestStorageClassCases(BaseClass): """Validate glusterblock storage with different incorrect parameters""" self.create_sc_with_parameter("glusterblock", parameter=parameter) + @pytest.mark.tier0 @ddt.data(1, 2) def test_gluster_block_provisioning_with_valid_ha_count(self, hacount): """Validate gluster-block provisioning with different valid 'hacount' @@ -235,6 +237,7 @@ class TestStorageClassCases(BaseClass): if hacount > 1: self.validate_multipath_info(hacount) + @pytest.mark.tier0 def test_gluster_block_provisioning_with_ha_count_as_glusterpod(self): """Validate gluster-block provisioning with "hacount" value equal to gluster pods count @@ -264,6 +267,7 @@ class TestStorageClassCases(BaseClass): ) self.validate_multipath_info(hacount) + @pytest.mark.tier0 def test_gluster_block_provisioning_with_invalid_ha_count(self): """Validate gluster-block provisioning with any invalid 'hacount' value @@ -295,6 +299,7 @@ class TestStorageClassCases(BaseClass): ) self.validate_multipath_info(gluster_pod_count) + @pytest.mark.tier0 @ddt.data('true', 'false', '') def test_gluster_block_chapauthenabled_parameter(self, chapauthenabled): """Validate gluster-block provisioning with different -- cgit