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/integration/client | |
| 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/integration/client')
| -rw-r--r-- | spec/integration/client/client_spec.rb | 39 | ||||
| -rw-r--r-- | spec/integration/client/exit_code_spec.rb | 27 |
2 files changed, 0 insertions, 66 deletions
diff --git a/spec/integration/client/client_spec.rb b/spec/integration/client/client_spec.rb index d15a7d2afa..afe94f854e 100644 --- a/spec/integration/client/client_spec.rb +++ b/spec/integration/client/client_spec.rb @@ -407,45 +407,6 @@ describe "chef-client" do end end - when_the_repository "has a cookbook with only an audit recipe" do - - before do - file "config/client.rb", <<~EOM - local_mode true - cookbook_path "#{path_to('cookbooks')}" - audit_mode :enabled - EOM - end - - it "should exit with a zero code when there is not an audit failure" do - file "cookbooks/audit_test/recipes/succeed.rb", <<~RECIPE - control_group "control group without top level control" do - it "should succeed" do - expect(2 - 2).to eq(0) - end - end - RECIPE - - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'audit_test::succeed' -l info", cwd: chef_dir) - expect(result.error?).to be_falsey - expect(result.stdout).to include("Successfully executed all `control_group` blocks and contained examples") - end - - it "should exit with a non-zero code when there is an audit failure" do - file "cookbooks/audit_test/recipes/fail.rb", <<~RECIPE - control_group "control group without top level control" do - it "should fail" do - expect(2 - 2).to eq(1) - end - end - RECIPE - - result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'audit_test::fail'", cwd: chef_dir) - expect(result.error?).to be_truthy - expect(result.stdout).to include("Failure/Error: expect(2 - 2).to eq(1)") - end - end - when_the_repository "has a cookbook that deploys a file" do before do file "cookbooks/x/recipes/default.rb", <<~RECIPE diff --git a/spec/integration/client/exit_code_spec.rb b/spec/integration/client/exit_code_spec.rb index a6e070f9a5..2e29502070 100644 --- a/spec/integration/client/exit_code_spec.rb +++ b/spec/integration/client/exit_code_spec.rb @@ -34,14 +34,6 @@ describe "chef-client" do EOM end - def setup_client_rb_with_audit_mode - file "config/client.rb", <<~EOM - local_mode true - cookbook_path "#{path_to('cookbooks')}" - audit_mode :audit_only - EOM - end - def run_chef_client_and_expect_exit_code(exit_code) shell_out!("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir, @@ -63,25 +55,6 @@ describe "chef-client" do end end - context "with an audit recipe" do - context "which fails" do - before do - file "cookbooks/x/recipes/default.rb", <<~RECIPE - control_group "control group without top level control" do - it "should fail" do - expect(4 - 4).to eq(1) - end - end - RECIPE - end - - it "exits with AUDIT_MODE_FAILURE, 42" do - setup_client_rb_with_audit_mode - run_chef_client_and_expect_exit_code 42 - end - end - end - context "with a recipe" do context "which throws an error" do before { file "cookbooks/x/recipes/default.rb", "raise 'BOOM'" } |
