iotests: remove qemu_io_silent() and qemu_io_silent_check().

Like qemu-img, qemu-io returning 0 should be the norm and not the
exception. Remove all calls to qemu_io_silent that just assert the
return code is zero (That's every last call, as it turns out), and
replace them with a normal qemu_io() call.

qemu_io_silent_check() appeared to have been unused already.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220418211504.943969-12-jsnow@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
This commit is contained in:
John Snow 2022-04-18 17:15:03 -04:00 committed by Hanna Reitz
parent 23d44dcb7c
commit 72cfb937b8
10 changed files with 37 additions and 58 deletions

View file

@ -21,7 +21,7 @@
#
import iotests
from iotests import log, qemu_img, qemu_io_silent
from iotests import log, qemu_img, qemu_io
# Need backing file support
iotests.script_initialize(supported_fmts=['qcow2'],
@ -44,15 +44,15 @@ with iotests.FilePath('base.img') as base_img_path, \
log('')
qemu_img('create', '-f', iotests.imgfmt, base_img_path, '64M')
assert qemu_io_silent(base_img_path, '-c', 'write -P 1 0M 1M') == 0
assert qemu_io_silent(base_img_path, '-c', 'write -P 1 3M 1M') == 0
qemu_io(base_img_path, '-c', 'write -P 1 0M 1M')
qemu_io(base_img_path, '-c', 'write -P 1 3M 1M')
qemu_img('create', '-f', iotests.imgfmt, '-b', base_img_path,
'-F', iotests.imgfmt, mid_img_path)
assert qemu_io_silent(mid_img_path, '-c', 'write -P 3 2M 1M') == 0
assert qemu_io_silent(mid_img_path, '-c', 'write -P 3 4M 1M') == 0
qemu_io(mid_img_path, '-c', 'write -P 3 2M 1M')
qemu_io(mid_img_path, '-c', 'write -P 3 4M 1M')
qemu_img('create', '-f', iotests.imgfmt, '-b', mid_img_path,
'-F', iotests.imgfmt, top_img_path)
assert qemu_io_silent(top_img_path, '-c', 'write -P 2 1M 1M') == 0
qemu_io(top_img_path, '-c', 'write -P 2 1M 1M')
# 0 1 2 3 4
# top 2
@ -107,10 +107,10 @@ with iotests.FilePath('base.img') as base_img_path, \
# Detach backing to check that we can read the data from the top level now
qemu_img('rebase', '-u', '-b', '', '-f', iotests.imgfmt, top_img_path)
assert qemu_io_silent(top_img_path, '-c', 'read -P 0 0 1M') == 0
assert qemu_io_silent(top_img_path, '-c', 'read -P 2 1M 1M') == 0
assert qemu_io_silent(top_img_path, '-c', 'read -P 3 2M 1M') == 0
assert qemu_io_silent(top_img_path, '-c', 'read -P 0 3M 1M') == 0
assert qemu_io_silent(top_img_path, '-c', 'read -P 3 4M 1M') == 0
qemu_io(top_img_path, '-c', 'read -P 0 0 1M')
qemu_io(top_img_path, '-c', 'read -P 2 1M 1M')
qemu_io(top_img_path, '-c', 'read -P 3 2M 1M')
qemu_io(top_img_path, '-c', 'read -P 0 3M 1M')
qemu_io(top_img_path, '-c', 'read -P 3 4M 1M')
log('Done')