summaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
authormarkgibbons <mark.gibbons@nordstrom.com>2019-05-08 15:35:07 -0700
committermarkgibbons <mark.gibbons@nordstrom.com>2019-05-08 15:42:23 -0700
commitf52f71d4c98ea876fc50ebbe023de22871937069 (patch)
tree4525642f344d2dc1102d6b8c5ed94488f365c9a1 /spec/unit
parente793c825c857af87e745a8af479af71522ff20db (diff)
downloadchef-f52f71d4c98ea876fc50ebbe023de22871937069.tar.gz
Use exports compatibile with /bin/sh in the bootstrap script
The bootstrap script is explicitly using /bin/sh. On some solaris servers the version of /bin/sh exporting environment variables using "export id=value" fails. The form "id=value export id" does work. Bootstrap fails when the wrong form is used. Signed-off-by: markgibbons <mark.gibbons@nordstrom.com>
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/knife/bootstrap_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/unit/knife/bootstrap_spec.rb b/spec/unit/knife/bootstrap_spec.rb
index f24dec6fa7..5280e3b64b 100644
--- a/spec/unit/knife/bootstrap_spec.rb
+++ b/spec/unit/knife/bootstrap_spec.rb
@@ -131,6 +131,28 @@ describe Chef::Knife::Bootstrap do
end
end
+ context "with --bootstrap-proxy" do
+ let(:bootstrap_cli_options) { [ "--bootstrap-proxy", "1.1.1.1" ] }
+ let(:rendered_template) do
+ knife.merge_configs
+ knife.render_template
+ end
+ it "configures the https_proxy environment variable in the bootstrap template correctly" do
+ expect(rendered_template).to match(%r{https_proxy="1.1.1.1" export https_proxy})
+ end
+ end
+
+ context "with --bootstrap-no-proxy" do
+ let(:bootstrap_cli_options) { [ "--bootstrap-no-proxy", "localserver" ] }
+ let(:rendered_template) do
+ knife.merge_configs
+ knife.render_template
+ end
+ it "configures the https_proxy environment variable in the bootstrap template correctly" do
+ expect(rendered_template).to match(%r{no_proxy="localserver" export no_proxy})
+ end
+ end
+
context "with :bootstrap_template and :template_file cli options" do
let(:bootstrap_cli_options) { [ "--bootstrap-template", "my-template", "other-template" ] }