2013-03-30 00:59:35 +00:00
|
|
|
#!/bin/sh -ex
|
|
|
|
|
|
|
|
p=`uuidgen`
|
|
|
|
|
|
|
|
# objects
|
|
|
|
ceph osd pool create $p 12
|
|
|
|
ceph osd pool set-quota $p max_objects 10
|
|
|
|
|
|
|
|
for f in `seq 1 10` ; do
|
|
|
|
rados -p $p put obj$f /etc/passwd
|
|
|
|
done
|
|
|
|
|
|
|
|
sleep 30
|
|
|
|
|
2015-07-06 21:06:27 +00:00
|
|
|
rados -p $p put onemore /etc/passwd &
|
|
|
|
pid=$!
|
2013-03-30 00:59:35 +00:00
|
|
|
|
|
|
|
ceph osd pool set-quota $p max_objects 100
|
2015-07-06 21:06:27 +00:00
|
|
|
wait $pid
|
|
|
|
[ $? -ne 0 ] && exit 1 || true
|
2013-03-30 00:59:35 +00:00
|
|
|
|
2015-07-06 21:06:27 +00:00
|
|
|
rados -p $p put twomore /etc/passwd
|
2013-03-30 00:59:35 +00:00
|
|
|
|
|
|
|
# bytes
|
|
|
|
ceph osd pool set-quota $p max_bytes 100
|
|
|
|
sleep 30
|
|
|
|
|
2015-07-06 21:06:27 +00:00
|
|
|
rados -p $p put two /etc/passwd &
|
|
|
|
pid=$!
|
2013-03-30 00:59:35 +00:00
|
|
|
|
|
|
|
ceph osd pool set-quota $p max_bytes 0
|
|
|
|
ceph osd pool set-quota $p max_objects 0
|
2015-07-06 21:06:27 +00:00
|
|
|
wait $pid
|
|
|
|
[ $? -ne 0 ] && exit 1 || true
|
2013-03-30 00:59:35 +00:00
|
|
|
|
|
|
|
rados -p $p put three /etc/passwd
|
|
|
|
|
2015-07-06 21:06:27 +00:00
|
|
|
|
|
|
|
#one pool being full does not block a different pool
|
|
|
|
|
|
|
|
pp=`uuidgen`
|
|
|
|
|
|
|
|
ceph osd pool create $pp 12
|
|
|
|
|
|
|
|
# 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
|
2013-03-30 00:59:35 +00:00
|
|
|
# done
|
|
|
|
ceph osd pool delete $p $p --yes-i-really-really-mean-it
|
2015-07-06 21:06:27 +00:00
|
|
|
ceph osd pool delete $pp $pp --yes-i-really-really-mean-it
|
2013-03-30 00:59:35 +00:00
|
|
|
|
|
|
|
echo OK
|
|
|
|
|