Firstly, forgive me if I get my terminology mixed up. Being sold on
the virtues of TDD, I have a growing itch to test our puppet
manifests. Now by this I dont mean testing, say, the mechanics of a
define to test that the right things *happen*, I mean being able to
say that given a collection of classes and parameters for a node, the
following resources should be created and the relationship between
them should be xyz.

How would I go about this? Is it a case of generating a catalog from
the manifest, parsing that and then making assertions on the result?
Does puppet already have a framework or API to enable this sort of
testing?

Some pseudo code to perhaps explain what I'd like to achieve:

c = generate_catalog(
  classes=['foo', 'bar'],
  parameters={
    'a':1,
    'b':2
  }),

assertEqual(
  c.resources.get("File['/foo/bar/baz']").mode,
  777,
)
assertTrue(c.resources.get("File['/foo/bar/baz']").parent is
c.resources.get("File['/foo/bar']"))

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@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