about summary refs log tree commit homepage
path: root/test/exec
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-03-09 15:18:26 -0700
committerEric Wong <normalperson@yhbt.net>2009-03-09 15:18:26 -0700
commitdd57428309cb5d245dbc1200e1a6f8fe11ab4ed0 (patch)
treef693d96c7b027dac41c400f2f5fc31f6b9f7e198 /test/exec
parent5b308775a8c46d71b126f623cef196540a44985a (diff)
downloadunicorn-dd57428309cb5d245dbc1200e1a6f8fe11ab4ed0.tar.gz
This reverts commit 4414d9bf34f162a604d2aacc765ab1ca2fc90404.
Diffstat (limited to 'test/exec')
-rw-r--r--test/exec/test_exec.rb21
1 files changed, 8 insertions, 13 deletions
diff --git a/test/exec/test_exec.rb b/test/exec/test_exec.rb
index 6f4d12c..94bebeb 100644
--- a/test/exec/test_exec.rb
+++ b/test/exec/test_exec.rb
@@ -360,30 +360,24 @@ end
   def test_reexec
     File.open("config.ru", "wb") { |fp| fp.syswrite(HI) }
     pid_file = "#{@tmpdir}/test.pid"
-    ucfg = Tempfile.new('unicorn_test_config')
-    ucfg.syswrite("pid \"#{pid_file}\"\n")
     pid = fork do
       redirect_test_io do
-        exec($unicorn_bin, "-l#{@addr}:#{@port}", "-c#{ucfg.path}")
+        exec($unicorn_bin, "-l#{@addr}:#{@port}", "-P#{pid_file}")
       end
     end
-    wait_for_file(pid_file)
-    reexec_usr2_quit_test(pid, pid_file)
+    reexec_basic_test(pid, pid_file)
   end
 
   def test_reexec_alt_config
     config_file = "#{@tmpdir}/foo.ru"
-    pid_file = "#{@tmpdir}/test.pid"
-    ucfg = Tempfile.new('unicorn_test_config')
-    ucfg.syswrite("pid \"#{pid_file}\"\n")
     File.open(config_file, "wb") { |fp| fp.syswrite(HI) }
-    pid = xfork do
+    pid_file = "#{@tmpdir}/test.pid"
+    pid = fork do
       redirect_test_io do
-        exec($unicorn_bin, "-l#{@addr}:#{@port}", "-c#{ucfg.path}", config_file)
+        exec($unicorn_bin, "-l#{@addr}:#{@port}", "-P#{pid_file}", config_file)
       end
     end
-    wait_for_file(pid_file)
-    reexec_usr2_quit_test(pid, pid_file)
+    reexec_basic_test(pid, pid_file)
   end
 
   def test_unicorn_config_file
@@ -403,7 +397,8 @@ end
     File.open("config.ru", "wb") { |fp| fp.syswrite(HI) }
     pid = xfork do
       redirect_test_io do
-        exec($unicorn_bin, "-l#{@addr}:#{@port}", "-c#{ucfg.path}")
+        exec($unicorn_bin, "-l#{@addr}:#{@port}",
+             "-P#{pid_file}", "-c#{ucfg.path}")
       end
     end
     results = retry_hit(["http://#{@addr}:#{@port}/"])