]>
Commit | Line | Data |
---|---|---|
11fdf7f2 | 1 | #!/usr/bin/env bash |
7c673cae | 2 | |
11fdf7f2 | 3 | set -ex |
7c673cae FG |
4 | |
5 | function expect_false() | |
6 | { | |
7 | set -x | |
8 | if "$@"; then return 1; else return 0; fi | |
9 | } | |
10 | ||
11 | # note: we need to pass the other args or ceph_argparse.py will take | |
12 | # 'invalid' that is not replicated|erasure and assume it is the next | |
13 | # argument, which is a string. | |
14 | expect_false ceph osd pool create foo 123 123 invalid foo-profile foo-ruleset | |
15 | ||
16 | ceph osd pool create foo 123 123 replicated | |
17 | ceph osd pool create fooo 123 123 erasure default | |
18 | ceph osd pool create foooo 123 | |
19 | ||
20 | ceph osd pool create foo 123 # idempotent | |
21 | ||
22 | ceph osd pool set foo size 1 | |
23 | ceph osd pool set foo size 4 | |
24 | ceph osd pool set foo size 10 | |
25 | expect_false ceph osd pool set foo size 0 | |
26 | expect_false ceph osd pool set foo size 20 | |
27 | ||
28 | # should fail due to safety interlock | |
29 | expect_false ceph osd pool delete foo | |
30 | expect_false ceph osd pool delete foo foo | |
31 | expect_false ceph osd pool delete foo foo --force | |
32 | expect_false ceph osd pool delete foo fooo --yes-i-really-mean-it | |
33 | expect_false ceph osd pool delete foo --yes-i-really-mean-it foo | |
34 | ||
35 | ceph osd pool delete foooo foooo --yes-i-really-really-mean-it | |
36 | ceph osd pool delete fooo fooo --yes-i-really-really-mean-it | |
37 | ceph osd pool delete foo foo --yes-i-really-really-mean-it | |
38 | ||
39 | # idempotent | |
40 | ceph osd pool delete foo foo --yes-i-really-really-mean-it | |
41 | ceph osd pool delete fooo fooo --yes-i-really-really-mean-it | |
42 | ceph osd pool delete fooo fooo --yes-i-really-really-mean-it | |
43 | ||
44 | # non-existent pool | |
45 | ceph osd pool delete fuggg fuggg --yes-i-really-really-mean-it | |
46 | ||
47 | echo OK | |
48 | ||
49 |