Signed-off-by: Amos Kong <ak...@redhat.com> Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> --- tests/blockdev-test.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-)
diff --git a/tests/blockdev-test.c b/tests/blockdev-test.c index c940e00..c9127c0 100644 --- a/tests/blockdev-test.c +++ b/tests/blockdev-test.c @@ -16,35 +16,16 @@ static void test_drive_add_empty(void) { - QDict *response; - const char *response_return; - /* Start with an empty drive */ qtest_start("-drive if=none,id=drive0"); /* Delete the drive */ - response = qmp("{\"execute\": \"human-monitor-command\"," - " \"arguments\": {" - " \"command-line\": \"drive_del drive0\"" - "}}"); - g_assert(response); - response_return = qdict_get_try_str(response, "return"); - g_assert(response_return); - g_assert(strcmp(response_return, "") == 0); - QDECREF(response); + qmp_exec_hmp_cmd("", "drive_del drive0"); /* Ensure re-adding the drive works - there should be no duplicate ID error * because the old drive must be gone. */ - response = qmp("{\"execute\": \"human-monitor-command\"," - " \"arguments\": {" - " \"command-line\": \"drive_add 0 if=none,id=drive0\"" - "}}"); - g_assert(response); - response_return = qdict_get_try_str(response, "return"); - g_assert(response_return); - g_assert(strcmp(response_return, "OK\r\n") == 0); - QDECREF(response); + qmp_exec_hmp_cmd("OK\r\n", "drive_add 0 if=none,id=drive0"); qtest_end(); } -- 1.9.3