blob: f008fb6b3cfb34a0a1193c349278db7d66b7a501 (
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
|
#!/bin/sh -ex
POOL_NAME=rbd_test_validate_pool
PG_NUM=100
tear_down () {
ceph osd pool delete $POOL_NAME $POOL_NAME --yes-i-really-really-mean-it || true
}
set_up () {
tear_down
ceph osd pool create $POOL_NAME $PG_NUM
ceph osd pool mksnap $POOL_NAME snap
rbd pool init $POOL_NAME
}
trap tear_down EXIT HUP INT
set_up
# creating an image in a pool-managed snapshot pool should fail
rbd create --pool $POOL_NAME --size 1 foo && exit 1 || true
# should succeed if images already exist in the pool
rados --pool $POOL_NAME create rbd_directory
rbd create --pool $POOL_NAME --size 1 foo
echo OK
|