diff options
author | Salim Alam <salam@chef.io> | 2016-03-30 09:41:38 -0700 |
---|---|---|
committer | Salim Alam <salam@chef.io> | 2016-03-30 09:41:38 -0700 |
commit | a7ffc40d060c73bb883307eaa3f3df3a63ae874c (patch) | |
tree | 3bcecdd67343a54a9b61ee7df10a6ee39f89f8dc /spec | |
parent | c4c6faa08d90b7116c3a927f7147249d89913fab (diff) | |
parent | e82138ddf51e6f45fc3d215866ccc48845b6e0c3 (diff) | |
download | chef-a7ffc40d060c73bb883307eaa3f3df3a63ae874c.tar.gz |
Merge pull request #4767 from chef/salam/timeout
Add option to set knife ssh timeout
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/knife/ssh_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/unit/knife/ssh_spec.rb b/spec/unit/knife/ssh_spec.rb index 3a8728515d..65cc5a97b4 100644 --- a/spec/unit/knife/ssh_spec.rb +++ b/spec/unit/knife/ssh_spec.rb @@ -203,6 +203,23 @@ describe Chef::Knife::Ssh do expect(@knife.session.servers[0].port).to eq(123) end + it "uses the timeout from Chef Config" do + Chef::Config[:knife][:ssh_timeout] = 5 + @knife.session_from_list([["the.b.org", nil]]) + expect(@knife.session.servers[0].options[:timeout]).to eq(5) + end + + it "uses the timeout from knife config" do + @knife.config[:ssh_timeout] = 6 + @knife.session_from_list([["the.b.org", nil]]) + expect(@knife.session.servers[0].options[:timeout]).to eq(6) + end + + it "defaults to no timeout" do + @knife.session_from_list([["the.b.org", nil]]) + expect(@knife.session.servers[0].options[:timeout]).to eq(nil) + end + it "uses the user from an ssh config file" do @knife.session_from_list([["the.b.org", 123]]) expect(@knife.session.servers[0].user).to eq("locutus") |