summaryrefslogtreecommitdiffstats
path: root/tests/functional/common/heketi/heketi_tests/test_disabling_device.py
diff options
context:
space:
mode:
authorValerii Ponomarov <vponomar@redhat.com>2018-12-20 23:04:22 +0530
committerValerii Ponomarov <vponomar@redhat.com>2018-12-25 20:54:32 +0530
commit8b6107b62dacf5edc264f4f0206771d8fa07f7bf (patch)
tree775a3755324ea3a272a65ba9eddf100a605208d1 /tests/functional/common/heketi/heketi_tests/test_disabling_device.py
parent418b6a6dd31e70888cfcc343922d43e4646f7184 (diff)
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
Diffstat (limited to 'tests/functional/common/heketi/heketi_tests/test_disabling_device.py')
-rw-r--r--tests/functional/common/heketi/heketi_tests/test_disabling_device.py11
1 files changed, 2 insertions, 9 deletions
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)