You can actually do something like that :)
Beaker is going to run you Puppet code on the node(s) it spins up,
probably using apply manifest like so:
apply_manifest(pp, :catch_failures=>true)
If this sees an error while doing so (because your FreeIP class
doesn't apply) then it will throw an error. However...
If you check the API docs you can see:
http://www.rubydoc.info/github/puppetlabs/beaker/Beaker/DSL/Helpers/PuppetHelpers#apply_manifest_on-instance_method
apply_manifest(pp, :accept_all_exit_codes => true)
This will run your puppet code and not throw an error.
Now, whether this works for you really depends on if any other classes
depend on the FreeIPA class. And you can't easily test for idempotent
runs easily with this.
Another approach if you can change the puppet code is to introduce a
switch in the profile, for instance if a fact exists like MOCK_FREEIPA
you could not include the class. And then drop that fact into your
beaker test environment.
Also see the other points about testing at different levels but you
can absolutely do it in your acceptance tests.
Gareth
--
Gareth Rushgrove
@garethr
devopsweekly.com
morethanseven.net
garethrushgrove.com