Thanks Patrick, I'll give that a try.

I'm not too worried about breaking existing configuration, or cached
facts. Everything will be running in a sandbox, which will be clean
prior to every test run.

On Aug 3, 12:22 pm, Patrick Mohr <kc7...@gmail.com> wrote:
> On Aug 2, 2010, at 5:50 PM, Jon Wilson wrote:
>
> > Hiya,
>
> > Is there a way I can easily generate the catalog for a particular
> > puppet client, without actually running Puppet on that client?
>
> > I'd like to write some unit tests for my Puppet master, which generate
> > catalogs for a set of clients, and check their content. This will
> > syntax & sanity check my manifests, without getting stuck in
> > certificate hell.
>
> Here's a command to get you started:
> puppetmasterd --compile clients.fqdn
>
> I'm not sure how, but some magic is being done to get the client's facts.  
> I'm assuming the facts are cached from an earlier run, but this is pure 
> speculation.
>
> If you run it with --verbose, it will send that information to stderr.
>
> To make the tests much shorter on failure, you probably want to test the erb 
> using "erb -x -P -T '-' $1 | ruby -c " and test the config using --parseonly.
>
> Warning: when the catalog is compiled, everything* that would normally be 
> done with storeconfigs will be done.  This means running tests like this can 
> affect your existing configuration.
>
> *I'm not actually sure it does everything, but it does most of the 
> storeconfigs stuff.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to