iotests: use python logging
v2 cover iotests: use python logging
Based-on: https://github.com/jnsnow/qemu/tree/bitmaps
This series uses python logging to enable output conditionally on iotests.log(). We unify an initialization call (which also enables debugging output for those tests with -d) and then make the switch inside of iotests.
It will help alleviate the need to create logged/unlogged versions of all the various helpers we have made.
Depends on my bitmaps branch, because of the existing iotests refactoring I have done there.
V2:
- Added all of the other python tests I missed to use script_initialize
- Refactored the common setup as per Ehabkost's suggestion
- Added protocol arguments to common initialization,
but this isn't strictly required.
John Snow (3):
iotests: add script_initialize
iotests: add protocol support to initialization info
iotests: use python logging for iotests.log()
tests/qemu-iotests/030 | 4 +- tests/qemu-iotests/149 | 3 +- tests/qemu-iotests/194 | 3 +- tests/qemu-iotests/202 | 3 +- tests/qemu-iotests/203 | 3 +- tests/qemu-iotests/206 | 2 +- tests/qemu-iotests/207 | 4 +- tests/qemu-iotests/208 | 2 +- tests/qemu-iotests/209 | 2 +- tests/qemu-iotests/210 | 4 +- tests/qemu-iotests/211 | 4 +- tests/qemu-iotests/212 | 4 +- tests/qemu-iotests/213 | 4 +- tests/qemu-iotests/216 | 3 +- tests/qemu-iotests/218 | 2 +- tests/qemu-iotests/219 | 2 +- tests/qemu-iotests/222 | 5 +- tests/qemu-iotests/224 | 3 +- tests/qemu-iotests/228 | 3 +- tests/qemu-iotests/234 | 3 +- tests/qemu-iotests/235 | 4 +- tests/qemu-iotests/236 | 2 +- tests/qemu-iotests/237 | 2 +- tests/qemu-iotests/238 | 2 + tests/qemu-iotests/242 | 2 +- tests/qemu-iotests/245 | 1 + tests/qemu-iotests/245.out | 24 ++++---- tests/qemu-iotests/246 | 2 +- tests/qemu-iotests/248 | 2 +- tests/qemu-iotests/254 | 2 +- tests/qemu-iotests/255 | 2 +- tests/qemu-iotests/256 | 2 +- tests/qemu-iotests/iotests.py | 108 ++++++++++++++++++++++------------ 33 files changed, 121 insertions(+), 97 deletions(-)
Signature · 1 line
2.21.0
PATCH v2 1/3 iotests: add script_initialize
Like script_main, but doesn't require a single point of entry. Replace all existing initialization sections with this drop-in replacement.
This brings debug support to all existing script-style iotests.
Note: supported_oses=['linux'] was omitted, as it is a default argument.
--- tests/qemu-iotests/149 | 3 +- tests/qemu-iotests/194 | 3 +- tests/qemu-iotests/202 | 3 +- tests/qemu-iotests/203 | 3 +- tests/qemu-iotests/206 | 2 +- tests/qemu-iotests/207 | 2 +- tests/qemu-iotests/208 | 2 +- tests/qemu-iotests/209 | 2 +- tests/qemu-iotests/210 | 2 +- tests/qemu-iotests/211 | 2 +- tests/qemu-iotests/212 | 2 +- tests/qemu-iotests/213 | 2 +- tests/qemu-iotests/216 | 3 +- tests/qemu-iotests/218 | 2 +- tests/qemu-iotests/219 | 2 +- tests/qemu-iotests/222 | 5 ++- tests/qemu-iotests/224 | 3 +- tests/qemu-iotests/228 | 3 +- tests/qemu-iotests/234 | 3 +- tests/qemu-iotests/235 | 4 +-- tests/qemu-iotests/236 | 2 +- tests/qemu-iotests/237 | 2 +- tests/qemu-iotests/238 | 2 ++ tests/qemu-iotests/242 | 2 +- tests/qemu-iotests/246 | 2 +- tests/qemu-iotests/248 | 2 +- tests/qemu-iotests/254 | 2 +- tests/qemu-iotests/255 | 2 +- tests/qemu-iotests/256 | 2 +- tests/qemu-iotests/iotests.py | 58 +++++++++++++++++++++++------------ 30 files changed, 70 insertions(+), 59 deletions(-)
tests/qemu-iotests/149 +1 -2
@@ -383,8 +383,7 @@ def test_once(config, qemu_img=False): # Obviously we only work with the luks image format -iotests.verify_image_format(supported_fmts=['luks']) -iotests.verify_platform() +iotests.script_initialize(supported_fmts=['luks']) # We need sudo in order to run cryptsetup to create # dm-crypt devices. This is safe to use on any
tests/qemu-iotests/194 +1 -2
@@ -21,8 +21,7 @@ import iotests -iotests.verify_image_format(supported_fmts=['qcow2', 'qed', 'raw']) -iotests.verify_platform(['linux']) +iotests.script_initialize(supported_fmts=['qcow2', 'qed', 'raw']) with iotests.FilePath('source.img') as source_img_path, \ iotests.FilePath('dest.img') as dest_img_path, \
tests/qemu-iotests/202 +1 -2
@@ -24,8 +24,7 @@ import iotests -iotests.verify_image_format(supported_fmts=['qcow2']) -iotests.verify_platform(['linux']) +iotests.script_initialize(supported_fmts=['qcow2']) with iotests.FilePath('disk0.img') as disk0_img_path, \ iotests.FilePath('disk1.img') as disk1_img_path, \
tests/qemu-iotests/203 +1 -2
@@ -24,8 +24,7 @@ import iotests -iotests.verify_image_format(supported_fmts=['qcow2']) -iotests.verify_platform(['linux']) +iotests.script_initialize(supported_fmts=['qcow2']) with iotests.FilePath('disk0.img') as disk0_img_path, \ iotests.FilePath('disk1.img') as disk1_img_path, \
tests/qemu-iotests/206 +1 -1
@@ -23,7 +23,7 @@ import iotests from iotests import imgfmt -iotests.verify_image_format(supported_fmts=['qcow2']) +iotests.script_initialize(supported_fmts=['qcow2']) def blockdev_create(vm, options): result = vm.qmp_log('blockdev-create',
tests/qemu-iotests/207 +1 -1
@@ -24,7 +24,7 @@ import iotests import subprocess import re -iotests.verify_image_format(supported_fmts=['raw']) +iotests.script_initialize(supported_fmts=['raw']) iotests.verify_protocol(supported=['ssh']) def filter_hash(qmsg):
tests/qemu-iotests/208 +1 -1
@@ -22,7 +22,7 @@ import iotests -iotests.verify_image_format(supported_fmts=['generic']) +iotests.script_initialize(supported_fmts=['generic']) with iotests.FilePath('disk.img') as disk_img_path, \ iotests.FilePath('disk-snapshot.img') as disk_snapshot_img_path, \
tests/qemu-iotests/209 +1 -1
@@ -22,7 +22,7 @@ import iotests from iotests import qemu_img_create, qemu_io, qemu_img_verbose, qemu_nbd, \ file_path -iotests.verify_image_format(supported_fmts=['qcow2']) +iotests.script_initialize(supported_fmts=['qcow2']) disk, nbd_sock = file_path('disk', 'nbd-sock') nbd_uri = 'nbd+unix:///exp?socket=' + nbd_sock
tests/qemu-iotests/210 +1 -1
@@ -23,7 +23,7 @@ import iotests from iotests import imgfmt -iotests.verify_image_format(supported_fmts=['luks']) +iotests.script_initialize(supported_fmts=['luks']) iotests.verify_protocol(supported=['file']) def blockdev_create(vm, options):
tests/qemu-iotests/211 +1 -1
@@ -23,7 +23,7 @@ import iotests from iotests import imgfmt -iotests.verify_image_format(supported_fmts=['vdi']) +iotests.script_initialize(supported_fmts=['vdi']) iotests.verify_protocol(supported=['file']) def blockdev_create(vm, options):
tests/qemu-iotests/212 +1 -1
@@ -23,7 +23,7 @@ import iotests from iotests import imgfmt -iotests.verify_image_format(supported_fmts=['parallels']) +iotests.script_initialize(supported_fmts=['parallels']) iotests.verify_protocol(supported=['file']) def blockdev_create(vm, options):
tests/qemu-iotests/213 +1 -1
@@ -23,7 +23,7 @@ import iotests from iotests import imgfmt -iotests.verify_image_format(supported_fmts=['vhdx']) +iotests.script_initialize(supported_fmts=['vhdx']) iotests.verify_protocol(supported=['file']) def blockdev_create(vm, options):
tests/qemu-iotests/216 +1 -2
@@ -23,8 +23,7 @@ import iotests from iotests import log, qemu_img, qemu_io_silent # Need backing file support -iotests.verify_image_format(supported_fmts=['qcow2', 'qcow', 'qed', 'vmdk']) -iotests.verify_platform(['linux']) +iotests.script_initialize(supported_fmts=['qcow2', 'qcow', 'qed', 'vmdk']) log('') log('=== Copy-on-read across nodes ===')
tests/qemu-iotests/218 +1 -1
@@ -29,7 +29,7 @@ import iotests from iotests import log, qemu_img, qemu_io_silent -iotests.verify_image_format(supported_fmts=['qcow2', 'raw']) +iotests.script_initialize(supported_fmts=['qcow2', 'raw']) # Launches the VM, adds two null-co nodes (source and target), and
tests/qemu-iotests/219 +1 -1
@@ -21,7 +21,7 @@ import iotests -iotests.verify_image_format(supported_fmts=['qcow2']) +iotests.script_initialize(supported_fmts=['qcow2']) img_size = 4 * 1024 * 1024
tests/qemu-iotests/222 +2 -3
@@ -24,9 +24,8 @@ import iotests from iotests import log, qemu_img, qemu_io, qemu_io_silent -iotests.verify_platform(['linux']) -iotests.verify_image_format(supported_fmts=['qcow2', 'qcow', 'qed', 'vmdk', - 'vhdx', 'raw']) +iotests.script_initialize(supported_fmts=['qcow2', 'qcow', 'qed', 'vmdk', + 'vhdx', 'raw']) patterns = [("0x5d", "0", "64k"), ("0xd5", "1M", "64k"),
tests/qemu-iotests/224 +1 -2
@@ -26,8 +26,7 @@ from iotests import log, qemu_img, qemu_io_silent, filter_qmp_testfiles, \ import json # Need backing file support (for arbitrary backing formats) -iotests.verify_image_format(supported_fmts=['qcow2', 'qcow', 'qed']) -iotests.verify_platform(['linux']) +iotests.script_initialize(supported_fmts=['qcow2', 'qcow', 'qed']) # There are two variations of this test:
tests/qemu-iotests/228 +1 -2
@@ -25,8 +25,7 @@ from iotests import log, qemu_img, filter_testfiles, filter_imgfmt, \ filter_qmp_testfiles, filter_qmp_imgfmt # Need backing file and change-backing-file support -iotests.verify_image_format(supported_fmts=['qcow2', 'qed']) -iotests.verify_platform(['linux']) +iotests.script_initialize(supported_fmts=['qcow2', 'qed']) def log_node_info(node):
tests/qemu-iotests/234 +1 -2
@@ -23,8 +23,7 @@ import iotests import os -iotests.verify_image_format(supported_fmts=['qcow2']) -iotests.verify_platform(['linux']) +iotests.script_initialize(supported_fmts=['qcow2']) def enable_migration_events(vm, name): iotests.log('Enabling migration QMP events on %s...' % name)
tests/qemu-iotests/235 +2 -2
@@ -27,6 +27,8 @@ sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'python')) from qemu.machine import QEMUMachine +iotests.script_initialize(supported_fmts=['qcow2']) + # Note: # This test was added to check that mirror dead-lock was fixed (see previous # commit before this test addition).
@@ -40,8 +42,6 @@ from qemu.machine import QEMUMachine size = 1 * 1024 * 1024 * 1024 -iotests.verify_image_format(supported_fmts=['qcow2']) - disk = file_path('disk') # prepare source image
tests/qemu-iotests/236 +1 -1
@@ -22,7 +22,7 @@ import iotests from iotests import log -iotests.verify_image_format(supported_fmts=['generic']) +iotests.script_initialize(supported_fmts=['generic']) size = 64 * 1024 * 1024 granularity = 64 * 1024
tests/qemu-iotests/237 +1 -1
@@ -24,7 +24,7 @@ import math import iotests from iotests import imgfmt -iotests.verify_image_format(supported_fmts=['vmdk']) +iotests.script_initialize(supported_fmts=['vmdk']) def blockdev_create(vm, options): result = vm.qmp_log('blockdev-create', job_id='job0', options=options,
tests/qemu-iotests/238 +2 -0
@@ -23,6 +23,8 @@ import os import iotests from iotests import log +iotests.script_initialize() + virtio_scsi_device = iotests.get_virtio_scsi_device() vm = iotests.VM()
tests/qemu-iotests/242 +1 -1
@@ -24,7 +24,7 @@ import struct from iotests import qemu_img_create, qemu_io, qemu_img_pipe, \ file_path, img_info_log, log, filter_qemu_io -iotests.verify_image_format(supported_fmts=['qcow2']) +iotests.script_initialize(supported_fmts=['qcow2']) disk = file_path('disk') chunk = 256 * 1024
tests/qemu-iotests/246 +1 -1
@@ -22,7 +22,7 @@ import iotests from iotests import log -iotests.verify_image_format(supported_fmts=['qcow2']) +iotests.script_initialize(supported_fmts=['qcow2']) size = 64 * 1024 * 1024 * 1024 gran_small = 32 * 1024 gran_large = 128 * 1024
tests/qemu-iotests/248 +1 -1
@@ -21,7 +21,7 @@ import iotests from iotests import qemu_img_create, qemu_io, file_path, filter_qmp_testfiles -iotests.verify_image_format(supported_fmts=['qcow2']) +iotests.script_initialize(supported_fmts=['qcow2']) source, target = file_path('source', 'target') size = 5 * 1024 * 1024
tests/qemu-iotests/254 +1 -1
@@ -21,7 +21,7 @@ import iotests from iotests import qemu_img_create, file_path, log -iotests.verify_image_format(supported_fmts=['qcow2']) +iotests.script_initialize(supported_fmts=['qcow2']) disk, top = file_path('disk', 'top') size = 1024 * 1024
tests/qemu-iotests/255 +1 -1
@@ -23,7 +23,7 @@ import iotests from iotests import imgfmt -iotests.verify_image_format(supported_fmts=['qcow2']) +iotests.script_initialize(supported_fmts=['qcow2']) def blockdev_create(vm, options): result = vm.qmp_log('blockdev-create',
tests/qemu-iotests/256 +1 -1
@@ -23,7 +23,7 @@ import os import iotests from iotests import log -iotests.verify_image_format(supported_fmts=['qcow2']) +iotests.script_initialize(supported_fmts=['qcow2']) size = 64 * 1024 * 1024 with iotests.FilePath('img0') as img0_path, \
tests/qemu-iotests/iotests.py +38 -20
96 lines not on this page · raw message
Signature · 1 line
2.21.0
Re: [Qemu-devel] [PATCH v2 1/3] iotests: add script_initialize
Quoted 8 lines · John Snow
Like
script_main, but doesn't require a single point of entry. Replace all existing initialization sections with this drop-in replacement.This brings debug support to all existing script-style iotests.
Note: supported_oses=['linux'] was omitted, as it is a default argument.
Signed-off-by John Snow <[email protected]>---
Looks good to me, but I’m afraid I looked at this series too late (that is, now), so I sent my own version of your 2/3, sorry. :-/
That means that this needs a bit of rebasing and what remains of 2/3 afterwards (I haven’t converted existing tests using verify_protocol, so that still needs to be done) should probably be squashed into this patch here.
Max
Re: [Qemu-devel] [PATCH v2 1/3] iotests: add script_initialize
Quoted 4 lines · Max Reitz
Quoted 3 lines · John Snow
Like
script_main, but doesn't require a single point of entry. Replace all existing initialization sections with this drop-in replacement.
Quoted 9 lines
Quoted 5 lines
This brings debug support to all existing script-style iotests.
Note: supported_oses=['linux'] was omitted, as it is a default argument.
Signed-off-by John Snow <[email protected]>---
Looks good to me, but I’m afraid I looked at this series too late (that is, now), so I sent my own version of your 2/3, sorry. :-/
You're replying to v2; there was a v3.
I'll rebase V3 and re-send, especially if your version of 2/3 already hit master.
--js
Re: [Qemu-devel] [PATCH v2 1/3] iotests: add script_initialize
Quoted 13 lines · John Snow
Quoted 10 lines · Max Reitz
Quoted 8 lines · John Snow
Like
script_main, but doesn't require a single point of entry. Replace all existing initialization sections with this drop-in replacement.This brings debug support to all existing script-style iotests.
Note: supported_oses=['linux'] was omitted, as it is a default argument.
Signed-off-by John Snow <[email protected]>---
Quoted 5 lines
Quoted 3 lines
Looks good to me, but I’m afraid I looked at this series too late (that is, now), so I sent my own version of your 2/3, sorry. :-/
You're replying to v2; there was a v3.
Yes, I noticed later, sorry. Still, my (vpc) series is in Kevin’s branch already, so I then thought to myself “Well, the comment about some rebasing still applies, in a sense”.
Max
Quoted 2 lines
I'll rebase V3 and re-send, especially if your version of 2/3 already hit master.
PATCH v2 2/3 iotests: add protocol support to initialization info
In reply to John SnowThis will add supported_protocols and unsupported_protocols to all of iotests.main, iotests.script_main, and iotests.script_initialize.
--- tests/qemu-iotests/207 | 4 ++-- tests/qemu-iotests/210 | 4 ++-- tests/qemu-iotests/211 | 4 ++-- tests/qemu-iotests/212 | 4 ++-- tests/qemu-iotests/213 | 4 ++-- tests/qemu-iotests/iotests.py | 5 ++++- 6 files changed, 14 insertions(+), 11 deletions(-)
tests/qemu-iotests/207 +2 -2
@@ -24,8 +24,8 @@ import iotests import subprocess import re -iotests.script_initialize(supported_fmts=['raw']) -iotests.verify_protocol(supported=['ssh']) +iotests.script_initialize(supported_fmts=['raw'], + supported_protocols=['ssh']) def filter_hash(qmsg): def _filter(key, value):
tests/qemu-iotests/210 +2 -2
@@ -23,8 +23,8 @@ import iotests from iotests import imgfmt -iotests.script_initialize(supported_fmts=['luks']) -iotests.verify_protocol(supported=['file']) +iotests.script_initialize(supported_fmts=['luks'], + supported_protocols=['file']) def blockdev_create(vm, options): result = vm.qmp_log('blockdev-create', job_id='job0', options=options,
tests/qemu-iotests/211 +2 -2
@@ -23,8 +23,8 @@ import iotests from iotests import imgfmt -iotests.script_initialize(supported_fmts=['vdi']) -iotests.verify_protocol(supported=['file']) +iotests.script_initialize(supported_fmts=['vdi'], + supported_protocols=['file']) def blockdev_create(vm, options): result = vm.qmp_log('blockdev-create', job_id='job0', options=options,
tests/qemu-iotests/212 +2 -2
@@ -23,8 +23,8 @@ import iotests from iotests import imgfmt -iotests.script_initialize(supported_fmts=['parallels']) -iotests.verify_protocol(supported=['file']) +iotests.script_initialize(supported_fmts=['parallels'], + supported_protocols=['file']) def blockdev_create(vm, options): result = vm.qmp_log('blockdev-create', job_id='job0', options=options,
tests/qemu-iotests/213 +2 -2
@@ -23,8 +23,8 @@ import iotests from iotests import imgfmt -iotests.script_initialize(supported_fmts=['vhdx']) -iotests.verify_protocol(supported=['file']) +iotests.script_initialize(supported_fmts=['vhdx'], + supported_protocols=['file']) def blockdev_create(vm, options): result = vm.qmp_log('blockdev-create', job_id='job0', options=options,
tests/qemu-iotests/iotests.py +4 -1
@@ -909,7 +909,9 @@ def execute_unittest(debug=False): def execute_setup_common(supported_fmts=[], supported_oses=['linux'], supported_cache_modes=[], - unsupported_fmts=[]): + unsupported_fmts=[], + supported_protocols=[], + unsupported_protocols=[]): """ Perform necessary setup for either script-style or unittest-style tests. """
@@ -925,6 +927,7 @@ def execute_setup_common(supported_fmts=[], verify_image_format(supported_fmts, unsupported_fmts) verify_platform(supported_oses) verify_cache_mode(supported_cache_modes) + verify_protocol(supported_protocols, unsupported_protocols) debug = '-d' in sys.argv if debug:
Signature · 1 line
2.21.0
Re: [Qemu-devel] [PATCH v2 2/3] iotests: add protocol support to initialization info
Quoted 4 lines · John Snow
This will add
supported_protocolsandunsupported_protocolsto all of iotests.main, iotests.script_main, and iotests.script_initialize.Signed-off-by John Snow <[email protected]>
Quoted 8 lines
--- tests/qemu-iotests/207 | 4 ++-- tests/qemu-iotests/210 | 4 ++-- tests/qemu-iotests/211 | 4 ++-- tests/qemu-iotests/212 | 4 ++-- tests/qemu-iotests/213 | 4 ++-- tests/qemu-iotests/iotests.py | 5 ++++- 6 files changed, 14 insertions(+), 11 deletions(-)
Hm... Most of the other script-style tests that do not pass supported_protocols yet should probably do so, actually. I’m fairly certain most of them actually only support 'file'.
Max
Re: [Qemu-devel] [PATCH v2 2/3] iotests: add protocol support to initialization info
Quoted 14 lines · Max Reitz
Quoted 4 lines · John Snow
This will add
supported_protocolsandunsupported_protocolsto all of iotests.main, iotests.script_main, and iotests.script_initialize.Signed-off-by John Snow <[email protected]>Quoted 8 lines
--- tests/qemu-iotests/207 | 4 ++-- tests/qemu-iotests/210 | 4 ++-- tests/qemu-iotests/211 | 4 ++-- tests/qemu-iotests/212 | 4 ++-- tests/qemu-iotests/213 | 4 ++-- tests/qemu-iotests/iotests.py | 5 ++++- 6 files changed, 14 insertions(+), 11 deletions(-)
Quoted 3 lines
Hm... Most of the other script-style tests that do not pass
supported_protocolsyet should probably do so, actually. I’m fairly certain most of them actually only support 'file'.
Sounds like a follow-up patch.
I guess the protocol information patch you talked about is not at origin/master yet. Can you point me to it if I need to rebase on top of it?
My V3 still applies cleanly to master and appears to be correct.
--js
Re: [Qemu-devel] [PATCH v2 2/3] iotests: add protocol support to initialization info
Quoted 17 lines · John Snow
Quoted 14 lines · Max Reitz
Quoted 12 lines · John Snow
This will add
supported_protocolsandunsupported_protocolsto all of iotests.main, iotests.script_main, and iotests.script_initialize.Signed-off-by John Snow <[email protected]>--- tests/qemu-iotests/207 | 4 ++-- tests/qemu-iotests/210 | 4 ++-- tests/qemu-iotests/211 | 4 ++-- tests/qemu-iotests/212 | 4 ++-- tests/qemu-iotests/213 | 4 ++-- tests/qemu-iotests/iotests.py | 5 ++++- 6 files changed, 14 insertions(+), 11 deletions(-)
Quoted 5 lines
Quoted 3 lines
Hm... Most of the other script-style tests that do not pass
supported_protocolsyet should probably do so, actually. I’m fairly certain most of them actually only support 'file'.Sounds like a follow-up patch.
Why not. I think it fits well into this series, but either way works for me.
Quoted 2 lines
I guess the protocol information patch you talked about is not at origin/master yet. Can you point me to it if I need to rebase on top of it?
It’s in Kevin’s branch: git://repo.or.cz/qemu/kevin.git block
Max
PATCH v2 3/3 iotests: use python logging for iotests.log()
In reply to John SnowWe can turn logging on/off globally instead of per-function.
Remove use_log from run_job, and use python logging to turn on diffable output when we run through a script entry point.
iotest 245 changes output order due to buffering reasons.
--- tests/qemu-iotests/030 | 4 +-- tests/qemu-iotests/245 | 1 + tests/qemu-iotests/245.out | 24 +++++++++--------- tests/qemu-iotests/iotests.py | 47 +++++++++++++++++++++-------------- 4 files changed, 43 insertions(+), 33 deletions(-)
tests/qemu-iotests/030 +2 -2
@@ -411,8 +411,8 @@ class TestParallelOps(iotests.QMPTestCase): result = self.vm.qmp('block-job-set-speed', device='drive0', speed=0) self.assert_qmp(result, 'return', {}) - self.vm.run_job(job='drive0', auto_dismiss=True, use_log=False) - self.vm.run_job(job='node4', auto_dismiss=True, use_log=False) + self.vm.run_job(job='drive0', auto_dismiss=True) + self.vm.run_job(job='node4', auto_dismiss=True) self.assert_no_active_block_jobs() # Test a block-stream and a block-commit job in parallel
tests/qemu-iotests/245 +1 -0
@@ -1000,4 +1000,5 @@ class TestBlockdevReopen(iotests.QMPTestCase): self.reopen(opts, {'backing': 'hd2'}) if __name__ == '__main__': + iotests.activate_logging() iotests.main(supported_fmts=["qcow2"])
tests/qemu-iotests/245.out +12 -12
@@ -1,17 +1,17 @@ +{"execute": "job-finalize", "arguments": {"id": "commit0"}} +{"return": {}} +{"data": {"id": "commit0", "type": "commit"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "commit0", "len": 3145728, "offset": 3145728, "speed": 0, "type": "commit"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-finalize", "arguments": {"id": "stream0"}} +{"return": {}} +{"data": {"id": "stream0", "type": "stream"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "stream0", "len": 3145728, "offset": 3145728, "speed": 0, "type": "stream"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"execute": "job-finalize", "arguments": {"id": "stream0"}} +{"return": {}} +{"data": {"id": "stream0", "type": "stream"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "stream0", "len": 3145728, "offset": 3145728, "speed": 0, "type": "stream"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} .................. ---------------------------------------------------------------------- Ran 18 tests OK -{"execute": "job-finalize", "arguments": {"id": "commit0"}} -{"return": {}} -{"data": {"id": "commit0", "type": "commit"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} -{"data": {"device": "commit0", "len": 3145728, "offset": 3145728, "speed": 0, "type": "commit"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} -{"execute": "job-finalize", "arguments": {"id": "stream0"}} -{"return": {}} -{"data": {"id": "stream0", "type": "stream"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} -{"data": {"device": "stream0", "len": 3145728, "offset": 3145728, "speed": 0, "type": "stream"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} -{"execute": "job-finalize", "arguments": {"id": "stream0"}} -{"return": {}} -{"data": {"id": "stream0", "type": "stream"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} -{"data": {"device": "stream0", "len": 3145728, "offset": 3145728, "speed": 0, "type": "stream"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
tests/qemu-iotests/iotests.py +28 -19
110 lines not on this page · raw message
Signature · 1 line
2.21.0
Re: [Qemu-devel] [PATCH v2 3/3] iotests: use python logging for iotests.log()
Quoted 7 lines · John Snow
We can turn logging on/off globally instead of per-function.
Remove
use_logfromrun_job, and use python logging to turn on diffable output when we run through a script entry point.iotest 245 changes output order due to buffering reasons.
Quoted 7 lines
Signed-off-by John Snow <[email protected]>--- tests/qemu-iotests/030 | 4 +-- tests/qemu-iotests/245 | 1 + tests/qemu-iotests/245.out | 24 +++++++++--------- tests/qemu-iotests/iotests.py | 47 +++++++++++++++++++++-------------- 4 files changed, 43 insertions(+), 33 deletions(-)