thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
9ae3a8
From a1c05e91f427ee06521bdda8013091753736781f Mon Sep 17 00:00:00 2001
9ae3a8
From: Jeffrey Cody <jcody@redhat.com>
9ae3a8
Date: Tue, 16 Sep 2014 20:11:54 +0200
9ae3a8
Subject: [PATCH 16/20] block: iotest - update 084 to test static VDI image creation
9ae3a8
9ae3a8
Message-id: <179b35695a0f8dc312f7963cb818c630bcea84c7.1410897407.git.jcody@redhat.com>
9ae3a8
Patchwork-id: 61220
9ae3a8
O-Subject: [PATCH qemu-kvm-rhel RHEL7.1 15/15] block: iotest - update 084 to test static VDI image creation
9ae3a8
Bugzilla: 1098086
9ae3a8
RH-Acked-by: Fam Zheng <famz@redhat.com>
9ae3a8
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
RH-Acked-by: Max Reitz <mreitz@redhat.com>
9ae3a8
9ae3a8
This updates the VDI corruption test to also test static VDI image
9ae3a8
creation, as well as the default dynamic image creation.
9ae3a8
9ae3a8
Reviewed-by: Max Reitz <mreitz@redhat.com>
9ae3a8
Signed-off-by: Jeff Cody <jcody@redhat.com>
9ae3a8
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
9ae3a8
(cherry picked from commit 23d20b5b4fb7bde102e6779b7a13b88375e4db66)
9ae3a8
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 tests/qemu-iotests/084     |   16 ++++++++++++++--
9ae3a8
 tests/qemu-iotests/084.out |   14 ++++++++++++++
9ae3a8
 2 files changed, 28 insertions(+), 2 deletions(-)
9ae3a8
9ae3a8
diff --git a/tests/qemu-iotests/084 b/tests/qemu-iotests/084
9ae3a8
index 10a5a65..66ebcc3 100755
9ae3a8
--- a/tests/qemu-iotests/084
9ae3a8
+++ b/tests/qemu-iotests/084
9ae3a8
@@ -1,6 +1,7 @@
9ae3a8
 #!/bin/bash
9ae3a8
 #
9ae3a8
-# Test case for VDI header corruption; image too large, and too many blocks
9ae3a8
+# Test case for VDI header corruption; image too large, and too many blocks.
9ae3a8
+# Also simple test for creating dynamic and static VDI images.
9ae3a8
 #
9ae3a8
 # Copyright (C) 2013 Red Hat, Inc.
9ae3a8
 #
9ae3a8
@@ -43,14 +44,25 @@ _supported_fmt vdi
9ae3a8
 _supported_proto generic
9ae3a8
 _supported_os Linux
9ae3a8
 
9ae3a8
+size=64M
9ae3a8
 ds_offset=368  # disk image size field offset
9ae3a8
 bs_offset=376  # block size field offset
9ae3a8
 bii_offset=384 # block in image field offset
9ae3a8
 
9ae3a8
 echo
9ae3a8
+echo "=== Statically allocated image creation ==="
9ae3a8
+echo
9ae3a8
+_make_test_img $size -o static
9ae3a8
+_img_info
9ae3a8
+stat -c"disk image file size in bytes: %s" "${TEST_IMG}"
9ae3a8
+_cleanup_test_img
9ae3a8
+
9ae3a8
+echo
9ae3a8
 echo "=== Testing image size bounds ==="
9ae3a8
 echo
9ae3a8
-_make_test_img 64M
9ae3a8
+_make_test_img $size
9ae3a8
+_img_info
9ae3a8
+stat -c"disk image file size in bytes: %s" "${TEST_IMG}"
9ae3a8
 
9ae3a8
 # check for image size too large
9ae3a8
 # poke max image size, and appropriate blocks_in_image value
9ae3a8
diff --git a/tests/qemu-iotests/084.out b/tests/qemu-iotests/084.out
9ae3a8
index 99c8e74..943888a 100644
9ae3a8
--- a/tests/qemu-iotests/084.out
9ae3a8
+++ b/tests/qemu-iotests/084.out
9ae3a8
@@ -1,8 +1,22 @@
9ae3a8
 QA output created by 084
9ae3a8
 
9ae3a8
+=== Statically allocated image creation ===
9ae3a8
+
9ae3a8
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
9ae3a8
+image: TEST_DIR/t.IMGFMT
9ae3a8
+file format: IMGFMT
9ae3a8
+virtual size: 64M (67108864 bytes)
9ae3a8
+cluster_size: 1048576
9ae3a8
+disk image file size in bytes: 67109888
9ae3a8
+
9ae3a8
 === Testing image size bounds ===
9ae3a8
 
9ae3a8
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 
9ae3a8
+image: TEST_DIR/t.IMGFMT
9ae3a8
+file format: IMGFMT
9ae3a8
+virtual size: 64M (67108864 bytes)
9ae3a8
+cluster_size: 1048576
9ae3a8
+disk image file size in bytes: 1024
9ae3a8
 Test 1: Maximum size (1024 TB):
9ae3a8
 image: TEST_DIR/t.IMGFMT
9ae3a8
 file format: IMGFMT
9ae3a8
-- 
9ae3a8
1.7.1
9ae3a8