6690 set_nfsv4_ephemeral_mount_to() tries to read AUTOMOUNT_TIMEOUT from defunct...
[unleashed.git] / usr / src / test / libc-tests / tests / psignal.ksh
blobfc8e1a620538e8ff16d9e125065f31ea10cd877a
1 #!/usr/bin/ksh
3 # This file and its contents are supplied under the terms of the
4 # Common Development and Distribution License ("CDDL"), version 1.0.
5 # You may only use this file in accordance with the terms of version
6 # 1.0 of the CDDL.
8 # A full copy of the text of the CDDL should have accompanied this
9 # source. A copy of the CDDL is also available via the Internet at
10 # http://www.illumos.org/license/CDDL.
14 # Copyright 2016 Joyent, Inc.
18 # Add regression tests for illumos#5079. Verify that psignal and
19 # psiginfo print what we expect to stderr.
22 set -o errexit
23 set -o pipefail
25 ps_root=$(dirname $0)
26 ps_sig32=$ps_root/psignal-5097.32
27 ps_sig64=$ps_root/psignal-5097.64
28 ps_out=/tmp/$(basename $0).$$
30 function fatal
32 typeset msg="$*"
33 echo "Test Failed: $msg" >&2
34 exit 1
37 function test_one
39 typeset prog=$1
40 typeset outfile=$ps_out.test
42 $prog >/dev/null 2>$outfile || fatal "$prog unexpectedly failed"
43 diff $ps_out $outfile || fatal "$ps_out and $outfile differ " \
44 "unexpectedly"
45 rm -f $outfile
48 cat > $ps_out <<EOF
49 hello world: Segmentation Fault
50 Information Request
51 hello world : Segmentation Fault ( from process 0 )
52 Information Request ( from process 0 )
53 EOF
55 [[ $? -ne 0 ]] && fatal "failed to set up output file"
56 test_one $ps_sig32
57 test_one $ps_sig64
58 rm -f $ps_out
59 exit 0