From cc721e9b7beb900082b6f5e498ff5430ad18a4ff Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?= Date: Thu, 3 Aug 2017 21:20:08 -0700 Subject: [PATCH] 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. --- tests/id/setgid.sh | 5 +++++ tests/ln/sf-1.sh | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) 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 -- 2.47.2