4
## bitd daemon should not start on the node which dont have any brick
7
. $(dirname $0)/../../include.rc
8
. $(dirname $0)/../../volume.rc
9
. $(dirname $0)/../../cluster.rc
13
function get_bitd_count {
14
ps auxw | grep glusterfs | grep bitd.pid | grep -v grep | wc -l
17
## Start a 2 node virtual cluster
20
## Peer probe server 2 from server 1 cli
21
TEST $CLI_1 peer probe $H2;
23
EXPECT_WITHIN $PROBE_TIMEOUT 1 peer_count
25
## Creating a volume which is having brick only on one node
26
TEST $CLI_1 volume create $V0 $H1:$B1/${V0}0 $H1:$B1/${V0}1
29
TEST $CLI_1 volume start $V0
31
## Enable bitrot on volume from 2nd node.
32
TEST $CLI_2 volume bitrot $V0 enable
34
## Bitd daemon should be running on the node which is having brick. Here node1
35
## only have brick so bitrot daemon count value should be 1.
36
EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" get_bitd_count
38
## Bitd daemon should not run on 2nd node and it should not create bitrot
39
## volfile on this node. Below test case it to check whether its creating bitrot
40
## volfile or not for 2nd node which dont have any brick.
41
## Get current working directory of 2nd node which dont have any brick and do
42
## stat on bitrot volfile.
44
cur_wrk_dir2=$($CLI_2 system:: getwd)
45
TEST ! stat $cur_wrk_dir2/bitd/bitd-server.vol
48
## Bitd daemon should run on 1st node and it should create bitrot
49
## volfile on this node. Below test case it to check whether its creating bitrot
50
## volfile or not for 1st node which is having brick.
51
## Get current working directory of 1st node which have brick and do
52
## stat on bitrot volfile.
54
cur_wrk_dir1=$($CLI_1 system:: getwd)
55
TEST stat $cur_wrk_dir1/bitd/bitd-server.vol