summaryrefslogtreecommitdiffstats
path: root/tests/bugs/bitrot/1209752-volume-status-should-show-bitrot-scrub-info.t
blob: 6101910666cfff94beeba41978c97cb39be56343 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash

## Test case for bitrot
## gluster volume status command should show status of bitrot daemon


. $(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

## Lets create and start the volume
TEST $CLI_1 volume create $V0 $H1:$B1/${V0}0 $H2:$B2/${V0}1
TEST $CLI_1 volume start $V0

## Enable bitrot on volume $V0
TEST $CLI_1 volume bitrot $V0 enable

EXPECT_WITHIN $PROCESS_UP_TIMEOUT "2" get_bitd_count
EXPECT_WITHIN $PROCESS_UP_TIMEOUT "2" get_scrubd_count

## From node 1 Gluster volume status command should show the status of bitrot
## daemon of all the nodes. there are 2 nodes in a cluster with having brick
## ${V0}1 and ${V0}2 . So there should be 2 bitrot daemon running.

bitd=$($CLI_1 volume status $V0 | grep "Bitrot Daemon" | grep -v grep | wc -l)
TEST [ "$bitd" -eq 2 ];



## From node 2 Gluster volume status command should show the status of Scrubber
## daemon of all the nodes. There are 2 nodes in a cluster with having brick
## ${V0}1 and ${V0}2 . So there should be 2 Scrubber daemon running.

scrub=$($CLI_2 volume status $V0 | grep "Scrubber Daemon" | grep -v grep | \
        wc -l)
TEST [ "$scrub" -eq 2 ];



## From node 1 Gluster volume status command should print status of only
## scrubber daemon. There should be total 2 scrubber daemon running, one daemon
## for each node

scrub=$($CLI_1 volume status $V0 scrub | grep "Scrubber Daemon" | \
        grep -v grep | wc -l)
TEST [ "$scrub" -eq 2 ];



## From node 2 Gluster volume status command should print status of only
## bitd daemon. There should be total 2 bitd daemon running, one daemon
## for each node

bitd=$($CLI_2 volume status $V0 bitd | grep "Bitrot Daemon" | \
       grep -v grep | wc -l)
TEST [ "$bitd" -eq 2 ];


cleanup;