From: Markus Armbruster <armbru@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: qemu-devel@nongnu.org, peterx@redhat.com
Subject: Re: [Qemu-devel] [PATCH 09/12] tests: add a few qemu-qmp tests
Date: Tue, 17 Jul 2018 10:01:55 +0200 [thread overview]
Message-ID: <87zhyqe1e4.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20180706121354.2021-10-marcandre.lureau@redhat.com> ("Marc-André Lureau"'s message of "Fri, 6 Jul 2018 14:13:51 +0200")
Marc-André Lureau <marcandre.lureau@redhat.com> writes:
> These 2 tests exhibited two qmp bugs that were fixed in 2.7
> (series from commit e64c75a9752c5d0fd64eb2e684c656a5ea7d03c6 to
> commit 1382d4abdf9619985e4078e37e49e487cea9935e)
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> tests/qmp-test.c | 38 ++++++++++++++++++++++++++++++++++++++
> 1 file changed, 38 insertions(+)
>
> diff --git a/tests/qmp-test.c b/tests/qmp-test.c
> index ceaf4a6789..084c5edff0 100644
> --- a/tests/qmp-test.c
> +++ b/tests/qmp-test.c
> @@ -249,7 +249,39 @@ static void test_qmp_oob(void)
> recv_cmd_id(qts, "blocks-2");
> recv_cmd_id(qts, "err-2");
> cleanup_blocking_cmd();
> +}
> +
> +static void test_object_add_without_props(void)
> +{
> + QTestState *qts;
> + QDict *ret;
> +
> + qts = qtest_init(common_args);
> +
> + ret = qtest_qmp(qts, "{'execute': 'object-add',"
> + " 'arguments': { 'qom-type': 'memory-backend-ram', 'id': 'ram1' } }");
Please break lines between arguments instead of within. More of the
same below.
> + g_assert_nonnull(ret);
> +
> + g_assert_cmpstr(get_error_class(ret), ==, "GenericError");
> +
> + qobject_unref(ret);
> + qtest_quit(qts);
> +}
> +
> +static void test_qom_set_without_value(void)
> +{
> + QTestState *qts;
> + QDict *ret;
> +
> + qts = qtest_init(common_args);
>
> + ret = qtest_qmp(qts, "{'execute': 'qom-set',"
> + " 'arguments': { 'path': '/machine', 'property': 'rtc-time' } }");
> + g_assert_nonnull(ret);
> +
> + g_assert_cmpstr(get_error_class(ret), ==, "GenericError");
> +
> + qobject_unref(ret);
> qtest_quit(qts);
> }
>
> @@ -479,8 +511,13 @@ int main(int argc, char *argv[])
>
> g_test_init(&argc, &argv, NULL);
>
> + qtest_add_func("qmp/object-add-without-props",
> + test_object_add_without_props);
> + qtest_add_func("qmp/qom-set-without-value",
> + test_qom_set_without_value);
> qtest_add_func("qmp/protocol", test_qmp_protocol);
> qtest_add_func("qmp/oob", test_qmp_oob);
> +
> qmp_schema_init(&schema);
> add_query_tests(&schema);
> qtest_add_func("qmp/preconfig", test_qmp_preconfig);
> @@ -488,5 +525,6 @@ int main(int argc, char *argv[])
> ret = g_test_run();
>
> qmp_schema_cleanup(&schema);
> +
> return ret;
> }
Is this hunk intentional?
Taking a step back: the test cases look good, but is this file an
appropriate home? The file comment states it's about "QMP protocol test
cases". These test cases test commands, not the protocol.
I figure test_qom_set_without_value() belongs to qom-test.c.
test_object_add_without_props() could go into a memory backend test
collection, or an object-add test collection. Sadly, neither exists.
We could have a qmp command test collection as a home of last resort.
Temptation to just throw a few random test cases there instead of
covering (a set of related) commands with a proper test case collection.
As is, your patch turns qmp-test.c into such a home of last resort. If
that's what we want, we should update the file comment. But I think I'd
rather have a separate qmp-cmd-test.c.
Thoughts?
next prev parent reply other threads:[~2018-07-17 8:02 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-06 12:13 [Qemu-devel] [PATCH 00/12] RFC: monitor: various code simplification and fixes Marc-André Lureau
2018-07-06 12:13 ` [Qemu-devel] [PATCH 01/12] tests: change /0.15/* tests to /qmp/* Marc-André Lureau
2018-07-06 12:13 ` [Qemu-devel] [PATCH 02/12] monitor: consitify qmp_send_response() QDict argument Marc-André Lureau
2018-07-12 12:27 ` Markus Armbruster
2018-07-06 12:13 ` [Qemu-devel] [PATCH 03/12] qmp: constify qmp_is_oob() Marc-André Lureau
2018-07-12 12:27 ` Markus Armbruster
2018-07-06 12:13 ` [Qemu-devel] [PATCH 04/12] Revert "qmp: isolate responses into io thread" Marc-André Lureau
2018-07-12 13:14 ` Markus Armbruster
2018-07-12 13:32 ` Marc-André Lureau
2018-07-12 14:27 ` Peter Xu
2018-07-06 12:13 ` [Qemu-devel] [PATCH 05/12] monitor: no need to save need_resume Marc-André Lureau
2018-07-17 5:38 ` Markus Armbruster
2018-07-17 6:05 ` Peter Xu
2018-07-06 12:13 ` [Qemu-devel] [PATCH 06/12] qga: process_event() simplification and leak fix Marc-André Lureau
2018-07-17 5:53 ` Markus Armbruster
2018-07-17 9:27 ` Marc-André Lureau
2018-07-17 12:14 ` Markus Armbruster
2018-07-06 12:13 ` [Qemu-devel] [PATCH 07/12] json-parser: always set an error if return NULL Marc-André Lureau
2018-07-17 7:06 ` Markus Armbruster
2018-07-19 16:59 ` Marc-André Lureau
2018-07-20 6:03 ` Markus Armbruster
2018-07-06 12:13 ` [Qemu-devel] [PATCH 08/12] json-lexer: make it safe to call multiple times Marc-André Lureau
2018-07-17 7:22 ` Markus Armbruster
2018-07-06 12:13 ` [Qemu-devel] [PATCH 09/12] tests: add a few qemu-qmp tests Marc-André Lureau
2018-07-17 8:01 ` Markus Armbruster [this message]
2018-07-17 9:57 ` Marc-André Lureau
2018-07-17 13:15 ` Markus Armbruster
2018-07-19 17:20 ` Marc-André Lureau
2018-07-06 12:13 ` [Qemu-devel] [PATCH 10/12] tests: add a qmp success-response test Marc-André Lureau
2018-07-17 15:12 ` Markus Armbruster
2018-07-06 12:13 ` [Qemu-devel] [PATCH 11/12] qga: process_event() simplification Marc-André Lureau
2018-07-17 15:25 ` Markus Armbruster
2018-07-06 12:13 ` [Qemu-devel] [PATCH 12/12] RFC: qmp: rework 'id' handling Marc-André Lureau
2018-07-17 16:05 ` Markus Armbruster
2018-07-19 17:45 ` Marc-André Lureau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zhyqe1e4.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.