[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 03/19] iotests: drop qemu_img_verbose() helper
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v4 03/19] iotests: drop qemu_img_verbose() helper |
Date: |
Fri, 3 Dec 2021 14:07:21 +0100 |
qemu_img_verbose() has a drawback of not going through generic
qemu_img_pipe_and_status(). qemu_img_verbose() is not very popular, so
update the only two users to qemu_img_log() and drop qemu_img_verbose()
at all.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
---
tests/qemu-iotests/044 | 5 +++--
tests/qemu-iotests/044.out | 1 +
tests/qemu-iotests/209 | 7 ++++---
tests/qemu-iotests/209.out | 2 ++
tests/qemu-iotests/iotests.py | 8 --------
5 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/tests/qemu-iotests/044 b/tests/qemu-iotests/044
index 64b18eb7c8..714329eb16 100755
--- a/tests/qemu-iotests/044
+++ b/tests/qemu-iotests/044
@@ -24,7 +24,7 @@ import os
import qcow2
from qcow2 import QcowHeader
import iotests
-from iotests import qemu_img, qemu_img_verbose, qemu_io
+from iotests import qemu_img, qemu_img_log, qemu_io
import struct
import subprocess
import sys
@@ -112,9 +112,10 @@ class TestRefcountTableGrowth(iotests.QMPTestCase):
def test_grow_refcount_table(self):
qemu_io('-c', 'write 3800M 1M', test_img)
- qemu_img_verbose('check' , test_img)
+ qemu_img_log('check' , test_img)
pass
if __name__ == '__main__':
+ iotests.activate_logging()
iotests.main(supported_fmts=['qcow2'],
supported_protocols=['file'])
diff --git a/tests/qemu-iotests/044.out b/tests/qemu-iotests/044.out
index 703cf3dee1..ff663b17d7 100644
--- a/tests/qemu-iotests/044.out
+++ b/tests/qemu-iotests/044.out
@@ -1,6 +1,7 @@
No errors were found on the image.
7292415/33554432 = 21.73% allocated, 0.00% fragmented, 0.00% compressed
clusters
Image end offset: 4296217088
+
.
----------------------------------------------------------------------
Ran 1 tests
diff --git a/tests/qemu-iotests/209 b/tests/qemu-iotests/209
index ff7efea11b..f6ad08ec42 100755
--- a/tests/qemu-iotests/209
+++ b/tests/qemu-iotests/209
@@ -20,8 +20,8 @@
#
import iotests
-from iotests import qemu_img_create, qemu_io, qemu_img_verbose, qemu_nbd, \
- file_path
+from iotests import qemu_img_create, qemu_io, qemu_img_log, qemu_nbd, \
+ file_path, log
iotests.script_initialize(supported_fmts=['qcow2'])
@@ -33,4 +33,5 @@ qemu_img_create('-f', iotests.imgfmt, disk, '1M')
qemu_io('-f', iotests.imgfmt, '-c', 'write 0 512K', disk)
qemu_nbd('-k', nbd_sock, '-x', 'exp', '-f', iotests.imgfmt, disk)
-qemu_img_verbose('map', '-f', 'raw', '--output=json', nbd_uri)
+qemu_img_log('map', '-f', 'raw', '--output=json', nbd_uri)
+log('done.') # avoid new line at the end of output file
diff --git a/tests/qemu-iotests/209.out b/tests/qemu-iotests/209.out
index f27be3fa7b..515906ac7a 100644
--- a/tests/qemu-iotests/209.out
+++ b/tests/qemu-iotests/209.out
@@ -1,2 +1,4 @@
[{ "start": 0, "length": 524288, "depth": 0, "present": true, "zero": false,
"data": true, "offset": 0},
{ "start": 524288, "length": 524288, "depth": 0, "present": true, "zero":
true, "data": false, "offset": 524288}]
+
+done.
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index a7a257ee2f..4846ba7c60 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -227,14 +227,6 @@ def qemu_img_measure(*args):
def qemu_img_check(*args):
return json.loads(qemu_img_pipe("check", "--output", "json", *args))
-def qemu_img_verbose(*args):
- '''Run qemu-img without suppressing its output and return the exit code'''
- exitcode = subprocess.call(qemu_img_args + list(args))
- if exitcode < 0:
- sys.stderr.write('qemu-img received signal %i: %s\n'
- % (-exitcode, ' '.join(qemu_img_args + list(args))))
- return exitcode
-
def qemu_img_pipe(*args: str) -> str:
'''Run qemu-img and return its output'''
return qemu_img_pipe_and_status(*args)[0]
--
2.31.1
- [PATCH v4 00/19] iotests: support zstd, Vladimir Sementsov-Ogievskiy, 2021/12/03
- [PATCH v4 02/19] iotests.py: qemu_img*("create"): support IMGOPTS='compression_type=zstd', Vladimir Sementsov-Ogievskiy, 2021/12/03
- [PATCH v4 03/19] iotests: drop qemu_img_verbose() helper,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v4 05/19] iotest 303: explicit compression type, Vladimir Sementsov-Ogievskiy, 2021/12/03
- [PATCH v4 08/19] iotests.py: filter compression type out, Vladimir Sementsov-Ogievskiy, 2021/12/03
- [PATCH v4 17/19] iotests: declare lack of support for compresion_type in IMGOPTS, Vladimir Sementsov-Ogievskiy, 2021/12/03
- [PATCH v4 18/19] iotests.py: implement unsupported_imgopts, Vladimir Sementsov-Ogievskiy, 2021/12/03
- [PATCH v4 09/19] iotest 302: use img_info_log() helper, Vladimir Sementsov-Ogievskiy, 2021/12/03
- [PATCH v4 07/19] iotests.py: filter out successful output of qemu-img create, Vladimir Sementsov-Ogievskiy, 2021/12/03
- [PATCH v4 10/19] qcow2: simple case support for downgrading of qcow2 images with zstd, Vladimir Sementsov-Ogievskiy, 2021/12/03
- [PATCH v4 19/19] iotests: specify some unsupported_imgopts for python iotests, Vladimir Sementsov-Ogievskiy, 2021/12/03