From: Thomas Huth <thuth@redhat.com>
To: qemu-block@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
Max Reitz <mreitz@redhat.com>
Cc: John Snow <jsnow@redhat.com>, qemu-devel@nongnu.org
Subject: [PATCH v4 4/6] iotests: Check for the availability of the required devices in 267 and 127
Date: Mon, 2 Dec 2019 11:10:37 +0100 [thread overview]
Message-ID: <20191202101039.8981-5-thuth@redhat.com> (raw)
In-Reply-To: <20191202101039.8981-1-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.
Signed-off-by: Thomas Huth <thuth@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 170e173c0a..17ac640a83 100755
--- a/tests/qemu-iotests/267
+++ b/tests/qemu-iotests/267
@@ -44,6 +44,8 @@ _supported_os Linux
# Internal snapshots are (currently) impossible with refcount_bits=1
_unsupported_imgopts 'refcount_bits=1[^0-9]'
+_require_devices virtio-blk
+
do_run_qemu()
{
echo Testing: "$@"
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 0cc8acc9ed..38e949cf69 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -643,5 +643,19 @@ _require_drivers()
done
}
+# 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.18.1
next prev parent reply other threads:[~2019-12-02 10:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-02 10:10 [PATCH v4 0/6] Enable more iotests during "make check-block" Thomas Huth
2019-12-02 10:10 ` [PATCH v4 1/6] iotests: remove 'linux' from default supported platforms Thomas Huth
2019-12-02 10:10 ` [PATCH v4 2/6] iotests: Test 041 only works on certain systems Thomas Huth
2020-01-20 14:31 ` Max Reitz
2019-12-02 10:10 ` [PATCH v4 3/6] iotests: Test 183 does not work on macOS and OpenBSD Thomas Huth
2020-01-20 14:36 ` Max Reitz
2020-01-20 16:01 ` Thomas Huth
2019-12-02 10:10 ` Thomas Huth [this message]
2020-01-20 14:47 ` [PATCH v4 4/6] iotests: Check for the availability of the required devices in 267 and 127 Max Reitz
2019-12-02 10:10 ` [PATCH v4 5/6] iotests: Skip Python-based tests if QEMU does not support virtio-blk Thomas Huth
2020-01-20 14:50 ` Max Reitz
2020-01-20 16:05 ` Thomas Huth
2019-12-02 10:10 ` [PATCH v4 6/6] iotests: Enable more tests in the 'auto' group to improve test coverage Thomas Huth
2020-01-20 14:51 ` Max Reitz
2020-01-20 14:52 ` [PATCH v4 0/6] Enable more iotests during "make check-block" Max Reitz
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=20191202101039.8981-5-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--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).