libvirt/tests-Report-expected-monitor-command-for-simulated-.patch

43 lines
1.6 KiB
Diff
Raw Normal View History

From 31a4a7ecceeeaccfc016d28aa80f8a668c203ce0 Mon Sep 17 00:00:00 2001
From: Bihong Yu <yubihong@huawei.com>
Date: Tue, 30 Nov 2021 18:16:32 +0100
Subject: [PATCH 09/13] tests: Report expected monitor command for simulated
commands
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
There are two tests currently that simulate QMP talk:
qemucapabilitiestest and qemuhotplugtest. In both cases they
check whether currently executed command is the one for which
reply was provided. If not an error message is reported. However,
the error message contains only the actual command and not the
expected one. This makes it harder to navigate through .replies
files.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Bihong Yu <yubihong@huawei.com>
---
tests/qemumonitortestutils.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c
index 159b1b909e..78d52028de 100644
--- a/tests/qemumonitortestutils.c
+++ b/tests/qemumonitortestutils.c
@@ -637,7 +637,8 @@ qemuMonitorTestProcessCommandVerbatim(qemuMonitorTestPtr test,
ret = qemuMonitorTestAddResponse(test, data->response);
} else {
if (data->cmderr) {
- errmsg = g_strdup_printf("%s: %s", data->cmderr, cmdstr);
+ errmsg = g_strdup_printf("%s: %s expected %s",
+ data->cmderr, cmdstr, data->command_name);
ret = qemuMonitorTestAddErrorResponse(test, errmsg);
} else {
--
2.33.0