aboutsummaryrefslogtreecommitdiff
path: root/tests/qtest/drive_del-test.c
diff options
context:
space:
mode:
authorMaxim Levitsky <mlevitsk@redhat.com>2020-10-06 15:38:53 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2020-10-12 11:50:49 -0400
commitbb1a5b97f75ae209d8707f698da23088d7b9bbb5 (patch)
treea04a8d4278f942453e434b90160ffb1a723ad501 /tests/qtest/drive_del-test.c
parentc45a70d8c271056896a057fbcdc7743a2942d0ec (diff)
qtest: switch users back to qtest_qmp_receive
Let test use the new functionality for buffering events. The only remaining users of qtest_qmp_receive_dict are tests that fuzz the QMP protocol. Tested with 'make check-qtest'. Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Message-Id: <20201006123904.610658-4-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tests/qtest/drive_del-test.c')
-rw-r--r--tests/qtest/drive_del-test.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/qtest/drive_del-test.c b/tests/qtest/drive_del-test.c
index ba0cd77445..9d20a1ed8b 100644
--- a/tests/qtest/drive_del-test.c
+++ b/tests/qtest/drive_del-test.c
@@ -15,9 +15,6 @@
#include "libqos/virtio.h"
#include "qapi/qmp/qdict.h"
-/* TODO actually test the results and get rid of this */
-#define qmp_discard_response(q, ...) qobject_unref(qtest_qmp(q, __VA_ARGS__))
-
static void drive_add(QTestState *qts)
{
char *resp = qtest_hmp(qts, "drive_add 0 if=none,id=drive0");
@@ -38,13 +35,13 @@ static void device_del(QTestState *qts)
{
QDict *response;
- /* Complication: ignore DEVICE_DELETED event */
- qmp_discard_response(qts, "{'execute': 'device_del',"
+ response = qtest_qmp(qts, "{'execute': 'device_del',"
" 'arguments': { 'id': 'dev0' } }");
- response = qtest_qmp_receive_dict(qts);
g_assert(response);
g_assert(qdict_haskey(response, "return"));
qobject_unref(response);
+
+ qtest_qmp_eventwait(qts, "DEVICE_DELETED");
}
static void test_drive_without_dev(void)