summaryrefslogtreecommitdiffstats
path: root/tests/functional/glusterd/test_create_vol_with_used_bricks.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/glusterd/test_create_vol_with_used_bricks.py')
-rw-r--r--tests/functional/glusterd/test_create_vol_with_used_bricks.py46
1 files changed, 23 insertions, 23 deletions
diff --git a/tests/functional/glusterd/test_create_vol_with_used_bricks.py b/tests/functional/glusterd/test_create_vol_with_used_bricks.py
index e37741d56..a5f94c077 100644
--- a/tests/functional/glusterd/test_create_vol_with_used_bricks.py
+++ b/tests/functional/glusterd/test_create_vol_with_used_bricks.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2018 Red Hat, Inc. <http://www.redhat.com>
+# Copyright (C) 2018-2020 Red Hat, Inc. <http://www.redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -19,6 +19,7 @@
"""
from glusto.core import Glusto as g
+
from glustolibs.gluster.exceptions import ExecutionError
from glustolibs.gluster.gluster_base_class import GlusterBaseClass, runs_on
from glustolibs.gluster.brick_ops import add_brick
@@ -37,16 +38,14 @@ class TestCreateVolWithUsedBricks(GlusterBaseClass):
@classmethod
def setUpClass(cls):
cls.counter = 1
- GlusterBaseClass.setUpClass.im_func(cls)
+ cls.get_super_method(cls, 'setUpClass')()
# Uploading file_dir script in all client direcotries
g.log.info("Upload io scripts to clients %s for running IO on "
"mounts", cls.clients)
- script_local_path = ("/usr/share/glustolibs/io/scripts/"
- "file_dir_ops.py")
cls.script_upload_path = ("/usr/share/glustolibs/io/scripts/"
"file_dir_ops.py")
- ret = upload_scripts(cls.clients, script_local_path)
+ ret = upload_scripts(cls.clients, cls.script_upload_path)
if not ret:
raise ExecutionError("Failed to upload IO scripts to "
"clients %s" % cls.clients)
@@ -78,7 +77,7 @@ class TestCreateVolWithUsedBricks(GlusterBaseClass):
"dir's of deleted volume")
# Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
def test_create_vol_used_bricks(self):
'''
@@ -107,12 +106,14 @@ class TestCreateVolWithUsedBricks(GlusterBaseClass):
g.log.info("Bricks added successfully to the volume %s", self.volname)
# Mounting the volume.
- ret, _, _ = mount_volume(self.volname, mtype=self.mount_type,
- mpoint=self.mounts[0].mountpoint,
- mserver=self.mnode,
- mclient=self.mounts[0].client_system)
- self.assertEqual(ret, 0, ("Volume %s is not mounted") % self.volname)
- g.log.info("Volume mounted successfully : %s", self.volname)
+ for mount_obj in self.mounts:
+ ret, _, _ = mount_volume(self.volname, mtype=self.mount_type,
+ mpoint=mount_obj.mountpoint,
+ mserver=self.mnode,
+ mclient=mount_obj.client_system)
+ self.assertEqual(ret, 0, ("Volume %s is not mounted") % (
+ self.volname))
+ g.log.info("Volume mounted successfully : %s", self.volname)
# run IOs
g.log.info("Starting IO on all mounts...")
@@ -120,11 +121,9 @@ class TestCreateVolWithUsedBricks(GlusterBaseClass):
for mount_obj in self.mounts:
g.log.info("Starting IO on %s:%s", mount_obj.client_system,
mount_obj.mountpoint)
- cmd = ("python %s create_deep_dirs_with_files "
- "--dirname-start-num %d "
- "--dir-depth 2 "
- "--dir-length 5 "
- "--max-num-of-dirs 3 "
+ cmd = ("/usr/bin/env python %s create_deep_dirs_with_files "
+ "--dirname-start-num %d --dir-depth 2 "
+ "--dir-length 5 --max-num-of-dirs 3 "
"--num-of-files 10 %s" % (self.script_upload_path,
self.counter,
mount_obj.mountpoint))
@@ -137,14 +136,15 @@ class TestCreateVolWithUsedBricks(GlusterBaseClass):
# Validate IO
self.assertTrue(
validate_io_procs(self.all_mounts_procs, self.mounts),
- "IO failed on some of the clients"
- )
+ "IO failed on some of the clients")
# Unmouting the volume.
- ret, _, _ = umount_volume(mclient=self.mounts[0].client_system,
- mpoint=self.mounts[0].mountpoint)
- self.assertEqual(ret, 0, ("Volume %s is not unmounted") % self.volname)
- g.log.info("Volume unmounted successfully : %s", self.volname)
+ for mount_obj in self.mounts:
+ ret, _, _ = umount_volume(mclient=mount_obj.client_system,
+ mpoint=mount_obj.mountpoint)
+ self.assertEqual(ret, 0, "Volume %s is not unmounted" % (
+ self.volname))
+ g.log.info("Volume unmounted successfully : %s", self.volname)
# Getting brick list
self.brick_list = get_all_bricks(self.mnode, self.volname)