summaryrefslogtreecommitdiffstats
path: root/tests/bugs/core/bug-1699025-brick-mux-detach-brick-fd-issue.t
blob: 1acbaa8dc0bf247249bd18775a791d33a906cd6d (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
#!/bin/bash

. $(dirname $0)/../../include.rc
. $(dirname $0)/../../volume.rc
. $(dirname $0)/../../cluster.rc

function count_brick_processes {
        pgrep glusterfsd | wc -l
}

cleanup

#bug-1444596 - validating brick mux

TEST glusterd
TEST $CLI volume create $V0 $H0:$B0/brick{0,1}
TEST $CLI volume create $V1 $H0:$B0/brick{2,3}

TEST $CLI volume set all cluster.brick-multiplex on

TEST $CLI volume start $V0
TEST $CLI volume start $V1
EXPECT_WITHIN $PROCESS_UP_TIMEOUT 4 online_brick_count
EXPECT 1 count_brick_processes

TEST $CLI volume stop $V1
# At the time initialize brick daemon it always keeps open
# standard fd's (0, 1 , 2) so after stop 1 volume fd's should
# be open
nofds=$(ls -lrth /proc/`pgrep glusterfsd`/fd | grep dev/null | wc -l)
TEST [ $((nofds)) -eq 3 ]

cleanup