]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: avoid false failure with hidden /proc on Guix
authorPádraig Brady <P@draigBrady.com>
Thu, 16 Apr 2026 20:27:42 +0000 (21:27 +0100)
committerPádraig Brady <P@draigBrady.com>
Thu, 16 Apr 2026 20:28:44 +0000 (21:28 +0100)
* tests/stat/stat-mount.sh: Don't try our stat under unshare
unless mount(8) exits gracefully.
Reported by Bruno Haible.

tests/stat/stat-mount.sh

index 18b544043500b7b7574c90edb7718f88d122ba7b..1a3d2199648ca602db1301ee48ff1a6a2351d8e3 100755 (executable)
@@ -30,7 +30,10 @@ hide_proc() {
   unshare -rm $SHELL -c 'mount -t tmpfs tmpfs /proc && "$@"' -- "$@"
 }
 if hide_proc true; then
-  hide_proc stat -c '0%#a' / || fail=1
+  hide_proc mount; ret=$?
+  if test "$ret" = 2; then  # Avoid segfaults under unshare on Guix
+    hide_proc stat -c '0%#a' / || fail=1
+  fi
 fi
 
 Exit $fail