summaryrefslogtreecommitdiffstats
path: root/test/network/client/master.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-12-19 13:43:22 -0600
committerLuke Kanies <luke@madstop.com>2007-12-19 13:43:22 -0600
commit927cb24c0a6783b87bc511227f1640143c4a4649 (patch)
tree5f378bdf165d86d5f9b31afb4c2914c3176d5559 /test/network/client/master.rb
parentc998a254578e2ce1cbc6c8078b600aa6bf743038 (diff)
downloadpuppet-927cb24c0a6783b87bc511227f1640143c4a4649.tar.gz
puppet-927cb24c0a6783b87bc511227f1640143c4a4649.tar.xz
puppet-927cb24c0a6783b87bc511227f1640143c4a4649.zip
Fixing #967 -- default resources no longer conflict with
managed resources.
Diffstat (limited to 'test/network/client/master.rb')
-rwxr-xr-xtest/network/client/master.rb21
1 files changed, 18 insertions, 3 deletions
diff --git a/test/network/client/master.rb b/test/network/client/master.rb
index 60058aed9..3ec1d4d36 100755
--- a/test/network/client/master.rb
+++ b/test/network/client/master.rb
@@ -333,14 +333,16 @@ end
assert(FileTest.exists?(file), "file was not created on second run")
end
- def test_default_objects
+ def test_default_resources
+ client = mkclient()
+
# 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()
+ client.make_default_resources
# Now make sure they got created
assert(Puppet::Type.type(:filebucket)["puppet"],
@@ -354,7 +356,7 @@ end
"default filebucket not removed")
assert_nil(Puppet::Type.type(:schedule)["daily"],
"default schedules not removed")
- assert_nothing_raised { master.mkdefault_objects }
+ assert_nothing_raised { client.make_default_resources }
assert(Puppet::Type.type(:filebucket)["puppet"],
"default filebucket not found")
assert(Puppet::Type.type(:schedule)["daily"],
@@ -366,6 +368,19 @@ end
assert(Puppet::Type.type(:filebucket)["puppet"], "Could not retrieve default bucket")
end
+ # #965 - make sure default objects don't conflict with existing
+ # objects.
+ def test_default_resources_do_not_conflict_with_managed_resources
+ # Create some that conflict with our defaults
+ bucket = Puppet::Type.type(:filebucket).create :name => "puppet"
+ schedule = Puppet::Type.type(:schedule).create :name => "daily"
+
+ client = mkclient()
+
+ # Then make sure creating new defaults doesn't throw an exception.
+ assert_nothing_raised("Default resources conflicted with resources in the catalog") { client.make_default_resources }
+ end
+
# #540 - make sure downloads aren't affected by noop
def test_download_in_noop
source = tempfile