diff options
| author | Tim Smith <tsmith@chef.io> | 2018-09-21 15:04:09 -0700 |
|---|---|---|
| committer | Lamont Granquist <lamont@scriptkiddie.org> | 2019-03-11 12:20:20 -0700 |
| commit | df23dbbda7d4eb621804f004ff85181d83a11641 (patch) | |
| tree | dc4ac3d354e5b9eb3229ed9be56d5447cc9a1d85 /spec/unit/application | |
| parent | b870d8c578a6424e405ec2083d5f47d331f09d14 (diff) | |
| download | chef-df23dbbda7d4eb621804f004ff85181d83a11641.tar.gz | |
WIP: Remove audit mode from chef-client
This just gives us a line count to the change and perhaps a starting
point for when we do this in Chef 15
Signed-off-by: Tim Smith <tsmith@chef.io>
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/unit/application')
| -rw-r--r-- | spec/unit/application/client_spec.rb | 69 | ||||
| -rw-r--r-- | spec/unit/application/exit_code_spec.rb | 10 | ||||
| -rw-r--r-- | spec/unit/application/solo_spec.rb | 5 |
3 files changed, 0 insertions, 84 deletions
diff --git a/spec/unit/application/client_spec.rb b/spec/unit/application/client_spec.rb index 40f690abb1..f58d1ed079 100644 --- a/spec/unit/application/client_spec.rb +++ b/spec/unit/application/client_spec.rb @@ -337,75 +337,6 @@ Enable chef-client interval runs by setting `:client_fork = true` in your config end end - describe "audit mode" do - shared_examples "experimental feature" do - before do - allow(Chef::Log).to receive(:warn) - end - end - - shared_examples "unrecognized setting" do - it "fatals with a message including the incorrect setting" do - expect(Chef::Application).to receive(:fatal!).with(/Unrecognized setting #{mode} for audit mode/) - app.reconfigure - end - end - - shared_context "set via config file" do - before do - Chef::Config[:audit_mode] = mode - end - end - - shared_context "set via command line" do - before do - ARGV.replace(["--audit-mode", mode]) - end - end - - describe "enabled via config file" do - include_context "set via config file" do - let(:mode) { :enabled } - include_examples "experimental feature" - end - end - - describe "enabled via command line" do - include_context "set via command line" do - let(:mode) { "enabled" } - include_examples "experimental feature" - end - end - - describe "audit_only via config file" do - include_context "set via config file" do - let(:mode) { :audit_only } - include_examples "experimental feature" - end - end - - describe "audit-only via command line" do - include_context "set via command line" do - let(:mode) { "audit-only" } - include_examples "experimental feature" - end - end - - describe "unrecognized setting via config file" do - include_context "set via config file" do - let(:mode) { :derp } - include_examples "unrecognized setting" - end - end - - describe "unrecognized setting via command line" do - include_context "set via command line" do - let(:mode) { "derp" } - include_examples "unrecognized setting" - end - end - end - describe "when both the pidfile and lockfile opts are set to the same value" do before do diff --git a/spec/unit/application/exit_code_spec.rb b/spec/unit/application/exit_code_spec.rb index 7783cf3ed7..e8a0072ff3 100644 --- a/spec/unit/application/exit_code_spec.rb +++ b/spec/unit/application/exit_code_spec.rb @@ -49,10 +49,6 @@ describe Chef::Application::ExitCode do expect(valid_rfc_exit_codes.include?(3)).to eq(true) end - it "validates a AUDIT_MODE_FAILURE return code of 42" do - expect(valid_rfc_exit_codes.include?(42)).to eq(true) - end - it "validates a REBOOT_SCHEDULED return code of 35" do expect(valid_rfc_exit_codes.include?(35)).to eq(true) end @@ -98,12 +94,6 @@ describe Chef::Application::ExitCode do expect(exit_codes.normalize_exit_code(Exception.new("BOOM"))).to eq(1) end - it "returns AUDIT_MODE_FAILURE when there is an audit error" do - audit_error = Chef::Exceptions::AuditError.new("BOOM") - runtime_error = Chef::Exceptions::RunFailedWrappingError.new(audit_error) - expect(exit_codes.normalize_exit_code(runtime_error)).to eq(42) - end - it "returns REBOOT_SCHEDULED when there is an reboot requested" do reboot_error = Chef::Exceptions::Reboot.new("BOOM") runtime_error = Chef::Exceptions::RunFailedWrappingError.new(reboot_error) diff --git a/spec/unit/application/solo_spec.rb b/spec/unit/application/solo_spec.rb index 3f7c203c67..939300b7e4 100644 --- a/spec/unit/application/solo_spec.rb +++ b/spec/unit/application/solo_spec.rb @@ -49,11 +49,6 @@ describe Chef::Application::Solo do expect(Chef::Config[:solo]).to be_truthy end - it "should set audit-mode to :disabled" do - app.reconfigure - expect(Chef::Config[:audit_mode]).to be :disabled - end - describe "when configured to not fork the client process" do before do Chef::Config[:client_fork] = false |
