On 2014-11-07 at 20:39, Kevin Wolf wrote:
This is forbidden if the raw driver was probed.
Signed-off-by: Kevin Wolf <kw...@redhat.com>
---
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
+owner=kw...@redhat.com
+
+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 <mre...@redhat.com>
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