From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Thu, 16 Jul 2026 15:06:46 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-wm1-f63.google.com (mail-wm1-f63.google.com [209.85.128.63]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 66GD6jTr031218 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 16 Jul 2026 15:06:45 +0200 Received: by mail-wm1-f63.google.com with SMTP id 5b1f17b1804b1-490a767b782sf23987165e9.2 for ; Thu, 16 Jul 2026 06:06:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1784207200; cv=pass; d=google.com; s=arc-20260327; b=O5wg63iNQbCaXM/uVuknzH02VdM56qMYuwmt1gtDRBJ+voofRgLXj9rcgB1b3J7MYg EA19wWpfckfpBZh2dXqAGj1nEc/4CglYORQJlmL8zUxHRYZKnIkHZe2aH37svaf4aN2c 51UnS8NArsTVZ9nswrv2VVjE7je99gnSZFPMrBqbYWTj/m+cAiAccEnJPf/un8ynoO3x ETGhfZQ3UxwN1ATDhOqC2phx2cAJW1kSw3C7qaf3ejWJjWT6hBW6YI/TwYbRn3cQSuxq EvuvgmUvDcKalij4DVIX/Q50i2I0suePYOUr7mWKXU7omNTFzidjhKswMui+6Bn6xzEE lXEg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :sender:dkim-signature; bh=D30GlI601HB4e1I76XAgqfeaW9oWcqXvio082EqPCAI=; fh=ZA0uQOVcEP3LUQ9Z8jgUM1X0tGu+XUEgFFX/7Zf0QHI=; b=XR9FRQLe+7Wj4UOyfzi1LhbmbGVrEcVLMCysyFWp2xKMdFL/lRlvVsMA4SLCYy4dPb lHHf8uucRqEnobZxTtVt0Lu3P4uw0p+MO2m+HsKq5iazpSSQB+tGtyWizURADqF7Q4fU NLhfMqgoU+pirQfnWoVpB8ZRzig9/4lvl5b+iQON7Ewnjnhm8fouYeCmhuSWwF1PORO6 xMGZlk41IZq5RlPDi5f3Rsgj+qq9RiJ8XrFPKIainy8rx39Ro/n7p0iLexRJtnf52ano Nt6QYUaG1MpMECam7G174j8WkzwAfEFSQOGxSFcrOn+H00a0bImREpbuNrYJUNdndx4p EPRw==; darn=ilbers.de ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of wzh@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=wzh@ilbers.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20251104; t=1784207200; x=1784812000; darn=ilbers.de; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:content-type:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to:content-type; bh=D30GlI601HB4e1I76XAgqfeaW9oWcqXvio082EqPCAI=; b=cPo84r33UtFEJM+4M+V4lUdNd9/HBSObhA1caPofsLXRU5rpdovfYtEp0+YkOmELBE R0P/OcfmT4kazONRCcFmn9Mb3oxUbMwLUBOIyay9iAZKDts6KflJPXxNdjJdvbNT3ibe XRqGPWJ984TwHGazWHaRIoXwsf0xYR5RJi+Of/FsVmYP+q2e7bgdDG4hkJDN3r+5GLxh 1Sjyhtn9P/3d9Ci1BkbNn45X+huhz0FIJxPQF8fyloB3GNinpq5rYs+Z24HiBgug/+Nn DVwSsr2gvFgiSmWSLos79nJ/YPVO5JTrmQOgEmgc71KwMQPx8xkWRgJtH1y9qdtrLTQ9 W+Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784207200; x=1784812000; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:content-type :in-reply-to:from:content-language:references:to:subject:user-agent :mime-version:date:message-id:x-beenthere:x-gm-message-state:sender :from:to:cc:subject:date:message-id:reply-to:content-type; bh=D30GlI601HB4e1I76XAgqfeaW9oWcqXvio082EqPCAI=; b=eLVgqYvL0oLw6rjG+xxhWUZVc9S5Xq0lAMTeUkO6ivuPpJXG0tnRQrk3/81sr83gRs 4u5rcfN48M6wj8Nwm8gDoNStq7lDJ3XnQp3Y9AcjJoHFqoYD9xZ2mUrzXf7xQ3o+gG1L rvTqHL1z2zBHcIoLaHPCIIzuCIqCu2x254bYhHJNBFzfPu4jrbQ17jya2xFHZgJ6wIrD SRWHQhrve/Za9maK8a7L30dI4qQAbLfu5cxUNs9PU9TS11Z8rrX/sDPC1urqiBwstXeg O1c8yZi6+8Wyj1/GD9oNnOR2LDCMrW+VnFAKaWImqeV40Zt9qR4/9ptlKj9SpNIi/k2G Ajug== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AHgh+Rp1JlGHRZlfTgZboIvNok2TCG++7Q9jJDMkOQF2skxMpB63RXkz10EdBMxqZxhNyO24HJZ0@ilbers.de X-Gm-Message-State: AOJu0Yx7h1CflasF5VZw3dAnHnHNRNHIDa/1vrV6blqliQUMl29Brk15 maNkCJiNjah7u2AtGegDZVTXx6YNqXuuvxrrXGoFgqMzVDh/e05sAo+G X-Received: by 2002:a05:600c:674a:b0:493:f80c:5455 with SMTP id 5b1f17b1804b1-493f87d85a9mr227101355e9.5.1784207199665; Thu, 16 Jul 2026 06:06:39 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com; h="Aa7YSPRN1gQsQwlcFgmFjZWlTfwqIiGdrfGtWcUGl511Sk4AvQ==" Received: by 2002:a05:600c:310f:b0:493:f851:cfc1 with SMTP id 5b1f17b1804b1-495441b066fls5251645e9.1.-pod-prod-08-eu; Thu, 16 Jul 2026 06:06:37 -0700 (PDT) X-Forwarded-Encrypted: i=2; AHgh+Rq2QtLtaq1GDXVZmNQxLPQwfa5UEi1uOAkQLpMbCk5g/wxGjXuApwOV+VOu5LSADgbY7YJWhhTGbW5R@googlegroups.com X-Received: by 2002:a05:600c:a00f:b0:495:3dd7:ef06 with SMTP id 5b1f17b1804b1-4953dd7f0bcmr73890375e9.12.1784207197349; Thu, 16 Jul 2026 06:06:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1784207197; cv=none; d=google.com; s=arc-20260327; b=BiBnjWOSaAR50PJoDChkEuiCJ2OrfRpSEi0kxBhZC/LNT9SoAqKdCOLdkyBigzY3wH TgJjFPFEjfzx61UCVt9SQUhU/+YgJdnIzrr1QwhW8t5EqIcM0otz/ElqZiIdU6bl4+T6 MmGZlQNM6MNtIp+8HmXiRmp56oK+OEUyUmsYxebLfaHHIjV/e/DHamPTsXavphKrehUp 779YvN5ODtNYbQOyy2ake/68aIGbCnrdo17Pd9KT/gUt3QF8k+lCUEe1AsWd5tcWQfEN VoJHAXJzqIsotV5VAgA8E1mztuoVmeWLzVxx+CwuUVJk0kCTHfy4Kn7s3m1841lYUoWs BI3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id; bh=apj5UK1kE8D8Wwx3vaZmPrAtN24qDkllc/CYAeyBKsU=; fh=PICfM4Fo6fj0YFd/Sa2/vzFoNnq31QOnYxZYf2j1CDU=; b=AO1VJw9m2fzHI6/3pzGY8g1RV4BVP+qq+A1Y1TVbZ2CD3P7h8f7W85ETE79RjGsW/e pAHO6jAGc6FUeWPhXobc+I1QoBgV1Lbwca8hBLOk3oMrMjeRrwauxLZRFNO6e08m9i99 xqrRjJIm9XIsySPt6BtzvDOAZ+MeXA/dje3w4q+dQ5gBPcR9X8TDM/h/8mMAOiv3ERwK LsGu3JoOvAizNpl/obfqybGS0VwwzGIviMVGlc7ahb8s5DNinVkgsbX4GAVYbi0sgFU3 KF5+PfGruhL8dF/tWIDQSQDowQBKuTIduA+nSvFEQhH2/0WA0j+nRiZ4HS6LPp1LTshz qK8Q==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of wzh@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=wzh@ilbers.de Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id 5b1f17b1804b1-495436104basi253095e9.1.2026.07.16.06.06.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 16 Jul 2026 06:06:37 -0700 (PDT) Received-SPF: pass (google.com: domain of wzh@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Received: from [192.168.178.148] ([88.130.203.42]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 66GD6aNg031207 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Jul 2026 15:06:36 +0200 Message-ID: <79b35aa7-0abb-4aa5-b702-caf0b5120285@ilbers.de> Date: Thu, 16 Jul 2026 15:06:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] testsuite: Support cleanup on rootless build files in test-container To: "MOESSBAUER, Felix" , "isar-users@googlegroups.com" References: <20260716124017.1480579-1-wzh@ilbers.de> <70e199294fd7739328d57e0f2983d3c8cce6d2fc.camel@siemens.com> Content-Language: en-US From: Zhihang Wei In-Reply-To: <70e199294fd7739328d57e0f2983d3c8cce6d2fc.camel@siemens.com> Content-Type: text/plain; charset="UTF-8"; format=flowed X-Spam-Status: No, score=-4.6 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_RP_CERTIFIED,RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-Original-Sender: wzh@ilbers.de X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of wzh@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=wzh@ilbers.de Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-TUID: R70KYMKR/dtE On 7/16/26 14:47, MOESSBAUER, Felix wrote: > On Thu, 2026-07-16 at 14:40 +0200, Zhihang Wei wrote: >> When running tests with rootless builds, some files created with the user >> namespace inside the container cannot be removed by the calling user after >> the test-container exits without sudo. Add the `--clean-rootless-files` >> option to the test-container entrypoint to clean up such files before >> leaving the container. >> >> The cleanup is only performed for rootless builds and only removes files >> that cannot be cleaned up without sudo outside the container. Other build >> artifacts are left untouched so they remain available for CI artifact >> collection and post-test inspection. >> >> Signed-off-by: Zhihang Wei >> --- >> .../dockerdata/test-container-entrypoint | 38 +++++++++++++++++-- >> 1 file changed, 34 insertions(+), 4 deletions(-) >> >> diff --git a/testsuite/dockerdata/test-container-entrypoint b/testsuite/dockerdata/test-container-entrypoint >> index e4714942..9bddbb18 100755 >> --- a/testsuite/dockerdata/test-container-entrypoint >> +++ b/testsuite/dockerdata/test-container-entrypoint >> @@ -17,6 +17,8 @@ else >> shift 1 >> fi >> >> +clean_rootless_files=0 >> + >> export args="--max-parallel-tasks=1 --disable-sysinfo" >> for arg in $*; do >> case "$arg" in >> @@ -29,15 +31,19 @@ for arg in $*; do >> --shell) >> export start_shell=1 >> ;; >> + --clean-rootless-files) >> + clean_rootless_files=1 >> + ;; >> --help) >> cat <> Usage: run-tests.sh [params] ... >> >> Supported parameters: >> - --clean Purge results of previous test runs before starting. >> - --debug Use '--show=app,test' log settings for avocado. >> - --shell Drop into shell rather than starting tests. >> - --help Show this help message. >> + --clean Purge results of previous test runs before starting. >> + --debug Use '--show=app,test' log settings for avocado. >> + --shell Drop into shell rather than starting tests. >> + --clean-rootless-files Clean up files created by rootless builds with unshare after the tests finish. >> + --help Show this help message. >> >> Any other parameters are passed to "avocado run". Its usage is: >> >> @@ -59,6 +65,15 @@ case "$args" in >> ;; >> esac >> >> +case "$args" in >> + *"-p rootless=1"*) >> + ;; >> + *) >> + clean_rootless_files=0 >> + ;; >> +esac >> +export clean_rootless_files >> + >> mkdir /isar >> >> busybox syslogd >> @@ -72,6 +87,21 @@ echo exit | /container-entrypoint >> gosu builder sh -c ' >> set -e >> >> +cleanup_rootless_files() >> +{ >> + rc=$? >> + >> + if [ "${clean_rootless_files}" = 1 ]; then >> + find build \ >> + \( ! -user "$(whoami)" -type d -prune \) \ >> + -exec unshare --map-auto --map-root-user --keep-caps rm -rf {} \; > We can reuse the ./scripts/isar-clean-builddir script which was written > exactly for cleaning up the leftover files. > > Apart from that, the change is fine. > > Felix Hi Felix, This part was borrowed from your isar-clean-builddir script. But here I want to keep the logs and build artifacts. Thinking about it more: the files with different ownership are only in rootfs dirs. Maybe I can reuse the script to clean up rootfs only. Let me try. v8 unprivileged is on CI, we'll merge once it passes. Zhihang > >> + fi >> + >> + exit ${rc} >> +} >> + >> +trap cleanup_rootless_files EXIT >> + >> base_dir=/work/build/testsuite >> >> mkdir -p ${base_dir}/overlay/upper >> -- >> 2.39.5 >> >> -- >> You received this message because you are subscribed to the Google Groups "isar-users" group. >> To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com. >> To view this discussion visit https://groups.google.com/d/msgid/isar-users/20260716124017.1480579-1-wzh%40ilbers.de. -- You received this message because you are subscribed to the Google Groups "isar-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/isar-users/79b35aa7-0abb-4aa5-b702-caf0b5120285%40ilbers.de.