qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 9/9] qemu-iotests: Test writing non-raw image


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH v2 9/9] qemu-iotests: Test writing non-raw image headers to raw image
Date: Mon, 10 Nov 2014 16:53:22 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

On 2014-11-07 at 20:39, Kevin Wolf wrote:
This is forbidden if the raw driver was probed.

Signed-off-by: Kevin Wolf <address@hidden>
---
  tests/qemu-iotests/109     | 100 ++++++++++++++++++++++++++++++
  tests/qemu-iotests/109.out | 149 +++++++++++++++++++++++++++++++++++++++++++++
  tests/qemu-iotests/group   |   1 +
  3 files changed, 250 insertions(+)
  create mode 100755 tests/qemu-iotests/109
  create mode 100644 tests/qemu-iotests/109.out

diff --git a/tests/qemu-iotests/109 b/tests/qemu-iotests/109
new file mode 100755
index 0000000..ca7ea43
--- /dev/null
+++ b/tests/qemu-iotests/109
@@ -0,0 +1,100 @@
+#!/bin/bash
+#
+# Test writing image headers of other formats into raw images
+#
+# Copyright (C) 2014 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+# creator
address@hidden
+
+seq="$(basename $0)"
+echo "QA output created by $seq"
+
+here="$PWD"
+tmp=/tmp/$$
+status=1       # failure is the default!
+
+_cleanup()
+{
+    rm -f $TEST_IMG.src
+       _cleanup_test_img
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.qemu
+
+_supported_fmt raw
+_supported_proto file
+_supported_os Linux
+
+qemu_comm_method=qmp
+
+for fmt in qcow qcow2 qed vdi vhdx vmdk vpc; do
+
+    echo
+    echo "=== Writing a $fmt header into raw ==="
+    echo
+
+    _make_test_img 64M
+    TEST_IMG="$TEST_IMG.src" IMGFMT=$fmt _make_test_img 64M

Sometimes you're using "$TEST_IMG.src" and sometimes "${TEST_IMG}.src". I don't know why, but it's not wrong. I guess.

Note that vhdx support is optional. For another optional block driver, quorum, we decided to skip the test if it was not enabled. The easiest way to do this here would be to drop vhdx from the list. I'm not sure whether we want to do that, but I don't feel so good about having this test fail (for raw!) when vhdx is not enabled, either.

With vhdx removed or somehow that case circumvented if it isn't enabled:

Reviewed-by: Max Reitz <address@hidden>

This doesn't mean I strongly oppose leaving it in but I at least want you to acknowledge that this test fails without having vhdx enabled.

Max



reply via email to

[Prev in Thread] Current Thread [Next in Thread]