Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / test / cli-integration / rbd / defaults.t
1 Plain create with various options specified via usual cli arguments
2 ===================================================================
3   $ rbd create -s 1 test
4   $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
5   {
6       "block_name_prefix": "rb.0.*",  (glob)
7       "format": 1, 
8       "name": "test", 
9       "object_size": 4194304, 
10       "objects": 1, 
11       "order": 22, 
12       "size": 1048576
13   }
14   $ rbd rm test --no-progress
15   $ rbd create -s 1 --object-size 1M test
16   $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
17   {
18       "block_name_prefix": "rb.0.*",  (glob)
19       "format": 1, 
20       "name": "test", 
21       "object_size": 1048576, 
22       "objects": 1, 
23       "order": 20, 
24       "size": 1048576
25   }
26   $ rbd rm test --no-progress
27   $ rbd create -s 1G --object-size 4K test
28   $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
29   {
30       "block_name_prefix": "rb.0.*",  (glob)
31       "format": 1, 
32       "name": "test", 
33       "object_size": 4096, 
34       "objects": 262144, 
35       "order": 12, 
36       "size": 1073741824
37   }
38   $ rbd rm test --no-progress
39   $ rbd create -s 1 test --image-format 2
40   $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
41   {
42       "block_name_prefix": "rbd_data.*",  (glob)
43       "features": [
44           "layering", 
45           "striping", 
46           "exclusive"
47       ], 
48       "format": 2, 
49       "name": "test", 
50       "object_size": 4194304, 
51       "objects": 1, 
52       "order": 22, 
53       "size": 1048576
54   }
55   $ rbd rm test --no-progress
56   $ rbd create -s 1G test --image-format 2
57   $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
58   {
59       "block_name_prefix": "rbd_data.*",  (glob)
60       "features": [
61           "layering", 
62           "striping", 
63           "exclusive"
64       ], 
65       "format": 2, 
66       "name": "test", 
67       "object_size": 4194304, 
68       "objects": 256, 
69       "order": 22, 
70       "size": 1073741824
71   }
72   $ rbd rm test --no-progress
73   $ rbd create -s 1 test --image-format 2 --object-size 1M
74   $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
75   {
76       "block_name_prefix": "rbd_data.*",  (glob)
77       "features": [
78           "layering", 
79           "striping", 
80           "exclusive"
81       ], 
82       "format": 2, 
83       "name": "test", 
84       "object_size": 1048576, 
85       "objects": 1, 
86       "order": 20, 
87       "size": 1048576
88   }
89   $ rbd rm test --no-progress
90   $ rbd create -s 1 test --image-format 2 --stripe-unit 1048576 --stripe-count 8
91   $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
92   {
93       "block_name_prefix": "rbd_data.*",  (glob)
94       "features": [
95           "layering", 
96           "striping", 
97           "exclusive"
98       ], 
99       "format": 2, 
100       "name": "test", 
101       "object_size": 4194304, 
102       "objects": 1, 
103       "order": 22, 
104       "size": 1048576, 
105       "stripe_count": 8, 
106       "stripe_unit": 1048576
107   }
108   $ rbd rm test --no-progress
109   $ rbd create -s 1 test --image-format 2 --stripe-unit 1048576B --stripe-count 8
110   $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
111   {
112       "block_name_prefix": "rbd_data.*",  (glob)
113       "features": [
114           "layering", 
115           "striping", 
116           "exclusive"
117       ], 
118       "format": 2, 
119       "name": "test", 
120       "object_size": 4194304, 
121       "objects": 1, 
122       "order": 22, 
123       "size": 1048576, 
124       "stripe_count": 8, 
125       "stripe_unit": 1048576
126   }
127   $ rbd rm test --no-progress
128   $ rbd create -s 1G test --image-format 2 --stripe-unit 4K --stripe-count 8
129   $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
130   {
131       "block_name_prefix": "rbd_data.*",  (glob)
132       "features": [
133           "layering", 
134           "striping", 
135           "exclusive"
136       ], 
137       "format": 2, 
138       "name": "test", 
139       "object_size": 4194304, 
140       "objects": 256, 
141       "order": 22, 
142       "size": 1073741824, 
143       "stripe_count": 8, 
144       "stripe_unit": 4096
145   }
146   $ rbd rm test --no-progress
147   $ rbd create -s 1G test --image-format 2 --stripe-unit 1M --stripe-count 8
148   $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
149   {
150       "block_name_prefix": "rbd_data.*",  (glob)
151       "features": [
152           "layering", 
153           "striping", 
154           "exclusive"
155       ], 
156       "format": 2, 
157       "name": "test", 
158       "object_size": 4194304, 
159       "objects": 256, 
160       "order": 22, 
161       "size": 1073741824, 
162       "stripe_count": 8, 
163       "stripe_unit": 1048576
164   }
165   $ rbd rm test --no-progress
166
167 Format 2 Usual arguments with custom rbd_default_* params
168 =========================================================
169   $ rbd create -s 1 test --image-format 2 --stripe-unit 1048576 --stripe-count 8 --rbd-default-order 21
170   $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
171   {
172       "block_name_prefix": "rbd_data.*",  (glob)
173       "features": [
174           "layering", 
175           "striping", 
176           "exclusive"
177       ], 
178       "format": 2, 
179       "name": "test", 
180       "object_size": 2097152, 
181       "objects": 1, 
182       "order": 21, 
183       "size": 1048576, 
184       "stripe_count": 8, 
185       "stripe_unit": 1048576
186   }
187   $ rbd rm test --no-progress
188   $ rbd create -s 1 test --image-format 2 --stripe-unit 1048576 --stripe-count 8 --object-size 8M --rbd-default-order 20
189   $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
190   {
191       "block_name_prefix": "rbd_data.*",  (glob)
192       "features": [
193           "layering", 
194           "striping", 
195           "exclusive"
196       ], 
197       "format": 2, 
198       "name": "test", 
199       "object_size": 8388608, 
200       "objects": 1, 
201       "order": 23, 
202       "size": 1048576, 
203       "stripe_count": 8, 
204       "stripe_unit": 1048576
205   }
206   $ rbd rm test --no-progress
207   $ rbd create -s 1 test --image-format 2 --rbd-default-stripe-unit 1048576 --rbd-default-stripe-count 8
208   $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
209   {
210       "block_name_prefix": "rbd_data.*",  (glob)
211       "features": [
212           "layering", 
213           "striping", 
214           "exclusive"
215       ], 
216       "format": 2, 
217       "name": "test", 
218       "object_size": 4194304, 
219       "objects": 1, 
220       "order": 22, 
221       "size": 1048576, 
222       "stripe_count": 8, 
223       "stripe_unit": 1048576
224   }
225   $ rbd rm test --no-progress
226
227 Format 1 Usual arguments with custom rbd_default_* params
228 =========================================================
229   $ rbd create -s 1 test --rbd-default-order 20
230   $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
231   {
232       "block_name_prefix": "rb.0.*",  (glob)
233       "format": 1, 
234       "name": "test", 
235       "object_size": 1048576, 
236       "objects": 1, 
237       "order": 20, 
238       "size": 1048576
239   }
240   $ rbd rm test --no-progress
241   $ rbd create -s 1 test --rbd-default-format 2
242   $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
243   {
244       "block_name_prefix": "rbd_data.*",  (glob)
245       "features": [
246           "layering", 
247           "striping", 
248           "exclusive"
249       ], 
250       "format": 2, 
251       "name": "test", 
252       "object_size": 4194304, 
253       "objects": 1, 
254       "order": 22, 
255       "size": 1048576
256   }
257   $ rbd rm test --no-progress
258   $ rbd create -s 1 test --rbd-default-format 2 --rbd-default-order 20
259   $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
260   {
261       "block_name_prefix": "rbd_data.*",  (glob)
262       "features": [
263           "layering", 
264           "striping", 
265           "exclusive"
266       ], 
267       "format": 2, 
268       "name": "test", 
269       "object_size": 1048576, 
270       "objects": 1, 
271       "order": 20, 
272       "size": 1048576
273   }
274   $ rbd rm test --no-progress
275   $ rbd create -s 1 test --rbd-default-format 2 --rbd-default-order 20 --rbd-default-features 1
276   $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
277   {
278       "block_name_prefix": "rbd_data.*",  (glob)
279       "features": [
280           "layering", 
281           "striping", 
282           "exclusive"
283       ], 
284       "format": 2, 
285       "name": "test", 
286       "object_size": 1048576, 
287       "objects": 1, 
288       "order": 20, 
289       "size": 1048576
290   }
291   $ rbd rm test --no-progress
292   $ rbd create -s 1 test --rbd-default-format 2 --stripe-unit 1048576 --stripe-count 8
293   $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
294   {
295       "block_name_prefix": "rbd_data.*",  (glob)
296       "features": [
297           "layering", 
298           "striping", 
299           "exclusive"
300       ], 
301       "format": 2, 
302       "name": "test", 
303       "object_size": 4194304, 
304       "objects": 1, 
305       "order": 22, 
306       "size": 1048576, 
307       "stripe_count": 8, 
308       "stripe_unit": 1048576
309   }
310   $ rbd rm test --no-progress