summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorValerii Ponomarov <vponomar@redhat.com>2019-01-10 16:55:17 +0000
committerGerrit Code Review <gerrit2@gerrit.host.prod.eng.bos.redhat.com>2019-01-10 16:55:18 +0000
commitfb6e0d6032993454c850c77c441f16ced772f8c2 (patch)
tree9c0d3793283c2a4a625e118fbbd0bda3ad0b8a5c /tests
parent2a31473675e98bc58adb492035cfbc4a30ecfacf (diff)
parentd60afd2af87aa4258edf1d9136e11712bb6ea891 (diff)
Merge "Fix 'verify_arbiter_brick_able_to_contain_expected_amount_of_files' tc"
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/common/arbiter/test_arbiter.py41
1 files changed, 19 insertions, 22 deletions
diff --git a/tests/functional/common/arbiter/test_arbiter.py b/tests/functional/common/arbiter/test_arbiter.py
index 4a0853b3..d4b391f6 100644
--- a/tests/functional/common/arbiter/test_arbiter.py
+++ b/tests/functional/common/arbiter/test_arbiter.py
@@ -3,8 +3,8 @@ import ddt
from cnslibs.cns import cns_baseclass
from cnslibs.common import heketi_ops
from cnslibs.common.openshift_ops import (
+ cmd_run_on_gluster_pod_or_node,
get_gluster_vol_info_by_pvc_name,
- get_ocp_gluster_pod_names,
oc_create_pvc,
oc_create_tiny_pod_with_volume,
oc_delete,
@@ -346,33 +346,30 @@ class TestArbiterVolumeCreateExpandDelete(cns_baseclass.BaseClass):
# Try to create expected amount of files on arbiter brick mount
passed_arbiter_bricks = []
not_found = "Mount Not Found"
- gluster_pods = get_ocp_gluster_pod_names(self.node)
for brick in bricks_info['arbiter_list']:
- for gluster_pod in gluster_pods:
- # "brick path" looks like following:
- # ip_addr:/path/to/vg/brick_unique_name/brick
- # So, we remove "ip_addr" and "/brick" parts to have mount path
- brick_path = brick["name"].split(":")[-1]
- cmd = "oc exec %s -- mount | grep %s || echo '%s'" % (
- gluster_pod, brick_path[0:-6], not_found)
- out = self.cmd_run(cmd)
- if out != not_found:
- cmd = (
- "oc exec %s -- python -c \"["
- " open('%s/foo_file{0}'.format(i), 'a').close()"
- " for i in range(%s)"
- "]\"" % (gluster_pod, brick_path, expected_file_amount)
- )
- out = self.cmd_run(cmd)
- passed_arbiter_bricks.append(brick_path)
- break
+ # "brick path" looks like following:
+ # ip_addr:/path/to/vg/brick_unique_name/brick
+ gluster_ip, brick_path = brick["name"].split(":")
+ brick_path = brick_path[0:-6]
+
+ cmd = "mount | grep %s || echo '%s'" % (brick_path, not_found)
+ out = cmd_run_on_gluster_pod_or_node(self.node, cmd, gluster_ip)
+ if out != not_found:
+ cmd = (
+ "python -c \"["
+ " open('%s/foo_file{0}'.format(i), 'a').close()"
+ " for i in range(%s)"
+ "]\"" % (brick_path, expected_file_amount)
+ )
+ cmd_run_on_gluster_pod_or_node(self.node, cmd, gluster_ip)
+ passed_arbiter_bricks.append(brick["name"])
# Make sure all the arbiter bricks were checked
for brick in bricks_info['arbiter_list']:
self.assertIn(
- brick["name"].split(":")[-1], passed_arbiter_bricks,
+ brick["name"], passed_arbiter_bricks,
"Arbiter brick '%s' was not verified. Looks like it was "
- "not found on any of gluster nodes." % brick_path)
+ "not found on any of gluster PODs/nodes." % brick["name"])
@ddt.data(True, False)
def test_aribiter_required_tag_on_node_or_devices_other_disabled(