]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: qemuMonitorTestProcessCommandDefaultValidate: simplify condition
authorJán Tomko <jtomko@redhat.com>
Sat, 15 Jun 2019 09:47:34 +0000 (11:47 +0200)
committerJán Tomko <jtomko@redhat.com>
Thu, 20 Jun 2019 10:12:34 +0000 (12:12 +0200)
We return success when running this function for either non-JSON monitor
testing or guest agent testing.

However we no longer test HMP monitor and we do not try to validate
the guest agent interaction.

Drop the test->json check and report a proper error if someone tries
to run this function for the guest agent without properly wiring it up.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
tests/qemumonitortestutils.c

index b29c6d0f536a1037a93ba56671eb4fc6bce1b846..9f18e511ac894a1b6b671c5e108a021036ccdbcd 100644 (file)
@@ -521,9 +521,16 @@ qemuMonitorTestProcessCommandDefaultValidate(qemuMonitorTestPtr test,
     VIR_AUTOPTR(virJSONValue) emptyargs = NULL;
     VIR_AUTOFREE(char *) schemapath = NULL;
 
-    if (!test->qapischema || !test->json || test->agent)
+    if (!test->qapischema)
         return 0;
 
+    if (test->agent) {
+        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                       "Command validation testing is not "
+                       "implemented for the guest agent");
+        return -1;
+    }
+
     /* 'device_add' needs to be skipped as it does not have fully defined schema */
     if (STREQ(cmdname, "device_add"))
         return 0;