From: Pádraig Brady
Date: Sat, 14 Feb 2026 13:50:48 +0000 (+0000)
Subject: maint: tests: avoid AIX specific EACCES handling
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe997b5f986a2195c2e5fe460d58a56f39a681cf;p=thirdparty%2Fcoreutils.git
maint: tests: avoid AIX specific EACCES handling
* tests/rm/inaccessible.sh: Remove AIX specific handling.
* tests/cp/fail-perm.sh: Likeise. Also remove confusing
EPERM/HPUX mentions.
* tests/misc/sync.sh: Don't hardcode EISDIR and EACCES.
---
diff --git a/tests/cp/fail-perm.sh b/tests/cp/fail-perm.sh
index ec7036afac..ed591723d7 100755
--- a/tests/cp/fail-perm.sh
+++ b/tests/cp/fail-perm.sh
@@ -18,6 +18,7 @@
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ cp
skip_if_root_
+getlimits_
chmod g-s . || framework_failure_
mkdir D D/D || framework_failure_
@@ -37,28 +38,21 @@ test "$mode" = dr-x------ || fail=1
chmod 0 D
ln -s D/D symlink
touch F
-cat > exp <<\EOF
-cp: cannot stat 'symlink': Permission denied
+cat > exp < out && fail=1
-# HPUX appears to fail with EACCES rather than EPERM.
-# Transform their diagnostic
-# ...: The file access permissions do not allow the specified action.
-# to the expected one:
-sed 's/: The file access permissions.*/: Permission denied/'o1;mv o1 out
compare exp out || fail=1
cp --no-target-directory F symlink 2> out && fail=1
-sed 's/: The file access permissions.*/: Permission denied/'o1;mv o1 out
compare exp out || fail=1
-cat > exp <<\EOF
-cp: target directory 'symlink': Permission denied
+cat > exp < out && fail=1
-sed 's/: The file access permissions.*/: Permission denied/'o1;mv o1 out
compare exp out || fail=1
chmod 700 D
diff --git a/tests/misc/sync.sh b/tests/misc/sync.sh
index f782a2b9a1..2a005566b9 100755
--- a/tests/misc/sync.sh
+++ b/tests/misc/sync.sh
@@ -18,6 +18,7 @@
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ sync
+getlimits_
touch file || framework_failure_
@@ -52,8 +53,8 @@ chmod 0 norw || framework_failure_
if ! test -r norw; then
returns_ 1 sync norw 2>errt || fail=1
# AIX gives "Is a directory"
- sed 's/Is a directory/Permission denied/' err || framework_failure_
- printf "sync: error opening 'norw': Permission denied\n" >exp
+ sed "s/$EISDIR/$EACCES/" err || framework_failure_
+ printf "sync: error opening 'norw': $EACCES\n" >exp
compare exp err || fail=1
fi
diff --git a/tests/rm/inaccessible.sh b/tests/rm/inaccessible.sh
index 917c82b967..5383c682ba 100755
--- a/tests/rm/inaccessible.sh
+++ b/tests/rm/inaccessible.sh
@@ -19,11 +19,12 @@
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ rm
+skip_if_root_
+getlimits_
# Skip this test if your system has neither the openat-style functions
# nor /proc/self/fd support with which to emulate them.
require_openat_support_
-skip_if_root_
p=$(pwd)
mkdir abs1 abs2 no-access || framework_failure_
@@ -34,16 +35,10 @@ set +x
test -d "$p/abs1" && fail=1
test -d "$p/abs2" && fail=1
-cat <<\EOF > exp || framework_failure_
-rm: cannot remove 'rel': Permission denied
+cat < exp || framework_failure_
+rm: cannot remove 'rel': $EACCES
EOF
-# AIX 4.3.3 fails with a different diagnostic.
-# Transform their diagnostic
-# ...: The file access permissions do not allow the specified action.
-# to the expected one:
-sed 's/: The file access permissions.*/: Permission denied/'o1;mv o1 out
-
compare exp out || fail=1
Exit $fail