Re: [GNU Autoconf 2.72e] testsuite: 11 119 261 failed on Solaris 11.4 x86

"Zack Weinberg" <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.patches,gmane.comp.sysutils.autoconf.bugs
Message-ID <[email protected]>
On Fri, Dec 22, 2023, at 8:22 AM, Zack Weinberg wrote:
> (But I'll also see if it's practical to mark this test as an expected
> failure on systems where the write error isn't detected.)

Thus.  Tested only on Linux.  I don't have access to a machine that
has *both* /dev/full and a buggy printf(1).  (Alan, I saw what you
said about zero-cost installation media for Solaris 11.4 but I have
several higher-priority things to resolve and setting up a VM could
easily eat my entire day.)

zw

diff --git a/tests/torture.at b/tests/torture.at
index 288a5a55..d98b92c0 100644
--- a/tests/torture.at
+++ b/tests/torture.at
@@ -291,7 +291,21 @@ AT_CHECK_CONFIG_CREATION(command)
 # Create a link
 AT_CHECK_CONFIG_CREATION(link)
 
-# Now check for write errors
+# Now check for write errors.
+# Depending on the shell, 'printf' might or might not report write
+# errors on stdout.  Check /bin/sh regardless of $SHELL, because
+# config.status always uses /bin/sh.
+# Note: another way to force a write error is with ulimit -f, but
+# depending on the OS it might not be possible to set that limit
+# lower than one disk block, so we'd have to make the tests below
+# produce much more output.
+test_write_errors=false
+if test -w /dev/full && test -c /dev/full; then
+  if /bin/sh -c 'printf "write errors detected?\\n"' > /dev/full 2> /dev/null
+  then :
+  else test_write_errors=:
+  fi
+fi
 
 # Create a file
 AT_CHECK_CONFIG_CREATION_NOWRITE(file)
@@ -301,7 +315,7 @@ AT_CHECK([echo from-stdin | ./config.status --file=file:-],
 AT_CHECK([grep from-stdin file], [], [from-stdin
 ])
 # Force write error creating a file on stdout
-if test -w /dev/full && test -c /dev/full; then
+if $test_write_errors; then
   AT_CHECK([./config.status --file=-:input </dev/null >/dev/full || exit 1],
 	   [1], [ignore], [ignore])
 fi
@@ -320,7 +334,7 @@ AT_CHECK([./config.status --header=-:input </dev/null],
 AT_CHECK([grep OK stdout], [], [OK
 ])
 # Force write error creating a header on stdout
-if test -w /dev/full && test -c /dev/full; then
+if $test_write_errors; then
   AT_CHECK([./config.status --header=-:input </dev/null >/dev/full || exit 1],
 	   [1], [ignore], [ignore])
 fi
-- 
2.41.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.