[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 59/73] iotests: Add test for unsupported image creati
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 59/73] iotests: Add test for unsupported image creation |
Date: |
Wed, 10 Dec 2014 11:34:25 +0100 |
From: Max Reitz <address@hidden>
Add a test for creating and amending images (amendment uses the creation
options) with formats not supporting creation over protocols not
supporting creation.
Cc: address@hidden
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
tests/qemu-iotests/113 | 76 ++++++++++++++++++++++++++++++++++++++++++++++
tests/qemu-iotests/113.out | 15 +++++++++
tests/qemu-iotests/group | 1 +
3 files changed, 92 insertions(+)
create mode 100755 tests/qemu-iotests/113
create mode 100644 tests/qemu-iotests/113.out
diff --git a/tests/qemu-iotests/113 b/tests/qemu-iotests/113
new file mode 100755
index 0000000..a2cd96b
--- /dev/null
+++ b/tests/qemu-iotests/113
@@ -0,0 +1,76 @@
+#!/bin/bash
+#
+# Test case for accessing creation options on image formats and
+# protocols not supporting image creation
+#
+# 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()
+{
+ _cleanup_test_img
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+# We can only test one format here because we need its sample file
+_supported_fmt bochs
+_supported_proto nbd
+_supported_os Linux
+
+echo
+echo '=== Unsupported image creation in qemu-img create ==='
+echo
+
+$QEMU_IMG create -f $IMGFMT nbd://example.com 2>&1 64M | _filter_imgfmt
+
+echo
+echo '=== Unsupported image creation in qemu-img convert ==='
+echo
+
+# We could use any input image format here, but this is a bochs test, so just
+# use the bochs image
+_use_sample_img empty.bochs.bz2
+$QEMU_IMG convert -f $IMGFMT -O $IMGFMT "$TEST_IMG" nbd://example.com 2>&1 \
+ | _filter_imgfmt
+
+echo
+echo '=== Unsupported format in qemu-img amend ==='
+echo
+
+# The protocol does not matter here
+_use_sample_img empty.bochs.bz2
+$QEMU_IMG amend -f $IMGFMT -o foo=bar "$TEST_IMG" 2>&1 | _filter_imgfmt
+
+
+# success, all done
+echo
+echo '*** done'
+rm -f $seq.full
+status=0
diff --git a/tests/qemu-iotests/113.out b/tests/qemu-iotests/113.out
new file mode 100644
index 0000000..00bdfd6
--- /dev/null
+++ b/tests/qemu-iotests/113.out
@@ -0,0 +1,15 @@
+QA output created by 113
+
+=== Unsupported image creation in qemu-img create ===
+
+qemu-img: nbd://example.com: Format driver 'IMGFMT' does not support image
creation
+
+=== Unsupported image creation in qemu-img convert ===
+
+qemu-img: Format driver 'IMGFMT' does not support image creation
+
+=== Unsupported format in qemu-img amend ===
+
+qemu-img: Format driver 'IMGFMT' does not support any options to amend
+
+*** done
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
index 2ba10ad..a4742c6 100644
--- a/tests/qemu-iotests/group
+++ b/tests/qemu-iotests/group
@@ -113,4 +113,5 @@
108 rw auto quick
109 rw auto
111 rw auto quick
+113 rw auto quick
114 rw auto quick
--
1.8.3.1
- [Qemu-devel] [PULL 68/73] vmdk: Use g_random_int to generate CID, (continued)
- [Qemu-devel] [PULL 68/73] vmdk: Use g_random_int to generate CID, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 69/73] vmdk: Fix comment to match code of extent lines, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 71/73] vmdk: Check descriptor file length when reading it, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 70/73] vmdk: Clean up descriptor file reading, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 67/73] block: Use g_new0() for a bit of extra type checking, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 73/73] vmdk: Set errp on failures in vmdk_open_vmdk4, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 72/73] vmdk: Remove unnecessary initialization, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 64/73] qemu-iotests: Skip 099 for VMDK subformats with desc file, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 43/73] qcow2.py: Add required padding for header extensions, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 05/73] qjson: Drop trailing space for pretty formatting, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 59/73] iotests: Add test for unsupported image creation,
Kevin Wolf <=
- [Qemu-devel] [PULL 12/73] blockdev: acquire AioContext in change-backing-file, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 04/73] qmp: Add optional switch "query-nodes" in query-blockstats, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 18/73] blkdebug: Simplify and improve filename generation, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 33/73] block: Factor bdrv_probe_all() out of find_image_format(), Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 08/73] iotests: Use -qmp-pretty in 067, Kevin Wolf, 2014/12/10
- Re: [Qemu-devel] [PULL 00/73] Merging block-next for 2.3, Peter Maydell, 2014/12/11