diff options
| author | Luke Kanies <luke@madstop.com> | 2007-11-19 01:36:48 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-11-19 01:36:48 -0600 |
| commit | 2b14f627aca1d5be69cf6606044df4d6e67f6eba (patch) | |
| tree | a20db3a608af483f598f482e743868413da8fd8f /test/network/client/master.rb | |
| parent | 9cf477b6cc771eab7bd29d18c49128571e877987 (diff) | |
| download | puppet-2b14f627aca1d5be69cf6606044df4d6e67f6eba.tar.gz puppet-2b14f627aca1d5be69cf6606044df4d6e67f6eba.tar.xz puppet-2b14f627aca1d5be69cf6606044df4d6e67f6eba.zip | |
Reverting the changes I'd made toward removing the global
resources. These are commits:
c19835ce9f8a5138b30a1a32ca741c996b0916d2
9290cc89a2206fb5204578f8e91208857a48b147
ffb4c2dbc7314b364d25e4f7be599ef05b767b44
Diffstat (limited to 'test/network/client/master.rb')
| -rwxr-xr-x | test/network/client/master.rb | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/test/network/client/master.rb b/test/network/client/master.rb index 0caba4bd2..7216af936 100755 --- a/test/network/client/master.rb +++ b/test/network/client/master.rb @@ -332,6 +332,39 @@ end assert(FileTest.exists?(file), "file was not created on second run") end + def test_default_objects + # Make sure they start out missing + assert_nil(Puppet::Type.type(:filebucket)["puppet"], + "default filebucket already exists") + assert_nil(Puppet::Type.type(:schedule)["daily"], + "default schedules already exists") + + master = mkclient() + + # Now make sure they got created + assert(Puppet::Type.type(:filebucket)["puppet"], + "default filebucket not found") + assert(Puppet::Type.type(:schedule)["daily"], + "default schedules not found") + + # clear everything, and make sure we can recreate them + Puppet::Type.allclear + assert_nil(Puppet::Type.type(:filebucket)["puppet"], + "default filebucket not removed") + assert_nil(Puppet::Type.type(:schedule)["daily"], + "default schedules not removed") + assert_nothing_raised { master.mkdefault_objects } + assert(Puppet::Type.type(:filebucket)["puppet"], + "default filebucket not found") + assert(Puppet::Type.type(:schedule)["daily"], + "default schedules not found") + + + # Make sure we've got schedules + assert(Puppet::Type.type(:schedule)["hourly"], "Could not retrieve hourly schedule") + assert(Puppet::Type.type(:filebucket)["puppet"], "Could not retrieve default bucket") + end + # #540 - make sure downloads aren't affected by noop def test_download_in_noop source = tempfile @@ -517,6 +550,24 @@ end assert_equal(facts["environment"], Puppet[:environment], "Did not add environment to client facts") end + # This is partially to fix #532, but also to save on memory. + def test_remove_objects_after_every_run + client = mkclient + + ftype = Puppet::Type.type(:file) + file = ftype.create :title => "/what/ever", :ensure => :present + config = Puppet::Node::Configuration.new + config.add_resource(file) + + config.expects :apply + + client.configuration = config + client.expects(:getconfig) + client.run + + assert_nil(ftype[@createdfile], "file object was not removed from memory") + end + # #685 def test_http_failures_do_not_kill_puppetd client = mkclient |
