From nobody Sat May 4 06:55:23 2024 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=1566404044; cv=none; d=zoho.com; s=zohoarc; b=Y85jwBii2JSOWwxHw0f6xHWOJKPGTfsOZopewOU6Jb2IAFxKeHGmY5aE4SwMjL+/hLs3N+dqLQehbjcChBjAOCDZ66+DWlCh/CoJkjwnFMztQDjqeAFhF31IV3GG6ecl4qKWGRh5UKvnbPd9JC+Tx+VVivtFjLGKsBz3TPv7lOY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566404044; 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=Tq2/9hrTL0/vkBd3onTJltut6kyQBWurf6SIWavlRPs=; b=nZ9xblzfZVXh0h7xoqNyaTofmiDbKK0ux8hrZnTJahd8oSNu9K32GpoC1K4x+aA3SXxqSsPbpidUg66fWZrBSOqFsO/ayOf2xhJn1d/XbQy3bh5W56ul+DDWXIhjW4lJZBdVgk8emfvAeI3JUcgUwiqQQD4DAgkPTqPOAIiCjp4= 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 1566404044296383.1468514113333; Wed, 21 Aug 2019 09:14:04 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0CCB0300183E; Wed, 21 Aug 2019 16:14:03 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D9CBF60605; Wed, 21 Aug 2019 16:14:02 +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 A82E52551C; Wed, 21 Aug 2019 16:14:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7LGE1r5016807 for ; Wed, 21 Aug 2019 12:14:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0525817D97; Wed, 21 Aug 2019 16:14:01 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 000595D9D3 for ; Wed, 21 Aug 2019 16:13:58 +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 BA6E681F13 for ; Wed, 21 Aug 2019 16:13:49 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id 597F142004 for ; Wed, 21 Aug 2019 16:13:48 +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 I6T2F11hp9eS for ; Wed, 21 Aug 2019 19:13:47 +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 112F942ECC for ; Wed, 21 Aug 2019 19:13:47 +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:46 +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= 1566404027; x=1568218428; bh=M2b/yr97OiDKHuy8Hs0Z2I900dB++eH8Rec l6iTziR4=; b=RYhqGhphd04zjKkVnRGeJ0tW+OXKJoPzvf2n/WI5MgZOnhScf5N pqhbWP6UdnTnUFAGVR5H9gV0hMX9l6CK+XJ01hGgnJe3JNu4r02RX1r6lqMHg/rk NqQaymBs9+pOY/r6OoAbQZi4AUq6+W6n6XgeHj/VvKEycRmQ0xGetPGs= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Aug 2019 19:13:13 +0300 Message-ID: <20190821161323.1583-2-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.25]); Wed, 21 Aug 2019 16:13:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 21 Aug 2019 16:13:50 +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.83 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCH 01/11] tests: Don't test octal localhost IP in sockettest 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Wed, 21 Aug 2019 16:14:03 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" getaddrinfo on macOS doesn't interpret octal IPv4 addresses. Only inet_aton can be used for that. Therefore, from macOS standpoint "0177.0.0.01" is not the same as "127.0.0.1". The issue was also discovered by python and dotnet core: https://bugs.python.org/issue27612 https://github.com/dotnet/corefx/issues/8362 Signed-off-by: Roman Bolshakov Reviewed-by: Daniel P. Berrang=C3=A9 --- tests/sockettest.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/sockettest.c b/tests/sockettest.c index 859f02e51e..2b21352c13 100644 --- a/tests/sockettest.c +++ b/tests/sockettest.c @@ -465,7 +465,11 @@ mymain(void) =20 DO_TEST_LOCALHOST("127.0.0.1", true); DO_TEST_LOCALHOST("2130706433", true); + + /* Octal IPv4 doesn't work in getaddrinfo on macOS */ +#ifndef __APPLE__ DO_TEST_LOCALHOST("0177.0.0.01", true); +#endif DO_TEST_LOCALHOST("::1", true); DO_TEST_LOCALHOST("0::1", true); DO_TEST_LOCALHOST("0:0:0::1", true); --=20 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 06:55:23 2024 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=1566404045; cv=none; d=zoho.com; s=zohoarc; b=lEpX4Gt1sOS5us9OzlY8ZAtCal9CAtr6PXYDybgPPQbJ+tNLIvBYn3spnud1puBodHDdqcDcyBI9OHQPuSq1vaWxnNsfk6unBgHh2znhVEQiyfBw5o9e4ULWWapxQL11sbJTDiy++xVFJkED26ZOp3pL14uKLU748NyeJZvPUoY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566404045; 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=g3rPXuCiKjfRxkCUpzH77q7CaeyKmTSzjeeyAvXQLTQ=; b=QQgGyd0fzSjkOMQS0Y/QMWXGPhTIegZfzO4b6awfof0r3dqmAKh55oD4pk70hvP0vW0xosHdijAcZEgWJkkUk+f+t3i1SS3jT2X+XpCdeAS1udEsfsuueC8mdEeSgNkW1rDeMDd8cR913T3uPH5bgXXvh8bAJUivGrPRw/sp6E4= 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 1566404045368535.302216221933; Wed, 21 Aug 2019 09:14:05 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 053121918647; Wed, 21 Aug 2019 16:14:04 +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 DA91060BF3; Wed, 21 Aug 2019 16:14:03 +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 A20B41806B00; Wed, 21 Aug 2019 16:14:03 +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 x7LGE2Gj016821 for ; Wed, 21 Aug 2019 12:14:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id 41A7F5C224; Wed, 21 Aug 2019 16:14:02 +0000 (UTC) Received: from mx1.redhat.com (ext-mx03.extmail.prod.ext.phx2.redhat.com [10.5.110.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3CAF15C221 for ; Wed, 21 Aug 2019 16:13:59 +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 8F4E881F2F for ; Wed, 21 Aug 2019 16:13:50 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id 2F2B042ED6 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 i9bgcdnut3jI 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 DADD242ED2 for ; Wed, 21 Aug 2019 19:13:47 +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:47 +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=ZdLNJeoFp5RgxQhMAjSQFaW4++8L4b3w1rc 7DArGYSQ=; b=sUVMiuPUTe3dDW8UrxVT1+Lg6hKTiD0y9ju4TllaMS9G3nVnCHH WNiZfA/gTdBlO30X0QNMINdY7fM1Wi+VGZ7VpwOR5RX5ANLN0+/G2pawYv0Yh4Zs 701VdyO+TD8nhWcmadf9xDrHk15Qj9NRbuzv4shmG8AlGlHVOHt18QU8= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Aug 2019 19:13:14 +0300 Message-ID: <20190821161323.1583-3-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.27]); Wed, 21 Aug 2019 16:13:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 21 Aug 2019 16:13:50 +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.27 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCH 02/11] tests: Avoid IPv4-translated IPv6 address in sockettest 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.70]); Wed, 21 Aug 2019 16:14:04 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" getnameinfo on macOS formats certain IPv6 addresses as IPv4-translated addresses. The following pattern has been observed: ::ffff is formated as ::0.0.255.255 ::fffe is formated as ::0.0.255.254 ::ffff:0 is formated as ::255.255.0.0 ::fffe:0 is formated as ::255.254.0.0 ::ffff:0:0 is formated as ::ffff:0.0.0.0 ::fffe:0:0 is formated as ::fffe:0:0 ::ffff:0:0:0 is formated as ::ffff:0:0:0 The getnameinfo behavior causes a failure for: DO_TEST_PARSE_AND_FORMAT("::ffff", AF_UNSPEC, true); Use non-ambigious IPv6 for parse/format testing. Signed-off-by: Roman Bolshakov Reviewed-by: Daniel P. Berrang=C3=A9 --- tests/sockettest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sockettest.c b/tests/sockettest.c index 2b21352c13..29a565de40 100644 --- a/tests/sockettest.c +++ b/tests/sockettest.c @@ -378,7 +378,7 @@ mymain(void) DO_TEST_PARSE_AND_FORMAT("::1", AF_INET, false); DO_TEST_PARSE_AND_FORMAT("::1", AF_INET6, true); DO_TEST_PARSE_AND_FORMAT("::1", AF_UNIX, false); - DO_TEST_PARSE_AND_FORMAT("::ffff", AF_UNSPEC, true); + DO_TEST_PARSE_AND_FORMAT("::fffe:0:0", AF_UNSPEC, true); =20 /* tests that specify a network that should contain the range */ DO_TEST_RANGE("192.168.122.1", "192.168.122.1", "192.168.122.1", 24, 1= , true); --=20 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 06:55:23 2024 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 From nobody Sat May 4 06:55:23 2024 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=1566404070; cv=none; d=zoho.com; s=zohoarc; b=BOcu+DHCGZjTkXMmg2Ns1Iu+HczF2EfIcDXvZIPwQVAR4HDu9h9LmSkzNqAj4llI9ZZeKAOhvsTxlaxiSMltSTNnewQSQYdhSow/ZkWE8xwD90doGONzpucAskkenjbMemm3JaJlLlOcgnFTbr06V5udMcy4ebT3N6z3ks+d5j0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566404070; 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=V2r7Se3XceeuCmEoAbp6Igb9nj9jwuaXGUjpDaCaSnU=; b=B8sszc9mUOSOGPEAgntqR/EuTRUQm6x/uwywZ2m2eIlQDKgwMETkV20EHwPh5wKcN6kC9z0qAj0BszBbSLbtJrcB1EMD0gW0itExhY4chEPF6rcL+82WuxXswpY/UzsX7CbU2LHHOT0vIB+MfKnHRgRF5IDgILjZgRjQ53IryQE= 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 1566404070529841.2364987384555; Wed, 21 Aug 2019 09:14:30 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0F8838E23F; Wed, 21 Aug 2019 16:14:29 +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 E10401001B07; Wed, 21 Aug 2019 16:14:28 +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 A96EA180BAA4; Wed, 21 Aug 2019 16:14:28 +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 x7LGEFKp016909 for ; Wed, 21 Aug 2019 12:14:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id C93DB5C228; Wed, 21 Aug 2019 16:14:15 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C3C955C1D6 for ; Wed, 21 Aug 2019 16:14:15 +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 3C69B11A12 for ; Wed, 21 Aug 2019 16:14:00 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id 9BEE042EE0 for ; Wed, 21 Aug 2019 16:13:54 +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 fEItIGHYQk1o for ; Wed, 21 Aug 2019 19:13:51 +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 B73E442ECC for ; Wed, 21 Aug 2019 19:13:49 +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:49 +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= 1566404031; x=1568218432; bh=4H3kWh4U8qie8BUay2Vx/aqqEV6wV0ZD8bV plUzq1uE=; b=PfwIqGGMyDuNd1It4Mp/3k4di+klja64xX3AIxab1QwA5ebVcKq y0x+6TY1KxZl9TXr0NFTlfIOctyT7rpKe6v8N2FxTknGIczUYv6nb7sRWbjirpLQ uZemXKFq37K1LoKqn7nTK+2qt3Mr8mqoD5C5oHV01txGG1hVXe+8U/p8= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Aug 2019 19:13:16 +0300 Message-ID: <20190821161323.1583-5-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.28]); Wed, 21 Aug 2019 16:14:01 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 21 Aug 2019 16:14:01 +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.28 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCH 04/11] tests: Add lib- prefix to all mocks 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 21 Aug 2019 16:14:29 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" In preparation libtool "-module" flag removal, add lib prefix to all mock shared objects. While at it, introduce VIR_TEST_MOCK macros that makes path out of mock name to be used with VIR_TEST_PRELOAD or VIR_TEST_MAIN_PRELOAD. That, hopefully, improves readability, reduces line length and allows to tailor VIR_TEST_MOCK for specific platform if it has shared library suffix different from ".so". Signed-off-by: Roman Bolshakov Reviewed-by: Daniel P. Berrang=C3=A9 --- tests/Makefile.am | 194 ++++++++++++++++----------------- tests/bhyveargv2xmltest.c | 2 +- tests/bhyvexml2argvtest.c | 2 +- tests/bhyvexml2xmltest.c | 2 +- tests/domaincapstest.c | 6 +- tests/fchosttest.c | 2 +- tests/libxlxml2domconfigtest.c | 2 +- tests/nsstest.c | 2 +- tests/qemucaps2xmltest.c | 2 +- tests/qemucapsprobe.c | 2 +- tests/qemumemlocktest.c | 3 +- tests/qemumonitorjsontest.c | 2 +- tests/qemuxml2argvtest.c | 8 +- tests/qemuxml2xmltest.c | 6 +- tests/testutils.c | 4 +- tests/testutils.h | 4 + tests/vircaps2xmltest.c | 2 +- tests/vircgrouptest.c | 2 +- tests/vircryptotest.c | 2 +- tests/virfilecachetest.c | 2 +- tests/virfiletest.c | 2 +- tests/virfirewalltest.c | 2 +- tests/virhostcputest.c | 2 +- tests/virhostdevtest.c | 2 +- tests/viriscsitest.c | 3 +- tests/virmacmaptest.c | 2 +- tests/virnetdaemontest.c | 2 +- tests/virnetdevbandwidthtest.c | 2 +- tests/virnetdevtest.c | 2 +- tests/virnetserverclienttest.c | 2 +- tests/virnettlscontexttest.c | 2 +- tests/virnettlssessiontest.c | 2 +- tests/virpcitest.c | 2 +- tests/virpolkittest.c | 2 +- tests/virportallocatortest.c | 2 +- tests/virsystemdtest.c | 2 +- tests/virusbtest.c | 2 +- 37 files changed, 143 insertions(+), 143 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 6b5d05bbed..713dc30de3 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -206,16 +206,16 @@ test_programs =3D virshtest sockettest \ $(NULL) =20 test_libraries =3D libshunload.la \ - virportallocatormock.la \ - virnetdaemonmock.la \ - virnetserverclientmock.la \ - vircgroupmock.la \ - virpcimock.la \ - virnetdevmock.la \ - virrandommock.la \ - virhostcpumock.la \ - domaincapsmock.la \ - virfilecachemock.la \ + libvirportallocatormock.la \ + libvirnetdaemonmock.la \ + libvirnetserverclientmock.la \ + libvircgroupmock.la \ + libvirpcimock.la \ + libvirnetdevmock.la \ + libvirrandommock.la \ + libvirhostcpumock.la \ + libdomaincapsmock.la \ + libvirfilecachemock.la \ $(NULL) =20 if WITH_REMOTE @@ -234,11 +234,11 @@ test_programs +=3D fchosttest test_programs +=3D scsihosttest test_programs +=3D vircaps2xmltest test_programs +=3D virresctrltest -test_libraries +=3D virusbmock.la \ - virnetdevbandwidthmock.la \ - virnumamock.la \ - virtestmock.la \ - virfilemock.la \ +test_libraries +=3D libvirusbmock.la \ + libvirnetdevbandwidthmock.la \ + libvirnumamock.la \ + libvirtestmock.la \ + libvirfilemock.la \ $(NULL) endif WITH_LINUX =20 @@ -250,7 +250,7 @@ if WITH_DBUS test_programs +=3D virdbustest \ virsystemdtest \ $(NULL) -test_libraries +=3D virdbusmock.la +test_libraries +=3D libvirdbusmock.la if WITH_POLKIT test_programs +=3D virpolkittest endif WITH_POLKIT @@ -291,10 +291,10 @@ test_programs +=3D qemuxml2argvtest qemuxml2xmltest \ test_helpers +=3D qemucapsprobe test_libraries +=3D libqemumonitortestutils.la \ libqemutestdriver.la \ - qemuxml2argvmock.la \ - qemucaps2xmlmock.la \ - qemucapsprobemock.la \ - qemucpumock.la \ + libqemuxml2argvmock.la \ + libqemucaps2xmlmock.la \ + libqemucapsprobemock.la \ + libqemucpumock.la \ $(NULL) endif WITH_QEMU =20 @@ -324,7 +324,7 @@ endif WITH_VMWARE =20 if WITH_BHYVE test_programs +=3D bhyvexml2argvtest bhyvexml2xmltest bhyveargv2xmltest -test_libraries +=3D bhyvexml2argvmock.la bhyveargv2xmlmock.la +test_libraries +=3D libbhyvexml2argvmock.la libbhyveargv2xmlmock.la endif WITH_BHYVE =20 if WITH_CIL @@ -379,7 +379,7 @@ endif WITH_LINUX if WITH_NSS test_helpers +=3D nsslinktest nssguestlinktest test_programs +=3D nsstest nssguesttest -test_libraries +=3D nssmock.la +test_libraries +=3D libnssmock.la endif WITH_NSS =20 test_programs +=3D storagevolxml2xmltest @@ -555,10 +555,10 @@ libqemutestdriver_la_SOURCES =3D libqemutestdriver_la_LDFLAGS =3D $(DRIVERLIB_LDFLAGS) libqemutestdriver_la_LIBADD =3D $(qemu_LDADDS) =20 -qemucpumock_la_SOURCES =3D \ +libqemucpumock_la_SOURCES =3D \ qemucpumock.c testutilshostcpus.h -qemucpumock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) -qemucpumock_la_LIBADD =3D $(MOCKLIBS_LIBS) +libqemucpumock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +libqemucpumock_la_LIBADD =3D $(MOCKLIBS_LIBS) =20 qemuxml2argvtest_SOURCES =3D \ qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \ @@ -568,10 +568,10 @@ qemuxml2argvtest_SOURCES =3D \ qemuxml2argvtest_LDADD =3D libqemutestdriver.la \ $(LDADDS) $(LIBXML_LIBS) =20 -qemuxml2argvmock_la_SOURCES =3D \ +libqemuxml2argvmock_la_SOURCES =3D \ qemuxml2argvmock.c -qemuxml2argvmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) -qemuxml2argvmock_la_LIBADD =3D $(MOCKLIBS_LIBS) +libqemuxml2argvmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +libqemuxml2argvmock_la_LIBADD =3D $(MOCKLIBS_LIBS) =20 qemuxml2xmltest_SOURCES =3D \ qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \ @@ -600,10 +600,10 @@ qemucapsprobe_SOURCES =3D \ qemucapsprobe_LDADD =3D \ libqemutestdriver.la $(LDADDS) =20 -qemucapsprobemock_la_SOURCES =3D \ +libqemucapsprobemock_la_SOURCES =3D \ qemucapsprobemock.c -qemucapsprobemock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) -qemucapsprobemock_la_LIBADD =3D $(MOCKLIBS_LIBS) +libqemucapsprobemock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +libqemucapsprobemock_la_LIBADD =3D $(MOCKLIBS_LIBS) =20 qemucommandutiltest_SOURCES =3D \ qemucommandutiltest.c \ @@ -620,10 +620,10 @@ qemucaps2xmltest_SOURCES =3D \ $(NULL) qemucaps2xmltest_LDADD =3D $(qemu_LDADDS) =20 -qemucaps2xmlmock_la_SOURCES =3D \ +libqemucaps2xmlmock_la_SOURCES =3D \ qemucaps2xmlmock.c -qemucaps2xmlmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) -qemucaps2xmlmock_la_LIBADD =3D $(MOCKLIBS_LIBS) +libqemucaps2xmlmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +libqemucaps2xmlmock_la_LIBADD =3D $(MOCKLIBS_LIBS) =20 qemuagenttest_SOURCES =3D \ qemuagenttest.c \ @@ -780,15 +780,15 @@ EXTRA_DIST +=3D vmwarevertest.c endif ! WITH_VMWARE =20 if WITH_BHYVE -bhyvexml2argvmock_la_SOURCES =3D \ +libbhyvexml2argvmock_la_SOURCES =3D \ bhyvexml2argvmock.c -bhyvexml2argvmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) -bhyvexml2argvmock_la_LIBADD =3D $(MOCKLIBS_LIBS) +libbhyvexml2argvmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +libbhyvexml2argvmock_la_LIBADD =3D $(MOCKLIBS_LIBS) =20 -bhyveargv2xmlmock_la_SOURCES =3D \ +libbhyveargv2xmlmock_la_SOURCES =3D \ bhyveargv2xmlmock.c -bhyveargv2xmlmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) -bhyveargv2xmlmock_la_LIBADD =3D $(MOCKLIBS_LIBS) +libbhyveargv2xmlmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +libbhyveargv2xmlmock_la_LIBADD =3D $(MOCKLIBS_LIBS) =20 bhyve_LDADDS =3D ../src/libvirt_driver_bhyve_impl.la if WITH_STORAGE @@ -1035,9 +1035,9 @@ else ! WITH_QEMU vircapstest_LDADD =3D $(LDADDS) endif ! WITH_QEMU =20 -domaincapsmock_la_SOURCES =3D domaincapsmock.c -domaincapsmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) -domaincapsmock_la_LIBADD =3D $(MOCKLIBS_LIBS) +libdomaincapsmock_la_SOURCES =3D domaincapsmock.c +libdomaincapsmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +libdomaincapsmock_la_LIBADD =3D $(MOCKLIBS_LIBS) =20 domaincapstest_SOURCES =3D \ domaincapstest.c testutils.h testutils.c \ @@ -1072,20 +1072,20 @@ virnetdaemontest_SOURCES =3D \ testutils.h testutils.c virnetdaemontest_LDADD =3D $(LDADDS) =20 -virnetdaemonmock_la_SOURCES =3D \ +libvirnetdaemonmock_la_SOURCES =3D \ virnetdaemonmock.c -virnetdaemonmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) -virnetdaemonmock_la_LIBADD =3D $(MOCKLIBS_LIBS) +libvirnetdaemonmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +libvirnetdaemonmock_la_LIBADD =3D $(MOCKLIBS_LIBS) =20 virnetserverclienttest_SOURCES =3D \ virnetserverclienttest.c \ testutils.h testutils.c virnetserverclienttest_LDADD =3D $(LDADDS) =20 -virnetserverclientmock_la_SOURCES =3D \ +libvirnetserverclientmock_la_SOURCES =3D \ virnetserverclientmock.c -virnetserverclientmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) -virnetserverclientmock_la_LIBADD =3D $(MOCKLIBS_LIBS) +libvirnetserverclientmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +libvirnetserverclientmock_la_LIBADD =3D $(MOCKLIBS_LIBS) =20 virnettlscontexttest_SOURCES =3D \ virnettlscontexttest.c \ @@ -1157,19 +1157,19 @@ virportallocatortest_SOURCES =3D \ virportallocatortest.c testutils.h testutils.c virportallocatortest_LDADD =3D $(LDADDS) =20 -virportallocatormock_la_SOURCES =3D \ +libvirportallocatormock_la_SOURCES =3D \ virportallocatormock.c -virportallocatormock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) -virportallocatormock_la_LIBADD =3D $(MOCKLIBS_LIBS) +libvirportallocatormock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +libvirportallocatormock_la_LIBADD =3D $(MOCKLIBS_LIBS) =20 vircgrouptest_SOURCES =3D \ vircgrouptest.c testutils.h testutils.c vircgrouptest_LDADD =3D $(LDADDS) =20 -vircgroupmock_la_SOURCES =3D \ +libvircgroupmock_la_SOURCES =3D \ vircgroupmock.c -vircgroupmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) -vircgroupmock_la_LIBADD =3D $(MOCKLIBS_LIBS) +libvircgroupmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +libvircgroupmock_la_LIBADD =3D $(MOCKLIBS_LIBS) =20 vircryptotest_SOURCES =3D \ vircryptotest.c testutils.h testutils.c @@ -1183,44 +1183,44 @@ virpcitest_SOURCES =3D \ virpcitest.c testutils.h testutils.c virpcitest_LDADD =3D $(LDADDS) =20 -virpcimock_la_SOURCES =3D \ +libvirpcimock_la_SOURCES =3D \ virpcimock.c -virpcimock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) -virpcimock_la_LIBADD =3D $(MOCKLIBS_LIBS) +libvirpcimock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +libvirpcimock_la_LIBADD =3D $(MOCKLIBS_LIBS) =20 -virrandommock_la_SOURCES =3D \ +libvirrandommock_la_SOURCES =3D \ virrandommock.c -virrandommock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) -virrandommock_la_LIBADD =3D $(MOCKLIBS_LIBS) +libvirrandommock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +libvirrandommock_la_LIBADD =3D $(MOCKLIBS_LIBS) =20 -virhostcpumock_la_SOURCES =3D \ +libvirhostcpumock_la_SOURCES =3D \ virhostcpumock.c -virhostcpumock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) -virhostcpumock_la_LIBADD =3D $(MOCKLIBS_LIBS) +libvirhostcpumock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +libvirhostcpumock_la_LIBADD =3D $(MOCKLIBS_LIBS) =20 -virfilecachemock_la_SOURCES =3D \ +libvirfilecachemock_la_SOURCES =3D \ virfilecachemock.c -virfilecachemock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) -virfilecachemock_la_LIBADD =3D $(MOCKLIBS_LIBS) +libvirfilecachemock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +libvirfilecachemock_la_LIBADD =3D $(MOCKLIBS_LIBS) =20 if WITH_LINUX vircaps2xmltest_SOURCES =3D \ vircaps2xmltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper= .c vircaps2xmltest_LDADD =3D $(LDADDS) =20 -virnumamock_la_SOURCES =3D \ +libvirnumamock_la_SOURCES =3D \ virnumamock.c -virnumamock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) -virnumamock_la_LIBADD =3D $(MOCKLIBS_LIBS) +libvirnumamock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +libvirnumamock_la_LIBADD =3D $(MOCKLIBS_LIBS) =20 virresctrltest_SOURCES =3D \ virresctrltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c virresctrltest_LDADD =3D $(LDADDS) =20 -virfilemock_la_SOURCES =3D \ +libvirfilemock_la_SOURCES =3D \ virfilemock.c -virfilemock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) -virfilemock_la_LIBADD =3D $(MOCKLIBS_LIBS) +libvirfilemock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +libvirfilemock_la_LIBADD =3D $(MOCKLIBS_LIBS) else ! WITH_LINUX EXTRA_DIST +=3D vircaps2xmltest.c virnumamock.c virfilewrapper.c \ virfilewrapper.h virresctrltest.c virfilemock.c @@ -1246,10 +1246,10 @@ nssguesttest_LDADD =3D \ $(LDADDS) \ ../tools/nss/libnss_libvirt_guest_impl.la =20 -nssmock_la_SOURCES =3D \ +libnssmock_la_SOURCES =3D \ nssmock.c -nssmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) -nssmock_la_LIBADD =3D $(MOCKLIBS_LIBS) +libnssmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +libnssmock_la_LIBADD =3D $(MOCKLIBS_LIBS) =20 ## Intentionaly not linking with anything else. ## See the test source for more detailed explanation. @@ -1271,12 +1271,12 @@ else ! WITH_NSS EXTRA_DIST +=3D nsstest.c nssmock.c nsslinktest.c endif ! WITH_NSS =20 -virdeterministichashmock_la_SOURCES =3D \ +libvirdeterministichashmock_la_SOURCES =3D \ virdeterministichashmock.c -virdeterministichashmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) -virdeterministichashmock_la_LIBADD =3D $(MOCKLIBS_LIBS) +libvirdeterministichashmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +libvirdeterministichashmock_la_LIBADD =3D $(MOCKLIBS_LIBS) =20 -test_libraries +=3D virdeterministichashmock.la +test_libraries +=3D libvirdeterministichashmock.la =20 if WITH_YAJL virmacmaptest_SOURCES =3D \ @@ -1301,11 +1301,11 @@ virnetdevtest_SOURCES =3D \ virnetdevtest_CFLAGS =3D $(AM_CFLAGS) $(LIBNL_CFLAGS) virnetdevtest_LDADD =3D $(LDADDS) =20 -virnetdevmock_la_SOURCES =3D \ +libvirnetdevmock_la_SOURCES =3D \ virnetdevmock.c -virnetdevmock_la_CFLAGS =3D $(AM_CFLAGS) $(LIBNL_CFLAGS) -virnetdevmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) -virnetdevmock_la_LIBADD =3D $(MOCKLIBS_LIBS) +libvirnetdevmock_la_CFLAGS =3D $(AM_CFLAGS) $(LIBNL_CFLAGS) +libvirnetdevmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +libvirnetdevmock_la_LIBADD =3D $(MOCKLIBS_LIBS) =20 virrotatingfiletest_SOURCES =3D \ virrotatingfiletest.c testutils.h testutils.c @@ -1320,21 +1320,21 @@ virnetdevbandwidthtest_SOURCES =3D \ virnetdevbandwidthtest.c testutils.h testutils.c virnetdevbandwidthtest_LDADD =3D $(LDADDS) $(LIBXML_LIBS) =20 -virusbmock_la_SOURCES =3D virusbmock.c -virusbmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) -virusbmock_la_LIBADD =3D $(MOCKLIBS_LIBS) \ +libvirusbmock_la_SOURCES =3D virusbmock.c +libvirusbmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +libvirusbmock_la_LIBADD =3D $(MOCKLIBS_LIBS) \ $(PROBES_O) \ ../src/libvirt_util.la =20 -virnetdevbandwidthmock_la_SOURCES =3D \ +libvirnetdevbandwidthmock_la_SOURCES =3D \ virnetdevbandwidthmock.c -virnetdevbandwidthmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) -virnetdevbandwidthmock_la_LIBADD =3D $(MOCKLIBS_LIBS) +libvirnetdevbandwidthmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +libvirnetdevbandwidthmock_la_LIBADD =3D $(MOCKLIBS_LIBS) =20 -virtestmock_la_SOURCES =3D \ +libvirtestmock_la_SOURCES =3D \ virtestmock.c -virtestmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) -virtestmock_la_LIBADD =3D \ +libvirtestmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +libvirtestmock_la_LIBADD =3D \ $(MOCKLIBS_LIBS) \ $(PROBES_O) \ ../src/libvirt_util.la @@ -1350,11 +1350,11 @@ virdbustest_SOURCES =3D \ virdbustest_CFLAGS =3D $(AM_CFLAGS) $(DBUS_CFLAGS) virdbustest_LDADD =3D $(LDADDS) $(DBUS_LIBS) =20 -virdbusmock_la_SOURCES =3D \ +libvirdbusmock_la_SOURCES =3D \ virdbusmock.c -virdbusmock_la_CFLAGS =3D $(AM_CFLAGS) $(DBUS_CFLAGS) -virdbusmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) -virdbusmock_la_LIBADD =3D $(MOCKLIBS_LIBS) +libvirdbusmock_la_CFLAGS =3D $(AM_CFLAGS) $(DBUS_CFLAGS) +libvirdbusmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +libvirdbusmock_la_LIBADD =3D $(MOCKLIBS_LIBS) =20 virpolkittest_SOURCES =3D \ virpolkittest.c testutils.h testutils.c diff --git a/tests/bhyveargv2xmltest.c b/tests/bhyveargv2xmltest.c index d552364846..8e29225e31 100644 --- a/tests/bhyveargv2xmltest.c +++ b/tests/bhyveargv2xmltest.c @@ -205,7 +205,7 @@ mymain(void) return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } =20 -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/bhyveargv2xmlmock.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("bhyveargv2xml")) =20 #else =20 diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c index c84925c57b..14ceac052e 100644 --- a/tests/bhyvexml2argvtest.c +++ b/tests/bhyvexml2argvtest.c @@ -258,7 +258,7 @@ mymain(void) return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } =20 -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/bhyvexml2argvmock.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("bhyvexml2argv")) =20 #else =20 diff --git a/tests/bhyvexml2xmltest.c b/tests/bhyvexml2xmltest.c index e8a6867fcd..66394e2ae4 100644 --- a/tests/bhyvexml2xmltest.c +++ b/tests/bhyvexml2xmltest.c @@ -135,7 +135,7 @@ mymain(void) return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } =20 -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/bhyvexml2argvmock.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("bhyvexml2argv")) =20 #else =20 diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c index 45ecfe61ac..c9cbf6ef8a 100644 --- a/tests/domaincapstest.c +++ b/tests/domaincapstest.c @@ -488,8 +488,8 @@ mymain(void) =20 #if WITH_QEMU VIR_TEST_MAIN_PRELOAD(mymain, - abs_builddir "/.libs/domaincapsmock.so", - abs_builddir "/.libs/qemucpumock.so") + VIR_TEST_MOCK("domaincaps"), + VIR_TEST_MOCK("qemucpu")) #else -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/domaincapsmock.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("domaincaps")) #endif diff --git a/tests/fchosttest.c b/tests/fchosttest.c index 3ee1912926..05272a2e9e 100644 --- a/tests/fchosttest.c +++ b/tests/fchosttest.c @@ -382,4 +382,4 @@ mymain(void) return ret; } =20 -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virrandommock.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virrandom")) diff --git a/tests/libxlxml2domconfigtest.c b/tests/libxlxml2domconfigtest.c index 048e6c0431..3b3f63403e 100644 --- a/tests/libxlxml2domconfigtest.c +++ b/tests/libxlxml2domconfigtest.c @@ -221,7 +221,7 @@ mymain(void) return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } =20 -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/libxlmock.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("xl")) =20 #else =20 diff --git a/tests/nsstest.c b/tests/nsstest.c index 4118c31cef..734e4cbc07 100644 --- a/tests/nsstest.c +++ b/tests/nsstest.c @@ -190,7 +190,7 @@ mymain(void) return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } =20 -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/nssmock.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("nss")) #else int main(void) diff --git a/tests/qemucaps2xmltest.c b/tests/qemucaps2xmltest.c index 08dc598541..3b381251a0 100644 --- a/tests/qemucaps2xmltest.c +++ b/tests/qemucaps2xmltest.c @@ -217,4 +217,4 @@ mymain(void) return (data.ret =3D=3D 0) ? EXIT_SUCCESS : EXIT_FAILURE; } =20 -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/qemucaps2xmlmock.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("qemucaps2xml")) diff --git a/tests/qemucapsprobe.c b/tests/qemucapsprobe.c index 14c0ecad97..ae016c47c2 100644 --- a/tests/qemucapsprobe.c +++ b/tests/qemucapsprobe.c @@ -47,7 +47,7 @@ main(int argc, char **argv) virThread thread; virQEMUCapsPtr caps; =20 - VIR_TEST_PRELOAD(abs_builddir "/.libs/qemucapsprobemock.so"); + VIR_TEST_PRELOAD(VIR_TEST_MOCK("qemucapsprobe")); =20 if (argc !=3D 2) { fprintf(stderr, "%s QEMU_binary\n", argv[0]); diff --git a/tests/qemumemlocktest.c b/tests/qemumemlocktest.c index 42a4643338..c9484ac9cb 100644 --- a/tests/qemumemlocktest.c +++ b/tests/qemumemlocktest.c @@ -155,8 +155,7 @@ mymain(void) return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } =20 -VIR_TEST_MAIN_PRELOAD(mymain, - abs_builddir "/.libs/virpcimock.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virpci")) =20 #else =20 diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 522ff5a3d5..07832de3f1 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -3298,4 +3298,4 @@ mymain(void) return (ret =3D=3D 0) ? EXIT_SUCCESS : EXIT_FAILURE; } =20 -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virdeterministichashmoc= k.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virdeterministichash")) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 2554d848cf..1799eb3387 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2994,10 +2994,10 @@ mymain(void) } =20 VIR_TEST_MAIN_PRELOAD(mymain, - abs_builddir "/.libs/qemuxml2argvmock.so", - abs_builddir "/.libs/virrandommock.so", - abs_builddir "/.libs/qemucpumock.so", - abs_builddir "/.libs/virpcimock.so") + VIR_TEST_MOCK("qemuxml2argv"), + VIR_TEST_MOCK("virrandom"), + VIR_TEST_MOCK("qemucpu"), + VIR_TEST_MOCK("virpci")) =20 #else =20 diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index d7850a89d3..cf46bb330f 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1343,9 +1343,9 @@ mymain(void) } =20 VIR_TEST_MAIN_PRELOAD(mymain, - abs_builddir "/.libs/virpcimock.so", - abs_builddir "/.libs/virrandommock.so", - abs_builddir "/.libs/virdeterministichashmock.so") + VIR_TEST_MOCK("virpci"), + VIR_TEST_MOCK("virrandom"), + VIR_TEST_MOCK("virdeterministichash")) =20 #else =20 diff --git a/tests/testutils.c b/tests/testutils.c index 245b1832f6..1fda3763f9 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -962,8 +962,6 @@ virTestSetEnvPath(void) return ret; } =20 -#define TEST_MOCK (abs_builddir "/.libs/virtestmock.so") - int virTestMain(int argc, char **argv, int (*func)(void), @@ -981,7 +979,7 @@ int virTestMain(int argc, virLogOutputPtr *outputs =3D NULL; =20 if (getenv("VIR_TEST_FILE_ACCESS")) - VIR_TEST_PRELOAD(TEST_MOCK); + VIR_TEST_PRELOAD(VIR_TEST_MOCK("virtest")); =20 va_start(ap, func); while ((lib =3D va_arg(ap, const char *))) diff --git a/tests/testutils.h b/tests/testutils.h index 07dda6e355..e0fa2b2448 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -148,6 +148,10 @@ int virTestMain(int argc, return virTestMain(argc, argv, func, __VA_ARGS__, NULL); \ } =20 +#define MOCK_EXT ".so" + +#define VIR_TEST_MOCK(mock) (abs_builddir "/.libs/lib" mock "mock" MOCK_EX= T) + virCapsPtr virTestGenericCapsInit(void); int virTestCapsBuildNUMATopology(virCapsPtr caps, int seq); diff --git a/tests/vircaps2xmltest.c b/tests/vircaps2xmltest.c index fc112db0bc..41e84a3b25 100644 --- a/tests/vircaps2xmltest.c +++ b/tests/vircaps2xmltest.c @@ -116,4 +116,4 @@ mymain(void) return ret; } =20 -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virnumamock.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virnuma")) diff --git a/tests/vircgrouptest.c b/tests/vircgrouptest.c index 20f4c57b04..e862b132f0 100644 --- a/tests/vircgrouptest.c +++ b/tests/vircgrouptest.c @@ -1136,7 +1136,7 @@ mymain(void) return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } =20 -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/vircgroupmock.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("vircgroup")) =20 #else int diff --git a/tests/vircryptotest.c b/tests/vircryptotest.c index 6841d74901..42ef0b8900 100644 --- a/tests/vircryptotest.c +++ b/tests/vircryptotest.c @@ -179,4 +179,4 @@ mymain(void) } =20 /* Forces usage of not so random virRandomBytes */ -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virrandommock.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virrandom")) diff --git a/tests/virfilecachetest.c b/tests/virfilecachetest.c index 08062d66e3..a17086e004 100644 --- a/tests/virfilecachetest.c +++ b/tests/virfilecachetest.c @@ -233,4 +233,4 @@ mymain(void) return ret !=3D 0 ? EXIT_FAILURE : EXIT_SUCCESS; } =20 -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virfilecachemock.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virfilecache")) diff --git a/tests/virfiletest.c b/tests/virfiletest.c index aa4c3435e5..14be2d9d60 100644 --- a/tests/virfiletest.c +++ b/tests/virfiletest.c @@ -464,7 +464,7 @@ mymain(void) } =20 #ifdef __linux__ -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virfilemock.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virfile")) #else VIR_TEST_MAIN(mymain) #endif diff --git a/tests/virfirewalltest.c b/tests/virfirewalltest.c index 7c586877d3..78685a3bf4 100644 --- a/tests/virfirewalltest.c +++ b/tests/virfirewalltest.c @@ -1198,7 +1198,7 @@ mymain(void) } =20 # if WITH_DBUS -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virdbusmock.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virdbus")) # else VIR_TEST_MAIN(mymain) # endif diff --git a/tests/virhostcputest.c b/tests/virhostcputest.c index bb60dd3ffc..9ee0d2f15b 100644 --- a/tests/virhostcputest.c +++ b/tests/virhostcputest.c @@ -276,6 +276,6 @@ mymain(void) return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } =20 -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virhostcpumock.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virhostcpu")) =20 #endif /* __linux__ */ diff --git a/tests/virhostdevtest.c b/tests/virhostdevtest.c index f860426678..d0859a421c 100644 --- a/tests/virhostdevtest.c +++ b/tests/virhostdevtest.c @@ -597,7 +597,7 @@ mymain(void) return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } =20 -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virpcimock.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virpci")) #else int main(void) diff --git a/tests/viriscsitest.c b/tests/viriscsitest.c index cc552a5cfe..1ce039425b 100644 --- a/tests/viriscsitest.c +++ b/tests/viriscsitest.c @@ -365,6 +365,5 @@ mymain(void) return EXIT_SUCCESS; } =20 -VIR_TEST_MAIN_PRELOAD(mymain, - abs_builddir "/.libs/virrandommock.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virrandom")) #endif /* WIN32 */ diff --git a/tests/virmacmaptest.c b/tests/virmacmaptest.c index 884dabab82..995aff1178 100644 --- a/tests/virmacmaptest.c +++ b/tests/virmacmaptest.c @@ -232,4 +232,4 @@ mymain(void) return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } =20 -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virdeterministichashmoc= k.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virdeterministichash")) diff --git a/tests/virnetdaemontest.c b/tests/virnetdaemontest.c index 816bfe05d4..0a75568902 100644 --- a/tests/virnetdaemontest.c +++ b/tests/virnetdaemontest.c @@ -416,7 +416,7 @@ mymain(void) =20 return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virnetdaemonmock.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virnetdaemon")) #else static int mymain(void) diff --git a/tests/virnetdevbandwidthtest.c b/tests/virnetdevbandwidthtest.c index 2c0b6a6713..59647173c3 100644 --- a/tests/virnetdevbandwidthtest.c +++ b/tests/virnetdevbandwidthtest.c @@ -166,4 +166,4 @@ mymain(void) return ret; } =20 -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virnetdevbandwidthmock.= so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virnetdevbandwidth")) diff --git a/tests/virnetdevtest.c b/tests/virnetdevtest.c index 24fb4d35e0..5d266a28ee 100644 --- a/tests/virnetdevtest.c +++ b/tests/virnetdevtest.c @@ -82,7 +82,7 @@ mymain(void) return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } =20 -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virnetdevmock.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virnetdev")) #else int main(void) diff --git a/tests/virnetserverclienttest.c b/tests/virnetserverclienttest.c index cb5071b2d9..4d7c6555b9 100644 --- a/tests/virnetserverclienttest.c +++ b/tests/virnetserverclienttest.c @@ -170,7 +170,7 @@ mymain(void) =20 return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virnetserverclientmock.= so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virnetserverclient")) #else static int mymain(void) diff --git a/tests/virnettlscontexttest.c b/tests/virnettlscontexttest.c index 07910c2749..9a0d947c1b 100644 --- a/tests/virnettlscontexttest.c +++ b/tests/virnettlscontexttest.c @@ -630,7 +630,7 @@ mymain(void) return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } =20 -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virrandommock.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virrandom")) =20 #else =20 diff --git a/tests/virnettlssessiontest.c b/tests/virnettlssessiontest.c index 41abbe7eaf..8d89b16814 100644 --- a/tests/virnettlssessiontest.c +++ b/tests/virnettlssessiontest.c @@ -484,7 +484,7 @@ mymain(void) return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } =20 -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virrandommock.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virrandom")) =20 #else =20 diff --git a/tests/virpcitest.c b/tests/virpcitest.c index 0bd37268ef..12b142700a 100644 --- a/tests/virpcitest.c +++ b/tests/virpcitest.c @@ -420,7 +420,7 @@ mymain(void) return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } =20 -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virpcimock.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virpci")) #else int main(void) diff --git a/tests/virpolkittest.c b/tests/virpolkittest.c index 94a6daae0c..ce1ff92bf2 100644 --- a/tests/virpolkittest.c +++ b/tests/virpolkittest.c @@ -347,7 +347,7 @@ mymain(void) return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } =20 -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virdbusmock.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virdbus")) =20 #else /* ! __ELF__ */ int diff --git a/tests/virportallocatortest.c b/tests/virportallocatortest.c index 211de705a4..c695b26859 100644 --- a/tests/virportallocatortest.c +++ b/tests/virportallocatortest.c @@ -182,7 +182,7 @@ mymain(void) return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } =20 -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virportallocatormock.so= ") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virportallocator")) #else /* defined(__linux__) && defined(RTLD_NEXT) */ int main(void) diff --git a/tests/virsystemdtest.c b/tests/virsystemdtest.c index 2dafce2764..3add1ab56f 100644 --- a/tests/virsystemdtest.c +++ b/tests/virsystemdtest.c @@ -783,7 +783,7 @@ mymain(void) return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } =20 -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virdbusmock.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virdbus")) =20 #else /* ! (WITH_DBUS && __linux__) */ int diff --git a/tests/virusbtest.c b/tests/virusbtest.c index 564c4b44a4..1f04f283f5 100644 --- a/tests/virusbtest.c +++ b/tests/virusbtest.c @@ -288,4 +288,4 @@ mymain(void) return EXIT_SUCCESS; } =20 -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virusbmock.so") +VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virusb")) --=20 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 06:55:23 2024 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=1566404058; cv=none; d=zoho.com; s=zohoarc; b=k108fkrm9M3ZVNZSts04eUm6lqmsubzNYS26/ay5O2Jzs3sqFZPnUpDxRgBOWL9YZlvqOlrYiIl+6LJugnGColHLWpGt2z27NTNICwvPJRKYfXiYOYDy+dHJ8J2BA3KgQtAoGZduuapbm1HOW3Wf5a3CmBuBzzgcPkXm9T1kt3I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566404058; 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=jkLRmOt2ytcVuL009Hplg9NmjjCLsp1LNUU5Jz0mc5Q=; b=iOQf++215p7PiHL5xbLvxLsMsNzpVdXSnUFmvG48QoqmDdWmAWpkh6HUmVZTwEyipKeHTNxQpkiLU1QY+RNws5kmIXZ73bp77P+APh+tGNStifzjdQUihwS7l2Q9wmecQiCdeixO+MEZ0oRLjqcgw+TXfLiUqWsHzETN/2WnN04= 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 1566404058959559.377338137149; Wed, 21 Aug 2019 09:14:18 -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 D4D0E30020D7; Wed, 21 Aug 2019 16:14:17 +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 B54B45D9D3; Wed, 21 Aug 2019 16:14:17 +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 7DF05180BA9E; Wed, 21 Aug 2019 16:14:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7LGE3JL016836 for ; Wed, 21 Aug 2019 12:14:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id 34B041001B09; Wed, 21 Aug 2019 16:14:03 +0000 (UTC) Received: from mx1.redhat.com (ext-mx27.extmail.prod.ext.phx2.redhat.com [10.5.110.68]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2F4FE1001B07 for ; Wed, 21 Aug 2019 16:14:00 +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 24882A2F6BF for ; Wed, 21 Aug 2019 16:13:54 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id B7ACC42EDE for ; Wed, 21 Aug 2019 16:13:52 +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 xJScQtk67ALW for ; Wed, 21 Aug 2019 19:13:51 +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 9236342ECD for ; Wed, 21 Aug 2019 19:13:50 +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:50 +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= 1566404031; x=1568218432; bh=POXy1YBHZ7XCfYvjMVWZNSexWOCUs/iNqMP GUzxyESY=; b=BOhFhiGrBwvqLtqnRPNge24D0HDLmIPptrDoLysFn5lgDa8vbcV 16EUhHM+cZzbGFiUjZj/hiN1y1CDlbd1poFVwKH/PVnH/ALY/PdzxnEZNoxu7itP gVq+ggG8VcB4V+mhmmvVe2ECW2iaGgeL4R1ABGCBKEqc99bwRyLkUg/A= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Aug 2019 19:13:17 +0300 Message-ID: <20190821161323.1583-6-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.6.2 (mx1.redhat.com [10.5.110.68]); Wed, 21 Aug 2019 16:13:54 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.68]); Wed, 21 Aug 2019 16:13:54 +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.84 on 10.5.110.68 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCH 05/11] tests: Remove -module flag for mocks 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.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 21 Aug 2019 16:14:18 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" macOS has two kinds of loadable libraries: MH_BUNDLE, and MH_DYLIB. bundle is used for plugins that are loaded with dlopen/dlsym/dlclose. And there's no way to preload a bundle into an application. dynamic linker (dyld) will reject it when finds it in DYLD_INSERT_LIBRARIES. Unfortunately, a bundle is built if -module flag is provided to libtool. The flag has been removed to build dylibs with ".dylib" suffix. Signed-off-by: Roman Bolshakov Reviewed-by: Daniel P. Berrang=C3=A9 --- tests/Makefile.am | 2 +- tests/testutils.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 713dc30de3..460efb6b7b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -48,7 +48,7 @@ AM_CFLAGS =3D \ AM_LDFLAGS =3D \ -export-dynamic =20 -MOCKLIBS_LDFLAGS =3D -module -avoid-version \ +MOCKLIBS_LDFLAGS =3D -avoid-version \ -rpath /evil/libtool/hack/to/force/shared/lib/creation \ $(MINGW_EXTRA_LDFLAGS) =20 diff --git a/tests/testutils.h b/tests/testutils.h index e0fa2b2448..7660101991 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -119,8 +119,10 @@ int virTestMain(int argc, =20 #ifdef __APPLE__ # define PRELOAD_VAR "DYLD_INSERT_LIBRARIES" +# define MOCK_EXT ".dylib" #else # define PRELOAD_VAR "LD_PRELOAD" +# define MOCK_EXT ".so" #endif =20 #define VIR_TEST_PRELOAD(lib) \ @@ -148,8 +150,6 @@ int virTestMain(int argc, return virTestMain(argc, argv, func, __VA_ARGS__, NULL); \ } =20 -#define MOCK_EXT ".so" - #define VIR_TEST_MOCK(mock) (abs_builddir "/.libs/lib" mock "mock" MOCK_EX= T) =20 virCapsPtr virTestGenericCapsInit(void); --=20 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 06:55:23 2024 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=1566404052; cv=none; d=zoho.com; s=zohoarc; b=ZjO6k9d1VWajsTBdH6gySs06+bAbUuAgN54KVW3M3nD/Cq/BaQ6CIgSANESBNUqz68uEpDbwVMjtGYKFvvtsdcpQmhN17MJodBUL0qYjrLLZ2YnVuBkQ9wpv8zBFbnOxE8T2Vcdcz+YYj85aq6c+IYZHgLR/j2/E5m1fE1F7BDc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566404052; 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=NAFf139XxdGsXE8m4yFhGkubjwZ4N0/Qw3Cy2GznwgY=; b=oQTLTRCxF1QQXbMqGisStrgprQUI+rtE37L+Q1E5n/fUWuLKMTSBNsrwf/5/lJyOPQrq1/9OpPHpancKflb2VZwMQwSmo6N92W7ZuBNgwQFT/1ZZqw+NgQe4c5kcR0KFS0kZh+hkMWbucMYG8w4WeIHgSvIVoA9dicZNtnKYmh8= 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 1566404052696644.9687980997747; Wed, 21 Aug 2019 09:14:12 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 979E030613CC; Wed, 21 Aug 2019 16:14:11 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7571F60BF3; Wed, 21 Aug 2019 16:14:11 +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 3A2A52551E; Wed, 21 Aug 2019 16:14:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7LGEAX7016864 for ; Wed, 21 Aug 2019 12:14:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 66915381A5; Wed, 21 Aug 2019 16:14:10 +0000 (UTC) Received: from mx1.redhat.com (ext-mx19.extmail.prod.ext.phx2.redhat.com [10.5.110.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 60DCE2B9E3 for ; Wed, 21 Aug 2019 16:14:07 +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 24F86307D978 for ; Wed, 21 Aug 2019 16:14:00 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id BCCA842EDF for ; Wed, 21 Aug 2019 16:13:53 +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 qxhljZ0CLxZv for ; Wed, 21 Aug 2019 19:13:52 +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 7F3CA42ED2 for ; Wed, 21 Aug 2019 19:13:51 +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:50 +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= 1566404032; x=1568218433; bh=KpZvDAVO2SgSGLPhhXxYPqYyVrwVTnr0Vb/ m7KWEAl0=; b=jpiCS9Hpn7J0PThcR3//qwk/zn+jmY6gQm/YaYPNFSh5FHHxHPC bGghTSQDlQGC9Q3bqUD0ZMz1qhq650O/Z04OMY2q5Y1bZo3GUu05k3Kgpbb7VrIL zHsBfqcsHYcnCLIaLwYR3qRUGlhB8JEapAr0439btC5phwHe3a+0A+Sk= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Aug 2019 19:13:18 +0300 Message-ID: <20190821161323.1583-7-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.48]); Wed, 21 Aug 2019 16:14:00 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 21 Aug 2019 16:14:00 +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.84 on 10.5.110.48 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCH 06/11] tests: Drop /private CWD prefix in commandhelper 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 21 Aug 2019 16:14:12 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" /tmp is a symbolic link to /private/tmp on macOS. That causes failures in commandtest, because getcwd returns /private/tmp and the expected output doesn't match to "CWD: /tmp". Rathern than making a copy of commanddata solely for macOS, the /private prefix is stripped. Signed-off-by: Roman Bolshakov Reviewed-by: Daniel P. Berrang=C3=A9 --- tests/commandhelper.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/commandhelper.c b/tests/commandhelper.c index 1312f3ee52..358c37e014 100644 --- a/tests/commandhelper.c +++ b/tests/commandhelper.c @@ -130,7 +130,16 @@ int main(int argc, char **argv) { if (strlen(cwd) > strlen(".../commanddata") && STREQ(cwd + strlen(cwd) - strlen("/commanddata"), "/commanddata")) strcpy(cwd, ".../commanddata"); +#ifdef __APPLE__ + char *noprivateprefix =3D NULL; + if (strstr(cwd, "/private")) + noprivateprefix =3D cwd + strlen("/private"); + else + noprivateprefix =3D cwd; + fprintf(log, "CWD:%s\n", noprivateprefix); +#else fprintf(log, "CWD:%s\n", cwd); +#endif free(cwd); =20 fprintf(log, "UMASK:%04o\n", umask(0)); --=20 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 06:55:23 2024 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=1566404060; cv=none; d=zoho.com; s=zohoarc; b=VUak99jXkAlJ0z0VdixfpJEGV43s6CyHwPZjF4n6XnDE274cqWrQZ4PtVG4R9RQ49Tk5Ao+ak1JkwQdXrKJqIj44bLhWQG3Oq+gPpq2lFFH/iZ6RWmSlnYqQOk5uF95A8s/l3REVCXcZHRz2WkaafSRTkX2LOMzFQmSDqA7+//I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566404060; 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=4rpJQvXdB4MJJ4zO6d8oLb/dlmAirB33Yxp1GeGb2x4=; b=jERd6qitnnaoGHMHVycWF9cnOmMlwJX2hBOiZAr6Qoi97BhwMAuYLVNhJHR7HqPDC7QJRKaGNjQrB+fwD6RWwRDQM3Stw5WtbnAd8lcqufdt0EGSVapqlDZPWVQx5Hc9529XasHZq9ijl2tBboHidmxAPAYa8t0vqGEHju7/+cY= 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 1566404060862517.9245884429484; Wed, 21 Aug 2019 09:14:20 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8E8B03023087; Wed, 21 Aug 2019 16:14:19 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6896B381A5; Wed, 21 Aug 2019 16:14:19 +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 345D924F30; Wed, 21 Aug 2019 16:14:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7LGEDnl016885 for ; Wed, 21 Aug 2019 12:14:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id DDEBD17D94; Wed, 21 Aug 2019 16:14:13 +0000 (UTC) Received: from mx1.redhat.com (ext-mx29.extmail.prod.ext.phx2.redhat.com [10.5.110.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D82C55DD6F for ; Wed, 21 Aug 2019 16:14:13 +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 143AF1918645 for ; Wed, 21 Aug 2019 16:14:01 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id CE23442EE3 for ; Wed, 21 Aug 2019 16:13:54 +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 Ylrzky6zSfIs for ; Wed, 21 Aug 2019 19:13:53 +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 651C742EDA for ; Wed, 21 Aug 2019 19:13:52 +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:52 +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= 1566404033; x=1568218434; bh=UD0BsXm7WgW3o/KSLiUQiPSYNXANO0u0/iE E8VUYhkE=; b=HVtavTo0dwkJtAg+oN2yru3sWA4fgz0s1zf6Ox75ig8nwb1Mu0u hnJ0CKlrKvDNNcxDI7jD5m8CZJfENi9vsehmEPSfV+F0QwT0NeEispH+7HztiYNZ K4J37jjwjdIGTPHgv0r8gc7XDeQdSKgzCWlp5jhtUGW5ipwKPzpJusGk= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Aug 2019 19:13:19 +0300 Message-ID: <20190821161323.1583-8-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.6.2 (mx1.redhat.com [10.5.110.70]); Wed, 21 Aug 2019 16:14:01 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.70]); Wed, 21 Aug 2019 16:14:01 +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.84 on 10.5.110.70 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCH 07/11] build: Use flat namespace for libvirt 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 21 Aug 2019 16:14:20 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" >From ld(1): By default all references resolved to a dynamic library record the library to which they were resolved. At runtime, dyld uses that information to directly resolve symbols. The alternative is to use the -flat_namespace option. With flat namespace, the library is not recorded. At runtime, dyld will search each dynamic library in load order when resolving symbols. This is slower, but more like how other operating systems resolve symbols. That fixes the set of tests that preload a mock library to replace library symbols: qemublocktest qemumonitorjsontest viriscsitest virmacmaptest virnetserverclienttest Signed-off-by: Roman Bolshakov Reviewed-by: Daniel P. Berrang=C3=A9 --- configure.ac | 1 + src/Makefile.am | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index f41c6d5d86..852b464e97 100644 --- a/configure.ac +++ b/configure.ac @@ -212,6 +212,7 @@ fi =20 AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" =3D "yes"]) AM_CONDITIONAL([WITH_FREEBSD], [test "$with_freebsd" =3D "yes"]) +AM_CONDITIONAL([WITH_MACOS], [test "$with_macos" =3D "yes"]) =20 # We don't support the daemon yet if test "$with_win" =3D "yes" ; then diff --git a/src/Makefile.am b/src/Makefile.am index 817a7ecf34..adaf61350a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -579,8 +579,13 @@ libvirt_la_LDFLAGS =3D \ -version-info $(LIBVIRT_VERSION_INFO) \ $(LIBVIRT_NODELETE) \ $(NO_UNDEFINED_LDFLAGS) \ - $(AM_LDFLAGS) \ - $(NULL) + $(AM_LDFLAGS) +if WITH_MACOS +# macOS has two-level namespaces by default. +# Override it to allow symbol replacement with DYLD_INSERT_LIBRARIES +libvirt_la_LDFLAGS +=3D -Wl,-flat_namespace +endif WITH_MACOS +libvirt_la_LDFLAGS +=3D $(NULL) libvirt_la_BUILT_LIBADD +=3D ../gnulib/lib/libgnu.la libvirt_la_LIBADD +=3D \ $(DRIVER_MODULES_LIBS) \ --=20 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 06:55:23 2024 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=1566404055; cv=none; d=zoho.com; s=zohoarc; b=Rfc/0wJVMbi5MpFqso45+nng7NpOdhTcVYHmtZmGEt13es3EYlxf2foUc3smMknWF3Dw4N9Zn6CgIXMGKxj8Ltjtv9xgZinD4mkoaJslgXngIUdOFUXSTf/XJOM66j3dIP3xfvhSHGWvKD9LsnkIP3ahj3X0HceUaaYsgyns5M8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566404055; 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=eJ3axQ5b8I6JpEHGNV6R34jhizEQJ1tEbhDZ3lPk70A=; b=kVZbfZkhRtLKkJE8B7aBdrO1IQAmyij9qUYYPYFNpDoDD2wSdo9Kb7iNTjAChoqDBM8XFXYdK9iKm8gTFUbvg3kkiugMfFWFkyEZS7/BghApVdz/Y0b+ONl6EgKlQAWbdbokocz+KbXuL2aWzbxvVIgdiJtvmlptKHc8JBCyu0Q= 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 1566404055943834.6337876943115; Wed, 21 Aug 2019 09:14:15 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 979763008958; Wed, 21 Aug 2019 16:14:14 +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 716FB60619; Wed, 21 Aug 2019 16:14:14 +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 3B4F9180BA99; Wed, 21 Aug 2019 16:14:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7LGEBvG016874 for ; Wed, 21 Aug 2019 12:14:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6BFFF51176; Wed, 21 Aug 2019 16:14:11 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 66A292B9E3 for ; Wed, 21 Aug 2019 16:14:11 +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 6DA152D6A0B for ; Wed, 21 Aug 2019 16:14:01 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id 9CDB142EDA for ; Wed, 21 Aug 2019 16:13:55 +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 ftuCBmB4s6ih for ; Wed, 21 Aug 2019 19:13:54 +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 526ED42ED7 for ; Wed, 21 Aug 2019 19:13:53 +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:52 +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= 1566404034; x=1568218435; bh=+aNVltmfFaHwy8tKXezySUgtruD7OOsFpIB d5INw8SU=; b=QCsReltHGGkBIJ6hVtg42o3rcDK8BnqwRfxT1lmfwySwWeJXM9J OIlGsZdZfBtpA7SeZ+/Hl+M43XLDt80t/b7RXN5v+RyO3HYi1gcMSr+6yt1f1DUI rP8wQlJKiy6RMj3yJFXR7SnVokDdihK8FGt02/WocLVGJgULPXzQCjrw= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Aug 2019 19:13:20 +0300 Message-ID: <20190821161323.1583-9-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.29]); Wed, 21 Aug 2019 16:14:01 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 21 Aug 2019 16:14:01 +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.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCH 08/11] tests: Lookup extended stat/lstat in mocks 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 21 Aug 2019 16:14:15 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" macOS syscall interface (/usr/lib/system/libsystem_kernel.dylib) has three kinds of stat but only one of them can be used to fill "struct stat": stat$INODE64. virmockstathelpers looks up regular stat instead of stat$INODE64. That causes a failure in qemufirmwaretest because "struct stat" is laid out differently from the values returned by stat. Introduce VIR_MOCK_REAL_INIT_ALIASED that can be used to lookup stat$INODE64 and lstat$INODE64 and use it to setup real functions on macOS. Signed-off-by: Roman Bolshakov Reviewed-by: Daniel P. Berrang=C3=A9 --- tests/virmock.h | 10 ++++++++++ tests/virmockstathelpers.c | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/tests/virmock.h b/tests/virmock.h index 74bb0d5b15..7520bb5d6e 100644 --- a/tests/virmock.h +++ b/tests/virmock.h @@ -288,3 +288,13 @@ abort(); \ } \ } while (0) + +#define VIR_MOCK_REAL_INIT_ALIASED(name, alias) \ + do { \ + if (real_##name =3D=3D NULL && \ + !(real_##name =3D dlsym(RTLD_NEXT, \ + alias))) { \ + fprintf(stderr, "Missing symbol '" alias "'\n"); \ + abort(); \ + } \ + } while (0) diff --git a/tests/virmockstathelpers.c b/tests/virmockstathelpers.c index 0bbea4b437..1f6f831bed 100644 --- a/tests/virmockstathelpers.c +++ b/tests/virmockstathelpers.c @@ -138,7 +138,11 @@ static void virMockStatInit(void) debug =3D getenv("VIR_MOCK_STAT_DEBUG"); =20 #ifdef MOCK_STAT +#ifdef __APPLE__ + VIR_MOCK_REAL_INIT_ALIASED(stat, "stat$INODE64"); +#else VIR_MOCK_REAL_INIT(stat); +#endif fdebug("real stat %p\n", real_stat); #endif #ifdef MOCK_STAT64 @@ -154,7 +158,11 @@ static void virMockStatInit(void) fdebug("real __xstat64 %p\n", real___xstat64); #endif #ifdef MOCK_LSTAT +#ifdef __APPLE__ + VIR_MOCK_REAL_INIT_ALIASED(stat, "lstat$INODE64"); +#else VIR_MOCK_REAL_INIT(lstat); +#endif fdebug("real lstat %p\n", real_lstat); #endif #ifdef MOCK_LSTAT64 --=20 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 06:55:23 2024 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=1566404066; cv=none; d=zoho.com; s=zohoarc; b=Rj97IWijvGq/6Ew1+CTvm1OrciZZv18unb3PdUrnqDzkHgXOlq92Tc+YMckcN7dyQjA0ha7L3L4KyEncuK/xAShPC90svyVlGZ7/FGrHQQ0wF2E8XAr+etjEABfjF5IYz/ce+3QEVB4dH6AOBxtWUSs76OBEFhV3IwaK9eEp1Kk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566404066; 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=8wmzrOscq3CPcUBTqUCrqDa05RNXc349ZrMbfIW6zIk=; b=BqACfnW3iaCmCvNnFwC8RQkBF8yg1HhP7XwY2gpgIvJzBZA+Rdw2o6SEyoDxuMf4yUAIG0KdAVVw66WIbjwt2rPOZkyEUJ1CoOnnxXXsYWREVt81UGAmhK1eR3JkAMoFRwM2qJpgaiwWpETEXWIyyDdQAjgrfkRmX1lijVdEOZk= 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 1566404066008155.83178596887308; Wed, 21 Aug 2019 09:14:26 -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 A9512302C074; Wed, 21 Aug 2019 16:14:24 +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 85E7B17D39; Wed, 21 Aug 2019 16:14:24 +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 4D925180BAA1; Wed, 21 Aug 2019 16:14:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7LGEEAC016890 for ; Wed, 21 Aug 2019 12:14:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4B8E160623; Wed, 21 Aug 2019 16:14:14 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4607360603 for ; Wed, 21 Aug 2019 16:14:11 +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 DC25881F13 for ; Wed, 21 Aug 2019 16:14:01 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id CA5C842EE4 for ; Wed, 21 Aug 2019 16:13:55 +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 NB5H6TacNfLE for ; Wed, 21 Aug 2019 19:13:54 +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 0C86A42ED2 for ; Wed, 21 Aug 2019 19:13:54 +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:53 +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= 1566404034; x=1568218435; bh=oTqyWWU9rrXRDR2cij/M/rzL3N54g2OnyjA hXBgTiPA=; b=osMN5/85nYMDazXTKaNdHtiqtaqECDowtRY0rDHVOGZ6mqDdMED 7P1Rb24falHLSbWb5L4aF+T8RcTzcn/DS5mhRKApqIrbohQpKFQFpyOS+BpU4lIv e8b6Nvq38/6GlVoW3ThOz5jaeISCSPikHY69rmpWb/KWTTpd6wPsTJR0= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Aug 2019 19:13:21 +0300 Message-ID: <20190821161323.1583-10-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.25]); Wed, 21 Aug 2019 16:14:02 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 21 Aug 2019 16:14:02 +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.83 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCH 09/11] tests: Use flat namespace 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.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 21 Aug 2019 16:14:25 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Test executables and mocks have assumption that any symbol can be replaced with LD_PRELOAD. That's not a case for macOS unless flat namespace is used, because every external symbol reference records the library to be looked up. And the symbols cannot be replaced unless dyld interposing is used. Setting DYLD_FORCE_FLAT_NAMESPACE changes symbol lookup behaviour to be similar to Linux dynamic linker. It's more lightweight solution than explicitly decorating all mock symbols as interpositions and building libvirt as interposable dynamic library. This fixes vircryptotest and allows to proceed other tests that rely on mocks a little bit further. Signed-off-by: Roman Bolshakov --- tests/testutils.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/testutils.h b/tests/testutils.h index 7660101991..b46bc86d84 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -119,9 +119,12 @@ int virTestMain(int argc, =20 #ifdef __APPLE__ # define PRELOAD_VAR "DYLD_INSERT_LIBRARIES" +# define FORCE_FLAT_NAMESPACE \ + setenv("DYLD_FORCE_FLAT_NAMESPACE", "1", 1); # define MOCK_EXT ".dylib" #else # define PRELOAD_VAR "LD_PRELOAD" +# define FORCE_FLAT_NAMESPACE # define MOCK_EXT ".so" #endif =20 @@ -141,6 +144,7 @@ int virTestMain(int argc, return EXIT_FAILURE; \ } \ setenv(PRELOAD_VAR, newenv, 1); \ + FORCE_FLAT_NAMESPACE \ 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 From nobody Sat May 4 06:55:23 2024 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=1566404058; cv=none; d=zoho.com; s=zohoarc; b=AVBH5Aauyn6IH7WeUaC8mkKpI3ANA2akhdZRw2pEeehFZfrPPubx6qIs4dhLiCp+2v9L0gBA4Lp8wsGfxxSwJZpQS7TIbeNgZvwLzZHBuayE6p8otrxrSvOxySDoSAq8ISNqnCKbMl3Q6yc45wtsnMrAjqpMdRAY5mA+8/L2Jew= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566404058; 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=Ymhnymu3NRRYJHGvYIaemw1OjLkIdBWgZDZUXwsyYCQ=; b=Vd9fIqmCHm8R0kseafPMIxmGmIbQKLO4TOi4D7OXJ5JPGc6vdbpIXOIqxwZrduY0RNGUT0hP/1buoR7A8ZsYsPSVuBrYzPF6gUgoTdg9DFamT1QJqfVG+74u1l9frEkZewDn/aOH9kiTiSlA5MykU6LWW4yJpkb7YujpEcQnzH4= 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 1566404058041305.5416526526908; Wed, 21 Aug 2019 09:14:18 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BA713970DA; Wed, 21 Aug 2019 16:14:16 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8E4ED1001B09; Wed, 21 Aug 2019 16:14:16 +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 4916C24FDF; Wed, 21 Aug 2019 16:14:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7LGEAl7016869 for ; Wed, 21 Aug 2019 12:14:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id EAF2A79B3; Wed, 21 Aug 2019 16:14:10 +0000 (UTC) Received: from mx1.redhat.com (ext-mx19.extmail.prod.ext.phx2.redhat.com [10.5.110.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E651E799C for ; Wed, 21 Aug 2019 16:14:10 +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 DC6B1307D9CF for ; Wed, 21 Aug 2019 16:14:01 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id A0DE042ED2 for ; Wed, 21 Aug 2019 16:13:56 +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 kXAAG2_DDkeA for ; Wed, 21 Aug 2019 19:13:55 +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 CC34542ED9 for ; Wed, 21 Aug 2019 19:13:54 +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:54 +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= 1566404035; x=1568218436; bh=rYxAoq7H47nOi1nrQwnzhtoVP977IuBHTJ3 7D1xXWTY=; b=EZJCsEW3PMezqc7WG1cOdhk8NfYLV6piZ05j8MyuB1u9aLexAFg b4aTEf09kM1m8DgOCr8cbRmled9oSxmGdopgyLMvEJcTP8mZNFZLXohCIFjBuVXS xDET1X7K9ElOyaDWCF9q3ldedYFn1abS+rnX1CYjuqKAb+UELntwrUOI= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Aug 2019 19:13:22 +0300 Message-ID: <20190821161323.1583-11-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.48]); Wed, 21 Aug 2019 16:14:02 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 21 Aug 2019 16:14:02 +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.84 on 10.5.110.48 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCH 10/11] tests: Avoid gnulib replacements in mocks 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 21 Aug 2019 16:14:17 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" gnulib headers change stat, lstat and open to replacement functions, even for function definitions. This effectively disables standard library overrides in virfilewrapper and virmockstathelpers since they are never reached. Rename the functions and provide a declartion that uses correct assembler name for the mocks. This fixes firmware lookup in domaincapstest on macOS. Signed-off-by: Roman Bolshakov Reviewed-by: Daniel P. Berrang=C3=A9 --- tests/virfilewrapper.c | 5 +++++ tests/virmockstathelpers.c | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/tests/virfilewrapper.c b/tests/virfilewrapper.c index 067cb30657..20cb2f4464 100644 --- a/tests/virfilewrapper.c +++ b/tests/virfilewrapper.c @@ -157,7 +157,12 @@ int access(const char *path, int mode) return real_access(newpath ? newpath : path, mode); } =20 +#ifdef __APPLE__ +int _open(const char *path, int flags, ...) __asm("_open"); +int _open(const char *path, int flags, ...) +#else int open(const char *path, int flags, ...) +#endif { VIR_AUTOFREE(char *) newpath =3D NULL; va_list ap; diff --git a/tests/virmockstathelpers.c b/tests/virmockstathelpers.c index 1f6f831bed..4ddb0dfec1 100644 --- a/tests/virmockstathelpers.c +++ b/tests/virmockstathelpers.c @@ -192,7 +192,12 @@ static int virMockStatRedirect(const char *path, char = **newpath); #endif =20 #ifdef MOCK_STAT +# ifdef __APPLE__ +int _stat(const char *path, struct stat *sb) __asm("_stat$INODE64"); +int _stat(const char *path, struct stat *sb) +# else int stat(const char *path, struct stat *sb) +# endif { VIR_AUTOFREE(char *) newpath =3D NULL; =20 @@ -262,8 +267,13 @@ __xstat64(int ver, const char *path, struct stat64 *sb) #endif =20 #ifdef MOCK_LSTAT +# ifdef __APPLE__ +int _lstat(const char *path, struct stat *sb) __asm("_lstat$INODE64"); +int _lstat(const char *path, struct stat *sb) +# else int lstat(const char *path, struct stat *sb) +# endif { VIR_AUTOFREE(char *) newpath =3D NULL; =20 --=20 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 06:55:23 2024 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=1566404065; cv=none; d=zoho.com; s=zohoarc; b=ctW7GrM3w138m9ypHRFz2JUdJOAaZ4J4xx2XXQzXF5xwQgPRw5VDsFXI1RTNq9UOTnGcQEJDsADLBBuJn+f2kMrLfSAM3ltN8aNR0oS+il/3+1GeMOrRHF6b288FloyfF1549Z3p//wWSpLgAYMLfOqxXjbUJ5eB8RVl4woNZzA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566404065; 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=V9xp8lJmrr2auJdjtMNrsvpXJXWqNMGyVCRbir7SJRM=; b=NuWpmbZ7VQ7j8yF4fZ6sgr9bJdLD02DI5+/Qt9gKfJXdWpkl5sVweJqafN7lxbP/QdTcdr4ZzGftiHAE7Lt3hwtsTF6AmXxuVmxBpcv3HgumiaAOR9gvWkaygWgHxgcHtUWZ5ZpW5GCu+exJjkoUjKrdQ0x5sdYkFVlnjI/8fYk= 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 1566404065780588.3412025232792; Wed, 21 Aug 2019 09:14:25 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5E42511A15; Wed, 21 Aug 2019 16:14:24 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3A6B61001B09; Wed, 21 Aug 2019 16:14:24 +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 0258424F30; Wed, 21 Aug 2019 16:14:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7LGEEm8016891 for ; Wed, 21 Aug 2019 12:14:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4BBBE60624; Wed, 21 Aug 2019 16:14:14 +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 4644360619 for ; Wed, 21 Aug 2019 16:14:10 +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 6226587630 for ; Wed, 21 Aug 2019 16:14:02 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id CC73142ED7 for ; Wed, 21 Aug 2019 16:13:56 +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 raJ0eSxefodz for ; Wed, 21 Aug 2019 19:13:55 +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 A86DF42ECC for ; Wed, 21 Aug 2019 19:13:55 +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:55 +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= 1566404035; x=1568218436; bh=HNvaUu+Ult72Dt71YNGfN2iMdm7HKBeHO7A LU4p1Lmw=; b=nC8ffqfmRrr+2yczqVvzIHg7ypzXyp+USS4lfcLlJmFETZ0hH2D u9RSEl1FibaORMG/4L/T2oWAIP5MgyQdYlpMh5E63fKO58E7tNLLTT2ZAxtti4oV f/rSKCcFnMmGcr6OEL1OPJp8AbzC7jQBZiLLj953cO9x8Isv0dE6cjGw= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Aug 2019 19:13:23 +0300 Message-ID: <20190821161323.1583-12-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:14:02 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 21 Aug 2019 16:14:02 +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.13 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCH 11/11] tests: Make references to global symbols indirect in test drivers 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 21 Aug 2019 16:14:24 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" A library has to be built with -flat_namespace to get all references to global symbols indirected. That can also be achieved with two-level namespace interposition but we're not using explicit symbol interposition since it's more verbose and requires massive changes to the mocks. This provides a way to interpose a mock for virQEMUCapsProbeHostCPU from qemucpumock and fixes domaincapstest on macOS. Signed-off-by: Roman Bolshakov Reviewed-by: Daniel P. Berrang=C3=A9 --- tests/Makefile.am | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/Makefile.am b/tests/Makefile.am index 460efb6b7b..f92710db43 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -56,6 +56,9 @@ DRIVERLIB_LDFLAGS =3D \ -avoid-version \ -rpath /evil/libtool/hack/to/force/shared/lib/creation \ $(MINGW_EXTRA_LDFLAGS) +if WITH_MACOS +DRIVERLIB_LDFLAGS +=3D -Wl,-flat_namespace +endif WITH_MACOS =20 PROBES_O =3D if WITH_DTRACE_PROBES --=20 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list