Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/bin/sh Add delay to improve stability of test
details: https://anonhg.NetBSD.org/src/rev/e72a6cac23b9
branches: trunk
changeset: 340773:e72a6cac23b9
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Wed Sep 30 06:08:36 2015 +0000
description:
Add delay to improve stability of test
diffstat:
tests/bin/sh/t_wait.sh | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diffs (35 lines):
diff -r c303a7586985 -r e72a6cac23b9 tests/bin/sh/t_wait.sh
--- a/tests/bin/sh/t_wait.sh Wed Sep 30 04:28:04 2015 +0000
+++ b/tests/bin/sh/t_wait.sh Wed Sep 30 06:08:36 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_wait.sh,v 1.2 2015/08/23 07:15:16 christos Exp $
+# $NetBSD: t_wait.sh,v 1.3 2015/09/30 06:08:36 ozaki-r Exp $
#
# Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -64,6 +64,8 @@
# a helper script that executes /bin/sh directly.
local s=$PWD/killhelper.sh
local z=/tmp/killhelper.$$
+ local pid=
+
cat >$s <<\EOF
#!/bin/sh
trap "echo SIGHUP" 1
@@ -73,9 +75,15 @@
echo $?
EOF
chmod +x $s
+
$s > $z &
+ pid=$!
+ sleep 1
+
# XXX: built-in kill does not work?
- /bin/kill -HUP $!
+ /bin/kill -HUP $pid
+ sleep 1
+
output="$(cat $z | tr '\n' ' ')"
rm -f $s $z
if [ "$output" != "SIGHUP 129 " ]; then
Home |
Main Index |
Thread Index |
Old Index