summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsiddheshwar-more <siddheshwar.more@clogeny.com>2014-10-20 14:52:43 +0530
committersiddheshwar-more <siddheshwar.more@clogeny.com>2014-10-20 14:52:43 +0530
commit8802793016eff0c543d69fafc807b81f425d689f (patch)
tree1bcec9be6ac0f2bcfdedc18efae6080d23da7bea
parent0886a6bd145a30375d69ec16d182f96faf79e41a (diff)
downloadchef-8802793016eff0c543d69fafc807b81f425d689f.tar.gz
Fixed review comments related to bootstrap config spec tests
-rw-r--r--spec/unit/knife/bootstrap_spec.rb40
1 files changed, 40 insertions, 0 deletions
diff --git a/spec/unit/knife/bootstrap_spec.rb b/spec/unit/knife/bootstrap_spec.rb
index b67427b22b..2599e44a56 100644
--- a/spec/unit/knife/bootstrap_spec.rb
+++ b/spec/unit/knife/bootstrap_spec.rb
@@ -415,6 +415,46 @@ describe Chef::Knife::Bootstrap do
end
end
+ context "from the knife config file" do
+ let(:knife_ssh) do
+ knife.name_args = ["config.example.com"]
+ Chef::Config[:knife][:ssh_user] = "curiosity"
+ Chef::Config[:knife][:ssh_port] = "2430"
+ Chef::Config[:knife][:forward_agent] = true
+ Chef::Config[:knife][:identity_file] = "~/.ssh/you.rsa"
+ Chef::Config[:knife][:ssh_gateway] = "towel.blinkenlights.nl"
+ Chef::Config[:knife][:host_key_verify] = true
+ knife.stub(:render_template).and_return("")
+ knife.config = {}
+ knife.merge_configs
+ knife.knife_ssh
+ end
+
+ it "configures the ssh user" do
+ knife_ssh.config[:ssh_user].should == 'curiosity'
+ end
+
+ it "configures the ssh port" do
+ knife_ssh.config[:ssh_port].should == '2430'
+ end
+
+ it "configures the ssh agent forwarding" do
+ knife_ssh.config[:forward_agent].should == true
+ end
+
+ it "configures the ssh identity file" do
+ knife_ssh.config[:identity_file].should == '~/.ssh/you.rsa'
+ end
+
+ it "configures the ssh gateway" do
+ knife_ssh.config[:ssh_gateway].should == 'towel.blinkenlights.nl'
+ end
+
+ it "configures the host key verify mode" do
+ knife_ssh.config[:host_key_verify].should == true
+ end
+ end
+
describe "when falling back to password auth when host key auth fails" do
let(:knife_ssh_with_password_auth) do
knife.name_args = ["foo.example.com"]