summaryrefslogtreecommitdiffstats
path: root/tests/bugs/quota/bug-1288474.t
blob: 57a66197cdedafbba8204632173eb4b7829ea430 (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
. $(dirname $0)/../../tier.rc

NUM_BRICKS=2

function create_dist_tier_vol () {
        mkdir -p $B0/cold/${V0}{0..$1}
        mkdir -p $B0/hot/${V0}{0..$1}
        TEST $CLI volume create $V0 $H0:$B0/cold/${V0}{0..$1}
	TEST $CLI volume set $V0 nfs.disable false
        TEST $CLI volume start $V0
        TEST $CLI volume tier $V0 attach $H0:$B0/hot/${V0}{0..$1}
}

cleanup;

#Basic checks
TEST glusterd

#Create and start a tiered volume
create_dist_tier_vol $NUM_BRICKS

TEST $GFS --volfile-id=/$V0 --volfile-server=$H0 $M0
touch $M0/foobar

TEST $CLI volume quota $V0 enable
TEST $CLI volume quota $V0 limit-usage / 10MB

EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "10.0MB" quota_list_field "/" 5

#check quota list after detach tier
TEST $CLI volume detach-tier $V0 start
sleep 1
TEST $CLI volume detach-tier $V0 force

EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "10.0MB" quota_list_field "/" 5

#check quota list after attach tier
rm -rf $B0/hot
mkdir $B0/hot
TEST $CLI volume tier $V0 attach $H0:$B0/hot/${V0}{0..$1}

EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "10.0MB" quota_list_field "/" 5

TEST umount $M0

cleanup;