summaryrefslogtreecommitdiffstats
path: root/tests/bugs/distribute/bug-1368012.t
blob: 0b626353aab82029356f75811b8452e85ff56021 (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
#!/bin/bash

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

cleanup;

function get_permission {
        stat -c "%A" $1
}

## Start glusterd
TEST glusterd;
TEST pidof glusterd;
TEST $CLI volume info;

## Lets create volume
TEST $CLI volume create $V0 $H0:$B0/${V0}{1,2};

## Verify volume is created
EXPECT "$V0" volinfo_field $V0 'Volume Name';
EXPECT 'Created' volinfo_field $V0 'Status';
## Start volume and verify
TEST $CLI volume start $V0;
EXPECT_WITHIN $PROCESS_UP_TIMEOUT "2" online_brick_count
TEST $CLI volume set $V0 performance.stat-prefetch off
EXPECT 'Started' volinfo_field $V0 'Status';
TEST glusterfs -s $H0 --volfile-id=$V0 $M0

##Test case: Add-brick
#------------------------------------------------------------
#change permission of both root
TEST chmod 444 $M0

#store permission for comparision
TEST permission_root=`stat -c "%A" $M0`
TEST echo $permission_root
#Add-brick
TEST $CLI volume add-brick $V0 $H0:$B0/${V0}3
EXPECT_WITHIN $PROCESS_UP_TIMEOUT "3" online_brick_count

#Allow one lookup to happen
TEST ls $M0
#Generate another lookup
echo 3 > /proc/sys/vm/drop_caches
TEST ls $M0
#check root permission
EXPECT_WITHIN "5" $permission_root get_permission $M0
#check permission on the new-brick
EXPECT $permission_root get_permission $B0/${V0}3
cleanup