On Tue, Oct 20, 2015 at 12:49 AM, Alex Harvey <[email protected]> wrote:

> Hi all,
>
> I am investigating whether or not I can use Beaker to do acceptance
> testing on roles and profiles.
>
> I've had a look at Liam Bennett's excellent blog posts -
>
> http://tech.opentable.co.uk/blog/2014/09/01/testing-puppet-with-beaker-pt-dot-3-testing-roles/
> http://www.slideshare.net/liamjbennett/cfgmgmt2015-testing-with-beaker
>
> I need to handle a situation in my tests where, say, a role that I am
> testing will apply a base class which will cause the node, for instance, to
> join a FreeIPA domain.  But I don't want Beaker to actually build a FreeIPA
> box.  And I don't want my short-lived node to join a real FreeIPA domain.
>
> I would hope that Beaker could either build Mock Services
> https://en.wikipedia.org/wiki/Mock_object
>
> Or better still, tell Beaker to expect the base class to try to apply the
> FreeIPA class, and just pretend it succeeds.  Just as you can stub out
> methods in rspec etc.
>
> Has anyone done anything like this before?
>

Have you looked into rspec-puppet (http://rspec-puppet.com/)? It should let
you do things like apply a class to a node (the role class) and then
inspect the catalog generated to see if it includes the base class in
question, without having to spin up a new machine (as long as you correctly
stub your facts) or worry about a machine actually connecting to a FreeIPA
domain.

After you have a strong base of rspec-puppet tests I would use Beaker to
ensure that the roles can *actually* spin up a FreeIPA box and join a
similarly spun up domain, in a way that can *relatively* quickly smoke test
small changes at a time before pushing them to a staging environment.


HTH,
Justin


> Kind regards,
> Alex Harvey
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/5493914c-ecc9-42e4-ad90-4151e0e75fbc%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/5493914c-ecc9-42e4-ad90-4151e0e75fbc%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CA%2B%3DBEqVP49Az08FLYJoFo2SSgs4esXa2TQvAmaYPjwBUO8Kb6A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to