From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 753561FF144 for ; Tue, 10 Mar 2026 09:40:58 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 66E3013AAD; Tue, 10 Mar 2026 09:40:52 +0100 (CET) Date: Tue, 10 Mar 2026 09:40:45 +0100 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= Subject: Re: [PATCH proxmox] oci: ignore tests that require to be run as UID 0 To: Filip Schauer , pve-devel@lists.proxmox.com References: <20260309154055.139983-1-f.schauer@proxmox.com> In-Reply-To: <20260309154055.139983-1-f.schauer@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.17.0 (https://github.com/astroidmail/astroid) Message-Id: <1773130159.wbr2a1rq79.astroid@yuna.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1773132015072 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.198 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_NUMSUBJECT 0.5 Subject ends in numbers excluding current years SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: ZQHO4JOOCVZVD5M4EB2GL6X2DKL3ERRD X-Message-ID-Hash: ZQHO4JOOCVZVD5M4EB2GL6X2DKL3ERRD X-MailFrom: f.gruenbichler@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; 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: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On March 9, 2026 4:39 pm, Filip Schauer wrote: > This prevents unprivileged test runs from failing when extracting test > artifacts containing files with UID 0. >=20 > The tests can still run without root privileges using a user namespace: > unshare -r cargo test -- --include-ignored before this patch: - `cargo test -p proxmox-oci` fails (unless you happen to run it as real or fake root) - `make deb` runs the test under fakeroot, so executes them and they work - `make dsc` and building with sbuild+autopkgtest using unshare runs the test in a userns as non-privileged user, executes them but they fail (unles the debian/tests/control file is extended with `needs-root`) 1/3 after this patch: - `cargo test -p proxmox-oci` works, but doesn't run the test - `make deb` works, but doesn't run the test - `make dsc` works, but doesn't run the test 0/3 so in practice this has roughly the same effect as dropping the tests enitrely, because nobody will go out of their way to run tests using a special invocation (we know that, because until we added a `cargo test` invocation to `make deb` tests would frequently be broken without anybody noticing..) I still think either - creating those tar files on the fly with the current user/group (if that makes the tests work!) or - printing a warning and skipping the test if not root would be better options, as that would lead to some level of coverage out of the box.. I'll add control over `needs-root` and the other restrictions to debcargo to my todo list, so we can at least fix the tests run during proper package building fixed without the need to manually override the whole tests control file.. >=20 > Signed-off-by: Filip Schauer > --- > proxmox-oci/tests/extract_replace.rs | 3 +++ > proxmox-oci/tests/extract_whiteouts.rs | 3 +++ > 2 files changed, 6 insertions(+) >=20 > diff --git a/proxmox-oci/tests/extract_replace.rs b/proxmox-oci/tests/ext= ract_replace.rs > index eb41f9e3..2c8ea7ed 100644 > --- a/proxmox-oci/tests/extract_replace.rs > +++ b/proxmox-oci/tests/extract_replace.rs > @@ -4,6 +4,7 @@ use proxmox_oci::{parse_and_extract_image, Arch}; > use proxmox_sys::fs::make_tmp_dir; > =20 > #[test] > +#[ignore =3D "Must be run as UID 0 (unshare -r cargo test -- --include-i= gnored)"] > fn test_replace_file() { > let extract_dir =3D make_tmp_dir("/tmp/", None).unwrap(); > =20 > @@ -23,6 +24,7 @@ fn test_replace_file() { > } > =20 > #[test] > +#[ignore =3D "Must be run as UID 0 (unshare -r cargo test -- --include-i= gnored)"] > fn test_replace_file_with_dir() { > let extract_dir =3D make_tmp_dir("/tmp/", None).unwrap(); > =20 > @@ -40,6 +42,7 @@ fn test_replace_file_with_dir() { > } > =20 > #[test] > +#[ignore =3D "Must be run as UID 0 (unshare -r cargo test -- --include-i= gnored)"] > fn test_replace_dir_with_file() { > let extract_dir =3D make_tmp_dir("/tmp/", None).unwrap(); > =20 > diff --git a/proxmox-oci/tests/extract_whiteouts.rs b/proxmox-oci/tests/e= xtract_whiteouts.rs > index 71ec4dea..0333dac9 100644 > --- a/proxmox-oci/tests/extract_whiteouts.rs > +++ b/proxmox-oci/tests/extract_whiteouts.rs > @@ -40,6 +40,7 @@ fn test_whiteout_root_parent_breakout() { > } > =20 > #[test] > +#[ignore =3D "Must be run as UID 0 (unshare -r cargo test -- --include-i= gnored)"] > fn test_whiteout_current_directory() { > let extract_dir =3D make_tmp_dir("/tmp/", None).unwrap(); > =20 > @@ -57,6 +58,7 @@ fn test_whiteout_current_directory() { > } > =20 > #[test] > +#[ignore =3D "Must be run as UID 0 (unshare -r cargo test -- --include-i= gnored)"] > fn test_whiteout_symlink() { > let extract_dir =3D make_tmp_dir("/tmp/", None).unwrap(); > =20 > @@ -75,6 +77,7 @@ fn test_whiteout_symlink() { > } > =20 > #[test] > +#[ignore =3D "Must be run as UID 0 (unshare -r cargo test -- --include-i= gnored)"] > fn test_whiteout_dead_symlink_parent() { > let extract_dir =3D make_tmp_dir("/tmp/", None).unwrap(); > =20 > --=20 > 2.47.3 >=20 >=20 >=20 >=20 >=20 >=20