Discussion:
z/OS test failures due to quirky error handling
(too old to reply)
Daniel Richard G.
2017-02-20 22:37:27 UTC
Permalink
Raw Message
Two tests in the Gnulib test suite are currently failing due to z/OS
idiosyncrasies relating to error messages.

The first one is test-perror.sh:

$ srcdir=/path/to/testdir/gltests /path/to/testdir/gltests/test-perror.sh
test-perror.sh: failed test: result should not contain a number

The content of the t-perror.tmp file when this failure occurs is
as follows:

EDC5111I Permission denied.
EDC8127I Connection timed out.
EDC5149I Value Overflow Error.

I don't understand why the script checks for numbers in the output, but
the check may need tweaking on this platform.

The second test is test-sigpipe.sh:

$ /path/to/testdir/gltests/test-sigpipe.sh
CEE5213S The signal SIGPIPE was received.
$ echo $?
1

The default SIGPIPE signal handler appears to write to stderr, and this
is separate from the "Broken pipe" message printed to the terminal:

$ ./test-sigpipe A | head -1
y
CEE5213S The signal SIGPIPE was received.
Broken pipe

This test could probably use a tweak as well.


--Daniel
--
Daniel Richard G. || ***@iSKUNK.ORG
My ASCII-art .sig got a bad case of Times New Roman.
Bruno Haible
2017-02-28 23:48:34 UTC
Permalink
Raw Message
Post by Daniel Richard G.
Two tests in the Gnulib test suite are currently failing due to z/OS
idiosyncrasies relating to error messages.
$ srcdir=/path/to/testdir/gltests /path/to/testdir/gltests/test-perror.sh
test-perror.sh: failed test: result should not contain a number
The content of the t-perror.tmp file when this failure occurs is
EDC5111I Permission denied.
EDC8127I Connection timed out.
EDC5149I Value Overflow Error.
I don't understand why the script checks for numbers in the output, but
the check may need tweaking on this platform.
It tests against numbers in order to catch low-quality implementations that
produce just "error 12". Here's a proposed patch. Please test.

--- a/tests/test-perror.sh
+++ b/tests/test-perror.sh
@@ -2,9 +2,11 @@
: ${srcdir=.}
. "$srcdir/init.sh"; path_prepend_ .

-# Test NULL prefix. Result should not contain a number.
+# Test NULL prefix. Result should not contain a number, except in lines that
+# start with 'EDC' (IBM z/OS libc produces an error identifier before the
+# error message).
test-perror 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror.tmp
-grep '[0-9]' t-perror.tmp > /dev/null \
+grep -v '^EDC' t-perror.tmp | grep '[0-9]' > /dev/null \
&& fail_ "result should not contain a number"

# Test empty prefix. Result should be the same.
Daniel Richard G.
2017-03-01 19:53:02 UTC
Permalink
Raw Message
Post by Bruno Haible
It tests against numbers in order to catch low-quality implementations that
produce just "error 12". Here's a proposed patch. Please test.
--- a/tests/test-perror.sh
+++ b/tests/test-perror.sh
[...]

Works for me. test-perror.sh now passes clean.


--Daniel
--
Daniel Richard G. || ***@iSKUNK.ORG
My ASCII-art .sig got a bad case of Times New Roman.
Bruno Haible
2017-03-03 01:32:14 UTC
Permalink
Raw Message
Post by Daniel Richard G.
Works for me. test-perror.sh now passes clean.
Thanks for testing. I've pushed the change.

Bruno

Bruno Haible
2017-02-28 23:54:19 UTC
Permalink
Raw Message
Post by Daniel Richard G.
$ /path/to/testdir/gltests/test-sigpipe.sh
CEE5213S The signal SIGPIPE was received.
$ echo $?
1
The default SIGPIPE signal handler appears to write to stderr, and this
$ ./test-sigpipe A | head -1
y
CEE5213S The signal SIGPIPE was received.
Broken pipe
This test could probably use a tweak as well.
I would argue that this behaviour is not POSIX compliant. Quoting the POSIX
standard [1]:

Signal: SIGPIPE
Default action: T

The default actions are as follows:
T
Abnormal termination of the process.
A
Abnormal termination of the process [XSI] [Option Start] with additional actions. [Option End]

Writing to stderr is an additional action this is OK for 'A' but not for 'T'.

Bruno

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html
Daniel Richard G.
2017-03-01 19:39:14 UTC
Permalink
Raw Message
Post by Bruno Haible
I would argue that this behaviour is not POSIX compliant. Quoting the
Signal: SIGPIPE
Default action: T
T
Abnormal termination of the process.
A
Abnormal termination of the process [XSI] [Option Start] with
additional actions. [Option End]
Writing to stderr is an additional action this is OK for 'A' but not for 'T'.
Understood. Will push this to IBM.


--Daniel
--
Daniel Richard G. || ***@iSKUNK.ORG
My ASCII-art .sig got a bad case of Times New Roman.
Loading...