From: Pádraig Brady
Date: Fri, 4 Aug 2017 04:20:08 +0000 (-0700) Subject: tests: avoid false failures on AIX X-Git-Tag: v8.28~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc721e9b7beb900082b6f5e498ff5430ad18a4ff;p=thirdparty%2Fcoreutils.git tests: avoid false failures on AIX * tests/ln/sf-1.sh: Limit the symlink size to 1MiB to avoid memory exhaustion seen on NFS on AIX, giving: + printf '%0*d' 4294967296 0 + ./tests/ln/sf-1.sh: line 38: printf: warning: 0: Result too large * tests/id/setgid.sh: Skip the test when the adjusted gid would equal 4294967295, as that's reserved on AIX. Reported by Michael Felt. --- diff --git a/tests/id/setgid.sh b/tests/id/setgid.sh index 61a1d993f5..09f9eb0f5c 100755 --- a/tests/id/setgid.sh +++ b/tests/id/setgid.sh @@ -20,11 +20,16 @@ print_ver_ id require_root_ +getlimits_ + # Construct a different group number gp1=$NON_ROOT_GID gp1=$(expr $gp1 + 1) || skip_ "failed to adjust GID $NON_ROOT_GID" +test "$gp1" -lt $GID_T_MAX || + skip_ "GID $gp1 is reserved on some systems" + echo $gp1 > exp || framework_failure_ # With coreutils-8.16 and earlier, id -G would print both: diff --git a/tests/ln/sf-1.sh b/tests/ln/sf-1.sh index 149b275697..492fce9035 100755 --- a/tests/ln/sf-1.sh +++ b/tests/ln/sf-1.sh @@ -33,9 +33,14 @@ esac # Ensure we replace symlinks that don't or can't link to an existing target. # coreutils-8.22 would fail to replace {ENOTDIR,ELOOP,ENAMETOOLONG}_link below. -name_max_plus1=$(expr $(stat -f -c %l .) + 1) +name_max=$(stat -f -c %l .) || skip_ 'Error determining NAME_MAX' +# Apply a limit since AIX returns 2^32-1 which would trigger resource issues. +name_limit=$((1024*1024)) +test "$name_max" -lt "$name_limit" || name_max="$name_limit" +name_max_plus1=$(expr $name_max + 1) test $name_max_plus1 -gt 1 || skip_ 'Error determining NAME_MAX' long_name=$(printf '%0*d' $name_max_plus1 0) + for f in '' f; do ln -s$f missing ENOENT_link || fail=1 ln -s$f a/b ENOTDIR_link || fail=1