summaryrefslogtreecommitdiffstats
path: root/tests/bugs/bitrot
diff options
context:
space:
mode:
authorGauravKumarGarg <ggarg@redhat.com>2015-03-31 16:41:08 +0530
committerVenky Shankar <vshankar@redhat.com>2015-04-10 10:12:13 +0000
commitaccd61fb64b96c4af47aa6cfa41adb0f2e47a60a (patch)
tree2e1044171a52df21f090ca11c806ad93a8aa3269 /tests/bugs/bitrot
parentd57642044b720663c6474d318106c19e84f2c8bf (diff)
glusterd: bitd daemon should not start on the node which dont have any brick
If user enable bitrot from node1 which have brick then glusterd starting bitd daemon on node1 as well as glusterd starting bitd deamon on another node2 which does not have any brick (node1 and node2 are part of cluster). With this fix glusterd will not start bitd daemon on the node which don't have brick. Change-Id: Ic1c68d204221d369d89d628487cdd5957964792e BUG: 1207029 Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com> Reviewed-on: http://review.gluster.org/10071 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Venky Shankar <vshankar@redhat.com>
Diffstat (limited to 'tests/bugs/bitrot')
-rwxr-xr-xtests/bugs/bitrot/1207029-bitrot-daemon-should-start-on-valid-node.t55
1 files changed, 55 insertions, 0 deletions
diff --git a/tests/bugs/bitrot/1207029-bitrot-daemon-should-start-on-valid-node.t b/tests/bugs/bitrot/1207029-bitrot-daemon-should-start-on-valid-node.t
new file mode 100755
index 00000000000..e5b53bd0d24
--- /dev/null
+++ b/tests/bugs/bitrot/1207029-bitrot-daemon-should-start-on-valid-node.t
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+## Test case for bitrot
+## bitd daemon should not start on the node which dont have any brick
+
+
+. $(dirname $0)/../../include.rc
+. $(dirname $0)/../../volume.rc
+. $(dirname $0)/../../cluster.rc
+
+cleanup;
+
+
+## Start a 2 node virtual cluster
+TEST launch_cluster 2;
+
+## Peer probe server 2 from server 1 cli
+TEST $CLI_1 peer probe $H2;
+
+EXPECT_WITHIN $PROBE_TIMEOUT 1 peer_count
+
+## Creating a volume which is having brick only on one node
+TEST $CLI_1 volume create $V0 $H1:$B1/${V0}0 $H1:$B1/${V0}1
+
+## Start the volume
+TEST $CLI_1 volume start $V0
+
+## Enable bitrot on volume
+TEST $CLI_1 volume bitrot $V0 enable
+
+## Bitd daemon should be running on the node which is having brick. Here node1
+## only have brick so bitrot daemon count value should be 1.
+bitrot_daemon=$(ps auxww | grep glusterfs | grep bitd.pid | grep -v grep | wc -l)
+TEST [ "$bitrot_daemon" -eq 1 ];
+
+## Bitd daemon should not run on 2nd node and it should not create bitrot
+## volfile on this node. Below test case it to check whether its creating bitrot
+## volfile or not for 2nd node which dont have any brick.
+## Get current working directory of 2nd node which dont have any brick and do
+## stat on bitrot volfile.
+
+cur_wrk_dir2=$($CLI_2 system:: getwd)
+TEST ! stat $cur_wrk_dir2/bitd/bitd-server.vol
+
+
+## Bitd daemon should run on 1st node and it should create bitrot
+## volfile on this node. Below test case it to check whether its creating bitrot
+## volfile or not for 1st node which is having brick.
+## Get current working directory of 1st node which have brick and do
+## stat on bitrot volfile.
+
+cur_wrk_dir1=$($CLI_1 system:: getwd)
+TEST stat $cur_wrk_dir1/bitd/bitd-server.vol
+
+cleanup;