From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn9Qn-0004PE-TX for qemu-devel@nongnu.org; Thu, 22 Sep 2016 15:13:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bn9Qi-0000xk-Ua for qemu-devel@nongnu.org; Thu, 22 Sep 2016 15:13:13 -0400 References: <20160922184849.30524-1-marcandre.lureau@redhat.com> <20160922184849.30524-4-marcandre.lureau@redhat.com> From: Eric Blake Message-ID: <672b17db-a022-4bae-1ed4-6d497540ee72@redhat.com> Date: Thu, 22 Sep 2016 14:13:06 -0500 MIME-Version: 1.0 In-Reply-To: <20160922184849.30524-4-marcandre.lureau@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="DQNbkWgdAHMVCVj5E7TSTqT6dSiLfp5vE" Subject: Re: [Qemu-devel] [PATCH v3 3/3] tests: start generic qemu-qmp tests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , qemu-devel@nongnu.org Cc: paolo.bonzini@gmail.com, berrange@redhat.com, qemu-stable@nongnu.org, armbru@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --DQNbkWgdAHMVCVj5E7TSTqT6dSiLfp5vE From: Eric Blake To: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , qemu-devel@nongnu.org Cc: paolo.bonzini@gmail.com, berrange@redhat.com, qemu-stable@nongnu.org, armbru@redhat.com Message-ID: <672b17db-a022-4bae-1ed4-6d497540ee72@redhat.com> Subject: Re: [PATCH v3 3/3] tests: start generic qemu-qmp tests References: <20160922184849.30524-1-marcandre.lureau@redhat.com> <20160922184849.30524-4-marcandre.lureau@redhat.com> In-Reply-To: <20160922184849.30524-4-marcandre.lureau@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/22/2016 01:48 PM, Marc-Andr=C3=A9 Lureau wrote: > These 2 tests exhibit two qmp bugs fixed by the previous patches. >=20 > Signed-off-by: Marc-Andr=C3=A9 Lureau > Reviewed-by: Daniel P. Berrange > --- > tests/test-qemu-qmp.c | 61 ++++++++++++++++++++++++++++++++++++++++++= ++++++++ > tests/Makefile.include | 2 ++ > 2 files changed, 63 insertions(+) > create mode 100644 tests/test-qemu-qmp.c >=20 > diff --git a/tests/test-qemu-qmp.c b/tests/test-qemu-qmp.c > new file mode 100644 > index 0000000..3cdee59 > --- /dev/null > +++ b/tests/test-qemu-qmp.c > @@ -0,0 +1,61 @@ > +#include "qemu/osdep.h" > +#include "libqtest.h" > + No copyright blurb? The default GPLv2+ is fine, but being explicit never hurts. > + > +static void test_object_add_without_props(void) > +{ > + QDict *ret, *error; > + const gchar *class, *desc; > + > + ret =3D qmp("{'execute': 'object-add'," > + " 'arguments': { 'qom-type': 'memory-backend-ram', 'id':= 'ram1' } }"); > + g_assert_nonnull(ret); > + > + error =3D qdict_get_qdict(ret, "error"); > + class =3D qdict_get_try_str(error, "class"); This variable won't compile with C++; should you rename it to 'klass' just in case, since we already have part of qemu being built by C++ for the sake of qga on Windows? > + desc =3D qdict_get_try_str(error, "desc"); > + > + g_assert_cmpstr(class, =3D=3D, "GenericError"); > + g_assert_cmpstr(desc, =3D=3D, "can't create backend with size 0");= A little bit fragile to be parsing for a particular error message wording, but I guess I can live with it. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --DQNbkWgdAHMVCVj5E7TSTqT6dSiLfp5vE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJX5C1CAAoJEKeha0olJ0NqyJMH/ibWBhc3LEOANgcC0qArWOG+ dITm7ODzmQYh7bcBsllcX0/Jp9FlSL00dh5hAQzW2+u7hgiZJWMW0GGkYQFvujug KibuGhn8QpaS5heXizZiSVxOs546REF6w+nLLuLDzVDPfOWG9GnPXvE6r4ql1wUQ zki6riZSzYpnrYiZY3wq62jq/xffpGudwn0Kp5zporgppyzKP/nJgfArd332gsV5 WEipJOcjzkpDKperUbXkzqIblsetoDucPKAaSB1XK43+ixgu0VZJZixO/VtuDOO6 3Q9lQfxSZ9bGER+In1OyqGkP7I6dZWUiC3rdYhbJYWr/X7R4zEWPmKvxgL+4PEw= =Kg8t -----END PGP SIGNATURE----- --DQNbkWgdAHMVCVj5E7TSTqT6dSiLfp5vE--