[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 21/27] tests/qtest: arm: fix operation in a build without any boar
From: |
Paolo Bonzini |
Subject: |
[PULL 21/27] tests/qtest: arm: fix operation in a build without any boards or devices |
Date: |
Sun, 12 May 2024 12:49:39 +0200 |
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>
---
tests/qtest/arm-cpu-features.c | 4 ++++
tests/qtest/migration-test.c | 6 ++++++
tests/qtest/numa-test.c | 4 ++++
3 files changed, 14 insertions(+)
diff --git a/tests/qtest/arm-cpu-features.c b/tests/qtest/arm-cpu-features.c
index 9d6e6190d55..966c65d5c3e 100644
--- a/tests/qtest/arm-cpu-features.c
+++ b/tests/qtest/arm-cpu-features.c
@@ -632,6 +632,10 @@ int main(int argc, char **argv)
{
g_test_init(&argc, &argv, NULL);
+ if (!qtest_has_machine("virt")) {
+ goto out;
+ }
+
if (qtest_has_accel("tcg")) {
qtest_add_data_func("/arm/query-cpu-model-expansion",
NULL, test_query_cpu_model_expansion);
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index 7a1345f80f8..e8d3555f56b 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -781,6 +781,12 @@ static int test_migrate_start(QTestState **from,
QTestState **to,
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,
QEMU_ENV_DST);
diff --git a/tests/qtest/numa-test.c b/tests/qtest/numa-test.c
index 4f4404a4b14..7aa262dbb99 100644
--- a/tests/qtest/numa-test.c
+++ b/tests/qtest/numa-test.c
@@ -558,6 +558,9 @@ int main(int argc, char **argv)
}
if (g_str_equal(arch, "aarch64")) {
+ if (!qtest_has_machine("virt")) {
+ goto out;
+ }
g_string_append(args, " -machine virt");
}
@@ -590,5 +593,6 @@ int main(int argc, char **argv)
aarch64_numa_cpu);
}
+out:
return g_test_run();
}
--
2.45.0
- [PULL 12/27] s390x: select correct components for no-board build, (continued)
- [PULL 12/27] s390x: select correct components for no-board build, Paolo Bonzini, 2024/05/12
- [PULL 14/27] xen: initialize legacy backends from xen_bus_init(), Paolo Bonzini, 2024/05/12
- [PULL 15/27] xen: register legacy backends via xen_backend_init, Paolo Bonzini, 2024/05/12
- [PULL 13/27] tests/qtest: s390x: fix operation in a build without any boards or devices, Paolo Bonzini, 2024/05/12
- [PULL 19/27] hw/i386: move rtc-reset-reinjection command out of hw/rtc, Paolo Bonzini, 2024/05/12
- [PULL 17/27] i386: pc: remove unnecessary MachineClass overrides, Paolo Bonzini, 2024/05/12
- [PULL 18/27] hw/i386: split x86.c in multiple parts, Paolo Bonzini, 2024/05/12
- [PULL 08/27] sh4: select correct components for no-board build, Paolo Bonzini, 2024/05/12
- [PULL 16/27] i386: correctly select code in hw/i386 that depends on other components, Paolo Bonzini, 2024/05/12
- [PULL 20/27] i386: select correct components for no-board build, Paolo Bonzini, 2024/05/12
- [PULL 21/27] tests/qtest: arm: fix operation in a build without any boards or devices,
Paolo Bonzini <=
- [PULL 23/27] meson: move libfdt together with other dependencies, Paolo Bonzini, 2024/05/12
- [PULL 22/27] meson: pick libfdt from common_ss when building target-specific files, Paolo Bonzini, 2024/05/12
- [PULL 25/27] kconfig: express dependency of individual boards on libfdt, Paolo Bonzini, 2024/05/12
- [PULL 27/27] configs: disable emulators that require it if libfdt is not found, Paolo Bonzini, 2024/05/12
- [PULL 24/27] kconfig: allow compiling out QEMU device tree code per target, Paolo Bonzini, 2024/05/12
- [PULL 26/27] hw/xtensa: require libfdt, Paolo Bonzini, 2024/05/12
- [PULL 01/27] target/i386: remove PCOMMIT from TCG, deprecate property, Paolo Bonzini, 2024/05/12
- Re: [PULL 00/27] Build/arch cleanups, target/i386 fixes for 2024-05-10, Richard Henderson, 2024/05/14