]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
iotests: Check for the availability of the required devices in 267 and 127
authorThomas Huth <thuth@redhat.com>
Tue, 21 Jan 2020 09:52:03 +0000 (10:52 +0100)
committerMax Reitz <mreitz@redhat.com>
Thu, 6 Feb 2020 12:47:45 +0000 (13:47 +0100)
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
tests/qemu-iotests/267
tests/qemu-iotests/common.rc

index b64926ab3160d9a3626c8fa6d0f353915733e2a8..a4fc8660381b7674b79ec7d52d096e84856e02a0 100755 (executable)
@@ -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
index c296877168610900560f04d3b04aeadf3cf6d191..3146273eef3335a15cdc8f576148349c9b2fbbd9 100755 (executable)
@@ -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: "$@"
index 9ccde32634f287f62423961bbe4d02b6de558fce..8a6366c09dafa353d0624d12b64fed8af3a98024 100644 (file)
@@ -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