summaryrefslogtreecommitdiff
path: root/spec/unit/knife/core/windows_bootstrap_context_spec.rb
diff options
context:
space:
mode:
authorMarc A. Paradise <marc.paradise@gmail.com>2019-04-24 14:36:56 -0400
committerMarc A. Paradise <marc.paradise@gmail.com>2019-04-29 18:33:22 -0400
commitb95649acc976ea33bd46fdd073869d70fb689684 (patch)
treef89e42673ccbaf0092c530332515fb8116efb4e7 /spec/unit/knife/core/windows_bootstrap_context_spec.rb
parent945b9f6636bb3236999ca43f313113bf74045d82 (diff)
downloadchef-b95649acc976ea33bd46fdd073869d70fb689684.tar.gz
Ensure license is accepted on remote bootstrap target
When performing the initial `chef-client` converge on a bootstrapped host, ensure that we set the license environment variable that indicates the license was accepted. This will allow the run to continue under Chef 15, which requires license acceptance. I used the environment variable instead of the CLI flag because older versions of Chef do not support the CLI flag. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
Diffstat (limited to 'spec/unit/knife/core/windows_bootstrap_context_spec.rb')
-rw-r--r--spec/unit/knife/core/windows_bootstrap_context_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/unit/knife/core/windows_bootstrap_context_spec.rb b/spec/unit/knife/core/windows_bootstrap_context_spec.rb
index 3ab173f316..a19ad11247 100644
--- a/spec/unit/knife/core/windows_bootstrap_context_spec.rb
+++ b/spec/unit/knife/core/windows_bootstrap_context_spec.rb
@@ -264,4 +264,12 @@ describe Chef::Knife::Core::WindowsBootstrapContext do
end
end
end
+
+ describe "#start_chef" do
+ it "the command includes the license acceptance environment variable" do
+ expect(bootstrap_context.start_chef).to match(/SET "CHEF_LICENSE=accept"\n/m)
+ end
+
+ end
+
end