aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2023-05-10 19:42:38 +0200
committerThomas Huth <thuth@redhat.com>2023-05-22 09:44:48 +0200
commitb49056b5a306ce950d0eb96ce41bdbf4f152e491 (patch)
tree4966ac7975d9159b7186b8cf81392ddcaeb8b446
parent9b76fc5a71689d06d219fc9662ac43a64469d08a (diff)
downloadqemu-b49056b5a306ce950d0eb96ce41bdbf4f152e491.zip
qemu-b49056b5a306ce950d0eb96ce41bdbf4f152e491.tar.gz
qemu-b49056b5a306ce950d0eb96ce41bdbf4f152e491.tar.bz2
tests/qtest/cdrom-test: Fix the test to also work without optional devices
It's possible to disable virtio-scsi and virtio-blk in the binaries, so we must not run the corresponding tests if these devices are missing. Message-Id: <20230512124033.502654-14-thuth@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
-rw-r--r--tests/qtest/cdrom-test.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/qtest/cdrom-test.c b/tests/qtest/cdrom-test.c
index 2b7e10d..d1cc375 100644
--- a/tests/qtest/cdrom-test.c
+++ b/tests/qtest/cdrom-test.c
@@ -136,9 +136,12 @@ static void add_x86_tests(void)
}
qtest_add_data_func("cdrom/boot/default", "-cdrom ", test_cdboot);
- qtest_add_data_func("cdrom/boot/virtio-scsi",
- "-device virtio-scsi -device scsi-cd,drive=cdr "
- "-blockdev file,node-name=cdr,filename=", test_cdboot);
+ if (qtest_has_device("virtio-scsi-ccw")) {
+ qtest_add_data_func("cdrom/boot/virtio-scsi",
+ "-device virtio-scsi -device scsi-cd,drive=cdr "
+ "-blockdev file,node-name=cdr,filename=",
+ test_cdboot);
+ }
/*
* Unstable CI test under load
* See https://lists.gnu.org/archive/html/qemu-devel/2019-02/msg05509.html
@@ -183,10 +186,17 @@ static void add_s390x_tests(void)
{
if (!qtest_has_accel("tcg") && !qtest_has_accel("kvm")) {
g_test_skip("No KVM or TCG accelerator available, skipping boot tests");
+ }
+ if (!qtest_has_device("virtio-blk-ccw")) {
return;
}
qtest_add_data_func("cdrom/boot/default", "-cdrom ", test_cdboot);
+
+ if (!qtest_has_device("virtio-scsi-ccw")) {
+ return;
+ }
+
qtest_add_data_func("cdrom/boot/virtio-scsi",
"-device virtio-scsi -device scsi-cd,drive=cdr "
"-blockdev file,node-name=cdr,filename=", test_cdboot);