thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
Blob Blame History Raw
From 33e66fa335c602b53302cd2838d075a8c05509d6 Mon Sep 17 00:00:00 2001
From: Fam Zheng <famz@redhat.com>
Date: Fri, 17 Jan 2014 03:08:01 +0100
Subject: [PATCH 18/34] qemu-iotests: prefill some data to test image

RH-Author: Fam Zheng <famz@redhat.com>
Message-id: <1389928083-8921-17-git-send-email-famz@redhat.com>
Patchwork-id: 56778
O-Subject: [RHEL-7 qemu-kvm PATCH 16/18] qemu-iotests: prefill some data to test image
Bugzilla: 1041301
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>

Case 030 occasionally fails because of block job compltes too fast to be
captured by script, and 'unexpected qmp event' of job completion causes
the test failure.

Simply fill in some data to the test image to make this false alarm less
likely to happen.

(For other benefits to prefill data to test image, see also commit
ab68cdfaa).

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 7890111b642e8e03430c3bf8bd6cedee26cec4fe)
Signed-off-by: Fam Zheng <famz@redhat.com>
---
 tests/qemu-iotests/030 | 4 ++++
 1 file changed, 4 insertions(+)

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 tests/qemu-iotests/030 |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
index dd4ef11..3d128b3 100755
--- a/tests/qemu-iotests/030
+++ b/tests/qemu-iotests/030
@@ -421,7 +421,9 @@ class TestStreamStop(ImageStreamingTestCase):
 
     def setUp(self):
         qemu_img('create', backing_img, str(TestStreamStop.image_len))
+        qemu_io('-c', 'write -P 0x1 0 32M', backing_img)
         qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, test_img)
+        qemu_io('-c', 'write -P 0x1 32M 32M', test_img)
         self.vm = iotests.VM().add_drive(test_img)
         self.vm.launch()
 
@@ -447,7 +449,9 @@ class TestSetSpeed(ImageStreamingTestCase):
 
     def setUp(self):
         qemu_img('create', backing_img, str(TestSetSpeed.image_len))
+        qemu_io('-c', 'write -P 0x1 0 32M', backing_img)
         qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, test_img)
+        qemu_io('-c', 'write -P 0x1 32M 32M', test_img)
         self.vm = iotests.VM().add_drive(test_img)
         self.vm.launch()
 
-- 
1.7.1