qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: [PULL 08/17] iotests: Check for the availability of the required devices in 267 and 127
Date: Thu,  6 Feb 2020 13:51:23 +0100	[thread overview]
Message-ID: <20200206125132.594625-9-mreitz@redhat.com> (raw)
In-Reply-To: <20200206125132.594625-1-mreitz@redhat.com>

From: Thomas Huth <thuth@redhat.com>

We are going to enable 127 in the "auto" group, but it only works if
virtio-scsi and scsi-hd are available - which is not the case with
QEMU binaries like qemu-system-tricore for example, so we need a
proper check for the availability of these devices here.

A very similar problem exists in iotest 267 - it has been added to
the "auto" group already, but requires virtio-blk and thus currently
fails with qemu-system-tricore for example. Let's also add aproper
check there.

Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-id: 20200121095205.26323-5-thuth@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 tests/qemu-iotests/127       |  2 ++
 tests/qemu-iotests/267       |  2 ++
 tests/qemu-iotests/common.rc | 14 ++++++++++++++
 3 files changed, 18 insertions(+)

diff --git a/tests/qemu-iotests/127 b/tests/qemu-iotests/127
index b64926ab31..a4fc866038 100755
--- a/tests/qemu-iotests/127
+++ b/tests/qemu-iotests/127
@@ -43,6 +43,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt qcow2
 _supported_proto file
 
+_require_devices virtio-scsi scsi-hd
+
 IMG_SIZE=64K
 
 _make_test_img $IMG_SIZE
diff --git a/tests/qemu-iotests/267 b/tests/qemu-iotests/267
index c296877168..3146273eef 100755
--- a/tests/qemu-iotests/267
+++ b/tests/qemu-iotests/267
@@ -46,6 +46,8 @@ _require_drivers copy-on-read
 # and generally impossible with external data files
 _unsupported_imgopts 'refcount_bits=1[^0-9]' data_file
 
+_require_devices virtio-blk
+
 do_run_qemu()
 {
     echo Testing: "$@"
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 9ccde32634..8a6366c09d 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -713,5 +713,19 @@ _require_large_file()
     rm "$TEST_IMG"
 }
 
+# Check that a set of devices is available in the QEMU binary
+#
+_require_devices()
+{
+    available=$($QEMU -M none -device help | \
+                grep ^name | sed -e 's/^name "//' -e 's/".*$//')
+    for device
+    do
+        if ! echo "$available" | grep -q "$device" ; then
+            _notrun "$device not available"
+        fi
+    done
+}
+
 # make sure this script returns success
 true
-- 
2.24.1



  parent reply	other threads:[~2020-02-06 12:59 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-06 12:51 [PULL 00/17] Block patches Max Reitz
2020-02-06 12:51 ` [PULL 01/17] qcow2: Assert that host cluster offsets fit in L2 table entries Max Reitz
2020-02-06 12:51 ` [PULL 02/17] block: Use a GString in bdrv_perm_names() Max Reitz
2020-02-06 12:51 ` [PULL 03/17] block: fix memleaks in bdrv_refresh_filename Max Reitz
2020-02-06 12:51 ` [PULL 04/17] qcow2: Use a GString in report_unsupported_feature() Max Reitz
2020-02-06 12:51 ` [PULL 05/17] iotests: remove 'linux' from default supported platforms Max Reitz
2020-02-06 12:51 ` [PULL 06/17] iotests: Test 041 only works on certain systems Max Reitz
2020-02-06 12:51 ` [PULL 07/17] iotests: Test 183 does not work on macOS and OpenBSD Max Reitz
2020-02-06 12:51 ` Max Reitz [this message]
2020-02-06 12:51 ` [PULL 09/17] iotests: Skip Python-based tests if QEMU does not support virtio-blk Max Reitz
2020-02-06 12:51 ` [PULL 10/17] iotests: Enable more tests in the 'auto' group to improve test coverage Max Reitz
2020-02-06 12:51 ` [PULL 11/17] qcow2: Don't round the L1 table allocation up to the sector size Max Reitz
2020-02-06 12:51 ` [PULL 12/17] qcow2: Tighten cluster_offset alignment assertions Max Reitz
2020-02-06 12:51 ` [PULL 13/17] qcow2: Use bs->bl.request_alignment when updating an L1 entry Max Reitz
2020-02-06 12:51 ` [PULL 14/17] qcow2: Don't require aligned offsets in qcow2_co_copy_range_from() Max Reitz
2020-02-06 12:51 ` [PULL 15/17] qcow2: Use BDRV_SECTOR_SIZE instead of the hardcoded value Max Reitz
2020-02-06 12:51 ` [PULL 16/17] block/backup-top: fix failure path Max Reitz
2020-02-06 12:51 ` [PULL 17/17] iotests: add test for backup-top failure on permission activation Max Reitz
2020-02-06 18:58 ` [PULL 00/17] Block patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200206125132.594625-9-mreitz@redhat.com \
    --to=mreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).