From 57cea2bb6ca45b5c8239c12dd14fea9709e3aab6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?=
Date: Fri, 10 Apr 2026 14:55:07 +0100 Subject: [PATCH] tests: stat: ensure independence from /proc/ * tests/stat/stat-mount.sh: Ensure stat -c '%a' is independent from /proc. https://github.com/coreutils/coreutils/pull/250 --- tests/stat/stat-mount.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/stat/stat-mount.sh b/tests/stat/stat-mount.sh index b630d5b52d..18b5440435 100755 --- a/tests/stat/stat-mount.sh +++ b/tests/stat/stat-mount.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Test stat -c%m +# Test stat interactions with mounts # Copyright (C) 2010-2026 Free Software Foundation, Inc. @@ -25,4 +25,12 @@ case "$stat_mnt" in *) fail=1;; esac +# Ensure stat works without mounting /proc +hide_proc() { + unshare -rm $SHELL -c 'mount -t tmpfs tmpfs /proc && "$@"' -- "$@" +} +if hide_proc true; then + hide_proc stat -c '0%#a' / || fail=1 +fi + Exit $fail -- 2.47.3