Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tests/qtest/cdrom-test: Fix the test to also work without optional de…
…vices

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>
  • Loading branch information
huth committed May 22, 2023
1 parent 9b76fc5 commit b49056b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions tests/qtest/cdrom-test.c
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b49056b

Please sign in to comment.