diff --git a/config/default.rb b/config/default.rb index 2254050aa..f3d0bdf4d 100644 --- a/config/default.rb +++ b/config/default.rb @@ -2,6 +2,7 @@ Vagrant::Config.run do |config| # default config goes here config.vagrant.dotfile_name = ".vagrant" config.vagrant.host = :detect + config.vagrant.ssh_session_cache = false config.ssh.username = "vagrant" config.ssh.host = "127.0.0.1" diff --git a/lib/vagrant/config/vagrant.rb b/lib/vagrant/config/vagrant.rb index 545ec4859..ca9315b47 100644 --- a/lib/vagrant/config/vagrant.rb +++ b/lib/vagrant/config/vagrant.rb @@ -5,6 +5,7 @@ module Vagrant attr_accessor :dotfile_name attr_accessor :host + attr_accessor :ssh_session_cache def validate(errors) [:dotfile_name, :host].each do |field| diff --git a/lib/vagrant/ssh.rb b/lib/vagrant/ssh.rb index 02232a5b2..3b811a7fd 100644 --- a/lib/vagrant/ssh.rb +++ b/lib/vagrant/ssh.rb @@ -73,8 +73,12 @@ module Vagrant opts[:port] ||= port # Check if we have a currently open SSH session which has the - # same options, and use that if possible - session, options = @current_session + # same options, and use that if possible. + # + # NOTE: This is experimental and unstable. Therefore it is disabled + # by default. + session, options = nil + session, options = @current_session if env.config.vagrant.ssh_session_cache if session && options == opts # Verify that the SSH session is still valid diff --git a/test/vagrant/action/vm/network_test.rb b/test/vagrant/action/vm/network_test.rb index d33d7cf58..6745de52e 100644 --- a/test/vagrant/action/vm/network_test.rb +++ b/test/vagrant/action/vm/network_test.rb @@ -131,7 +131,7 @@ class NetworkVMActionTest < Test::Unit::TestCase adapter.expects(:enabled=).with(true) adapter.expects(:attachment_type=).with(:host_only).once - adapter.expects(:host_interface=).with(@network_name).once + adapter.expects(:host_only_interface=).with(@network_name).once if options[:mac] adapter.expects(:mac_address=).with(options[:mac].gsub(':', '')).once diff --git a/test/vagrant/environment_test.rb b/test/vagrant/environment_test.rb index a309b52a7..329fd6f14 100644 --- a/test/vagrant/environment_test.rb +++ b/test/vagrant/environment_test.rb @@ -11,11 +11,11 @@ class EnvironmentTest < Test::Unit::TestCase context "class method check virtualbox version" do setup do - VirtualBox.stubs(:version).returns("4.0.0") + VirtualBox.stubs(:version).returns("4.1.0") end should "not error and exit if everything is good" do - VirtualBox.expects(:version).returns("4.0.0") + VirtualBox.expects(:version).returns("4.1.0") assert_nothing_raised { @klass.check_virtualbox! } end diff --git a/test/vagrant/ssh_test.rb b/test/vagrant/ssh_test.rb index a23c2a853..61e02178f 100644 --- a/test/vagrant/ssh_test.rb +++ b/test/vagrant/ssh_test.rb @@ -12,7 +12,7 @@ class SshTest < Test::Unit::TestCase end setup do - VirtualBox.stubs(:version).returns("4.0.0") + VirtualBox.stubs(:version).returns("4.1.0") end context "connecting to external SSH" do