]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: tests: avoid AIX specific EACCES handling
authorPádraig Brady <P@draigBrady.com>
Sat, 14 Feb 2026 13:50:48 +0000 (13:50 +0000)
committerPádraig Brady <P@draigBrady.com>
Wed, 18 Feb 2026 18:31:49 +0000 (18:31 +0000)
* 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.

tests/cp/fail-perm.sh
tests/misc/sync.sh
tests/rm/inaccessible.sh

index ec7036afacbcf1e0548c438342cc56441728fecc..ed591723d73c4226e1d419f4ca36f846d27170c7 100755 (executable)
@@ -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 <<EOF
+cp: cannot stat 'symlink': $EACCES
 EOF
 
 cp F symlink 2> 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/'<out>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/'<out>o1;mv o1 out
 compare exp out || fail=1
 
-cat > exp <<\EOF
-cp: target directory 'symlink': Permission denied
+cat > exp <<EOF
+cp: target directory 'symlink': $EACCES
 EOF
 
 cp --target-directory=symlink F 2> out && fail=1
-sed 's/: The file access permissions.*/: Permission denied/'<out>o1;mv o1 out
 compare exp out || fail=1
 
 chmod 700 D
index f782a2b9a1d1f033bb38db515e50438de30707b1..2a005566b997d1caf88a8470f88eb9de295eac7f 100755 (executable)
@@ -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/' <errt >err || framework_failure_
-  printf "sync: error opening 'norw': Permission denied\n" >exp
+  sed "s/$EISDIR/$EACCES/" <errt >err || framework_failure_
+  printf "sync: error opening 'norw': $EACCES\n" >exp
   compare exp err || fail=1
 fi
 
index 917c82b9675bdcccf645b5afcbf16996eb22d4e2..5383c682ba7420019998f46bcdb28cb03ab0909b 100755 (executable)
 
 . "${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 <<EOF > 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/'<out>o1;mv o1 out
-
 compare exp out || fail=1
 
 Exit $fail