aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFabiano Rosas <farosas@suse.de>2023-04-26 15:00:06 -0300
committerPeter Maydell <peter.maydell@linaro.org>2023-05-02 10:21:32 +0100
commit557ed03a281d845b0a73d56204e91b22982c7c95 (patch)
tree337c56557865967ad41c5b790796dc420b8655ec /tests
parent39920a04952b67fb1fce8fc3519ac18b7a95f3f3 (diff)
downloadqemu-557ed03a281d845b0a73d56204e91b22982c7c95.zip
qemu-557ed03a281d845b0a73d56204e91b22982c7c95.tar.gz
qemu-557ed03a281d845b0a73d56204e91b22982c7c95.tar.bz2
tests/qtest: Adjust and document query-cpu-model-expansion test for arm
We're about to move the 32-bit CPUs under CONFIG_TCG, so adjust the query-cpu-model-expansion test to check against the cortex-a7, which is already under CONFIG_TCG. That allows the next patch to contain only code movement. (All the test cares about is that the CPU type it's checking is one which definitely doesn't work under KVM.) While here add comments clarifying what we're testing. Signed-off-by: Fabiano Rosas <farosas@suse.de> Acked-by: Thomas Huth <thuth@redhat.com> Message-id: 20230426180013.14814-7-farosas@suse.de Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/qtest/arm-cpu-features.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/tests/qtest/arm-cpu-features.c b/tests/qtest/arm-cpu-features.c
index 1cb0813..3fc33fc 100644
--- a/tests/qtest/arm-cpu-features.c
+++ b/tests/qtest/arm-cpu-features.c
@@ -506,9 +506,23 @@ static void test_query_cpu_model_expansion_kvm(const void *data)
QDict *resp;
char *error;
- assert_error(qts, "cortex-a15",
- "We cannot guarantee the CPU type 'cortex-a15' works "
- "with KVM on this host", NULL);
+ /*
+ * When using KVM, only the 'host' and 'max' CPU models are
+ * supported. Test that we're emitting a suitable error for
+ * unsupported CPU models.
+ */
+ if (qtest_has_accel("tcg")) {
+ assert_error(qts, "cortex-a7",
+ "We cannot guarantee the CPU type 'cortex-a7' works "
+ "with KVM on this host", NULL);
+ } else {
+ /*
+ * With a KVM-only build the 32-bit CPUs are not present.
+ */
+ assert_error(qts, "cortex-a7",
+ "The CPU type 'cortex-a7' is not a "
+ "recognized ARM CPU type", NULL);
+ }
assert_has_feature_enabled(qts, "host", "aarch64");