From: Markus Armbruster <armbru@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org, mreitz@redhat.com
Subject: Re: [Qemu-devel] [PATCH v4 4/5] iotests: Add VMDK tests for blockdev-create
Date: Fri, 07 Dec 2018 14:02:48 +0100 [thread overview]
Message-ID: <871s6txzev.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20181207115343.6747-5-kwolf@redhat.com> (Kevin Wolf's message of "Fri, 7 Dec 2018 12:53:42 +0100")
Kevin Wolf <kwolf@redhat.com> writes:
> Signed-off-by: Fam Zheng <famz@redhat.com>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> tests/qemu-iotests/237 | 233 +++++++++++++++++++++++++
> tests/qemu-iotests/237.out | 347 +++++++++++++++++++++++++++++++++++++
> tests/qemu-iotests/group | 1 +
> 3 files changed, 581 insertions(+)
> create mode 100755 tests/qemu-iotests/237
> create mode 100644 tests/qemu-iotests/237.out
>
> diff --git a/tests/qemu-iotests/237 b/tests/qemu-iotests/237
> new file mode 100755
> index 0000000000..e04a1ac6be
> --- /dev/null
> +++ b/tests/qemu-iotests/237
> @@ -0,0 +1,233 @@
> +#!/usr/bin/env python
> +#
> +# Test vmdk and file image creation
> +#
> +# Copyright (C) 2018 Red Hat, Inc.
> +#
> +# Creator/Owner: Kevin Wolf <kwolf@redhat.com>
> +#
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 2 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program. If not, see <http://www.gnu.org/licenses/>.
> +#
> +
> +import iotests
> +from iotests import imgfmt
> +
> +iotests.verify_image_format(supported_fmts=['vmdk'])
> +
> +def blockdev_create(vm, options):
> + result = vm.qmp_log('blockdev-create', job_id='job0', options=options)
> +
> + if 'return' in result:
> + assert result['return'] == {}
> + vm.run_job('job0')
> + iotests.log("")
> +
> +with iotests.FilePath('t.vmdk') as disk_path, \
> + iotests.FilePath('t.vmdk.1') as extent1_path, \
> + iotests.FilePath('t.vmdk.2') as extent2_path, \
> + iotests.FilePath('t.vmdk.3') as extent3_path, \
> + iotests.VM() as vm:
> +
> + #
> + # Successful image creation (defaults)
> + #
> + iotests.log("=== Successful image creation (defaults) ===")
> + iotests.log("")
> +
> + size = 5 * 1024 * 1024 * 1024
> +
> + vm.launch()
> + blockdev_create(vm, { 'driver': 'file',
> + 'filename': disk_path,
> + 'size': 0 })
> +
> + vm.qmp_log('blockdev-add', driver='file', filename=disk_path,
> + node_name='imgfile')
> +
> + blockdev_create(vm, { 'driver': imgfmt,
> + 'file': 'imgfile',
> + 'size': size })
> + vm.shutdown()
> +
> + iotests.img_info_log(disk_path)
> +
> + #
> + # Successful image creation (inline blockdev-add, explicit defaults)
> + #
> + iotests.log("=== Successful image creation (inline blockdev-add, explicit defaults) ===")
> + iotests.log("")
> +
> + # Choose a different size to show that we got a new image
> + size = 64 * 1024 * 1024
> +
> + vm.launch()
> + blockdev_create(vm, { 'driver': 'file',
> + 'filename': disk_path,
> + 'size': 0 })
> +
> + blockdev_create(vm, { 'driver': imgfmt,
> + 'file': {
> + 'driver': 'file',
> + 'filename': disk_path,
> + },
> + 'size': size,
> + 'extents': [],
> + 'subformat': 'monolithicSparse',
> + 'adapter-type': 'ide',
> + 'hwversion': '4',
> + 'zeroed-grain': False })
> + vm.shutdown()
> +
> + iotests.img_info_log(disk_path)
> +
> + #
> + # Successful image creation (non-default options)
> + #
> + iotests.log("=== Successful image creation (with non-default options) ===")
> + iotests.log("")
> +
> + # Choose a different size to show that we got a new image
> + size = 32 * 1024 * 1024
> +
> + vm.launch()
> + blockdev_create(vm, { 'driver': 'file',
> + 'filename': disk_path,
> + 'size': 0 })
> +
> + blockdev_create(vm, { 'driver': imgfmt,
> + 'file': {
> + 'driver': 'file',
> + 'filename': disk_path,
> + },
> + 'size': size,
> + 'extents': [],
> + 'subformat': 'monolithicSparse',
> + 'adapter-type': 'buslogic',
> + 'zeroed-grain': True })
> + vm.shutdown()
> +
> + iotests.img_info_log(disk_path)
> +
> + #
> + # Invalid BlockdevRef
> + #
> + iotests.log("=== Invalid BlockdevRef ===")
> + iotests.log("")
> +
> + vm.launch()
> + blockdev_create(vm, { 'driver': imgfmt,
> + 'file': "this doesn't exist",
> + 'size': size })
> + vm.shutdown()
> +
> + #
> + # Adapter types
> + #
> +
> + iotests.log("=== Adapter types ===")
> + iotests.log("")
> +
> + vm.add_blockdev('driver=file,filename=%s,node-name=node0' % (disk_path))
> +
> + # Valid
> + iotests.log("== Valid adapter types ==")
> + iotests.log("")
> +
> + vm.launch()
> + for adapter_type in [ 'ide', 'buslogic', 'lsilogic', 'legacyESX' ]:
> + blockdev_create(vm, { 'driver': imgfmt,
> + 'file': 'node0',
> + 'size': size,
> + 'adapter-type': adapter_type })
> + vm.shutdown()
> +
> + # Invalid
> + iotests.log("== Invalid adapter types ==")
> + iotests.log("")
> +
> + vm.launch()
> + for adapter_type in [ 'foo', 'IDE', 'legacyesx', 1 ]:
> + blockdev_create(vm, { 'driver': imgfmt,
> + 'file': 'node0',
> + 'size': size,
> + 'adapter-type': adapter_type })
> + vm.shutdown()
> +
> + #
> + # Other subformats
> + #
> + iotests.log("=== Other subformats ===")
> + iotests.log("")
> +
> + for path in [ extent1_path, extent2_path, extent3_path ]:
> + msg = iotests.qemu_img_pipe('create', '-f', imgfmt, path, '0')
> + iotests.log(msg, [iotests.filter_testfiles])
> +
You lost
+ vm.add_blockdev('driver=file,filename=%s,node-name=node0' % (disk_path))
here since v3. Intentional?
> + vm.add_blockdev('driver=file,filename=%s,node-name=ext1' % (extent1_path))
> + vm.add_blockdev('driver=file,filename=%s,node-name=ext2' % (extent2_path))
> + vm.add_blockdev('driver=file,filename=%s,node-name=ext3' % (extent3_path))
[...]
next prev parent reply other threads:[~2018-12-07 13:03 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-07 11:53 [Qemu-devel] [PATCH v4 0/5] vmdk: Implement blockdev-create Kevin Wolf
2018-12-07 11:53 ` [Qemu-devel] [PATCH v4 1/5] vmdk: Refactor vmdk_create_extent Kevin Wolf
2018-12-07 11:53 ` [Qemu-devel] [PATCH v4 2/5] vmdk: Implement .bdrv_co_create callback Kevin Wolf
2018-12-07 13:01 ` Markus Armbruster
2018-12-07 13:04 ` Markus Armbruster
2018-12-07 11:53 ` [Qemu-devel] [PATCH v4 3/5] iotests: Filter cid numbers in VMDK extent info Kevin Wolf
2018-12-07 11:53 ` [Qemu-devel] [PATCH v4 4/5] iotests: Add VMDK tests for blockdev-create Kevin Wolf
2018-12-07 13:02 ` Markus Armbruster [this message]
2018-12-07 13:12 ` Markus Armbruster
2018-12-07 14:45 ` Kevin Wolf
2018-12-07 15:40 ` Eric Blake
2018-12-07 16:42 ` Kevin Wolf
2018-12-07 16:52 ` Eric Blake
2018-12-07 17:09 ` Kevin Wolf
2018-12-07 11:53 ` [Qemu-devel] [PATCH v4 5/5] vmdk: Reject excess extents in blockdev-create Kevin Wolf
2018-12-07 13:11 ` Markus Armbruster
2018-12-07 14:54 ` Kevin Wolf
2018-12-07 15:34 ` Markus Armbruster
2018-12-07 12:56 ` [Qemu-devel] [PATCH v4 0/5] vmdk: Implement blockdev-create no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871s6txzev.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.