From 72cfb937b833ea6f49d022e1c7705eb9017a7c5d Mon Sep 17 00:00:00 2001 From: John Snow Date: Mon, 18 Apr 2022 17:15:03 -0400 Subject: 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 Reviewed-by: Eric Blake Reviewed-by: Hanna Reitz Message-Id: <20220418211504.943969-12-jsnow@redhat.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/iotests.py | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'tests/qemu-iotests/iotests.py') diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index a13e6fa..d1661f1 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -369,22 +369,6 @@ def qemu_io_log(*args: str) -> 'subprocess.CompletedProcess[str]': log(result.stdout, filters=[filter_testfiles, filter_qemu_io]) return result -def qemu_io_silent(*args): - '''Run qemu-io and return the exit code, suppressing stdout''' - args = qemu_io_wrap_args(args) - result = subprocess.run(args, stdout=subprocess.DEVNULL, check=False) - if result.returncode < 0: - sys.stderr.write('qemu-io received signal %i: %s\n' % - (-result.returncode, ' '.join(args))) - return result.returncode - -def qemu_io_silent_check(*args): - '''Run qemu-io and return the true if subprocess returned 0''' - args = qemu_io_wrap_args(args) - result = subprocess.run(args, stdout=subprocess.DEVNULL, - stderr=subprocess.STDOUT, check=False) - return result.returncode == 0 - class QemuIoInteractive: def __init__(self, *args): self.args = qemu_io_wrap_args(args) -- cgit v1.1