summaryrefslogtreecommitdiffstats
path: root/glustolibs-gluster/glustolibs/gluster/brickmux_ops.py
diff options
context:
space:
mode:
authorkshithijiyer <kshithij.ki@gmail.com>2019-12-10 19:01:44 +0530
committerBala Konda Reddy M <bmekala@redhat.com>2019-12-23 12:36:20 +0000
commit68d7bacad91349bb437b3c8cf6bbdf572562bbd3 (patch)
treeb73ff87dc5ec1df54eef339ce55a9302828c6546 /glustolibs-gluster/glustolibs/gluster/brickmux_ops.py
parent6a17654e9be3d5fbae9fa25249a7e2c8d892df3a (diff)
[TC] Gluster cli reset commands behaviour with brick mux
Test case steps: 1. Set cluster.brick-multiplex to enabled. 2. Create and start 2 volumes of type 1x3 and 2x3. 3. Check if cluster.brick-multiplex is enabled. 4. Reset the cluster using "gluster v reset all". 5. Check if cluster.brick-multiplex is disabled. 6. Create a new volume of type 2x3. 7. Set cluster.brick-multiplex to enabled. 8. Stop and start all three volumes. 9. Check the if pids match and check if more than one pids of glusterfsd is present. Additional library fix: Changing the command in check_brick_pid_matches_glusterfsd_pid() as it won't work when brick-mux is enabled. From: cmd = ("ps -eaf | grep glusterfsd | " "grep %s.%s | grep -v 'grep %s.%s'" % (volname, brick_node, volname, brick_node)) To: cmd = "pidof glusterfsd" Change-Id: If7bdde13071732b176a0a2289635319571872e47 Co-authored-by: Vitalii Koriakov <vkoriako@redhat.com> Signed-off-by: Vitalii Koriakov <vkoriako@redhat.com> Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
Diffstat (limited to 'glustolibs-gluster/glustolibs/gluster/brickmux_ops.py')
-rwxr-xr-xglustolibs-gluster/glustolibs/gluster/brickmux_ops.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/brickmux_ops.py b/glustolibs-gluster/glustolibs/gluster/brickmux_ops.py
index 48ffc0b..eeb4e2a 100755
--- a/glustolibs-gluster/glustolibs/gluster/brickmux_ops.py
+++ b/glustolibs-gluster/glustolibs/gluster/brickmux_ops.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-# Copyright (C) 2017-2018 Red Hat, Inc. <http://www.redhat.com>
+# Copyright (C) 2017-2019 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
@@ -119,18 +119,17 @@ def check_brick_pid_matches_glusterfsd_pid(mnode, volname):
"of brick path %s", brick_node, brick_path)
_rc = False
- cmd = ("ps -eaf | grep glusterfsd | "
- "grep %s.%s | grep -v 'grep %s.%s'"
- % (volname, brick_node,
- volname, brick_node))
+ cmd = "pidof glusterfsd"
ret, pid, _ = g.run(brick_node, cmd)
if ret != 0:
g.log.error("Failed to run the command %s on "
"node %s", cmd, brick_node)
_rc = False
- glusterfsd_pid = pid.split()[1]
- if glusterfsd_pid != brick_pid:
+ else:
+ glusterfsd_pid = pid.split()
+
+ if brick_pid not in glusterfsd_pid:
g.log.error("Brick pid %s doesn't match glusterfsd "
"pid %s of the node %s", brick_pid,
glusterfsd_pid, brick_node)