* [Qemu-devel] [PATCH v2 0/2] Two small fixes to the streaming test case.
@ 2012-06-06 14:23 Paolo Bonzini
2012-06-06 14:23 ` [Qemu-devel] [PATCH v2 1/2] qemu-iotests: fill streaming test image with data Paolo Bonzini
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Paolo Bonzini @ 2012-06-06 14:23 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf
Modified the commit messages according to the discussion thread.
Paolo Bonzini (2):
qemu-iotests: fill streaming test image with data
qemu-iotests: start vms in qtest mode
tests/qemu-iotests/030 | 15 +++++++++++++--
tests/qemu-iotests/iotests.py | 4 +++-
2 files changed, 16 insertions(+), 3 deletions(-)
--
1.7.10.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH v2 1/2] qemu-iotests: fill streaming test image with data
2012-06-06 14:23 [Qemu-devel] [PATCH v2 0/2] Two small fixes to the streaming test case Paolo Bonzini
@ 2012-06-06 14:23 ` Paolo Bonzini
2012-06-06 14:23 ` [Qemu-devel] [PATCH v2 2/2] qemu-iotests: start vms in qtest mode Paolo Bonzini
2012-06-06 14:45 ` [Qemu-devel] [PATCH v2 0/2] Two small fixes to the streaming test case Kevin Wolf
2 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2012-06-06 14:23 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf
The TestStreamStop test case is racy; if the job completes before we can
cancel it, it fails. If we remove the sleep the job will be canceled
before it has even started, and the test succeeds but it is also not
testing anything interesting.
But if the image is left sparse, then the job has really nothing to do.
For qcow2 it will read one L2-table, for raw it will issue a bunch of
ioctls. This also falls under "not testing anything interesting", and
this may be happening right now (depending on the filesystem) since the
file protocol got an is_allocated method.
Filling the test image with data ensures that the test covers the
intended case. It also slows down the test, which will be particularly
important after the next patch.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
tests/qemu-iotests/030 | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
index eb7bf99..4ab7d62 100755
--- a/tests/qemu-iotests/030
+++ b/tests/qemu-iotests/030
@@ -21,6 +21,7 @@
import os
import iotests
from iotests import qemu_img, qemu_io
+import struct
backing_img = os.path.join(iotests.test_dir, 'backing.img')
mid_img = os.path.join(iotests.test_dir, 'mid.img')
@@ -48,11 +49,21 @@ class ImageStreamingTestCase(iotests.QMPTestCase):
self.assert_no_active_streams()
+ def create_image(self, name, size):
+ file = open(name, 'w')
+ i = 0
+ while i < size:
+ sector = struct.pack('>l504xl', i / 512, i / 512)
+ file.write(sector)
+ i = i + 512
+ file.close()
+
+
class TestSingleDrive(ImageStreamingTestCase):
image_len = 1 * 1024 * 1024 # MB
def setUp(self):
- qemu_img('create', backing_img, str(TestSingleDrive.image_len))
+ self.create_image(backing_img, TestSingleDrive.image_len)
qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, mid_img)
qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % mid_img, test_img)
self.vm = iotests.VM().add_drive(test_img)
--
1.7.10.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH v2 2/2] qemu-iotests: start vms in qtest mode
2012-06-06 14:23 [Qemu-devel] [PATCH v2 0/2] Two small fixes to the streaming test case Paolo Bonzini
2012-06-06 14:23 ` [Qemu-devel] [PATCH v2 1/2] qemu-iotests: fill streaming test image with data Paolo Bonzini
@ 2012-06-06 14:23 ` Paolo Bonzini
2012-06-06 14:45 ` [Qemu-devel] [PATCH v2 0/2] Two small fixes to the streaming test case Kevin Wolf
2 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2012-06-06 14:23 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf
This way, they will not execute any VM code at all. However, right now
the cancellation test is "relying" on being slowed down by TCG executing
BIOS code. So, change the timeouts.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
tests/qemu-iotests/030 | 2 +-
tests/qemu-iotests/iotests.py | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
index 4ab7d62..cc671dd 100755
--- a/tests/qemu-iotests/030
+++ b/tests/qemu-iotests/030
@@ -147,7 +147,7 @@ class TestStreamStop(ImageStreamingTestCase):
result = self.vm.qmp('block-stream', device='drive0')
self.assert_qmp(result, 'return', {})
- time.sleep(1)
+ time.sleep(0.1)
events = self.vm.get_qmp_events(wait=False)
self.assertEqual(events, [], 'unexpected QMP event: %s' % events)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index e27b40e..e05b1d6 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -54,7 +54,9 @@ class VM(object):
self._qemu_log_path = os.path.join(test_dir, 'qemu-log.%d' % os.getpid())
self._args = qemu_args + ['-chardev',
'socket,id=mon,path=' + self._monitor_path,
- '-mon', 'chardev=mon,mode=control', '-nographic']
+ '-mon', 'chardev=mon,mode=control',
+ '-qtest', 'stdio', '-machine', 'accel=qtest',
+ '-display', 'none', '-vga', 'none']
self._num_drives = 0
def add_drive(self, path, opts=''):
--
1.7.10.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH v2 0/2] Two small fixes to the streaming test case.
2012-06-06 14:23 [Qemu-devel] [PATCH v2 0/2] Two small fixes to the streaming test case Paolo Bonzini
2012-06-06 14:23 ` [Qemu-devel] [PATCH v2 1/2] qemu-iotests: fill streaming test image with data Paolo Bonzini
2012-06-06 14:23 ` [Qemu-devel] [PATCH v2 2/2] qemu-iotests: start vms in qtest mode Paolo Bonzini
@ 2012-06-06 14:45 ` Kevin Wolf
2 siblings, 0 replies; 4+ messages in thread
From: Kevin Wolf @ 2012-06-06 14:45 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
Am 06.06.2012 16:23, schrieb Paolo Bonzini:
> Modified the commit messages according to the discussion thread.
>
> Paolo Bonzini (2):
> qemu-iotests: fill streaming test image with data
> qemu-iotests: start vms in qtest mode
>
> tests/qemu-iotests/030 | 15 +++++++++++++--
> tests/qemu-iotests/iotests.py | 4 +++-
> 2 files changed, 16 insertions(+), 3 deletions(-)
>
Thanks, applied both patches to the block branch.
Kevin
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-06-06 14:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-06 14:23 [Qemu-devel] [PATCH v2 0/2] Two small fixes to the streaming test case Paolo Bonzini
2012-06-06 14:23 ` [Qemu-devel] [PATCH v2 1/2] qemu-iotests: fill streaming test image with data Paolo Bonzini
2012-06-06 14:23 ` [Qemu-devel] [PATCH v2 2/2] qemu-iotests: start vms in qtest mode Paolo Bonzini
2012-06-06 14:45 ` [Qemu-devel] [PATCH v2 0/2] Two small fixes to the streaming test case Kevin Wolf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).