[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 18/30] qemu-iotests: drop duplicated "create_image"
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 18/30] qemu-iotests: drop duplicated "create_image" |
Date: |
Thu, 31 Oct 2013 16:48:32 +0100 |
From: Fam Zheng <address@hidden>
There's a same common function in iotests.py
Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
tests/qemu-iotests/040 | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/tests/qemu-iotests/040 b/tests/qemu-iotests/040
index aad535a..a2e18c5 100755
--- a/tests/qemu-iotests/040
+++ b/tests/qemu-iotests/040
@@ -54,22 +54,12 @@ class ImageCommitTestCase(iotests.QMPTestCase):
self.assert_no_active_commit()
- 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(ImageCommitTestCase):
image_len = 1 * 1024 * 1024
test_len = 1 * 1024 * 256
def setUp(self):
- self.create_image(backing_img, TestSingleDrive.image_len)
+ iotests.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)
qemu_io('-c', 'write -P 0xab 0 524288', backing_img)
@@ -167,7 +157,7 @@ class TestRelativePaths(ImageCommitTestCase):
except OSError as exception:
if exception.errno != errno.EEXIST:
raise
- self.create_image(self.backing_img_abs, TestRelativePaths.image_len)
+ iotests.create_image(self.backing_img_abs, TestRelativePaths.image_len)
qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' %
self.backing_img_abs, self.mid_img_abs)
qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' %
self.mid_img_abs, self.test_img)
qemu_img('rebase', '-u', '-b', self.backing_img, self.mid_img_abs)
--
1.8.1.4
- [Qemu-devel] [PULL 09/30] ide-test: Check what happens with bus mastering disabled, (continued)
- [Qemu-devel] [PULL 09/30] ide-test: Check what happens with bus mastering disabled, Kevin Wolf, 2013/10/31
- [Qemu-devel] [PULL 10/30] tests: Multiboot mmap test case, Kevin Wolf, 2013/10/31
- [Qemu-devel] [PULL 11/30] block: Don't copy backing file name on error, Kevin Wolf, 2013/10/31
- [Qemu-devel] [PULL 08/30] exec: Fix bounce buffer allocation in address_space_map(), Kevin Wolf, 2013/10/31
- [Qemu-devel] [PULL 12/30] sheepdog: explicitly set copies as type uint8_t, Kevin Wolf, 2013/10/31
- [Qemu-devel] [PULL 14/30] ahci: fix win7 hang on boot, Kevin Wolf, 2013/10/31
- [Qemu-devel] [PULL 13/30] sheepdog: pass copy_policy in the request, Kevin Wolf, 2013/10/31
- [Qemu-devel] [PULL 15/30] block: Disable BDRV_O_COPY_ON_READ for the backing file, Kevin Wolf, 2013/10/31
- [Qemu-devel] [PULL 16/30] block: Avoid unecessary drv->bdrv_getlength() calls, Kevin Wolf, 2013/10/31
- [Qemu-devel] [PULL 17/30] qemu-iotests: Fix 051 reference output, Kevin Wolf, 2013/10/31
- [Qemu-devel] [PULL 18/30] qemu-iotests: drop duplicated "create_image",
Kevin Wolf <=
- [Qemu-devel] [PULL 19/30] qemu-iotests: Test case for backing file deletion, Kevin Wolf, 2013/10/31
- [Qemu-devel] [PULL 20/30] sheepdog: check return values of qemu_co_recv/send correctly, Kevin Wolf, 2013/10/31
- [Qemu-devel] [PULL 21/30] sheepdog: handle vdi objects in resend_aio_req, Kevin Wolf, 2013/10/31
- [Qemu-devel] [PULL 22/30] sheepdog: reload inode outside of resend_aioreq, Kevin Wolf, 2013/10/31
- [Qemu-devel] [PULL 23/30] coroutine: add co_aio_sleep_ns() to allow sleep in block drivers, Kevin Wolf, 2013/10/31
- [Qemu-devel] [PULL 24/30] sheepdog: try to reconnect to sheepdog after network error, Kevin Wolf, 2013/10/31
- [Qemu-devel] [PULL 25/30] sheepdog: make add_aio_request and send_aioreq void functions, Kevin Wolf, 2013/10/31
- [Qemu-devel] [PULL 27/30] sheepdog: check simultaneous create in resend_aioreq, Kevin Wolf, 2013/10/31
- [Qemu-devel] [PULL 26/30] sheepdog: cancel aio requests if possible, Kevin Wolf, 2013/10/31
- [Qemu-devel] [PULL 28/30] qemu-iotests: prefill some data to test image, Kevin Wolf, 2013/10/31