Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tests/qtest: Don't run cdrom boot tests if no accelerator is present
On a build configured with: --disable-tcg --enable-xen it is possible
to produce a QEMU binary with no TCG nor KVM support. Skip the cdrom
boot tests if that's the case.

Fixes: 0c1ae3f ("tests/qtest: Fix tests when no KVM or TCG are present")
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-id: 20230508181611.2621-4-farosas@suse.de
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
Fabiano Rosas authored and pm215 committed May 12, 2023
1 parent a117e87 commit c726fa7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/qtest/cdrom-test.c
Expand Up @@ -130,6 +130,11 @@ static void test_cdboot(gconstpointer data)

static void add_x86_tests(void)
{
if (!qtest_has_accel("tcg") && !qtest_has_accel("kvm")) {
g_test_skip("No KVM or TCG accelerator available, skipping boot tests");
return;
}

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 "
Expand Down Expand Up @@ -176,6 +181,11 @@ static void add_x86_tests(void)

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");
return;
}

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 "
Expand Down

0 comments on commit c726fa7

Please sign in to comment.