This test depends on the presence of the pcie-root-port device. Add a build time dependency and a runtime check.
Signed-off-by: Fabiano Rosas <faro...@suse.de> --- tests/qtest/meson.build | 3 ++- tests/qtest/virtio-net-failover.c | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index e97616d327..431b623df9 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -73,7 +73,8 @@ qtests_i386 = \ (config_all_devices.has_key('CONFIG_ESP_PCI') ? ['am53c974-test'] : []) + \ (config_host.has_key('CONFIG_POSIX') and \ config_all_devices.has_key('CONFIG_ACPI_ERST') ? ['erst-test'] : []) + \ - (config_all_devices.has_key('CONFIG_VIRTIO_NET') and \ + (config_all_devices.has_key('CONFIG_PCIE_ROOT') and \ + config_all_devices.has_key('CONFIG_VIRTIO_NET') and \ config_all_devices.has_key('CONFIG_Q35') and \ config_all_devices.has_key('CONFIG_VIRTIO_PCI') and \ slirp.found() ? ['virtio-net-failover'] : []) + \ diff --git a/tests/qtest/virtio-net-failover.c b/tests/qtest/virtio-net-failover.c index 4a809590bf..9ca52cb026 100644 --- a/tests/qtest/virtio-net-failover.c +++ b/tests/qtest/virtio-net-failover.c @@ -1835,6 +1835,11 @@ int main(int argc, char **argv) gchar *tmpfile; int ret; + if (!qtest_has_device("pcie-root-port") || + !qtest_has_device("virtio-net")) { + return 0; + } + g_test_init(&argc, &argv, NULL); ret = g_file_open_tmp("failover_test_migrate-XXXXXX", &tmpfile, NULL); -- 2.35.3