File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,11 @@ VAGRANTFILE_API_VERSION = "2"
22
33Vagrant . configure ( VAGRANTFILE_API_VERSION ) do |config |
44 config . vm . box = 'hashicorp/precise64'
5+ config . vm . provision "shell" , inline : <<-SHELL
6+ echo 'ClientAliveInterval 1' >> /etc/ssh/sshd_config
7+ echo 'ClientAliveCountMax 1' >> /etc/ssh/sshd_config
8+ service ssh restart
9+ SHELL
510
611 json_config_path = File . join ( "test" , "boxes.json" )
712 list = File . open ( json_config_path ) . read
Original file line number Diff line number Diff line change @@ -212,6 +212,20 @@ def test_interaction_handler
212212 end . run
213213 assert_equal ( "Enter Data\n Captured SOME DATA" , captured_command_result )
214214 end
215+
216+ def test_connection_pool_keepalive
217+ # ensure we enable connection pool
218+ SSHKit ::Backend ::Netssh . pool . idle_timeout = 10
219+ Netssh . new ( a_host ) do |_host |
220+ test :false
221+ end . run
222+ sleep 2.5
223+ captured_command_result = nil
224+ Netssh . new ( a_host ) do |_host |
225+ captured_command_result = capture ( :echo , 'some_value' )
226+ end . run
227+ assert_equal "some_value" , captured_command_result
228+ end
215229 end
216230
217231 end
You can’t perform that action at this time.
0 commit comments