From b588ccbbf73547487f54fd1a9d5396d6848e8661 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 10 Sep 2023 19:21:05 +0000 Subject: tests: fold SO_KEEPALIVE check to Perl 5 integration No need to startup more processes than necessary. --- test/exec/test_exec.rb | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'test') diff --git a/test/exec/test_exec.rb b/test/exec/test_exec.rb index 55f828e..8494452 100644 --- a/test/exec/test_exec.rb +++ b/test/exec/test_exec.rb @@ -1,6 +1,5 @@ # -*- encoding: binary -*- - -# Copyright (c) 2009 Eric Wong +# Don't add to this file, new tests are in Perl 5. See t/README FLOCK_PATH = File.expand_path(__FILE__) require './test/test_helper' @@ -97,26 +96,6 @@ run lambda { |env| end end - def test_inherit_listener_unspecified - File.open("config.ru", "wb") { |fp| fp.write(HI) } - sock = TCPServer.new(@addr, @port) - sock.setsockopt(:SOL_SOCKET, :SO_KEEPALIVE, 0) - - pid = xfork do - redirect_test_io do - ENV['UNICORN_FD'] = sock.fileno.to_s - exec($unicorn_bin, sock.fileno => sock.fileno) - end - end - res = hit(["http://#@addr:#@port/"]) - assert_equal [ "HI\n" ], res - assert_shutdown(pid) - assert sock.getsockopt(:SOL_SOCKET, :SO_KEEPALIVE).bool, - 'unicorn should always set SO_KEEPALIVE on inherited sockets' - ensure - sock.close if sock - end - def test_working_directory_rel_path_config_file other = Tempfile.new('unicorn.wd') File.unlink(other.path) -- cgit v1.2.3-24-ge0c7