summaryrefslogtreecommitdiffstats
path: root/tests/bugs/quota/bug-1293601.t
blob: 4586e5a6acf1836204a701b20e551fbdd14795cc (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
#!/bin/bash

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

cleanup;
TESTS_EXPECTED_IN_LOOP=1044

TEST glusterd

TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1,2,3,4}
TEST $CLI volume start $V0
TEST $CLI volume quota $V0 enable
TEST $CLI volume quota $V0 limit-usage / 2MB

TEST glusterfs --volfile-server=$H0 --volfile-id=$V0 $M0;

for i in {1..1024}; do
    TEST_IN_LOOP dd if=/dev/zero of=$M0/f$i bs=1k count=1
done

EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "1.0MB" quotausage "/"

for i in {1..10}; do
    TEST_IN_LOOP $CLI volume quota $V0 disable
    TEST_IN_LOOP $CLI volume quota $V0 enable
done

TEST $CLI volume quota $V0 limit-usage / 2MB
EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "1.0MB" quotausage "/"

cleanup;