mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
iotests: replace qemu_img_log('create', ...) calls
qemu_img_log() calls into qemu_img_pipe(), which always removes output for 'create' commands on success anyway. Replace all of these calls to the simpler qemu_img_create(...) which doesn't log, but raises a detailed exception object on failure instead. Blank lines are removed from output files where appropriate. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Hanna Reitz <hreitz@redhat.com> Message-Id: <20220321201618.903471-17-jsnow@redhat.com> Signed-off-by: Hanna Reitz <hreitz@redhat.com>
This commit is contained in:
parent
97576f8c0a
commit
3c8b7358d6
6 changed files with 13 additions and 48 deletions
|
@ -31,12 +31,11 @@ size_long = 2 * 1024 * 1024
|
|||
size_diff = size_long - size_short
|
||||
|
||||
def create_chain() -> None:
|
||||
iotests.qemu_img_log('create', '-f', iotests.imgfmt, base,
|
||||
str(size_long))
|
||||
iotests.qemu_img_log('create', '-f', iotests.imgfmt, '-b', base,
|
||||
'-F', iotests.imgfmt, mid, str(size_short))
|
||||
iotests.qemu_img_log('create', '-f', iotests.imgfmt, '-b', mid,
|
||||
'-F', iotests.imgfmt, top, str(size_long))
|
||||
iotests.qemu_img_create('-f', iotests.imgfmt, base, str(size_long))
|
||||
iotests.qemu_img_create('-f', iotests.imgfmt, '-b', base,
|
||||
'-F', iotests.imgfmt, mid, str(size_short))
|
||||
iotests.qemu_img_create('-f', iotests.imgfmt, '-b', mid,
|
||||
'-F', iotests.imgfmt, top, str(size_long))
|
||||
|
||||
iotests.qemu_io_log('-c', 'write -P 1 0 %d' % size_long, base)
|
||||
|
||||
|
@ -160,9 +159,9 @@ with iotests.FilePath('base') as base, \
|
|||
('off', '512k', '256k', '500k', '436k')]:
|
||||
|
||||
iotests.log('=== preallocation=%s ===' % prealloc)
|
||||
iotests.qemu_img_log('create', '-f', iotests.imgfmt, base, base_size)
|
||||
iotests.qemu_img_log('create', '-f', iotests.imgfmt, '-b', base,
|
||||
'-F', iotests.imgfmt, top, top_size_old)
|
||||
iotests.qemu_img_create('-f', iotests.imgfmt, base, base_size)
|
||||
iotests.qemu_img_create('-f', iotests.imgfmt, '-b', base,
|
||||
'-F', iotests.imgfmt, top, top_size_old)
|
||||
iotests.qemu_io_log('-c', 'write -P 1 %s 64k' % off, base)
|
||||
|
||||
# After this, top_size_old to base_size should be allocated/zeroed.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue