qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v8 5/6] tests: add oob functional test for test-


From: Marc-André Lureau
Subject: Re: [Qemu-devel] [PATCH v8 5/6] tests: add oob functional test for test-qmp-cmds
Date: Fri, 28 Sep 2018 16:28:07 +0400

Hi
On Wed, Sep 5, 2018 at 10:24 AM Peter Xu <address@hidden> wrote:
>
> Straightforward test just to let the test-qmp-cmds be complete.
>
> Signed-off-by: Peter Xu <address@hidden>

Reviewed-by: Marc-André Lureau <address@hidden>

> ---
>  tests/test-qmp-cmds.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>
> diff --git a/tests/test-qmp-cmds.c b/tests/test-qmp-cmds.c
> index ab414fa0c9..23c68c7944 100644
> --- a/tests/test-qmp-cmds.c
> +++ b/tests/test-qmp-cmds.c
> @@ -122,6 +122,21 @@ static void test_dispatch_cmd(void)
>      qobject_unref(req);
>  }
>
> +static void test_dispatch_cmd_oob(void)
> +{
> +    QDict *req = qdict_new();
> +    QDict *resp;
> +
> +    qdict_put_str(req, "exec-oob", "test-flags-command");
> +
> +    resp = qmp_dispatch(&qmp_commands, QOBJECT(req), true);
> +    assert(resp != NULL);
> +    assert(!qdict_haskey(resp, "error"));
> +
> +    qobject_unref(resp);
> +    qobject_unref(req);
> +}
> +
>  /* test commands that return an error due to invalid parameters */
>  static void test_dispatch_cmd_failure(void)
>  {
> @@ -287,6 +302,7 @@ int main(int argc, char **argv)
>      g_test_init(&argc, &argv, NULL);
>
>      g_test_add_func("/qmp/dispatch_cmd", test_dispatch_cmd);
> +    g_test_add_func("/qmp/dispatch_cmd_oob", test_dispatch_cmd_oob);
>      g_test_add_func("/qmp/dispatch_cmd_failure", test_dispatch_cmd_failure);
>      g_test_add_func("/qmp/dispatch_cmd_io", test_dispatch_cmd_io);
>      g_test_add_func("/qmp/dealloc_types", test_dealloc_types);
> --
> 2.17.1
>
>


-- 
Marc-André Lureau



reply via email to

[Prev in Thread] Current Thread [Next in Thread]