aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2025-01-23 21:49:56 +0100
committerThomas Huth <thuth@redhat.com>2025-02-25 10:01:24 +0100
commitd8b913f7c75cd38ad07276033faa51fee68514b4 (patch)
tree349103713f7ea436b115f4415272164d9eed135f /tests
parent4098c6b7b62c6a11a15c74fa275e754af8970317 (diff)
downloadqemu-d8b913f7c75cd38ad07276033faa51fee68514b4.zip
qemu-d8b913f7c75cd38ad07276033faa51fee68514b4.tar.gz
qemu-d8b913f7c75cd38ad07276033faa51fee68514b4.tar.bz2
tests/qtest/qom-test: Test retrieval of machine class properties
There were recently some crashes that occurred when trying to retrieve the properties of machines. Let's add a test to avoid regression here. Message-ID: <20250123204956.1561463-1-thuth@redhat.com> Reviewed-by: Fabiano Rosas <farosas@suse.de> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/qtest/qom-test.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/qtest/qom-test.c b/tests/qtest/qom-test.c
index 1e30a5b..27d70bc 100644
--- a/tests/qtest/qom-test.c
+++ b/tests/qtest/qom-test.c
@@ -88,6 +88,17 @@ static void test_machine(gconstpointer data)
qts = qtest_initf("-machine %s", machine);
+ if (g_test_slow()) {
+ /* Make sure we can get the machine class properties: */
+ g_autofree char *qom_machine = g_strdup_printf("%s-machine", machine);
+
+ response = qtest_qmp(qts, "{ 'execute': 'qom-list-properties',"
+ " 'arguments': { 'typename': %s } }",
+ qom_machine);
+ g_assert(response);
+ qobject_unref(response);
+ }
+
test_properties(qts, "/machine", true);
response = qtest_qmp(qts, "{ 'execute': 'quit' }");