assert_recovered(qts);
/* lexical error: interpolation */
- qtest_qmp_send_raw(qts, "%%p\n");
- /* two errors, one for "%", one for "p" */
- resp = qtest_qmp_receive(qts);
- qmp_assert_error_class(resp, "GenericError");
+ qtest_qmp_send_raw(qts, "%%p");
resp = qtest_qmp_receive(qts);
qmp_assert_error_class(resp, "GenericError");
assert_recovered(qts);
QList *capabilities;
QTestState *qts;
- qts = qtest_init_without_qmp_handshake(false, common_args);
+ qts = qtest_init_without_qmp_handshake(common_args);
/* Test greeting */
resp = qtest_qmp_receive(qts);
g_assert(q);
test_version(qdict_get(q, "version"));
capabilities = qdict_get_qlist(q, "capabilities");
- g_assert(capabilities && qlist_empty(capabilities));
+ g_assert(capabilities);
qobject_unref(resp);
/* Test valid command before handshake */
" 'arguments': {"
" 'driver': 'blkdebug', 'node-name': %s,"
" 'config': %s,"
- " 'image': { 'driver': 'null-co' } } }",
+ " 'image': { 'driver': 'null-co', 'read-zeroes': true } } }",
id, id, fifo_name);
}
QList *capabilities;
QString *qstr;
- qts = qtest_init_without_qmp_handshake(true, common_args);
+ qts = qtest_init_without_qmp_handshake(common_args);
/* Check the greeting message. */
resp = qtest_qmp_receive(qts);
qtest_quit(qs);
}
+static void test_qmp_missing_any_arg(void)
+{
+ QTestState *qts;
+ QDict *resp;
+
+ qts = qtest_init(common_args);
+ resp = qtest_qmp(qts, "{'execute': 'qom-set', 'arguments':"
+ " { 'path': '/machine', 'property': 'rtc-time' } }");
+ g_assert_nonnull(resp);
+ qmp_assert_error_class(resp, "GenericError");
+ qtest_quit(qts);
+}
+
int main(int argc, char *argv[])
{
g_test_init(&argc, &argv, NULL);
qtest_add_func("qmp/protocol", test_qmp_protocol);
qtest_add_func("qmp/oob", test_qmp_oob);
qtest_add_func("qmp/preconfig", test_qmp_preconfig);
+ qtest_add_func("qmp/missing-any-arg", test_qmp_missing_any_arg);
return g_test_run();
}