summaryrefslogtreecommitdiff
path: root/spec/functional
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2017-01-20 17:13:46 +0000
committerThom May <thom@chef.io>2017-01-23 12:26:44 +0000
commitecd7a7b0260b8f4647f6971661f42427b8ed32c5 (patch)
treebd1da52a96febed961f204891f138f393ceda57c /spec/functional
parenta2e1d1d4edb74a968b416517fdbdf35740686467 (diff)
downloadchef-ecd7a7b0260b8f4647f6971661f42427b8ed32c5.tar.gz
Ensure ssh search paginates correctlytm/fix_ssh_search
Also use partial search for much small on-the-wire sizes Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'spec/functional')
-rw-r--r--spec/functional/knife/ssh_spec.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/functional/knife/ssh_spec.rb b/spec/functional/knife/ssh_spec.rb
index 065b646ac6..aea7585bb2 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(Chef::Node.new)).to eq("ec2.public_hostname")
+ expect(@knife.get_ssh_attribute({ "knife_config" => "ec2.public_hostname" })).to eq("ec2.public_hostname")
end
end
@@ -193,11 +193,11 @@ describe Chef::Knife::Ssh do
it "uses the default" do
@knife.run
- expect(@knife.get_ssh_attribute(Chef::Node.new)).to eq("fqdn")
+ expect(@knife.get_ssh_attribute({ "fqdn" => "fqdn" })).to eq("fqdn")
end
end
- context "when -a ec2.public_ipv4 is provided" do
+ context "when -a ec2.public_public_hostname is provided" do
before do
setup_knife(["-a ec2.public_hostname", "*:*", "uptime"])
Chef::Config[:knife][:ssh_attribute] = nil
@@ -276,8 +276,8 @@ describe Chef::Knife::Ssh do
Chef::Config[:client_key] = nil
Chef::Config[:chef_server_url] = "http://localhost:9000"
- @api.get("/search/node?q=*:*&sort=X_CHEF_id_CHEF_X%20asc&start=0", 200) do
- %({"total":1, "start":0, "rows":[{"name":"i-xxxxxxxx", "json_class":"Chef::Node", "automatic":{"fqdn":"the.fqdn", "ec2":{"public_hostname":"the_public_hostname"}},"recipes":[]}]})
+ @api.post("/search/node?q=*:*&sort=X_CHEF_id_CHEF_X%20asc&start=0", 200) do
+ %({"total":1, "start":0, "rows":[{"data": {"fqdn":"the.fqdn", "config": "the_public_hostname", "knife_config": "the_public_hostname" }}]})
end
end