On 16/09/11 18:26, Brice Figureau wrote:
> On Fri, 2011-09-16 at 09:20 -0700, Luke Kanies wrote:
>> On Sep 16, 2011, at 2:05 AM, Brice Figureau wrote:
>>> [snipped failing test]
>>>
>> In general, this has usually turned out to be a problem with Settings
>> retaining the fact that it has called use(), and thus refusing to
>> create directories (because it thinks that would be a duplicate).
>>
>> Does it change anything if you run Puppet.settings.clear before your
>> test?  I thought this was being called between every test, but if
>> there's an interaction between tests, there's obviously some kind of
>> state being retained.
> 
> Yes, it works. But it doesn't if the Puppet.settings.clear happens in
> the before, which might explain why it doesn't work when settings are
> cleared after every test in my case.
> 
> I guess I'll have to dig deeper...

OK, I found what happens. To use the various settings directory we need
to call Puppet.settings.use to realize them.

This for the ssl case is done when any terminus inheriting from the
ssl_file one is initialized. This can happen when we try to create the
singleton ssl host (by calling P::S::Host.localhost), because we're
using the ssl_file terminus.

Now, what happens when we run the ca_spec tests first is that it itself
initialize the terminus, which in turns does the Puppet.settings.use.
But at the end of every test we clear the settings, which also clears
what has been created during the call of use. But this doesn't reset any
initialized terminus. When the host_spec tests runs, no call to use is
done, and the various ssldir or vardir are not created.

So the correct fix is I guess to add a Puppet.settings.use :main, :ssl
to the test.
-- 
Brice Figureau
My Blog: http://www.masterzen.fr/

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to