* 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 | 16 +++++-----------
tests/misc/sync.sh | 5 +++--
tests/rm/inaccessible.sh | 13 ++++---------
3 files changed, 12 insertions(+), 22 deletions(-)
diff --git a/tests/cp/fail-perm.sh b/tests/cp/fail-perm.sh
index ec7036afa..ed591723d 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 <<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
diff --git a/tests/misc/sync.sh b/tests/misc/sync.sh
index f782a2b9a..2a005566b 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/' <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
diff --git a/tests/rm/inaccessible.sh b/tests/rm/inaccessible.sh
index 917c82b96..5383c682b 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 <<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
--
2.52.0