2015-12-14 22:49:55 +00:00
|
|
|
#!/bin/sh -ex
|
|
|
|
|
|
|
|
POOL_NAME=rbd_test_validate_pool
|
2017-09-30 17:56:48 +00:00
|
|
|
PG_NUM=32
|
2015-12-14 22:49:55 +00:00
|
|
|
|
2016-03-12 01:03:27 +00:00
|
|
|
tear_down () {
|
2015-12-14 22:49:55 +00:00
|
|
|
ceph osd pool delete $POOL_NAME $POOL_NAME --yes-i-really-really-mean-it || true
|
|
|
|
}
|
|
|
|
|
2016-03-12 01:03:27 +00:00
|
|
|
set_up () {
|
2015-12-14 22:49:55 +00:00
|
|
|
tear_down
|
|
|
|
ceph osd pool create $POOL_NAME $PG_NUM
|
|
|
|
ceph osd pool mksnap $POOL_NAME snap
|
2017-06-28 16:56:46 +00:00
|
|
|
rbd pool init $POOL_NAME
|
2015-12-14 22:49:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2018-06-27 14:18:24 +00:00
|
|
|
# should succeed if the pool already marked as validated
|
|
|
|
printf "overwrite validated" | rados --pool $POOL_NAME put rbd_info -
|
2015-12-14 22:49:55 +00:00
|
|
|
rbd create --pool $POOL_NAME --size 1 foo
|
|
|
|
|
|
|
|
echo OK
|