]> git.proxmox.com Git - ceph.git/blame - ceph/qa/workunits/mon/rbd_snaps_ops.sh
update sources to v12.1.3
[ceph.git] / ceph / qa / workunits / mon / rbd_snaps_ops.sh
CommitLineData
7c673cae
FG
1#!/bin/bash
2
3# attempt to trigger #6047
4
5
6cmd_no=0
7expect()
8{
9 cmd_no=$(($cmd_no+1))
10 cmd="$1"
11 expected=$2
12 echo "[$cmd_no] $cmd"
13 eval $cmd
14 ret=$?
15 if [[ $ret -ne $expected ]]; then
16 echo "[$cmd_no] unexpected return '$ret', expected '$expected'"
17 exit 1
18 fi
19}
20
21ceph osd pool delete test test --yes-i-really-really-mean-it || true
22expect 'ceph osd pool create test 256 256' 0
d2e6a577 23expect 'rbd --pool=test pool init' 0
7c673cae
FG
24expect 'ceph osd pool mksnap test snapshot' 0
25expect 'ceph osd pool rmsnap test snapshot' 0
26
27expect 'rbd --pool=test --rbd_validate_pool=false create --size=102400 image' 0
28expect 'rbd --pool=test snap create image@snapshot' 22
29
30expect 'ceph osd pool delete test test --yes-i-really-really-mean-it' 0
31expect 'ceph osd pool create test 256 256' 0
c07f9fc5 32expect 'rbd --pool=test pool init' 0
7c673cae
FG
33expect 'rbd --pool=test create --size=102400 image' 0
34expect 'rbd --pool=test snap create image@snapshot' 0
35expect 'rbd --pool=test snap ls image' 0
36expect 'rbd --pool=test snap rm image@snapshot' 0
37
38expect 'ceph osd pool mksnap test snapshot' 22
39
40expect 'ceph osd pool delete test test --yes-i-really-really-mean-it' 0
41
42# reproduce 7210 and expect it to be fixed
43# basically create such a scenario where we end up deleting what used to
44# be an unmanaged snapshot from a not-unmanaged pool
45
46ceph osd pool delete test-foo test-foo --yes-i-really-really-mean-it || true
47expect 'rados mkpool test-foo' 0
d2e6a577 48expect 'rbd pool init test-foo'
7c673cae
FG
49expect 'rbd --pool test-foo create --size 1024 image' 0
50expect 'rbd --pool test-foo snap create image@snapshot' 0
51
52ceph osd pool delete test-bar test-bar --yes-i-really-really-mean-it || true
53expect 'rados mkpool test-bar' 0
d2e6a577 54expect 'rbd pool init test-bar'
7c673cae
FG
55expect 'rados cppool test-foo test-bar --yes-i-really-mean-it' 0
56expect 'rbd --pool test-bar snap rm image@snapshot' 95
57expect 'ceph osd pool delete test-foo test-foo --yes-i-really-really-mean-it' 0
58expect 'ceph osd pool delete test-bar test-bar --yes-i-really-really-mean-it' 0
59
60
61echo OK