diff options
author | Mal Graty <mal.graty@googlemail.com> | 2017-11-28 11:06:16 +0000 |
---|---|---|
committer | Mal Graty <mal.graty@googlemail.com> | 2017-11-28 11:37:22 +0000 |
commit | edd8a50fed5899129dff538be0e92f125c5c12fd (patch) | |
tree | f994aa9b2bfd84805418b77a4a914203cec88fdc /spec/functional/knife | |
parent | 4b52680a30d43c4c41595379b78fce09ec8e70d8 (diff) | |
download | chef-edd8a50fed5899129dff538be0e92f125c5c12fd.tar.gz |
Refactor SSH attribute
Signed-off-by: Mal Graty <mal.graty@googlemail.com>
Diffstat (limited to 'spec/functional/knife')
-rw-r--r-- | spec/functional/knife/ssh_spec.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/functional/knife/ssh_spec.rb b/spec/functional/knife/ssh_spec.rb index fe1db2df20..3872d34322 100644 --- a/spec/functional/knife/ssh_spec.rb +++ b/spec/functional/knife/ssh_spec.rb @@ -181,7 +181,7 @@ describe Chef::Knife::Ssh do it "uses the ssh_attribute" do @knife.run - expect(@knife.get_ssh_attribute({ "knife_config" => "ec2.public_hostname" })).to eq("ec2.public_hostname") + expect(@knife.get_ssh_attribute({ "target" => "ec2.public_hostname" })).to eq("ec2.public_hostname") end end @@ -199,22 +199,22 @@ describe Chef::Knife::Ssh do context "when -a ec2.public_public_hostname is provided" do before do - setup_knife(["-a ec2.public_hostname", "*:*", "uptime"]) + setup_knife(["-a", "ec2.public_hostname", "*:*", "uptime"]) Chef::Config[:knife][:ssh_attribute] = nil end it "should use the value on the command line" do @knife.run - expect(@knife.config[:attribute]).to eq("ec2.public_hostname") + expect(@knife.config[:ssh_attribute]).to eq("ec2.public_hostname") end it "should override what is set in knife.rb" do # This is the setting imported from knife.rb Chef::Config[:knife][:ssh_attribute] = "fqdn" # Then we run knife with the -a flag, which sets the above variable - setup_knife(["-a ec2.public_hostname", "*:*", "uptime"]) + setup_knife(["-a", "ec2.public_hostname", "*:*", "uptime"]) @knife.run - expect(@knife.config[:attribute]).to eq("ec2.public_hostname") + expect(@knife.config[:ssh_attribute]).to eq("ec2.public_hostname") end end end @@ -305,7 +305,7 @@ describe Chef::Knife::Ssh do Chef::Config[:chef_server_url] = "http://localhost:9000" @api.post("/search/node?q=*:*&start=0&rows=1000", 200) do - %({"total":1, "start":0, "rows":[{"data": {"fqdn":"the.fqdn", "config": "the_public_hostname", "knife_config": "the_public_hostname" }}]}) + %({"total":1, "start":0, "rows":[{"data": {"fqdn":"the.fqdn", "target": "the_public_hostname"}}]}) end end |