]> git.proxmox.com Git - ceph.git/blame - ceph/qa/workunits/mon/pool_ops.sh
import ceph 14.2.5
[ceph.git] / ceph / qa / workunits / mon / pool_ops.sh
CommitLineData
11fdf7f2 1#!/usr/bin/env bash
7c673cae 2
11fdf7f2 3set -ex
7c673cae
FG
4
5function 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.
14expect_false ceph osd pool create foo 123 123 invalid foo-profile foo-ruleset
15
16ceph osd pool create foo 123 123 replicated
17ceph osd pool create fooo 123 123 erasure default
18ceph osd pool create foooo 123
19
20ceph osd pool create foo 123 # idempotent
21
22ceph osd pool set foo size 1
23ceph osd pool set foo size 4
24ceph osd pool set foo size 10
25expect_false ceph osd pool set foo size 0
26expect_false ceph osd pool set foo size 20
27
eafe8130
TL
28ceph osd pool set foo size 3
29ceph osd getcrushmap -o crush
30crushtool -d crush -o crush.txt
31sed -i 's/max_size 10/max_size 3/' crush.txt
32crushtool -c crush.txt -o crush.new
33ceph osd setcrushmap -i crush.new
34expect_false ceph osd pool set foo size 4
35ceph osd setcrushmap -i crush
36rm -f crush crush.txt crush.new
37
7c673cae
FG
38# should fail due to safety interlock
39expect_false ceph osd pool delete foo
40expect_false ceph osd pool delete foo foo
41expect_false ceph osd pool delete foo foo --force
42expect_false ceph osd pool delete foo fooo --yes-i-really-mean-it
43expect_false ceph osd pool delete foo --yes-i-really-mean-it foo
44
45ceph osd pool delete foooo foooo --yes-i-really-really-mean-it
46ceph osd pool delete fooo fooo --yes-i-really-really-mean-it
47ceph osd pool delete foo foo --yes-i-really-really-mean-it
48
49# idempotent
50ceph osd pool delete foo foo --yes-i-really-really-mean-it
51ceph osd pool delete fooo fooo --yes-i-really-really-mean-it
52ceph osd pool delete fooo fooo --yes-i-really-really-mean-it
53
54# non-existent pool
55ceph osd pool delete fuggg fuggg --yes-i-really-really-mean-it
56
57echo OK
58
59