From nobody Wed Feb 11 02:06:31 2026 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1715090525276384.0648455877532; Tue, 7 May 2024 07:02:05 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 1550C1D42; Tue, 7 May 2024 10:02:04 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id D05191DE8; Tue, 7 May 2024 09:59:24 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id CAEFB1AD7; Tue, 7 May 2024 09:59:13 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id E1EDD1ACB for ; Tue, 7 May 2024 09:59:12 -0400 (EDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-618-iwa9bR7dMUKJrLakno3B6Q-1; Tue, 07 May 2024 09:59:10 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AC38B8015D7 for ; Tue, 7 May 2024 13:59:10 +0000 (UTC) Received: from toolbox.redhat.com (unknown [10.42.28.138]) by smtp.corp.redhat.com (Postfix) with ESMTP id E957E1C060AE; Tue, 7 May 2024 13:59:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 X-MC-Unique: iwa9bR7dMUKJrLakno3B6Q-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: devel@lists.libvirt.org Cc: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 02/12] tests: fix tests when test driver is disabled Date: Tue, 7 May 2024 14:58:57 +0100 Message-ID: <20240507135907.1104087-3-berrange@redhat.com> In-Reply-To: <20240507135907.1104087-1-berrange@redhat.com> References: <20240507135907.1104087-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: YJFSXMD7AWJ3PDGLNOXRSK33X4Q6C4Z5 X-Message-ID-Hash: YJFSXMD7AWJ3PDGLNOXRSK33X4Q6C4Z5 X-MailFrom: berrange@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1715090528132100001 Various tests try to open a connection to 'test:///default' and must be skipped when the test driver is disabled. Signed-off-by: Daniel P. Berrang=C3=A9 --- tests/fchosttest.c | 9 ++++++--- tests/meson.build | 37 ++++++++++++++++++++++++------------- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/tests/fchosttest.c b/tests/fchosttest.c index d050458a58..14f9975157 100644 --- a/tests/fchosttest.c +++ b/tests/fchosttest.c @@ -33,6 +33,7 @@ static char *fchost_prefix; #define TEST_FC_HOST_NUM 5 #define TEST_FC_HOST_NUM_NO_FAB 6 =20 +#ifdef WITH_TEST /* virNodeDeviceCreateXML using "" to find the vport capable HBA */ static const char test7_xml[] =3D "" @@ -85,7 +86,7 @@ static const char test11_xml[] =3D " /dev/disk/by-path" " " ""; - +#endif /* WITH_TEST */ =20 /* Test virIsVHBACapable */ static int @@ -222,7 +223,7 @@ test6(const void *data G_GNUC_UNUSED) } =20 =20 - +#ifdef WITH_TEST /* Test manageVHBAByNodeDevice * - Test both virNodeDeviceCreateXML and virNodeDeviceDestroy * - Create a node device vHBA allowing usage of various different @@ -313,7 +314,7 @@ manageVHBAByStoragePool(const void *data) virConnectClose(conn); return ret; } - +#endif =20 static int mymain(void) @@ -334,6 +335,7 @@ mymain(void) ret =3D -1; if (virTestRun("virVHBAGetConfig-empty-fabric_wwn", test6, NULL) < 0) ret =3D -1; +#ifdef WITH_TEST if (virTestRun("manageVHBAByNodeDevice-by-parent", manageVHBAByNodeDev= ice, test7_xml) < 0) ret =3D -1; @@ -349,6 +351,7 @@ mymain(void) if (virTestRun("manageVHBAByStoragePool-by-parent", manageVHBAByStorag= ePool, test11_xml) < 0) ret =3D -1; +#endif =20 VIR_FREE(fchost_prefix); return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; diff --git a/tests/meson.build b/tests/meson.build index 7270840428..73b87be2a0 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -74,7 +74,6 @@ endif =20 mock_libs =3D [ { 'name': 'domaincapsmock' }, - { 'name': 'shunload', 'sources': [ 'shunloadhelper.c' ] }, { 'name': 'vircgroupmock' }, { 'name': 'virdnsmasqmock' }, { 'name': 'virfilecachemock' }, @@ -106,6 +105,11 @@ if host_machine.system() !=3D 'windows' ] endif =20 +if conf.has('WITH_TEST') + mock_libs +=3D [ + { 'name': 'shunload', 'sources': [ 'shunloadhelper.c' ] }, + ] +endif =20 # build libraries used by tests =20 @@ -258,15 +262,11 @@ tests +=3D [ { 'name': 'domainconftest' }, { 'name': 'genericxml2xmltest' }, { 'name': 'interfacexml2xmltest' }, - { 'name': 'metadatatest' }, - { 'name': 'networkmetadatatest' }, { 'name': 'networkxml2xmlupdatetest' }, { 'name': 'nodedevxml2xmltest' }, { 'name': 'nwfilterxml2xmltest' }, - { 'name': 'objecteventtest' }, { 'name': 'seclabeltest' }, { 'name': 'secretxml2xmltest' }, - { 'name': 'shunloadtest', 'deps': [ thread_dep ] }, { 'name': 'sockettest' }, { 'name': 'storagevolxml2xmltest' }, { 'name': 'sysinfotest' }, @@ -298,7 +298,6 @@ tests +=3D [ { 'name': 'virportallocatortest' }, { 'name': 'virrotatingfiletest' }, { 'name': 'virschematest' }, - { 'name': 'virshtest', 'depends': [ virsh_prog ] }, { 'name': 'virstringtest' }, { 'name': 'virsystemdtest' }, { 'name': 'virtimetest' }, @@ -333,6 +332,17 @@ if host_machine.system() =3D=3D 'linux' endif endif =20 +if conf.has('WITH_TEST') + tests +=3D [ + { 'name': 'fdstreamtest' }, + { 'name': 'metadatatest' }, + { 'name': 'networkmetadatatest' }, + { 'name': 'objecteventtest' }, + { 'name': 'shunloadtest', 'deps': [ thread_dep ] }, + { 'name': 'virshtest', 'depends': [ virsh_prog ] }, + ] +endif + if conf.has('WITH_BHYVE') tests +=3D [ { 'name': 'bhyveargv2xmltest', 'link_with': [ bhyve_driver_impl ] }, @@ -364,7 +374,6 @@ endif if conf.has('WITH_LIBVIRTD') tests +=3D [ { 'name': 'eventtest', 'deps': [ thread_dep ] }, - { 'name': 'fdstreamtest' }, { 'name': 'virdriverconnvalidatetest' }, { 'name': 'virdrivermoduletest' }, ] @@ -619,12 +628,14 @@ test( suite: 'script', ) =20 -# vsh based client self-test, which can be run directly from meson -test('virsh self-test', - virsh_prog, - args: [ '-q', '-c', 'test:///default', 'self-test' ], - suite: 'bin', -) +if conf.has('WITH_TEST') + # vsh based client self-test, which can be run directly from meson + test('virsh self-test', + virsh_prog, + args: [ '-q', '-c', 'test:///default', 'self-test' ], + suite: 'bin', + ) +endif =20 if conf.has('WITH_REMOTE') test('virt-admin self-test', --=20 2.43.0 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org