[PATCH 2/3] tests: qemuMonitorTestProcessCommandDefaultValidate: simplify condition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 tests/qemumonitortestutils.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c
index b29c6d0f53..9f18e511ac 100644
--- a/tests/qemumonitortestutils.c
+++ b/tests/qemumonitortestutils.c
@@ -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;
-- 
2.19.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux