From nobody Sat May 18 16:47:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650883064; cv=none; d=zohomail.com; s=zohoarc; b=SxrJaOcPmb/9aWNLLxtM8fvLsHcgWE3ssCNe8XAvOR+2v1UeT+RZzVte/i/ykul33JLOaNN33U3I9282N2BcLFUMhBBz+2aCr5seDlw3EYZTedq0aajyQtDovQnW3CJbQKgenqaeoD3C54dcaYSJLh3o7aNbAz3fwpS7UALysBk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650883064; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=guX3e3CTmV2cXY1Yhh16yNsmmzuYtfrMLNO/9uKByyA=; b=jT/jZ+iWumlhhY+PF99ZWzdV5469pIDz1WXqb2rk9jXN3xFtttoGfqYF3FB4q9jO0KhHi9kn8MyltN6SFXlfkHCas+SyKWY1hfNJ9cxi7pKbFcoveaSCMjoO9OH/XS2UQ787/sGj1QpqJ7GXDOnU/xfitwa9a6TMLpKP0ZthFpM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1650883064333371.682473069357; Mon, 25 Apr 2022 03:37:44 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-135-cz5FlKcfMbq4_0O4IztTWQ-1; Mon, 25 Apr 2022 06:37:41 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 03B6F833966; Mon, 25 Apr 2022 10:37:39 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id E507A404E4AF; Mon, 25 Apr 2022 10:37:38 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0C3891940352; Mon, 25 Apr 2022 10:37:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C1CEB1947BBE for ; Mon, 25 Apr 2022 10:37:36 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A5CD4141DED5; Mon, 25 Apr 2022 10:37:36 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4A399145BEE3 for ; Mon, 25 Apr 2022 10:37:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650883063; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=guX3e3CTmV2cXY1Yhh16yNsmmzuYtfrMLNO/9uKByyA=; b=PFHk/CmuMKWS9wj7yuxdHDR2l6DOqpBFd0fQCZ6ApFJlDuIqHeg/AsH33la2ry2fvvXiss QbUvrhztQhR+Wxi1zCP/19uGHGEcosUe8vsB8K8yIWUuvzWtTelrxxVPcDujUiYD/Ryvew aEat4JhgE8vHQnxOPxaqsrC2lMQyaEI= X-MC-Unique: cz5FlKcfMbq4_0O4IztTWQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/2] test: Link qemuhotplugmock with test_utils_qemu and test_utils Date: Mon, 25 Apr 2022 12:37:33 +0200 Message-Id: <9f24a7cc4ebf5f767f44b755bb8851d65e705698.1650882981.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1650883066233100002 Content-Type: text/plain; charset="utf-8"; x-default="true" As of ad81aa8ad07 the qemuhotplugmock.c calls testQemuPrepareHostBackendChardevOne() which is implemented in testutilsqemu.c. However, the mock is not linked with testutilsqemu static library which makes some tools (valgrind particularly) unhappy because the resulting mock library has unresolved symbol. The fix is simple, link mock library with test_utils_qemu_lib and also with test_utils_lib since testutils.c calls some functions from testutils.c. Since these two libraries are declared only after mock_libs[], I had to move the line that declares qemuhotplugmock after those two. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- tests/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/meson.build b/tests/meson.build index fd78d8a2fd..8d613d23f2 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -107,7 +107,6 @@ if conf.has('WITH_QEMU') mock_libs +=3D [ { 'name': 'qemucaps2xmlmock' }, { 'name': 'qemucpumock' }, - { 'name': 'qemuhotplugmock' }, { 'name': 'qemuxml2argvmock' }, { 'name': 'virhostidmock' }, ] @@ -178,6 +177,7 @@ if conf.has('WITH_QEMU') =20 mock_libs +=3D [ { 'name': 'qemucapsprobemock', 'link_with': [ test_qemu_driver_lib ] }, + { 'name': 'qemuhotplugmock', 'link_with': [ test_utils_qemu_lib, test_= utils_lib ] }, ] else test_qemu_driver_lib =3D [] --=20 2.35.1 From nobody Sat May 18 16:47:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650883067; cv=none; d=zohomail.com; s=zohoarc; b=VlhvZq6pkaNoHvDSBIyJ80bbU+rg0QvVO2BX1ZzSRNsarXGwbBbHi+S2KNJLxbZLZR1raCMaxwqZgWbTK3wJd50b/m1Ox9RabagGBS+rVUR9hi0dOMeKbzAS9rSyfDEp+CODDZ6UEbXlNjByL+7K3o/mbT7gwyw89Pyw5z/vJZs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650883067; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cqGPYLj7youJLdP5Nigxfp3kH8gBCZNYuccBs9BRJZI=; b=XXTUs+p5egLHNZtNQfc4P8jsn8q+3JJ6ifoCQLkCZ/lgD72M5fLMDs4SNDU/BYcnPFrTo5UZngNG30UNLyhE0kwR6/H3ebtsqDeOhFnafZB1RAxQtlAoMfCd2rEhoVq+V3syxiAn/zvPpjQJQjns/MSlS2lNW8yDYhpf7j1kAbc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1650883067190312.0261656231926; Mon, 25 Apr 2022 03:37:47 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-25-nFbTLaSlN_uq17T6WeakiA-1; Mon, 25 Apr 2022 06:37:41 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E94163811F55; Mon, 25 Apr 2022 10:37:39 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D05F9C28122; Mon, 25 Apr 2022 10:37:39 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 58A46194036A; Mon, 25 Apr 2022 10:37:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 66E8C194035D for ; Mon, 25 Apr 2022 10:37:37 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 480B5141DED5; Mon, 25 Apr 2022 10:37:37 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id E0833145BF0C for ; Mon, 25 Apr 2022 10:37:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650883066; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=cqGPYLj7youJLdP5Nigxfp3kH8gBCZNYuccBs9BRJZI=; b=hCjukwGG1StJbPCF4Y5+BAOBW48NQJlsgif2lPR+jlwupvHzoSQPIljnNadjNZ4klVZs7h wG2bfID6HjDe0mQnXsS3JZl6h6kEcd32ndODjbaflWJNqsedP52n4rT0YPDpnQPFRKZLEv D94g8hdLwRZwiQFR58pDyFigLsefK+8= X-MC-Unique: nFbTLaSlN_uq17T6WeakiA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/2] tests: Deduplicate some WITH_* checks Date: Mon, 25 Apr 2022 12:37:34 +0200 Message-Id: <15d31988e12c59717bc92f635758773664c821ac.1650882981.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1650883068225100005 Content-Type: text/plain; charset="utf-8"; x-default="true" When constructing mock_libs array it is firstly initialized to a static set of mocks followed by couple of WITH_* checks to append driver specific mocks. These checks are then repeated when filling some other variables (e.g. supplementary helpers, libraries, tests, etc.). Dissolve the former in the latter since we are already doing that, partially, for qemu (qemucapsprobemock and qemuhotplugmock) Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- tests/meson.build | 92 +++++++++++++++++++++-------------------------- 1 file changed, 40 insertions(+), 52 deletions(-) diff --git a/tests/meson.build b/tests/meson.build index 8d613d23f2..9b9fcaa622 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -84,40 +84,6 @@ if host_machine.system() =3D=3D 'linux' ] endif =20 -if conf.has('WITH_BHYVE') - mock_libs +=3D [ - { 'name': 'bhyveargv2xmlmock' }, - { 'name': 'bhyvexml2argvmock' }, - ] -endif - -if conf.has('WITH_LIBXL') - mock_libs +=3D [ - { 'name': 'xlmock', 'sources': [ 'libxlmock.c' ], 'deps': [ libxl_dep = ] }, - ] -endif - -if conf.has('WITH_NSS') - mock_libs +=3D [ - { 'name': 'nssmock' }, - ] -endif - -if conf.has('WITH_QEMU') - mock_libs +=3D [ - { 'name': 'qemucaps2xmlmock' }, - { 'name': 'qemucpumock' }, - { 'name': 'qemuxml2argvmock' }, - { 'name': 'virhostidmock' }, - ] -endif - -if conf.has('WITH_SECDRIVER_SELINUX') - mock_libs +=3D [ - { 'name': 'securityselinuxhelper' }, - ] -endif - =20 # build libraries used by tests =20 @@ -139,6 +105,10 @@ if conf.has('WITH_LIBXL') link_whole: [ libxl_driver_imp ], link_with: [ libvirt_lib ], ) + + mock_libs +=3D [ + { 'name': 'xlmock', 'sources': [ 'libxlmock.c' ], 'deps': [ libxl_dep = ] }, + ] else test_utils_xen_lib =3D [] test_xen_driver_lib =3D [] @@ -176,8 +146,12 @@ if conf.has('WITH_QEMU') ) =20 mock_libs +=3D [ + { 'name': 'qemucaps2xmlmock' }, { 'name': 'qemucapsprobemock', 'link_with': [ test_qemu_driver_lib ] }, + { 'name': 'qemucpumock' }, { 'name': 'qemuhotplugmock', 'link_with': [ test_utils_qemu_lib, test_= utils_lib ] }, + { 'name': 'qemuxml2argvmock' }, + { 'name': 'virhostidmock' }, ] else test_qemu_driver_lib =3D [] @@ -192,24 +166,6 @@ test_file_wrapper_lib =3D static_library( ) =20 tests_deps =3D [] -foreach mock : mock_libs - tests_deps +=3D shared_library( - mock['name'], - mock.get('sources', [ '@0@.c'.format(mock['name']) ]), - override_options: [ - 'b_asneeded=3Dfalse', - 'b_lundef=3Dfalse', - ], - dependencies: [ - tests_dep, - mock.get('deps', []), - ], - link_with: [ - libvirt_lib, - mock.get('link_with', []), - ], - ) -endforeach =20 # build helpers used by tests =20 @@ -367,6 +323,11 @@ if conf.has('WITH_BHYVE') { 'name': 'bhyvexml2argvtest', 'link_with': [ bhyve_driver_impl ] }, { 'name': 'bhyvexml2xmltest', 'link_with': [ bhyve_driver_impl ] }, ] + + mock_libs +=3D [ + { 'name': 'bhyveargv2xmlmock' }, + { 'name': 'bhyvexml2argvmock' }, + ] endif =20 if conf.has('WITH_ESX') @@ -428,6 +389,10 @@ if conf.has('WITH_NSS') 'link_with': [ nss_libvirt_guest_impl ], }, ] + + mock_libs +=3D [ + { 'name': 'nssmock' }, + ] endif =20 if conf.has('WITH_NWFILTER') @@ -506,6 +471,10 @@ if conf.has('WITH_SECDRIVER_SELINUX') ] endif endif + + mock_libs +=3D [ + { 'name': 'securityselinuxhelper' }, + ] endif =20 if conf.has('WITH_STORAGE') @@ -556,6 +525,25 @@ if conf.has('WITH_YAJL') ] endif =20 +foreach mock : mock_libs + tests_deps +=3D shared_library( + mock['name'], + mock.get('sources', [ '@0@.c'.format(mock['name']) ]), + override_options: [ + 'b_asneeded=3Dfalse', + 'b_lundef=3Dfalse', + ], + dependencies: [ + tests_dep, + mock.get('deps', []), + ], + link_with: [ + libvirt_lib, + mock.get('link_with', []), + ], + ) +endforeach + foreach data : tests test_sources =3D '@0@.c'.format(data['name']) test_bin =3D executable( --=20 2.35.1