summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVijay Avuthu <vavuthu@redhat.com>2018-10-22 15:24:23 +0530
committerVijay Avuthu <vavuthu@redhat.com>2018-10-23 05:58:43 +0000
commit626417efc66ad084bac09754f7b44c2610f885e2 (patch)
tree50eaf22415907c41dda6e61aa2edb3b509ddfa53 /tests
parent12bea024899fc191704c582bc24cd6c84ba8f778 (diff)
Fixing the issue bringing bricks online.
bring_bricks_online method takes list as parameter, but in the test cases, it passed as str. Change-Id: I07caef7ef6510268856d832221d8b2993d3e9751
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/afr/test_afr_cli_gfid_splitbrain.py48
1 files changed, 22 insertions, 26 deletions
diff --git a/tests/functional/afr/test_afr_cli_gfid_splitbrain.py b/tests/functional/afr/test_afr_cli_gfid_splitbrain.py
index 483e50f..ec3f803 100644
--- a/tests/functional/afr/test_afr_cli_gfid_splitbrain.py
+++ b/tests/functional/afr/test_afr_cli_gfid_splitbrain.py
@@ -105,19 +105,17 @@ class TestSelfHeal(GlusterBaseClass):
self.assertIsNotNone(all_bricks, "unable to get list of bricks")
g.log.info("bringing down brick1")
ret = bring_bricks_offline(self.volname, all_bricks[0])
- self.assertTrue(ret, "unable to bring brick1 offline")
+ self.assertTrue(ret, "unable to bring %s offline" % all_bricks[0])
g.log.info("Successfully brought the following brick offline "
- ": %s", str(all_bricks[0]))
+ ": %s", all_bricks[0])
g.log.info("creating a file from mount point")
all_mounts_procs = []
- for mount_obj in self.mounts:
- cmd = ("python %s create_files "
- "-f 1 --base-file-name test_file --fixed-file-size 1k %s"
- % (self.script_upload_path, mount_obj.mountpoint))
- proc = g.run_async(mount_obj.client_system, cmd,
- user=mount_obj.user)
- all_mounts_procs.append(proc)
+ cmd = ("python %s create_files "
+ "-f 1 --base-file-name test_file --fixed-file-size 1k %s"
+ % (self.script_upload_path, self.mounts[0].mountpoint))
+ proc = g.run_async(self.mounts[0].client_system, cmd)
+ all_mounts_procs.append(proc)
# Validate I/O
self.assertTrue(
validate_io_procs(all_mounts_procs, self.mounts),
@@ -126,26 +124,24 @@ class TestSelfHeal(GlusterBaseClass):
g.log.info("Successfully created a file from mount point")
g.log.info("bringing brick 1 back online")
- ret = bring_bricks_online(self.mnode, self.volname, all_bricks[0])
- self.assertIsNotNone(ret, "unable to bring brick 1 online")
+ ret = bring_bricks_online(self.mnode, self.volname, [all_bricks[0]])
+ self.assertIsNotNone(ret, "unable to bring %s online" % all_bricks[0])
g.log.info("Successfully brought the following brick online "
- ": %s", str(all_bricks[0]))
+ ": %s", all_bricks[0])
g.log.info("bringing down brick2")
ret = bring_bricks_offline(self.volname, all_bricks[1])
- self.assertTrue(ret, "unable to bring brick2 offline")
+ self.assertTrue(ret, "unable to bring %s offline" % all_bricks[0])
g.log.info("Successfully brought the following brick offline "
- ": %s", str(all_bricks[1]))
+ ": %s", all_bricks[1])
g.log.info("creating a new file of same name from mount point")
all_mounts_procs = []
- for mount_obj in self.mounts:
- cmd = ("python %s create_files "
- "-f 1 --base-file-name test_file --fixed-file-size 1k %s"
- % (self.script_upload_path, mount_obj.mountpoint))
- proc = g.run_async(mount_obj.client_system, cmd,
- user=mount_obj.user)
- all_mounts_procs.append(proc)
+ cmd = ("python %s create_files "
+ "-f 1 --base-file-name test_file --fixed-file-size 1k %s"
+ % (self.script_upload_path, self.mounts[0].mountpoint))
+ proc = g.run_async(self.mounts[0].client_system, cmd)
+ all_mounts_procs.append(proc)
# Validate I/O
self.assertTrue(
validate_io_procs(all_mounts_procs, self.mounts),
@@ -155,10 +151,10 @@ class TestSelfHeal(GlusterBaseClass):
"from mount point")
g.log.info("bringing brick2 back online")
- ret = bring_bricks_online(self.mnode, self.volname, all_bricks[1])
- self.assertIsNotNone(ret, "unable to bring brick2 online")
+ ret = bring_bricks_online(self.mnode, self.volname, [all_bricks[1]])
+ self.assertIsNotNone(ret, "unable to bring %s online" % all_bricks[0])
g.log.info("Successfully brought the following brick online "
- ": %s", str(all_bricks[1]))
+ ": %s", all_bricks[1])
g.log.info("enabling the self heal daemon")
ret = enable_self_heal_daemon(self.mnode, self.volname)
@@ -173,8 +169,8 @@ class TestSelfHeal(GlusterBaseClass):
g.log.info("resolving split-brain by choosing second brick as "
"the source brick")
node, _ = all_bricks[0].split(':')
- command = ("gluster v heal " + self.volname + " split-brain "
- "source-brick " + all_bricks[1] + " /test_file0.txt")
+ command = ("gluster volume heal %s split-brain source-brick %s "
+ "/test_file0.txt" % (self.volname, all_bricks[1]))
ret, _, _ = g.run(node, command)
self.assertEqual(ret, 0, "command execution not successful")
# triggering heal