From 0c3ec1aca5ad3b6f687ecdc75f193e2a0f0ae4a1 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 27 Sep 2009 17:26:54 -0700 Subject: test_signals: ensure we can parse pids in response We don't want to accidentally kill every process in the process group. --- test/unit/test_signals.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/unit/test_signals.rb b/test/unit/test_signals.rb index 9e8ccd0..d409da3 100644 --- a/test/unit/test_signals.rb +++ b/test/unit/test_signals.rb @@ -141,6 +141,7 @@ class SignalsTest < Test::Unit::TestCase pid = buf[/\r\nX-Pid: (\d+)\r\n/, 1].to_i header_len = buf[/\A(.+?\r\n\r\n)/m, 1].size end + assert pid > 0, "pid not positive: #{pid.inspect}" read = buf.size mode_before = @tmp.stat.mode assert_raises(EOFError,Errno::ECONNRESET,Errno::EPIPE,Errno::EINVAL, @@ -177,6 +178,7 @@ class SignalsTest < Test::Unit::TestCase sock.close end + assert pid > 0, "pid not positive: #{pid.inspect}" sock = TCPSocket.new('127.0.0.1', @port) sock.syswrite("PUT / HTTP/1.0\r\n") sock.syswrite("Content-Length: #{@bs * @count}\r\n\r\n") -- cgit v1.2.3-24-ge0c7