timeout: add regression test (Bug#9098)
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 17 Jul 2011 19:47:22 +0000 (12:47 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 17 Jul 2011 19:52:55 +0000 (12:52 -0700)
* tests/misc/timeout: Check that 'timeout' is not confused when
starting off with a child.

tests/misc/timeout

index 7506e7c..04465e1 100755 (executable)
@@ -51,4 +51,9 @@ test $? = 124 && fail=1
   exec timeout 10 true
 ) || fail=1
 
+# Don't be confused when starting off with a child (Bug#9098).
+out=$(sleep 1 & exec timeout 2 sh -c 'sleep 3; echo foo')
+status=$?
+test "$out" = "" && test $status = 124 || fail=1
+
 Exit $fail