SSH.up? returns false when an abrupt disconnect occurs
This commit is contained in:
parent
e855ae9965
commit
8d9e53fe27
|
@ -31,7 +31,7 @@ module Vagrant
|
|||
end
|
||||
|
||||
false
|
||||
rescue Errno::ECONNREFUSED
|
||||
rescue Errno::ECONNREFUSED, Net::SSH::Disconnect
|
||||
false
|
||||
end
|
||||
|
||||
|
|
|
@ -74,6 +74,13 @@ class SshTest < Test::Unit::TestCase
|
|||
assert !Vagrant::SSH.up?
|
||||
}
|
||||
end
|
||||
|
||||
should "return false if the connection is dropped" do
|
||||
Net::SSH.expects(:start).raises(Net::SSH::Disconnect)
|
||||
assert_nothing_raised {
|
||||
assert !Vagrant::SSH.up?
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
context "getting the ssh port" do
|
||||
|
|
Loading…
Reference in New Issue