RE: Re: Issues running Test Kitchen in Audit mode (solved)

Found my issue, thank you!

[root@144121448268883544 kitchen]# whereis chef-client
chef-client: /usr/bin/chef-client /opt/chef/bin/chef-client /opt/chefdk/bin/chef-client
[root@144121448268883544 kitchen]# /opt/chefdk/bin/chef-client -version
Chef: 12.3.0
[root@144121448268883544 kitchen]# /opt/chef/bin/chef-client -version
Chef: 12.0.3

Anushan Rajakulasingam

-----Original Message-----
From: Rajakulasingam, Anushan
Sent: Wednesday, September 09, 2015 10:48 AM
Subject: RE: [chef] Re: Issues running Test Kitchen in Audit mode


On console if I type chef-client -version It spits out:
Chef: 12.3.0

But the running client itself is reporting 12.0.3 in the output… is this a bug?

Anushan Rajakulasingam

-----Original Message-----
From: Julian C. Dunn []
Sent: Tuesday, September 08, 2015 7:39 PM
Subject: [chef] Re: Issues running Test Kitchen in Audit mode

The output indicates you’re running Chef Client 12.0.3 not 12.3.0.
Audit mode was added in 12.1.0.

  • Julian

On Tue, Sep 8, 2015 at 1:58 PM, Rajakulasingam, Anushan wrote:

Hello all,

I’m attempting to use test kitchen with chef-audit to test some of my audits but running into the following error:

   [2015-09-08T13:42:37-04:00] ERROR: No resource or method named `control_group' for `Chef::Recipe "default"'

See below for debug info. This runs fine on the actual server but via test kitchen fails with the above message… any ideas?

Application Versions

Test Kitchen: 1.4.0
Chef-Client: 12.3.0
Chefdk: 0.6.2 Release: 1.el6

Kitchen YML File

name: ssh
hostname: <%= ENV[‘vagrant_ip’] %>
port: '22’
username: username
password: xxxxxxxx

name: chef_zero
audit_mode: :audit_only

  • name: rhel-6.3


  • name: default
    • recipe[test-audit::default]

default.rb Recipe/Audit

Cookbook Name:: test-audit

Recipe:: default

Copyright © 2015 The Authors, All Rights Reserved.

control_group ‘Blog Post Examples’ do
control ‘SSH’ do
it ‘should be listening on port 22’ do
expect(port(22)).to be_listening

Trace from Test Kitchen

-----> Starting Kitchen (v1.4.0)
-----> Cleaning up any prior instances of Destroying
-----> …
Kitchen-ssh does not destroy your server ‘’ by shutting it down…
Shutdown your server ‘’ natively with user ''
in your cloud or virtualisation console etc.\n
Finished destroying (0m0.00s).
-----> Testing
-----> Creating …
Kitchen-ssh does not start your server ‘’ but will look for an ssh connection with user ‘vagrant’
[SSH] Established
Kitchen-ssh found ssh ready on host ‘’ with user ‘vagrant’

   Finished creating <default-rhel-63> (0m1.21s).

-----> Converging …
$$$$$$ Running legacy converge for ‘Ssh’ Driver
Preparing files for transfer
Preparing dna.json
Resolving cookbook dependencies with Berkshelf 3.3.0…
Removing non-cookbook files before transfer
Preparing validation.pem
Preparing client.rb
-----> Chef Omnibus installation detected (install only if missing)
Transferring files to
Starting Chef Client, version 12.0.3
[2015-09-08T13:42:37-04:00] WARN: Child with name ‘dna.json’ found in multiple directories: /tmp/kitchen/dna.json and /tmp/kitchen/dna.json
resolving cookbooks for run list: [“test-audit::default”]
Synchronizing Cookbooks:
- test-audit
Compiling Cookbooks…

   Recipe Compile Error in 



   No resource or method named `control_group' for `Chef::Recipe "default"'

   Cookbook Trace:
     /tmp/kitchen/cache/cookbooks/test-audit/recipes/default.rb:7:in `from_file'

   Relevant File Content:

     1:  #
     2:  # Cookbook Name:: test-audit
     3:  # Recipe:: default
     4:  #
     5:  # Copyright (c) 2015 The Authors, All Rights Reserved.
     7>> control_group 'Blog Post Examples' do
     8:    control 'SSH' do
     9:      it 'should be listening on port 22' do
    10:        expect(port(22)).to be_listening
    11:      end
    12:    end
    13:  end

   Running handlers:
   [2015-09-08T13:42:37-04:00] ERROR: Running exception handlers
   Running handlers complete
   [2015-09-08T13:42:37-04:00] ERROR: Exception handlers complete
   [2015-09-08T13:42:37-04:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
   Chef Client failed. 0 resources updated in 8.00419466 seconds
   [2015-09-08T13:42:37-04:00] ERROR: No resource or method named `control_group' for `Chef::Recipe "default"'
   [2015-09-08T13:42:39-04:00] FATAL: 

Chef::Exceptions::ChildConvergeError: Chef run process exited
unsuccessfully (exit code 1)

Converge failed on instance .
Please see .kitchen/logs/default-rhel-63.log for more details
Class: Kitchen::ActionFailed
Message: SSH exited (1) for command: [sh -c ’

sudo -E /opt/chef/bin/chef-client --local-mode --config
/tmp/kitchen/client.rb --log_level auto --force-formatter --no-color
–json-attributes /tmp/kitchen/dna.json --chef-zero-port 8889 ']

Anushan Rajakulasingam

[ Julian C. Dunn * Sorry, I’m ]
[ WWW: * only Web 1.0 ]
[ gopher:// * compliant! ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]