diff options
author | Eric Wong <BOFH@YHBT.net> | 2023-06-05 10:12:40 +0000 |
---|---|---|
committer | Eric Wong <bofh@yhbt.net> | 2023-06-05 10:38:48 +0000 |
commit | edb47aec2befe73fa953d00d85074d36d3307120 (patch) | |
tree | 9b3f4122c4e31b83739cc175423bcfb56657f71c /test/exec/test_exec.rb | |
parent | 96e404860c35860d30faf08bb16c2d5242f5697c (diff) | |
download | unicorn-edb47aec2befe73fa953d00d85074d36d3307120.tar.gz |
The Perl 5 tests already rely on this implicitly, and there was never a point when Perl 5 couldn't emulate systemd behavior.
Diffstat (limited to 'test/exec/test_exec.rb')
-rw-r--r-- | test/exec/test_exec.rb | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/test/exec/test_exec.rb b/test/exec/test_exec.rb index 2929b2e..1d3a0fd 100644 --- a/test/exec/test_exec.rb +++ b/test/exec/test_exec.rb @@ -97,39 +97,6 @@ run lambda { |env| end end - def test_sd_listen_fds_emulation - # [ruby-core:69895] [Bug #11336] fixed by r51576 - return if RUBY_VERSION.to_f < 2.3 - - File.open("config.ru", "wb") { |fp| fp.write(HI) } - sock = TCPServer.new(@addr, @port) - - [ %W(-l #@addr:#@port), nil ].each do |l| - sock.setsockopt(:SOL_SOCKET, :SO_KEEPALIVE, 0) - - pid = xfork do - redirect_test_io do - # pretend to be systemd - ENV['LISTEN_PID'] = "#$$" - ENV['LISTEN_FDS'] = '1' - - # 3 = SD_LISTEN_FDS_START - args = [ $unicorn_bin ] - args.concat(l) if l - args << { 3 => sock } - exec(*args) - 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' - end - ensure - sock.close if sock - end - def test_inherit_listener_unspecified File.open("config.ru", "wb") { |fp| fp.write(HI) } sock = TCPServer.new(@addr, @port) |