summaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
authorMarc A. Paradise <marc.paradise@gmail.com>2019-04-30 16:00:08 -0400
committerMarc A. Paradise <marc.paradise@gmail.com>2019-05-02 12:44:32 -0400
commitd0a9fd16d42a02cbc4b6ad73831a2521c6e7f0e4 (patch)
tree4a186779c2cf3aa245f6538ca074227b7154793a /spec/unit
parentb4668dc854258ea65f2bbf71a31e19210d01ad95 (diff)
downloadchef-d0a9fd16d42a02cbc4b6ad73831a2521c6e7f0e4.tar.gz
Require 'net/ssh' before we reference it.
This also updates bootstrap to provide `non_interactive` as an option to TrainConnector, instead of TrainConnector setting it behind the scenes. Bootstrap uses non-interactive to ensure that we don't get net/ssh prompts for password in case of password failure. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/knife/bootstrap_spec.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/spec/unit/knife/bootstrap_spec.rb b/spec/unit/knife/bootstrap_spec.rb
index 5bef9c5659..995a2ef4c9 100644
--- a/spec/unit/knife/bootstrap_spec.rb
+++ b/spec/unit/knife/bootstrap_spec.rb
@@ -961,6 +961,7 @@ describe Chef::Knife::Bootstrap do
sudo: false,
verify_host_key: false,
port: 9999,
+ non_interactive: true,
}
end
@@ -1012,6 +1013,7 @@ describe Chef::Knife::Bootstrap do
sudo: true, # ccli
verify_host_key: false, # Config
port: 12, # cli
+ non_interactive: true,
}
end
@@ -1060,6 +1062,7 @@ describe Chef::Knife::Bootstrap do
sudo_options: "-H",
sudo_password: "blah",
verify_host_key: true,
+ non_interactive: true,
}
end
it "generates a config hash using the CLI options and pulling nothing from Chef::Config" do
@@ -1079,6 +1082,7 @@ describe Chef::Knife::Bootstrap do
keys_only: false,
sudo: false,
verify_host_key: true,
+ non_interactive: true,
}
end
it "populates appropriate defaults" do
@@ -1430,13 +1434,13 @@ describe Chef::Knife::Bootstrap do
before do
knife.config[:ssh_forward_agent] = true
end
- it "returns a configuration hash with forward_agent set to true" do
- expect(knife.ssh_opts).to eq({ forward_agent: true })
+ it "returns a configuration hash with forward_agent set to true. non-interactive is always true" do
+ expect(knife.ssh_opts).to eq({ forward_agent: true, non_interactive: true })
end
end
context "when ssh_forward_agent is not set" do
- it "returns a configuration hash with forward_agent set to false" do
- expect(knife.ssh_opts).to eq({ forward_agent: false })
+ it "returns a configuration hash with forward_agent set to false. non-interactive is always true" do
+ expect(knife.ssh_opts).to eq({ forward_agent: false, non_interactive: true })
end
end
end