Skip to contentSkip to conversation

tests/qtest/qom-test: Test retrieval of machine class properties

PATCH In review Thomas Huth 2 participants 2 messages Jan 23, 2025 – Jan 28, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
Based-on: <[email protected]>
Based-on: <[email protected]>

 tests/qtest/qom-test.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
tests/qtest/qom-test.c +11 -0
index d677f87c8e..50064ed951 100644
@@ -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' }");
Signature · 1 line
2.48.1