From nobody Tue Feb 10 00:58:47 2026 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; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=yadro.com ARC-Seal: i=1; a=rsa-sha256; t=1566404050; cv=none; d=zoho.com; s=zohoarc; b=UlkAHSDPcgOcsxDFZbbQVz5OhQEfuUDb5BjxGV2jO2vs33S+D+kb/nnfwzcB2rW6iJF4EHmdVxbnDLQ7Hu5nlaB8Pf9+K7XCO0uba8yfHev+6hS1+x3f/ndPkT2GMCp/HgYmNVHVMnvIIswB5xr+RDZc+qWvIeT6ZvQPFmdhfRQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566404050; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=V9NEYp1h3S1L6j4I6y/svAaWpnpaqOePJKMcDdyRg9w=; b=X8PFQZEKtbHutiUNjtbBGa92+NO7aM4+QRVrOE6ElOrZRmqEhxO3Mxd77YYme2JdqyBBrjCBGkxzfg8PHVEct8WTopBIexyJ0jDAnBDBsML1r/9sOurbuQx/UEZMRoJMCrb5ve8N1+rH/45DrUyQ+syIHcX2AeYAvzG69vXrJoI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 156640405092467.30659242896206; Wed, 21 Aug 2019 09:14:10 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ABBFE10576F0; Wed, 21 Aug 2019 16:14:09 +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 8A6515D9D3; Wed, 21 Aug 2019 16:14:09 +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 55865180B536; Wed, 21 Aug 2019 16:14:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7LGE2Bt016815 for ; Wed, 21 Aug 2019 12:14:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id F19065C299; Wed, 21 Aug 2019 16:14:01 +0000 (UTC) Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EBAB45C228 for ; Wed, 21 Aug 2019 16:14:01 +0000 (UTC) Received: from mta-01.yadro.com (mta-02.yadro.com [89.207.88.252]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1C3CF87630 for ; Wed, 21 Aug 2019 16:13:51 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id ADE574120B for ; Wed, 21 Aug 2019 16:13:49 +0000 (UTC) Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 23dleuFB11qa for ; Wed, 21 Aug 2019 19:13:48 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (t-exch-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id A324042ECC for ; Wed, 21 Aug 2019 19:13:48 +0300 (MSK) Received: from localhost (172.17.128.60) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Wed, 21 Aug 2019 19:13:48 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-type:content-type:content-transfer-encoding:mime-version :references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received:received; s=mta-01; t= 1566404028; x=1568218429; bh=yvQ+oUFR4kXVwTaJANJR93HoSRaM4PzobMi PPDhDy78=; b=ZbKOl2SFkWGGNbdcURWnA0xo1UXnAVwVqjaUHeysQ1Zdf3zGrR+ klAvHrZxBEZy+FAqNPJcTUV6qinhGzQH/hbtso8O0GRZgxMDhqZoArovC3zO+S7b sGT/mAp/29Rrd1SR64i3x+ImXMYHqfMrCsdZENIwCv7kp72kvTi6f4yo= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Aug 2019 19:13:15 +0300 Message-ID: <20190821161323.1583-4-r.bolshakov@yadro.com> In-Reply-To: <20190821161323.1583-1-r.bolshakov@yadro.com> References: <20190821161323.1583-1-r.bolshakov@yadro.com> MIME-Version: 1.0 X-Originating-IP: [172.17.128.60] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-02.corp.yadro.com (172.17.10.102) X-Greylist: Sender passed SPF test, ACL 264 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 21 Aug 2019 16:13:51 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 21 Aug 2019 16:13:51 +0000 (UTC) for IP:'89.207.88.252' DOMAIN:'mta-02.yadro.com' HELO:'mta-01.yadro.com' FROM:'r.bolshakov@yadro.com' RCPT:'' X-RedHat-Spam-Score: -0.1 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_NONE, SPF_PASS) 89.207.88.252 mta-02.yadro.com 89.207.88.252 mta-02.yadro.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCH 03/11] tests: Preload mocks with DYLD_INSERT_LIBRARIES on macOS 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.64]); Wed, 21 Aug 2019 16:14:10 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" LD_PRELOAD has no effect on macOS. Instead, dyld(1) provides a way for symbol hooking via DYLD_INSERT_LIBRARIES. The variable should contain colon-separated paths to the dylibs to be inserted. Signed-off-by: Roman Bolshakov Reviewed-by: Daniel P. Berrang=C3=A9 --- tests/testutils.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/testutils.h b/tests/testutils.h index 8c12fd7c12..07dda6e355 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -117,9 +117,15 @@ int virTestMain(int argc, return virTestMain(argc, argv, func, NULL); \ } =20 +#ifdef __APPLE__ +# define PRELOAD_VAR "DYLD_INSERT_LIBRARIES" +#else +# define PRELOAD_VAR "LD_PRELOAD" +#endif + #define VIR_TEST_PRELOAD(lib) \ do { \ - const char *preload =3D getenv("LD_PRELOAD"); \ + const char *preload =3D getenv(PRELOAD_VAR); \ if (preload =3D=3D NULL || strstr(preload, lib) =3D=3D NULL) { \ char *newenv; \ if (!virFileIsExecutable(lib)) { \ @@ -132,7 +138,7 @@ int virTestMain(int argc, perror("virAsprintf"); \ return EXIT_FAILURE; \ } \ - setenv("LD_PRELOAD", newenv, 1); \ + setenv(PRELOAD_VAR, newenv, 1); \ execv(argv[0], argv); \ } \ } while (0) --=20 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list