summaryrefslogtreecommitdiffstats
path: root/tests/functional/heketi
diff options
context:
space:
mode:
authorvamahaja <vamahaja@redhat.com>2020-03-12 10:08:03 +0530
committervamahaja <vamahaja@redhat.com>2020-03-13 13:26:06 +0530
commit2535cae8fbfdfa3eeb9b1c4462f01b8802be96f2 (patch)
tree14fdd5e0b2b5a1cf1382cedc16618989d2721900 /tests/functional/heketi
parentb9db2f4be8f1dcabb31f3ea93f9b3b12bff66603 (diff)
[TestFix] Add pytest marker for tier0 test cases
Change-Id: I29093a09c3f0cc09eaa9c6d94bad882c0bafd91c Signed-off-by: vamahaja <vamahaja@redhat.com>
Diffstat (limited to 'tests/functional/heketi')
-rw-r--r--tests/functional/heketi/test_block_volumes_heketi.py8
-rw-r--r--tests/functional/heketi/test_check_brick_paths.py2
-rw-r--r--tests/functional/heketi/test_create_distributed_replica_heketi_volume.py3
-rw-r--r--tests/functional/heketi/test_heketi_create_volume.py4
-rw-r--r--tests/functional/heketi/test_heketi_device_operations.py3
-rw-r--r--tests/functional/heketi/test_heketi_node_operations.py5
-rw-r--r--tests/functional/heketi/test_restart_heketi_pod.py4
-rw-r--r--tests/functional/heketi/test_server_state_examine_gluster.py2
-rw-r--r--tests/functional/heketi/test_volume_creation.py4
-rw-r--r--tests/functional/heketi/test_volume_deletion.py4
-rw-r--r--tests/functional/heketi/test_volume_expansion_and_devices.py4
-rw-r--r--tests/functional/heketi/test_volume_multi_req.py4
12 files changed, 47 insertions, 0 deletions
diff --git a/tests/functional/heketi/test_block_volumes_heketi.py b/tests/functional/heketi/test_block_volumes_heketi.py
index 1e78180d..7ab6cab0 100644
--- a/tests/functional/heketi/test_block_volumes_heketi.py
+++ b/tests/functional/heketi/test_block_volumes_heketi.py
@@ -6,6 +6,7 @@ from glustolibs.gluster.volume_ops import (
volume_start,
volume_stop,
)
+import pytest
from openshiftstoragelibs.baseclass import BaseClass
from openshiftstoragelibs import exceptions
@@ -44,6 +45,7 @@ class TestBlockVolumeOps(BaseClass):
after manually creating a Block Hosting volume.
"""
+ @pytest.mark.tier0
def test_create_block_vol_after_host_vol_creation(self):
"""Validate block-device after manual block hosting volume creation
using heketi
@@ -61,6 +63,7 @@ class TestBlockVolumeOps(BaseClass):
heketi_blockvolume_delete, self.heketi_client_node,
self.heketi_server_url, block_vol["id"])
+ @pytest.mark.tier0
def test_block_host_volume_delete_without_block_volumes(self):
"""Validate deletion of empty block hosting volume"""
block_host_create_info = heketi_volume_create(
@@ -76,6 +79,7 @@ class TestBlockVolumeOps(BaseClass):
self.heketi_client_node, self.heketi_server_url,
block_hosting_vol_id, json=True)
+ @pytest.mark.tier0
def test_block_volume_delete(self):
"""Validate deletion of gluster-block volume and capacity of used pool
"""
@@ -95,6 +99,7 @@ class TestBlockVolumeOps(BaseClass):
"The block volume has not been successfully deleted,"
" ID is %s" % block_vol["id"])
+ @pytest.mark.tier0
def test_block_volume_list(self):
"""Validate heketi blockvolume list command works as expected"""
created_vol_ids = []
@@ -116,6 +121,7 @@ class TestBlockVolumeOps(BaseClass):
"Block vol with '%s' ID is absent in the "
"list of block volumes." % vol_id)
+ @pytest.mark.tier0
def test_block_host_volume_delete_block_volume_delete(self):
"""Validate block volume and BHV removal using heketi"""
free_space, nodenum = get_total_free_space(
@@ -157,6 +163,7 @@ class TestBlockVolumeOps(BaseClass):
self.assertIn(
block_vol_info["id"], bhv_info["blockinfo"]["blockvolume"])
+ @pytest.mark.tier0
@podcmd.GlustoPod()
def test_validate_gluster_voloptions_blockhostvolume(self):
"""Validate gluster volume options which are set for
@@ -239,6 +246,7 @@ class TestBlockVolumeOps(BaseClass):
("Password is %spresent in %s", (assertion_msg_part,
block_vol["id"])))
+ @pytest.mark.tier0
def test_block_volume_create_with_name(self):
"""Validate creation of block volume with name"""
vol_name = "autotests-heketi-volume-%s" % utils.get_random_str()
diff --git a/tests/functional/heketi/test_check_brick_paths.py b/tests/functional/heketi/test_check_brick_paths.py
index 3c8aa6df..de453de8 100644
--- a/tests/functional/heketi/test_check_brick_paths.py
+++ b/tests/functional/heketi/test_check_brick_paths.py
@@ -1,4 +1,5 @@
from glusto.core import Glusto as g
+import pytest
from openshiftstoragelibs.baseclass import BaseClass
from openshiftstoragelibs.heketi_ops import (
@@ -27,6 +28,7 @@ class TestHeketiVolume(BaseClass):
results.append(out)
assertion_method('present', results)
+ @pytest.mark.tier0
def test_validate_brick_paths_on_gluster_pods_or_nodes(self):
"""Validate brick paths after creation and deletion of a volume."""
diff --git a/tests/functional/heketi/test_create_distributed_replica_heketi_volume.py b/tests/functional/heketi/test_create_distributed_replica_heketi_volume.py
index c2a6e523..e9eccce0 100644
--- a/tests/functional/heketi/test_create_distributed_replica_heketi_volume.py
+++ b/tests/functional/heketi/test_create_distributed_replica_heketi_volume.py
@@ -4,6 +4,7 @@ import math
import ddt
from glusto.core import Glusto as g
from glustolibs.gluster.volume_ops import get_volume_list, get_volume_info
+import pytest
from openshiftstoragelibs.baseclass import BaseClass
from openshiftstoragelibs.heketi_ops import (
@@ -194,12 +195,14 @@ class TestHeketiVolume(BaseClass):
free_space_after_creating_vol,
free_space_after_deleting_vol))
+ @pytest.mark.tier0
def test_to_create_and_delete_dist_rep_vol(self):
"""Validate 2x3 vol type creation when the volume cannot be
carved out of a single device
"""
self._create_distributed_replica_vol(validate_cleanup=True)
+ @pytest.mark.tier0
@ddt.data(True, False)
def test_create_and_delete_dist_replicated_bhv(self, validate_cleanup):
"""Validate distributed replicated bhv using heketi-cli"""
diff --git a/tests/functional/heketi/test_heketi_create_volume.py b/tests/functional/heketi/test_heketi_create_volume.py
index 79d54f48..0ade5946 100644
--- a/tests/functional/heketi/test_heketi_create_volume.py
+++ b/tests/functional/heketi/test_heketi_create_volume.py
@@ -8,6 +8,7 @@ except ImportError:
from glusto.core import Glusto as g
from glustolibs.gluster.volume_ops import get_volume_list, get_volume_info
import mock
+import pytest
import six
from openshiftstoragelibs.baseclass import BaseClass
@@ -43,6 +44,7 @@ class TestHeketiVolume(BaseClass):
super(TestHeketiVolume, cls).setUpClass()
cls.volume_size = 1
+ @pytest.mark.tier0
@podcmd.GlustoPod()
def test_volume_create_and_list_volume(self):
"""Validate heketi and gluster volume list"""
@@ -117,6 +119,7 @@ class TestHeketiVolume(BaseClass):
self.assertTrue(vol_info, "Failed to get volume info %s" % name)
g.log.info("Successfully got the volume info %s" % name)
+ @pytest.mark.tier0
def test_create_vol_and_retrieve_topology_info(self):
volume_names = []
volume_ids = []
@@ -221,6 +224,7 @@ class TestHeketiVolume(BaseClass):
self.assertTrue(out, ("Failed to list heketi cluster"))
g.log.info("All heketi cluster successfully listed")
+ @pytest.mark.tier0
def test_to_check_deletion_of_node(self):
"""Validate deletion of a node which contains devices"""
diff --git a/tests/functional/heketi/test_heketi_device_operations.py b/tests/functional/heketi/test_heketi_device_operations.py
index b4987ba6..aaa7e2c5 100644
--- a/tests/functional/heketi/test_heketi_device_operations.py
+++ b/tests/functional/heketi/test_heketi_device_operations.py
@@ -1,5 +1,6 @@
import ddt
from glusto.core import Glusto as g
+import pytest
from openshiftstoragelibs.baseclass import BaseClass
from openshiftstoragelibs.heketi_ops import (
@@ -95,6 +96,7 @@ class TestHeketiDeviceOperations(BaseClass):
return online_hosts
+ @pytest.mark.tier0
def test_heketi_device_enable_disable(self):
"""Validate device enable and disable functionality"""
@@ -174,6 +176,7 @@ class TestHeketiDeviceOperations(BaseClass):
"None of '%s' volume bricks is present on the '%s' device." % (
vol_info['id'], online_device_id))
+ @pytest.mark.tier0
@ddt.data(True, False)
def test_heketi_device_remove(self, delete_device):
"""Validate remove/delete device using heketi-cli"""
diff --git a/tests/functional/heketi/test_heketi_node_operations.py b/tests/functional/heketi/test_heketi_node_operations.py
index c4908b3c..6b23b325 100644
--- a/tests/functional/heketi/test_heketi_node_operations.py
+++ b/tests/functional/heketi/test_heketi_node_operations.py
@@ -1,6 +1,7 @@
import ddt
from glusto.core import Glusto as g
from glustolibs.gluster import peer_ops
+import pytest
import six
from openshiftstoragelibs import baseclass
@@ -24,6 +25,7 @@ class TestHeketiNodeOperations(baseclass.BaseClass):
self.h_node = self.heketi_client_node
self.h_url = self.heketi_server_url
+ @pytest.mark.tier0
@podcmd.GlustoPod()
def test_heketi_node_list(self):
"""Test node list operation
@@ -70,6 +72,7 @@ class TestHeketiNodeOperations(baseclass.BaseClass):
"Failed to match node ID. Exp: %s, Act: %s" % (
node_id, node_info["id"]))
+ @pytest.mark.tier0
def test_heketi_node_states_enable_disable(self):
"""Test node enable and disable functionality
"""
@@ -162,6 +165,7 @@ class TestHeketiNodeOperations(baseclass.BaseClass):
return storage_hostname, storage_ip
+ @pytest.mark.tier0
@podcmd.GlustoPod()
def test_heketi_node_add_with_valid_cluster(self):
"""Test heketi node add operation with valid cluster id"""
@@ -415,6 +419,7 @@ class TestHeketiNodeOperations(baseclass.BaseClass):
self.h_node, self.h_url, device['id'])
heketi_ops.heketi_node_delete(self.h_node, self.h_url, node_id)
+ @pytest.mark.tier0
@ddt.data('remove', 'delete')
def test_heketi_node_remove_or_delete(self, operation='delete'):
"""Test node remove and delete functionality of heketi and validate
diff --git a/tests/functional/heketi/test_restart_heketi_pod.py b/tests/functional/heketi/test_restart_heketi_pod.py
index 5e778890..90f49682 100644
--- a/tests/functional/heketi/test_restart_heketi_pod.py
+++ b/tests/functional/heketi/test_restart_heketi_pod.py
@@ -6,6 +6,8 @@ except ImportError:
# py2
import json
+import pytest
+
from openshiftstoragelibs.baseclass import BaseClass
from openshiftstoragelibs.heketi_ops import (
heketi_topology_info,
@@ -26,6 +28,7 @@ from openshiftstoragelibs.openshift_ops import (
class TestRestartHeketi(BaseClass):
+ @pytest.mark.tier0
def test_restart_heketi_pod(self):
"""Validate restarting heketi pod"""
@@ -77,6 +80,7 @@ class TestRestartHeketi(BaseClass):
heketi_volume_delete(
self.heketi_client_node, self.heketi_server_url, vol_info['id'])
+ @pytest.mark.tier0
def test_set_heketi_vol_size_and_brick_amount_limits(self):
# Get Heketi secret name
cmd_get_heketi_secret_name = (
diff --git a/tests/functional/heketi/test_server_state_examine_gluster.py b/tests/functional/heketi/test_server_state_examine_gluster.py
index 1afeedd0..60a9e1cb 100644
--- a/tests/functional/heketi/test_server_state_examine_gluster.py
+++ b/tests/functional/heketi/test_server_state_examine_gluster.py
@@ -1,4 +1,5 @@
import ddt
+import pytest
from openshiftstoragelibs.baseclass import BaseClass
from openshiftstoragelibs import heketi_ops
@@ -48,6 +49,7 @@ class TestHeketiServerStateExamineGluster(BaseClass):
"heketi volume list matches with volume list of all nodes",
out['report'])
+ @pytest.mark.tier0
@ddt.data('', 'block')
def test_compare_real_vol_count_with_db_check_info(self, vol_type):
"""Validate file/block volumes using heketi db check."""
diff --git a/tests/functional/heketi/test_volume_creation.py b/tests/functional/heketi/test_volume_creation.py
index 354f7889..a1671c28 100644
--- a/tests/functional/heketi/test_volume_creation.py
+++ b/tests/functional/heketi/test_volume_creation.py
@@ -1,6 +1,7 @@
from glusto.core import Glusto as g
from glustolibs.gluster import snap_ops
from glustolibs.gluster import volume_ops
+import pytest
import six
from openshiftstoragelibs.baseclass import BaseClass
@@ -18,6 +19,7 @@ class TestVolumeCreationTestCases(BaseClass):
super(TestVolumeCreationTestCases, self).setUp()
self.node = self.ocp_master_node[0]
+ @pytest.mark.tier0
@podcmd.GlustoPod()
def test_create_heketi_volume(self):
"""Test heketi volume creation and background gluster validation"""
@@ -90,6 +92,7 @@ class TestVolumeCreationTestCases(BaseClass):
[brick_name]["status"]), 1,
"Brick %s is not up" % brick_name)
+ @pytest.mark.tier0
def test_volume_creation_no_free_devices(self):
"""Validate heketi error is returned when no free devices available"""
node, server_url = self.heketi_client_node, self.heketi_server_url
@@ -242,6 +245,7 @@ class TestVolumeCreationTestCases(BaseClass):
g_vol_info = g_vol_info.get(file_vol)
return g_vol_info
+ @pytest.mark.tier0
def test_volume_creation_of_size_greater_than_the_device_size(self):
"""Validate creation of a volume of size greater than the size of a
device.
diff --git a/tests/functional/heketi/test_volume_deletion.py b/tests/functional/heketi/test_volume_deletion.py
index 97c4924d..5059002e 100644
--- a/tests/functional/heketi/test_volume_deletion.py
+++ b/tests/functional/heketi/test_volume_deletion.py
@@ -1,5 +1,7 @@
from __future__ import division
+import pytest
+
from openshiftstoragelibs.baseclass import BaseClass
from openshiftstoragelibs.exceptions import ExecutionError
from openshiftstoragelibs import heketi_ops
@@ -30,6 +32,7 @@ class TestVolumeDeleteTestCases(BaseClass):
return total_free_space
+ @pytest.mark.tier0
def test_delete_heketi_volume(self):
"""
Method to test heketi volume deletion and whether it
@@ -52,6 +55,7 @@ class TestVolumeDeleteTestCases(BaseClass):
free_space_after_deletion > free_space_after_creation,
"Free space is not reclaimed after deletion of %s" % volume_id)
+ @pytest.mark.tier0
def test_delete_heketidb_volume(self):
"""Method to test heketidb volume deletion via heketi-cli."""
for i in range(0, 2):
diff --git a/tests/functional/heketi/test_volume_expansion_and_devices.py b/tests/functional/heketi/test_volume_expansion_and_devices.py
index f73ed736..cf6eb1a3 100644
--- a/tests/functional/heketi/test_volume_expansion_and_devices.py
+++ b/tests/functional/heketi/test_volume_expansion_and_devices.py
@@ -3,6 +3,7 @@ import math
from glusto.core import Glusto as g
from glustolibs.gluster import volume_ops, rebalance_ops
+import pytest
from openshiftstoragelibs.baseclass import BaseClass
from openshiftstoragelibs import (
@@ -161,6 +162,7 @@ class TestVolumeExpansionAndDevicesTestCases(BaseClass):
device_delete, False,
"Device %s could not be deleted" % device_id)
+ @pytest.mark.tier0
def test_volume_expansion_expanded_volume(self):
"""Validate volume expansion with brick and check rebalance"""
creation_info = heketi_ops.heketi_volume_create(
@@ -300,6 +302,7 @@ class TestVolumeExpansionAndDevicesTestCases(BaseClass):
"Free space not reclaimed after deletion of %s"
% volume_id)
+ @pytest.mark.tier0
def test_volume_expansion_no_free_space(self):
"""Validate volume expansion when there is no free space"""
@@ -437,6 +440,7 @@ class TestVolumeExpansionAndDevicesTestCases(BaseClass):
free_space_after_deletion, free_space_after_expansion,
"Free space not reclaimed after deletion of volume %s" % volume_id)
+ @pytest.mark.tier0
@podcmd.GlustoPod()
def test_volume_expansion_rebalance_brick(self):
"""Validate volume expansion with brick and check rebalance"""
diff --git a/tests/functional/heketi/test_volume_multi_req.py b/tests/functional/heketi/test_volume_multi_req.py
index 9fcaeb49..44c53035 100644
--- a/tests/functional/heketi/test_volume_multi_req.py
+++ b/tests/functional/heketi/test_volume_multi_req.py
@@ -7,6 +7,7 @@ import threading
import time
import ddt
+import pytest
import yaml
from glusto.core import Glusto as g
@@ -222,6 +223,7 @@ class TestVolumeMultiReq(BaseClass):
ocp_node = list(g.config['ocp_servers']['master'].keys())[0]
return len(_heketi_vols(ocp_node, self.heketi_server_url))
+ @pytest.mark.tier0
def test_simple_serial_vol_create(self):
"""Test that serially creating PVCs causes heketi to add volumes.
"""
@@ -282,6 +284,7 @@ class TestVolumeMultiReq(BaseClass):
self.assertIn(c2.heketiVolumeName, now_vols)
self.assertNotIn(c2.heketiVolumeName, orig_vols)
+ @pytest.mark.tier0
def test_multiple_vol_create(self):
"""Test creating two volumes via PVCs with no waiting between
the PVC requests.
@@ -383,6 +386,7 @@ class TestVolumeMultiReq(BaseClass):
c.update_pv_info(ocp_node)
self.assertIn(c.heketiVolumeName, now_vols)
+ @pytest.mark.tier0
def test_create_delete_volumes_concurrently(self):
"""Test creating volume when "other processes" are creating
and deleting other volumes in the background.