From nobody Thu May 15 07:07:38 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1528121142111428.5049150064117; Mon, 4 Jun 2018 07:05:42 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8915ADCA09; Mon, 4 Jun 2018 14:05:40 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E77A98B327; Mon, 4 Jun 2018 14:05:39 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8A9E218005DF; Mon, 4 Jun 2018 14:05:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w54Dx4gc002823 for ; Mon, 4 Jun 2018 09:59:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id ABA887C20; Mon, 4 Jun 2018 13:59:04 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 50AF263F48 for ; Mon, 4 Jun 2018 13:59:04 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 4 Jun 2018 15:58:41 +0200 Message-Id: <27a99898eecbbee74bfc1f05f46684452196a6c0.1528120448.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 08/10] tests: qemucapabilities: Test commands used to query capabilities X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 04 Jun 2018 14:05:41 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Use qemuMonitorTestNewFromFileFull which allows to test commands used along with providing replies. This has two advantages: 1) It's easier to see which command was used when looking at the files 2) We check that the used commands are actually in the correct order Signed-off-by: Peter Krempa Reviewed-by: John Ferlan --- tests/qemucapabilitiestest.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c index 6981e973a6..633389f263 100644 --- a/tests/qemucapabilitiestest.c +++ b/tests/qemucapabilitiestest.c @@ -32,7 +32,7 @@ typedef struct _testQemuData testQemuData; typedef testQemuData *testQemuDataPtr; struct _testQemuData { - virDomainXMLOptionPtr xmlopt; + virQEMUDriver driver; const char *archName; const char *base; }; @@ -42,7 +42,7 @@ static int testQemuCaps(const void *opaque) { int ret =3D -1; - const testQemuData *data =3D opaque; + testQemuData *data =3D (void *) opaque; char *repliesFile =3D NULL; char *capsFile =3D NULL; qemuMonitorTestPtr mon =3D NULL; @@ -55,7 +55,7 @@ testQemuCaps(const void *opaque) abs_srcdir, data->base, data->archName) < 0) goto cleanup; - if (!(mon =3D qemuMonitorTestNewFromFile(repliesFile, data->xmlopt, fa= lse))) + if (!(mon =3D qemuMonitorTestNewFromFileFull(repliesFile, &data->drive= r, NULL))) goto cleanup; if (!(capsActual =3D virQEMUCapsNew()) || @@ -139,7 +139,6 @@ static int mymain(void) { int ret =3D 0; - virQEMUDriver driver; testQemuData data; #if !WITH_YAJL @@ -148,13 +147,11 @@ mymain(void) #endif if (virThreadInitialize() < 0 || - qemuTestDriverInit(&driver) < 0) + qemuTestDriverInit(&data.driver) < 0) return EXIT_FAILURE; virEventRegisterDefaultImpl(); - data.xmlopt =3D driver.xmlopt; - #define DO_TEST(arch, name) \ do { \ data.archName =3D arch; \ @@ -200,7 +197,7 @@ mymain(void) * "tests/qemucapsfixreplies foo.replies" to fix the replies ids. */ - qemuTestDriverFree(&driver); + qemuTestDriverFree(&data.driver); return (ret =3D=3D 0) ? EXIT_SUCCESS : EXIT_FAILURE; } --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list