tests/qtest: arm: fix operation in a build without any boards or devices
ARM/aarch64 are easy to fix because they already have to pass a machine type by hand. Just guard the tests with a check that the machine actually exists. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20240509170044.190795-14-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
1b1badf3c5
commit
6bd92a7c62
@ -632,6 +632,10 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
g_test_init(&argc, &argv, NULL);
|
g_test_init(&argc, &argv, NULL);
|
||||||
|
|
||||||
|
if (!qtest_has_machine("virt")) {
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
if (qtest_has_accel("tcg")) {
|
if (qtest_has_accel("tcg")) {
|
||||||
qtest_add_data_func("/arm/query-cpu-model-expansion",
|
qtest_add_data_func("/arm/query-cpu-model-expansion",
|
||||||
NULL, test_query_cpu_model_expansion);
|
NULL, test_query_cpu_model_expansion);
|
||||||
|
@ -781,6 +781,12 @@ static int test_migrate_start(QTestState **from, QTestState **to,
|
|||||||
kvm_opts = ",dirty-ring-size=4096";
|
kvm_opts = ",dirty-ring-size=4096";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!qtest_has_machine(machine_alias)) {
|
||||||
|
g_autofree char *msg = g_strdup_printf("machine %s not supported", machine_alias);
|
||||||
|
g_test_skip(msg);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
machine = resolve_machine_version(machine_alias, QEMU_ENV_SRC,
|
machine = resolve_machine_version(machine_alias, QEMU_ENV_SRC,
|
||||||
QEMU_ENV_DST);
|
QEMU_ENV_DST);
|
||||||
|
|
||||||
|
@ -558,6 +558,9 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (g_str_equal(arch, "aarch64")) {
|
if (g_str_equal(arch, "aarch64")) {
|
||||||
|
if (!qtest_has_machine("virt")) {
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
g_string_append(args, " -machine virt");
|
g_string_append(args, " -machine virt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -590,5 +593,6 @@ int main(int argc, char **argv)
|
|||||||
aarch64_numa_cpu);
|
aarch64_numa_cpu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
return g_test_run();
|
return g_test_run();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user