
This rewrites the test case 213 to work with the new x-blockdev-create job rather than the old synchronous version of the command. All of the test cases stay the same as before, but in order to be able to implement proper job handling, the test case is rewritten in Python. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
170 lines
6.9 KiB
Plaintext
170 lines
6.9 KiB
Plaintext
=== Successful image creation (defaults) ===
|
|
|
|
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'size': 0, 'driver': 'file', 'filename': 'TEST_DIR/PID-t.vhdx'}}}
|
|
{u'return': {}}
|
|
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
|
|
{u'return': {}}
|
|
|
|
{'execute': 'blockdev-add', 'arguments': {'node_name': 'imgfile', 'driver': 'file', 'filename': 'TEST_DIR/PID-t.vhdx'}}
|
|
{u'return': {}}
|
|
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'vhdx', 'file': 'imgfile', 'size': 134217728}}}
|
|
{u'return': {}}
|
|
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
|
|
{u'return': {}}
|
|
|
|
image: TEST_IMG
|
|
file format: IMGFMT
|
|
virtual size: 128M (134217728 bytes)
|
|
cluster_size: 8388608
|
|
|
|
=== Successful image creation (explicit defaults) ===
|
|
|
|
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'size': 0, 'driver': 'file', 'filename': 'TEST_DIR/PID-t.vhdx'}}}
|
|
{u'return': {}}
|
|
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
|
|
{u'return': {}}
|
|
|
|
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'block-size': 8388608, 'driver': 'vhdx', 'subformat': 'dynamic', 'log-size': 1048576, 'file': {'driver': 'file', 'filename': 'TEST_DIR/PID-t.vhdx'}, 'block-state-zero': True, 'size': 67108864}}}
|
|
{u'return': {}}
|
|
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
|
|
{u'return': {}}
|
|
|
|
image: TEST_IMG
|
|
file format: IMGFMT
|
|
virtual size: 64M (67108864 bytes)
|
|
cluster_size: 8388608
|
|
|
|
=== Successful image creation (with non-default options) ===
|
|
|
|
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'size': 0, 'driver': 'file', 'filename': 'TEST_DIR/PID-t.vhdx'}}}
|
|
{u'return': {}}
|
|
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
|
|
{u'return': {}}
|
|
|
|
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'block-size': 268435456, 'driver': 'vhdx', 'subformat': 'fixed', 'log-size': 8388608, 'file': {'driver': 'file', 'filename': 'TEST_DIR/PID-t.vhdx'}, 'block-state-zero': False, 'size': 33554432}}}
|
|
{u'return': {}}
|
|
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
|
|
{u'return': {}}
|
|
|
|
image: TEST_IMG
|
|
file format: IMGFMT
|
|
virtual size: 32M (33554432 bytes)
|
|
cluster_size: 268435456
|
|
|
|
=== Invalid BlockdevRef ===
|
|
|
|
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'vhdx', 'file': "this doesn't exist", 'size': 33554432}}}
|
|
{u'return': {}}
|
|
Job failed: Cannot find device=this doesn't exist nor node_name=this doesn't exist
|
|
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
|
|
{u'return': {}}
|
|
|
|
=== Zero size ===
|
|
|
|
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'vhdx', 'file': 'node0', 'size': 0}}}
|
|
{u'return': {}}
|
|
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
|
|
{u'return': {}}
|
|
|
|
image: TEST_IMG
|
|
file format: IMGFMT
|
|
virtual size: 0 (0 bytes)
|
|
cluster_size: 8388608
|
|
|
|
=== Maximum size ===
|
|
|
|
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'vhdx', 'file': 'node0', 'size': 70368744177664}}}
|
|
{u'return': {}}
|
|
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
|
|
{u'return': {}}
|
|
|
|
image: TEST_IMG
|
|
file format: IMGFMT
|
|
virtual size: 64T (70368744177664 bytes)
|
|
cluster_size: 67108864
|
|
|
|
=== Invalid sizes ===
|
|
|
|
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'vhdx', 'file': 'node0', 'size': 18446744073709551104L}}}
|
|
{u'return': {}}
|
|
Job failed: Image size too large; max of 64TB
|
|
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
|
|
{u'return': {}}
|
|
|
|
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'vhdx', 'file': 'node0', 'size': 9223372036854775808L}}}
|
|
{u'return': {}}
|
|
Job failed: Image size too large; max of 64TB
|
|
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
|
|
{u'return': {}}
|
|
|
|
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'vhdx', 'file': 'node0', 'size': 9223372036854775296}}}
|
|
{u'return': {}}
|
|
Job failed: Image size too large; max of 64TB
|
|
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
|
|
{u'return': {}}
|
|
|
|
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'vhdx', 'file': 'node0', 'size': 70368744177665}}}
|
|
{u'return': {}}
|
|
Job failed: Image size too large; max of 64TB
|
|
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
|
|
{u'return': {}}
|
|
|
|
=== Invalid block size ===
|
|
|
|
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'vhdx', 'block-size': 1234567, 'file': 'node0', 'size': 67108864}}}
|
|
{u'return': {}}
|
|
Job failed: Block size must be a multiple of 1 MB
|
|
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
|
|
{u'return': {}}
|
|
|
|
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'vhdx', 'block-size': 128, 'file': 'node0', 'size': 67108864}}}
|
|
{u'return': {}}
|
|
Job failed: Block size must be a multiple of 1 MB
|
|
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
|
|
{u'return': {}}
|
|
|
|
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'vhdx', 'block-size': 3145728, 'file': 'node0', 'size': 67108864}}}
|
|
{u'return': {}}
|
|
Job failed: Block size must be a power of two
|
|
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
|
|
{u'return': {}}
|
|
|
|
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'vhdx', 'block-size': 536870912, 'file': 'node0', 'size': 67108864}}}
|
|
{u'return': {}}
|
|
Job failed: Block size must not exceed 268435456
|
|
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
|
|
{u'return': {}}
|
|
|
|
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'vhdx', 'block-size': 0, 'file': 'node0', 'size': 67108864}}}
|
|
{u'return': {}}
|
|
Job failed: Block size must be a multiple of 1 MB
|
|
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
|
|
{u'return': {}}
|
|
|
|
=== Invalid log size ===
|
|
|
|
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'log-size': 1234567, 'driver': 'vhdx', 'file': 'node0', 'size': 67108864}}}
|
|
{u'return': {}}
|
|
Job failed: Log size must be a multiple of 1 MB
|
|
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
|
|
{u'return': {}}
|
|
|
|
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'log-size': 128, 'driver': 'vhdx', 'file': 'node0', 'size': 67108864}}}
|
|
{u'return': {}}
|
|
Job failed: Log size must be a multiple of 1 MB
|
|
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
|
|
{u'return': {}}
|
|
|
|
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'log-size': 4294967296, 'driver': 'vhdx', 'file': 'node0', 'size': 67108864}}}
|
|
{u'return': {}}
|
|
Job failed: Log size must be smaller than 4 GB
|
|
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
|
|
{u'return': {}}
|
|
|
|
{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'log-size': 0, 'driver': 'vhdx', 'file': 'node0', 'size': 67108864}}}
|
|
{u'return': {}}
|
|
Job failed: Log size must be a multiple of 1 MB
|
|
{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
|
|
{u'return': {}}
|
|
|