Thu Mar 31 16:22:54 2016 UTC ()
Avoid leaving turds in /tmp. (from kre@)


(christos)
diff -r1.7 -r1.8 src/tests/bin/sh/t_wait.sh

cvs diff -r1.7 -r1.8 src/tests/bin/sh/t_wait.sh (expand / switch to unified diff)

--- src/tests/bin/sh/t_wait.sh 2016/03/27 14:50:40 1.7
+++ src/tests/bin/sh/t_wait.sh 2016/03/31 16:22:54 1.8
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: t_wait.sh,v 1.7 2016/03/27 14:50:40 christos Exp $ 1# $NetBSD: t_wait.sh,v 1.8 2016/03/31 16:22:54 christos Exp $
2# 2#
3# Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc. 3# Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
4# All rights reserved. 4# All rights reserved.
5# 5#
6# Redistribution and use in source and binary forms, with or without 6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions 7# modification, are permitted provided that the following conditions
8# are met: 8# are met:
9# 1. Redistributions of source code must retain the above copyright 9# 1. Redistributions of source code must retain the above copyright
10# notice, this list of conditions and the following disclaimer. 10# notice, this list of conditions and the following disclaimer.
11# 2. Redistributions in binary form must reproduce the above copyright 11# 2. Redistributions in binary form must reproduce the above copyright
12# notice, this list of conditions and the following disclaimer in the 12# notice, this list of conditions and the following disclaimer in the
13# documentation and/or other materials provided with the distribution. 13# documentation and/or other materials provided with the distribution.
14# 14#
@@ -137,27 +137,27 @@ EOF @@ -137,27 +137,27 @@ EOF
137 output=$(${TEST_SH} individualhelper.sh 2>&1) 137 output=$(${TEST_SH} individualhelper.sh 2>&1)
138 [ $? -eq 0 ] || atf_fail "${output}" 138 [ $? -eq 0 ] || atf_fail "${output}"
139} 139}
140 140
141atf_test_case kill 141atf_test_case kill
142kill_head() { 142kill_head() {
143 atf_set "descr" "Tests that killing the shell while in wait calls trap" 143 atf_set "descr" "Tests that killing the shell while in wait calls trap"
144} 144}
145kill_body() { 145kill_body() {
146 atf_require_prog sleep 146 atf_require_prog sleep
147 atf_require_prog kill 147 atf_require_prog kill
148 148
149 s=killhelper.sh 149 s=killhelper.sh
150 z=/tmp/killhelper.$$  150 z=killhelper.$$
151 pid= 151 pid=
152 152
153 # waiting for a specific process that is not a child 153 # waiting for a specific process that is not a child
154 # should return exit status of 127 according to the spec 154 # should return exit status of 127 according to the spec
155 # This test is here before the next, to avoid that one 155 # This test is here before the next, to avoid that one
156 # entering an infinite loop should the shell have a bug here. 156 # entering an infinite loop should the shell have a bug here.
157 157
158 atf_check -s exit:127 -o empty -e ignore ${TEST_SH} -c 'wait 1' 158 atf_check -s exit:127 -o empty -e ignore ${TEST_SH} -c 'wait 1'
159 159
160 cat > "${s}" <<'EOF' 160 cat > "${s}" <<'EOF'
161 161
162trap "echo SIGHUP" 1 162trap "echo SIGHUP" 1
163(sleep 5; exit 3) & 163(sleep 5; exit 3) &