[chef] Re: Re: Minitest dependencies in test-kitchen

Chronological Thread 
  • From: John Dewey < >
  • To:
  • Subject: [chef] Re: Re: Minitest dependencies in test-kitchen
  • Date: Sun, 2 Sep 2012 22:22:50 -0700

I need to go ticket hunting first :P…  Well i'll push up what I have, since I have some tests that may be useful.

Thanks for the tips on the configuration block.  Looks like it's working now, although it's a bit moot now (at least I learned something :)).


On Sunday, September 2, 2012 at 9:24 PM, Joshua Timberman wrote:


On Sep 2, 2012, at 12:36 PM, John Dewey < "> > wrote:

I am in the process of adding configuration support to the openssh community cookbook.

Awesome :-).

Have you seen this ticket?

Discussion has stalled as we haven't caught up in the resolved ticket backlog for code review, though.

The config.rb writes out a template and notifies the ssh service. The ssh service is defined in default.rb (by default),
and I encounter the following error. Is there a way around this?

[Sun, 02 Sep 2012 18:28:27 +0000] DEBUG: Found recipe config in cookbook openssh [80/987]
[Sun, 02 Sep 2012 18:28:27 +0000] ERROR: Running exception handlers
[Sun, 02 Sep 2012 18:28:27 +0000] ERROR: Exception handlers complete
[Sun, 02 Sep 2012 18:28:27 +0000] DEBUG: Re-raising exception: Chef::Exceptions::ResourceNotFound - Cannot find a resource matching service[ssh] (did you define it first?)
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/resource_collection.rb:115:in `lookup'

My Kitchenfile looks like this.

cookbook "openssh" do
configuration("config") { runtimes [] }
runtimes []

You'll need to add a configuration for "default", too. The way the Kitchenfile works here is if there aren't any configurations defined, then "default" is used. Otherwise, it only tests the listed configurations.

I believe this is because the "default" recipe might do "include_recipe", so you could add the included recipe as a configuration along with others.

cookbook "openssh" do
configuration("default") { runtimes [] }
configuration("config") { runtimes [] }
runtimes []

Opscode, Inc
Joshua Timberman, Technical Community Manager
IRC, Skype, Twitter, Github: jtimberman

Archive powered by MHonArc 2.6.16.