From nobody Mon Mar 23 23:29:04 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1773228556; cv=none; d=zohomail.com; s=zohoarc; b=Ny9IsY6MIm6G36FlsTxVKTmcZKlx0IJws8iVGhnn6B7bO3PEBVZbtDxBVzCqPbeRR8L6NS4gONS2ECyhCkHOuX5PvrhR3srZlSMGMiMoOujqhn6HfjtKbkpV/54SciubZoo/IGy9kc+ijEN9gTIqRQrbiLguvkUFTb2znskBBaU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773228556; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Subject:Subject:To:To:Message-Id:Cc; bh=zAk1+IcZqypz6+r8QaC69OvrkvxewaR/29vBO80+f8Y=; b=QBERb+np0wro6EKZidsrwti1HDrDZuQnGgRf653w/4IBgnQGlL5IrG9itMwarakb+dP8P9vzxSQiOOLgNfP4X96zqwykcrpWx1PQWH/HUYWVStDRX5/QIcgUEU75ww1yYORBSYOjFNdbi9aPsTNxt1V+AAxb1DroBESnkHxfw0k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1773228556780484.1522420921266; Wed, 11 Mar 2026 04:29:16 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id C2B6C41898; Wed, 11 Mar 2026 07:29:15 -0400 (EDT) Received: from [172.19.199.12] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 79F464195C; Wed, 11 Mar 2026 07:28:44 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 839B93F252; Wed, 11 Mar 2026 07:28:39 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id B9CE63F280 for ; Wed, 11 Mar 2026 07:28:38 -0400 (EDT) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-494-i-l6clrdOjO6oTPg3sNNng-1; Wed, 11 Mar 2026 07:28:36 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CF78B1800344 for ; Wed, 11 Mar 2026 11:28:35 +0000 (UTC) Received: from moe (unknown [10.43.3.236]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 12137180066F for ; Wed, 11 Mar 2026 11:28:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HELO_MISC_IP,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773228518; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zAk1+IcZqypz6+r8QaC69OvrkvxewaR/29vBO80+f8Y=; b=ite3G+loCoODrLUcxk7249VbRc6AGdds/aqABy/P9juUl8BybSiWTsegJ1Vh4ND/wt4EDs 8eCfmLgHdCGTmkw4blG7URLr+Z4Al0FxgADyD1+DGBFunXEtRYj/u9gjgraRZZ9LejVzTo nyY1ZVYWCj0FfPSyhflsMF4b6+YQkoE= X-MC-Unique: i-l6clrdOjO6oTPg3sNNng-1 X-Mimecast-MFC-AGG-ID: i-l6clrdOjO6oTPg3sNNng_1773228516 To: devel@lists.libvirt.org Subject: [PATCH] tests: Create fake root dirs later Date: Wed, 11 Mar 2026 12:28:32 +0100 Message-ID: <50b71eddae0d76c1f2dd888fdb7016d342c6abcd.1773228512.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: OdMuHh21ra_4tQ-EF3GT5RN1YAf_QSe6--bWzuZJmmQ_1773228516 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 4WTWOUOU3YPJKMYHAZ4AXAN4IMVOOJ5U X-Message-ID-Hash: 4WTWOUOU3YPJKMYHAZ4AXAN4IMVOOJ5U X-MailFrom: mprivozn@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Michal Privoznik via Devel Reply-To: Michal Privoznik X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1773228560420154100 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik In one of previous commits the virTestMain() function was changed to actually create fake HOME, XDG_RUNTIME_DIR, ... directories instead of setting spoofed values in the environment. But alongside with this, the call to virTestFakeRootDirInit() was moved (to location where environment was poisoned). And this would not matter if it wasn't for mocking. Because what we ended up with is virTestFakeRootDirInit() is called and then (optionally) the process re-execs itself (with mocks loaded). This means that previously created root dirs are never cleaned up and just pollute builddir. Therefore, restore original location from which the function was called. Fixes: 79d97d2b4f0b55ea80f8330144953e2b93927e25 Signed-off-by: Michal Privoznik Reviewed-by: Jiri Denemark --- tests/testutils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/testutils.c b/tests/testutils.c index c984f66d0e..14e5c56fcf 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -859,9 +859,6 @@ int virTestMain(int argc, preloads[npreloads] =3D NULL; } =20 - if (!(fakerootdir =3D virTestFakeRootDirInit())) - return EXIT_FAILURE; - va_start(ap, func); while ((lib =3D va_arg(ap, const char *))) { g_autofree char *abs_lib_path =3D g_strdup_printf("%s/%s", abs_bui= lddir, lib); @@ -934,6 +931,9 @@ int virTestMain(int argc, =20 failedTests =3D virBitmapNew(1); =20 + if (!(fakerootdir =3D virTestFakeRootDirInit())) + return EXIT_FAILURE; + ret =3D (func)(); =20 virResetLastError(); --=20 2.52.0