summaryrefslogtreecommitdiffstats
path: root/qa/workunits/rados/test_pool_quota.sh
blob: 0eacefc64b1682981165ed7693d21ab086bfd10e (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
#!/bin/sh -ex

p=`uuidgen`

# objects
ceph osd pool create $p 12
ceph osd pool set-quota $p max_objects 10
ceph osd pool application enable $p rados

for f in `seq 1 10` ; do
 rados -p $p put obj$f /etc/passwd
done

sleep 30

rados -p $p put onemore /etc/passwd  &
pid=$!

ceph osd pool set-quota $p max_objects 100
wait $pid 
[ $? -ne 0 ] && exit 1 || true

rados -p $p put twomore /etc/passwd

# bytes
ceph osd pool set-quota $p max_bytes 100
sleep 30

rados -p $p put two /etc/passwd &
pid=$!

ceph osd pool set-quota $p max_bytes 0
ceph osd pool set-quota $p max_objects 0
wait $pid 
[ $? -ne 0 ] && exit 1 || true

rados -p $p put three /etc/passwd


#one pool being full does not block a different pool

pp=`uuidgen`

ceph osd pool create $pp 12
ceph osd pool application enable $pp rados

# set objects quota 
ceph osd pool set-quota $pp max_objects 10
sleep 30

for f in `seq 1 10` ; do
 rados -p $pp put obj$f /etc/passwd
done

sleep 30

rados -p $p put threemore /etc/passwd 

ceph osd pool set-quota $p max_bytes 0
ceph osd pool set-quota $p max_objects 0

sleep 30
# done
ceph osd pool delete $p $p --yes-i-really-really-mean-it
ceph osd pool delete $pp $pp --yes-i-really-really-mean-it

echo OK