diff options
author | SushilG96 <guptarahul201010@gmail.com> | 2019-12-19 12:16:30 +0530 |
---|---|---|
committer | Vaibhav Mahajan <vamahaja@redhat.com> | 2020-01-24 09:48:00 +0000 |
commit | 4636f6b080156388bed026c94a9e6ea8fd9242e9 (patch) | |
tree | 25ae60ebc02973b56716b984af68d9e4bb2f92f0 /tests/functional/arbiter/test_arbiter.py | |
parent | 1269e4fe3ac8c8ee3f19f94141675b8c71dbc81b (diff) |
[Test] Add tc to validate PVC, heketi and gluster vol mapping in scale
Change-Id: I556e7f03013bd39780f2107f91aedec87a3c2ee0
Diffstat (limited to 'tests/functional/arbiter/test_arbiter.py')
-rw-r--r-- | tests/functional/arbiter/test_arbiter.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/functional/arbiter/test_arbiter.py b/tests/functional/arbiter/test_arbiter.py index fb284e0c..9d0cd2bd 100644 --- a/tests/functional/arbiter/test_arbiter.py +++ b/tests/functional/arbiter/test_arbiter.py @@ -6,6 +6,7 @@ from glustolibs.gluster import volume_ops from openshiftstoragelibs import baseclass from openshiftstoragelibs import exceptions +from openshiftstoragelibs import gluster_ops from openshiftstoragelibs import heketi_ops from openshiftstoragelibs import heketi_version from openshiftstoragelibs import openshift_ops @@ -14,6 +15,7 @@ from openshiftstoragelibs import podcmd from openshiftstoragelibs import utils BRICK_REGEX = r"^(.*):\/var\/lib\/heketi\/mounts\/(.*)\/brick$" +HEKETI_VOLS = re.compile(r"Id:(\S+)\s+Cluster:(\S+)\s+Name:(\S+)") @ddt.ddt @@ -802,3 +804,28 @@ class TestArbiterVolumeCreateExpandDelete(baseclass.BaseClass): cmd = "lvs %s" % lv_match.group(2).strip() openshift_ops.cmd_run_on_gluster_pod_or_node( self.node, cmd, gluster_node_ip) + + def test_arbiter_scaled_heketi_and_gluster_volume_mapping(self): + """Test to validate PVC, Heketi & gluster volume mapping + for large no of PVC's + """ + prefix = "autotest-{}".format(utils.get_random_str()) + + sc_name = self.create_storage_class( + vol_name_prefix=prefix, is_arbiter_vol=True) + for count in range(5): + self.create_and_wait_for_pvcs( + pvc_name_prefix=prefix, pvc_amount=20, + sc_name=sc_name, timeout=300, wait_step=5) + openshift_ops.match_pvc_and_pv(self.heketi_client_node, prefix) + + h_vol_list = heketi_ops.heketi_volume_list_by_name_prefix( + self.heketi_client_node, self.heketi_server_url, prefix, json=True) + heketi_volume_ids = sorted([v[0] for v in h_vol_list]) + openshift_ops.match_pv_and_heketi_volumes( + self.heketi_client_node, heketi_volume_ids, prefix) + + heketi_volume_names = sorted([ + v[2].replace("{}_".format(prefix), "") for v in h_vol_list]) + gluster_ops.match_heketi_and_gluster_volumes_by_prefix( + heketi_volume_names, "{}_".format(prefix)) |