1=== Successful image creation (defaults) ===
2
3{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "file", "filename": "TEST_DIR/PID-t.luks", "size": 0}}}
4{"return": {}}
5{"execute": "job-dismiss", "arguments": {"id": "job0"}}
6{"return": {}}
7
8{"execute": "blockdev-add", "arguments": {"driver": "file", "filename": "TEST_DIR/PID-t.luks", "node-name": "imgfile"}}
9{"return": {}}
10{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "luks", "file": "imgfile", "iter-time": 10, "key-secret": "keysec0", "size": 134217728}}}
11{"return": {}}
12{"execute": "job-dismiss", "arguments": {"id": "job0"}}
13{"return": {}}
14
15image: json:{"driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_IMG"}, "key-secret": "keysec0"}
16file format: IMGFMT
17virtual size: 128 MiB (134217728 bytes)
18encrypted: yes
19Format specific information:
20    ivgen alg: plain64
21    hash alg: sha256
22    cipher alg: aes-256
23    uuid: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
24    cipher mode: xts
25    slots:
26        [0]:
27            active: true
28            iters: XXX
29            key offset: 4096
30            stripes: 4000
31        [1]:
32            active: false
33            key offset: 262144
34        [2]:
35            active: false
36            key offset: 520192
37        [3]:
38            active: false
39            key offset: 778240
40        [4]:
41            active: false
42            key offset: 1036288
43        [5]:
44            active: false
45            key offset: 1294336
46        [6]:
47            active: false
48            key offset: 1552384
49        [7]:
50            active: false
51            key offset: 1810432
52    payload offset: 2068480
53    master key iters: XXX
54
55=== Successful image creation (with non-default options) ===
56
57{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "file", "filename": "TEST_DIR/PID-t.luks", "size": 0}}}
58{"return": {}}
59{"execute": "job-dismiss", "arguments": {"id": "job0"}}
60{"return": {}}
61
62{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"cipher-alg": "twofish-128", "cipher-mode": "ctr", "driver": "luks", "file": {"driver": "file", "filename": "TEST_DIR/PID-t.luks"}, "hash-alg": "sha1", "iter-time": 10, "ivgen-alg": "plain64", "ivgen-hash-alg": "md5", "key-secret": "keysec0", "size": 67108864}}}
63{"return": {}}
64{"execute": "job-dismiss", "arguments": {"id": "job0"}}
65{"return": {}}
66
67image: json:{"driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_IMG"}, "key-secret": "keysec0"}
68file format: IMGFMT
69virtual size: 64 MiB (67108864 bytes)
70encrypted: yes
71Format specific information:
72    ivgen alg: plain64
73    hash alg: sha1
74    cipher alg: twofish-128
75    uuid: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
76    cipher mode: ctr
77    slots:
78        [0]:
79            active: true
80            iters: XXX
81            key offset: 4096
82            stripes: 4000
83        [1]:
84            active: false
85            key offset: 69632
86        [2]:
87            active: false
88            key offset: 135168
89        [3]:
90            active: false
91            key offset: 200704
92        [4]:
93            active: false
94            key offset: 266240
95        [5]:
96            active: false
97            key offset: 331776
98        [6]:
99            active: false
100            key offset: 397312
101        [7]:
102            active: false
103            key offset: 462848
104    payload offset: 528384
105    master key iters: XXX
106
107=== Invalid BlockdevRef ===
108
109{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "luks", "file": "this doesn't exist", "size": 67108864}}}
110{"return": {}}
111Job failed: Cannot find device=this doesn't exist nor node_name=this doesn't exist
112{"execute": "job-dismiss", "arguments": {"id": "job0"}}
113{"return": {}}
114
115=== Zero size ===
116
117{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "luks", "file": "node0", "iter-time": 10, "key-secret": "keysec0", "size": 0}}}
118{"return": {}}
119{"execute": "job-dismiss", "arguments": {"id": "job0"}}
120{"return": {}}
121
122image: json:{"driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_IMG"}, "key-secret": "keysec0"}
123file format: IMGFMT
124virtual size: 0 B (0 bytes)
125encrypted: yes
126Format specific information:
127    ivgen alg: plain64
128    hash alg: sha256
129    cipher alg: aes-256
130    uuid: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
131    cipher mode: xts
132    slots:
133        [0]:
134            active: true
135            iters: XXX
136            key offset: 4096
137            stripes: 4000
138        [1]:
139            active: false
140            key offset: 262144
141        [2]:
142            active: false
143            key offset: 520192
144        [3]:
145            active: false
146            key offset: 778240
147        [4]:
148            active: false
149            key offset: 1036288
150        [5]:
151            active: false
152            key offset: 1294336
153        [6]:
154            active: false
155            key offset: 1552384
156        [7]:
157            active: false
158            key offset: 1810432
159    payload offset: 2068480
160    master key iters: XXX
161
162=== Invalid sizes ===
163
164{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "luks", "file": "node0", "key-secret": "keysec0", "size": 18446744073709551104}}}
165{"return": {}}
166Job failed: The requested file size is too large
167{"execute": "job-dismiss", "arguments": {"id": "job0"}}
168{"return": {}}
169
170{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "luks", "file": "node0", "key-secret": "keysec0", "size": 9223372036854775808}}}
171{"return": {}}
172Job failed: The requested file size is too large
173{"execute": "job-dismiss", "arguments": {"id": "job0"}}
174{"return": {}}
175
176{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "luks", "file": "node0", "key-secret": "keysec0", "size": 9223372036854775296}}}
177{"return": {}}
178Job failed: The requested file size is too large
179{"execute": "job-dismiss", "arguments": {"id": "job0"}}
180{"return": {}}
181
182=== Resize image with invalid sizes ===
183
184{"execute": "block_resize", "arguments": {"node-name": "node1", "size": 9223372036854775296}}
185{"error": {"class": "GenericError", "desc": "The requested file size is too large"}}
186{"execute": "block_resize", "arguments": {"node-name": "node1", "size": 9223372036854775808}}
187{"error": {"class": "GenericError", "desc": "Invalid parameter type for 'size', expected: integer"}}
188{"execute": "block_resize", "arguments": {"node-name": "node1", "size": 18446744073709551104}}
189{"error": {"class": "GenericError", "desc": "Invalid parameter type for 'size', expected: integer"}}
190{"execute": "block_resize", "arguments": {"node-name": "node1", "size": -9223372036854775808}}
191{"error": {"class": "GenericError", "desc": "Parameter 'size' expects a >0 size"}}
192image: json:{"driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_IMG"}, "key-secret": "keysec0"}
193file format: IMGFMT
194virtual size: 0 B (0 bytes)
195encrypted: yes
196Format specific information:
197    ivgen alg: plain64
198    hash alg: sha256
199    cipher alg: aes-256
200    uuid: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
201    cipher mode: xts
202    slots:
203        [0]:
204            active: true
205            iters: XXX
206            key offset: 4096
207            stripes: 4000
208        [1]:
209            active: false
210            key offset: 262144
211        [2]:
212            active: false
213            key offset: 520192
214        [3]:
215            active: false
216            key offset: 778240
217        [4]:
218            active: false
219            key offset: 1036288
220        [5]:
221            active: false
222            key offset: 1294336
223        [6]:
224            active: false
225            key offset: 1552384
226        [7]:
227            active: false
228            key offset: 1810432
229    payload offset: 2068480
230    master key iters: XXX
231
232