From 8b6107b62dacf5edc264f4f0206771d8fa07f7bf Mon Sep 17 00:00:00 2001 From: Valerii Ponomarov Date: Thu, 20 Dec 2018 23:04:22 +0530 Subject: Add abstraction between deployment types and gluster commands Now, it is possible to run glustolibs commands on both deployment types: containerized and standalone. It is possible using 'auto_get_gluster_endpoint' as target for lib function in addition to the '@podcmd.GlustoPod()' decorator. Example: """ from glustolibs.gluster.volume_ops import get_volume_list from cnslibs.common import heketi_libs from cnslibs.common import podcmd class TestExample(heketi_libs.HeketiBaseClass): @podcmd.GlustoPod() def test_get_vol_list_either_on_node_or_on_pod(self): volumes = get_volume_list('auto_get_gluster_endpoint') """ Also, delete all the current usages of 'deployment_type' config option, and delete the option as unneeded anymore. Change-Id: I281f287c432a5a9efefda588be436ee285188697 --- .../common/heketi/heketi_tests/test_disabling_device.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'tests/functional/common/heketi/heketi_tests/test_disabling_device.py') diff --git a/tests/functional/common/heketi/heketi_tests/test_disabling_device.py b/tests/functional/common/heketi/heketi_tests/test_disabling_device.py index 43d222a2..5d5e867c 100644 --- a/tests/functional/common/heketi/heketi_tests/test_disabling_device.py +++ b/tests/functional/common/heketi/heketi_tests/test_disabling_device.py @@ -4,7 +4,6 @@ from glustolibs.gluster.volume_ops import get_volume_info from cnslibs.common import exceptions from cnslibs.common import heketi_libs from cnslibs.common import heketi_ops -from cnslibs.common import openshift_ops from cnslibs.common import podcmd @@ -122,12 +121,6 @@ class TestDisableHeketiDevice(heketi_libs.HeketiBaseClass): name = out["name"] # Get gluster volume info - if self.deployment_type == "cns": - gluster_pod = openshift_ops.get_ocp_gluster_pod_names( - self.heketi_client_node)[1] - p = podcmd.Pod(self.heketi_client_node, gluster_pod) - out = get_volume_info(p, volname=name) - else: - out = get_volume_info(self.heketi_client_node, volname=name) - self.assertTrue(out, "Failed to get '%s' volume info." % name) + vol_info = get_volume_info('auto_get_gluster_endpoint', volname=name) + self.assertTrue(vol_info, "Failed to get '%s' volume info." % name) g.log.info("Successfully got the '%s' volume info." % name) -- cgit