diff options
author | Thom May <thom@may.lt> | 2016-04-27 18:11:12 +0100 |
---|---|---|
committer | Thom May <thom@may.lt> | 2016-04-27 18:11:12 +0100 |
commit | fae30e6a075977bfad381a22dd979601e350258d (patch) | |
tree | af8aac7006160c4782246e1ba9b5a2ea5e2a3a1e /chef-config/spec | |
parent | 68c9cbc93ed0d7dd995ae7240c1a8075c7d4387a (diff) | |
download | chef-fae30e6a075977bfad381a22dd979601e350258d.tar.gz |
Revert "Run in fips mode if node is fips enabled"
Diffstat (limited to 'chef-config/spec')
-rw-r--r-- | chef-config/spec/unit/config_spec.rb | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/chef-config/spec/unit/config_spec.rb b/chef-config/spec/unit/config_spec.rb index 8d0bc8f203..72c0981eca 100644 --- a/chef-config/spec/unit/config_spec.rb +++ b/chef-config/spec/unit/config_spec.rb @@ -19,7 +19,6 @@ require "spec_helper" require "chef-config/config" -require "ohai" RSpec.describe ChefConfig::Config do before(:each) do @@ -166,57 +165,6 @@ RSpec.describe ChefConfig::Config do allow(ChefConfig::Config).to receive(:path_accessible?).and_return(false) end - describe "ChefConfig::Config[:fips]" do - let(:fips_ohai) { double("Ohai::System", load_plugins: nil, require_plugin: nil) } - let(:fips_ohai_data) do - { - kernel: { - enabled: fips_ohai_value, - }, - } - end - let(:fips_ohai_value) { false } - - before(:all) do - @original_env = ENV.to_hash - end - - after(:all) do - ENV.clear - ENV.update(@original_env) - end - - before(:each) do - ENV["CHEF_FIPS"] = nil - allow(Ohai::System).to receive(:new).and_return(fips_ohai) - allow(fips_ohai).to receive(:[]).with(:fips).and_return(fips_ohai_data) - end - - it "returns false when no environment is set and ohai flag is disabled" do - expect(ChefConfig::Config[:fips]).to eq(false) - ChefConfig::Config.instance_eval { remove_instance_variable(:@sync_value) } - end - - context "when ENV['CHEF_FIPS'] is set" do - before do - ENV["CHEF_FIPS"] = "1" - end - - it "returns true" do - expect(ChefConfig::Config[:fips]).to eq(true) - end - end - - context "when fips is enabled in ohai data" do - let(:fips_ohai_value) { true } - - it "returns true" do - expect(ChefConfig::Config[:fips]).to eq(true) - ChefConfig::Config.instance_eval { remove_instance_variable(:@sync_value) } - end - end - end - describe "ChefConfig::Config[:chef_server_root]" do context "when chef_server_url isn't set manually" do it "returns the default of 'https://localhost:443'" do |