Skip to content

Commit

Permalink
Test send_keepalive_packet option of PluginHelper::SocketOption for TLS
Browse files Browse the repository at this point in the history
Signed-off-by: Takuro Ashie <ashie@clear-code.com>
  • Loading branch information
ashie committed Mar 31, 2021
1 parent 2f8f5b4 commit 59f2116
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/plugin_helper/test_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,13 @@ class Dummy < Fluent::Plugin::TestBase
assert_raise(ArgumentError.new("BUG: backlog is available for tcp/tls")) do
@d.__send__(m, :myserver, PORT, proto: proto, backlog: 500){|x| x }
end
assert_raise(ArgumentError.new("BUG: send_keepalive_packet is available for tcp")) do
end

data(
'server_create udp' => [:server_create, :udp],
)
test 'raise error if tcp/tls send_keepalive_packet option is specified for udp' do |(m, proto)|
assert_raise(ArgumentError.new("BUG: send_keepalive_packet is available for tcp/tls")) do
@d.__send__(m, :myserver, PORT, proto: proto, send_keepalive_packet: true){|x| x }
end
end
Expand Down Expand Up @@ -1300,7 +1306,7 @@ def assert_certificate(cert, expected_extensions)

test 'can accept all keyword arguments valid for tcp/tls server' do
assert_nothing_raised do
@d.server_create_tls(:s, PORT, bind: '127.0.0.1', shared: false, resolve_name: true, linger_timeout: 10, backlog: 500, tls_options: @tls_options) do |data, conn|
@d.server_create_tls(:s, PORT, bind: '127.0.0.1', shared: false, resolve_name: true, linger_timeout: 10, backlog: 500, tls_options: @tls_options, send_keepalive_packet: true) do |data, conn|
# ...
end
end
Expand Down

0 comments on commit 59f2116

Please sign in to comment.