ceph/qa/workunits/mon/pool_ops.sh
Loic Dachary bcc1680ad2 mon: fix inverted test in osd pool create
When using the properties key=value only, the test was inverted
and an attempt to obtain a substring at index string::npos throws
an exception.

Add variations of osd pool create to qa/workunits/mon/pool_ops.sh
to assert the problem has been fixed and all code paths are used.

http://tracker.ceph.com/issues/6357 fixes #6357

Signed-off-by: Loic Dachary <loic@dachary.org>
2013-09-20 00:33:13 +02:00

38 lines
1.3 KiB
Bash
Executable File

#!/bin/sh -x
set -e
ceph osd pool create foo 123 123 key1=+++ && exit 1 || true
ceph osd pool create foo 123 123 key1=value1 key2 key3=value3
ceph osd pool create fooo 123
ceph osd pool create foo 123 # idempotent
ceph osd pool set foo size 1
ceph osd pool set foo size 4
ceph osd pool set foo size 10
ceph osd pool set foo size 0 && exit 1 || true
ceph osd pool set foo size 20 && exit 1 || true
# should fail due to safety interlock
ceph osd pool delete foo && exit 1 || true
ceph osd pool delete foo foo && exit 1 || true
ceph osd pool delete foo foo --force && exit 1 || true
ceph osd pool delete foo fooo --yes-i-really-mean-it && exit 1 || true
ceph osd pool delete foo --yes-i-really-mean-it foo && exit 1 || true
ceph osd pool delete fooo fooo --yes-i-really-really-mean-it
ceph osd pool delete foo foo --yes-i-really-really-mean-it
# idempotent
ceph osd pool delete foo foo --yes-i-really-really-mean-it
ceph osd pool delete fooo fooo --yes-i-really-really-mean-it
ceph osd pool delete fooo fooo --yes-i-really-really-mean-it
# non-existent pool
ceph osd pool delete fuggg fuggg --yes-i-really-really-mean-it
echo OK