diff options
Diffstat (limited to 'spec/unit/knife/core/bootstrap_context_spec.rb')
-rw-r--r-- | spec/unit/knife/core/bootstrap_context_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/unit/knife/core/bootstrap_context_spec.rb b/spec/unit/knife/core/bootstrap_context_spec.rb index 515381cf6e..3a32155063 100644 --- a/spec/unit/knife/core/bootstrap_context_spec.rb +++ b/spec/unit/knife/core/bootstrap_context_spec.rb @@ -213,6 +213,23 @@ EXPECTED end end + describe "fips mode" do + before do + Chef::Config[:fips] = true + end + + it "adds the chef version check" do + expect(bootstrap_context.config_content).to include <<-CONFIG.gsub(/^ {8}/, "") + fips true + require "chef/version" + chef_version = ::Chef::VERSION.split(".") + unless chef_version[0].to_i > 12 || (chef_version[0].to_i == 12 && chef_version[1].to_i >= 8) + raise "FIPS Mode requested but not supported by this client" + end + CONFIG + end + end + describe "verify_api_cert" do it "isn't set in the config_content by default" do expect(bootstrap_context.config_content).not_to include("verify_api_cert") |