summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-12-11 15:35:36 -0600
committerLuke Kanies <luke@madstop.com>2007-12-11 15:35:36 -0600
commitcb0c4eebb0a7b2fadc5e0487e1c692007cb8b2e5 (patch)
treeb4284addea69adf9d19028ff1bab94035b1c1827 /test
parent7ac3bd79621f6c66cd3b5b7041aeba83c27c3602 (diff)
downloadpuppet-cb0c4eebb0a7b2fadc5e0487e1c692007cb8b2e5.tar.gz
puppet-cb0c4eebb0a7b2fadc5e0487e1c692007cb8b2e5.tar.xz
puppet-cb0c4eebb0a7b2fadc5e0487e1c692007cb8b2e5.zip
Renaming 'configuration' to 'catalog', fixing #954.
Diffstat (limited to 'test')
-rwxr-xr-xtest/language/ast/hostclass.rb2
-rwxr-xr-xtest/language/compile.rb6
-rwxr-xr-xtest/language/functions.rb14
-rwxr-xr-xtest/language/snippets.rb14
-rw-r--r--test/lib/puppettest/parsertesting.rb2
-rw-r--r--test/lib/puppettest/support/assertions.rb4
-rwxr-xr-xtest/lib/puppettest/support/resources.rb4
-rw-r--r--test/lib/puppettest/support/utils.rb14
-rwxr-xr-xtest/network/client/client.rb6
-rwxr-xr-xtest/network/client/master.rb6
-rwxr-xr-xtest/other/events.rb8
-rwxr-xr-xtest/other/overrides.rb2
-rwxr-xr-xtest/other/relationships.rb2
-rwxr-xr-xtest/other/report.rb2
-rwxr-xr-xtest/other/transactions.rb54
-rwxr-xr-xtest/ral/manager/instances.rb4
-rwxr-xr-xtest/ral/manager/type.rb30
-rwxr-xr-xtest/ral/types/basic.rb2
-rwxr-xr-xtest/ral/types/cron.rb4
-rwxr-xr-xtest/ral/types/exec.rb10
-rwxr-xr-xtest/ral/types/file.rb24
-rwxr-xr-xtest/ral/types/file/target.rb4
-rwxr-xr-xtest/ral/types/fileignoresource.rb6
-rwxr-xr-xtest/ral/types/filesources.rb10
-rwxr-xr-xtest/ral/types/group.rb4
-rwxr-xr-xtest/ral/types/host.rb4
-rwxr-xr-xtest/ral/types/parameter.rb6
-rwxr-xr-xtest/ral/types/sshkey.rb4
-rwxr-xr-xtest/ral/types/tidy.rb2
-rwxr-xr-xtest/ral/types/user.rb18
30 files changed, 136 insertions, 136 deletions
diff --git a/test/language/ast/hostclass.rb b/test/language/ast/hostclass.rb
index 62d4f9ee3..80032f30c 100755
--- a/test/language/ast/hostclass.rb
+++ b/test/language/ast/hostclass.rb
@@ -175,7 +175,7 @@ class TestASTHostClass < Test::Unit::TestCase
sub = parser.newclass "sub", :parent => "base"
base.expects(:safeevaluate).with do |args|
- assert(scope.compile.configuration.tags.include?("sub"), "Did not tag with sub class name before evaluating base class")
+ assert(scope.compile.catalog.tags.include?("sub"), "Did not tag with sub class name before evaluating base class")
base.evaluate(args)
true
end
diff --git a/test/language/compile.rb b/test/language/compile.rb
index 50b16a24d..298493c0a 100755
--- a/test/language/compile.rb
+++ b/test/language/compile.rb
@@ -74,7 +74,7 @@ class TestCompile < Test::Unit::TestCase
klass.expects(:classname).returns("myname")
compile = mkcompile
- compile.configuration.expects(:tag).with("myname")
+ compile.catalog.expects(:tag).with("myname")
assert_nothing_raised("Could not set class") do
compile.class_set "myname", "myscope"
@@ -153,7 +153,7 @@ class TestCompile < Test::Unit::TestCase
[:set_node_parameters, :evaluate_main, :evaluate_ast_node, :evaluate_node_classes, :evaluate_generators, :fail_on_unevaluated, :finish].each do |method|
compile.expects(method)
end
- assert_instance_of(Puppet::Node::Configuration, compile.compile, "Did not return the configuration")
+ assert_instance_of(Puppet::Node::Catalog, compile.compile, "Did not return the catalog")
end
# Test setting the node's parameters into the top scope.
@@ -416,7 +416,7 @@ class TestCompile < Test::Unit::TestCase
compile.expects(:verify_uniqueness).with(resource)
scope = stub("scope", :resource => mock('resource'))
- compile.configuration.expects(:add_edge!).with(scope.resource, resource)
+ compile.catalog.expects(:add_edge!).with(scope.resource, resource)
assert_nothing_raised("Could not store resource") do
compile.store_resource(scope, resource)
diff --git a/test/language/functions.rb b/test/language/functions.rb
index 70dd6af7b..132ee97ac 100755
--- a/test/language/functions.rb
+++ b/test/language/functions.rb
@@ -66,8 +66,8 @@ class TestLangFunctions < Test::Unit::TestCase
# Now make sure we correctly get tags.
scope.resource.tag("resourcetag")
assert(scope.function_tagged("resourcetag"), "tagged function did not catch resource tags")
- scope.compile.configuration.tag("configtag")
- assert(scope.function_tagged("configtag"), "tagged function did not catch configuration tags")
+ scope.compile.catalog.tag("configtag")
+ assert(scope.function_tagged("configtag"), "tagged function did not catch catalog tags")
end
def test_failfunction
@@ -212,15 +212,15 @@ class TestLangFunctions < Test::Unit::TestCase
Puppet[:environment] = "yay"
- configuration = nil
+ catalog = nil
assert_nothing_raised {
- configuration = interp.compile(node)
+ catalog = interp.compile(node)
}
- version = configuration.version
+ version = catalog.version
- fileobj = configuration.vertices.find { |r| r.title == file }
- assert(fileobj, "File was not in configuration")
+ fileobj = catalog.vertices.find { |r| r.title == file }
+ assert(fileobj, "File was not in catalog")
assert_equal("original text\n", fileobj["content"],
"Template did not work")
diff --git a/test/language/snippets.rb b/test/language/snippets.rb
index 0806a40b4..2a4ba0220 100755
--- a/test/language/snippets.rb
+++ b/test/language/snippets.rb
@@ -197,7 +197,7 @@ class TestSnippets < Test::Unit::TestCase
def snippet_classpathtest
path = "/tmp/classtest"
- file = @configuration.resource(:file, path)
+ file = @catalog.resource(:file, path)
assert(file, "did not create file %s" % path)
assert_nothing_raised {
@@ -460,13 +460,13 @@ class TestSnippets < Test::Unit::TestCase
node = Puppet::Node.new("testhost")
node.merge(facts)
- config = nil
- assert_nothing_raised("Could not compile configuration") {
- config = Puppet::Node::Configuration.find(node)
+ catalog = nil
+ assert_nothing_raised("Could not compile catalog") {
+ catalog = Puppet::Node::Catalog.find(node)
}
- assert_nothing_raised("Could not convert configuration") {
- config = config.to_ral
+ assert_nothing_raised("Could not convert catalog") {
+ catalog = catalog.to_ral
}
Puppet::Type.eachtype { |type|
@@ -479,7 +479,7 @@ class TestSnippets < Test::Unit::TestCase
assert(obj.name)
}
}
- @configuration = config
+ @catalog = catalog
assert_nothing_raised {
self.send(mname)
}
diff --git a/test/lib/puppettest/parsertesting.rb b/test/lib/puppettest/parsertesting.rb
index 3e3ce6cb9..6fd60180a 100644
--- a/test/lib/puppettest/parsertesting.rb
+++ b/test/lib/puppettest/parsertesting.rb
@@ -312,7 +312,7 @@ module PuppetTest::ParserTesting
config = nil
assert_nothing_raised {
- config = trans.extract.to_configuration
+ config = trans.extract.to_catalog
}
config.apply
diff --git a/test/lib/puppettest/support/assertions.rb b/test/lib/puppettest/support/assertions.rb
index 906bb3c76..2159c8d3e 100644
--- a/test/lib/puppettest/support/assertions.rb
+++ b/test/lib/puppettest/support/assertions.rb
@@ -52,7 +52,7 @@ module PuppetTest
msg = resources.pop
end
- config = resources2config(*resources)
+ config = resources2catalog(*resources)
transaction = Puppet::Transaction.new(config)
run_events(:evaluate, transaction, events, msg)
@@ -62,7 +62,7 @@ module PuppetTest
# A simpler method that just applies what we have.
def assert_apply(*resources)
- config = resources2config(*resources)
+ config = resources2catalog(*resources)
events = nil
assert_nothing_raised("Failed to evaluate") {
diff --git a/test/lib/puppettest/support/resources.rb b/test/lib/puppettest/support/resources.rb
index 18d7caa77..384f61c33 100755
--- a/test/lib/puppettest/support/resources.rb
+++ b/test/lib/puppettest/support/resources.rb
@@ -25,13 +25,13 @@ module PuppetTest::Support::Resources
end
def mktree
- configuration = Puppet::Node::Configuration.new do |config|
+ catalog = Puppet::Node::Catalog.new do |config|
one = treenode(config, "one", "a", "b")
two = treenode(config, "two", "c", "d")
middle = treenode(config, "middle", "e", "f", two)
top = treenode(config, "top", "g", "h", middle, one)
end
- return configuration
+ return catalog
end
end
diff --git a/test/lib/puppettest/support/utils.rb b/test/lib/puppettest/support/utils.rb
index d9bd6b2b6..cb4a6924c 100644
--- a/test/lib/puppettest/support/utils.rb
+++ b/test/lib/puppettest/support/utils.rb
@@ -21,10 +21,10 @@ module PuppetTest::Support::Utils
}
end
- # Turn a list of resources, or possibly a configuration and some resources,
- # into a configuration object.
- def resources2config(*resources)
- if resources[0].is_a?(Puppet::Node::Configuration)
+ # Turn a list of resources, or possibly a catalog and some resources,
+ # into a catalog object.
+ def resources2catalog(*resources)
+ if resources[0].is_a?(Puppet::Node::Catalog)
config = resources.shift
unless resources.empty?
resources.each { |r| config.add_resource r }
@@ -34,7 +34,7 @@ module PuppetTest::Support::Utils
comp = resources.shift
comp.delve
else
- config = Puppet::Node::Configuration.new
+ config = Puppet::Node::Catalog.new
resources.each { |res| config.add_resource res }
end
return config
@@ -159,13 +159,13 @@ module PuppetTest::Support::Utils
}
end
- def mk_configuration(*resources)
+ def mk_catalog(*resources)
if resources[0].is_a?(String)
name = resources.shift
else
name = :testing
end
- config = Puppet::Node::Configuration.new :testing do |conf|
+ config = Puppet::Node::Catalog.new :testing do |conf|
resources.each { |resource| conf.add_resource resource }
end
diff --git a/test/network/client/client.rb b/test/network/client/client.rb
index 918b9e86a..2588b9be5 100755
--- a/test/network/client/client.rb
+++ b/test/network/client/client.rb
@@ -46,13 +46,13 @@ class TestClient < Test::Unit::TestCase
assert(File.exists?(certfile))
assert(File.exists?(publickeyfile))
- # verify we can retrieve the configuration
- assert_nothing_raised("Client could not retrieve configuration") {
+ # verify we can retrieve the catalog
+ assert_nothing_raised("Client could not retrieve catalog") {
client.getconfig
}
# and apply it
- assert_nothing_raised("Client could not apply configuration") {
+ assert_nothing_raised("Client could not apply catalog") {
client.apply
}
diff --git a/test/network/client/master.rb b/test/network/client/master.rb
index 84cd9388c..60058aed9 100755
--- a/test/network/client/master.rb
+++ b/test/network/client/master.rb
@@ -558,12 +558,12 @@ end
ftype = Puppet::Type.type(:file)
file = ftype.create :title => "/what/ever", :ensure => :present
- config = Puppet::Node::Configuration.new
+ config = Puppet::Node::Catalog.new
config.add_resource(file)
config.expects :apply
- client.configuration = config
+ client.catalog = config
client.expects(:getconfig)
client.run
@@ -581,7 +581,7 @@ end
end
end
- def test_invalid_configurations_do_not_get_cached
+ def test_invalid_catalogs_do_not_get_cached
master = mkmaster :Code => "notify { one: require => File[yaytest] }"
master.local = false # so it gets cached
client = mkclient(master)
diff --git a/test/other/events.rb b/test/other/events.rb
index 2dfdfeb74..9d6bd2bb7 100755
--- a/test/other/events.rb
+++ b/test/other/events.rb
@@ -22,7 +22,7 @@ class TestEvents < Test::Unit::TestCase
:subscribe => [[file.class.name, file.name]]
)
- comp = mk_configuration("eventtesting", file, exec)
+ comp = mk_catalog("eventtesting", file, exec)
trans = assert_events([:file_created, :triggered], comp)
@@ -43,7 +43,7 @@ class TestEvents < Test::Unit::TestCase
)
- config = mk_configuration
+ config = mk_catalog
config.add_resource file
config.add_resource exec
trans = config.apply
@@ -74,7 +74,7 @@ class TestEvents < Test::Unit::TestCase
["file", f.name]
}
- comp = mk_configuration(exec, *files)
+ comp = mk_catalog(exec, *files)
assert_apply(comp)
assert(FileTest.exists?(fname), "Exec file did not get created")
@@ -106,7 +106,7 @@ class TestEvents < Test::Unit::TestCase
)
execs = [exec1, exec2, exec3]
- config = mk_configuration(exec1,exec2,exec3)
+ config = mk_catalog(exec1,exec2,exec3)
trans = Puppet::Transaction.new(config)
execs.each do |e| assert(config.vertex?(e), "%s is not in graph" % e.title) end
diff --git a/test/other/overrides.rb b/test/other/overrides.rb
index 272f78e30..e0e3fdf5f 100755
--- a/test/other/overrides.rb
+++ b/test/other/overrides.rb
@@ -90,7 +90,7 @@ class TestOverrides < Test::Unit::TestCase
}
}
- config = mk_configuration(baseobj, *children)
+ config = mk_catalog(baseobj, *children)
assert_nothing_raised("Could not eval component") {
config.apply
diff --git a/test/other/relationships.rb b/test/other/relationships.rb
index 0f2a103fe..bf83caf4a 100755
--- a/test/other/relationships.rb
+++ b/test/other/relationships.rb
@@ -176,7 +176,7 @@ class TestRelationships < Test::Unit::TestCase
# Now make sure that these relationships are added to the
# relationship graph
- config = mk_configuration(file, exec)
+ config = mk_catalog(file, exec)
config.apply do |trans|
assert(config.relationship_graph.edge?(file, exec), "autorequire edge was not created")
end
diff --git a/test/other/report.rb b/test/other/report.rb
index 1ccb44546..9894e2a8d 100755
--- a/test/other/report.rb
+++ b/test/other/report.rb
@@ -27,7 +27,7 @@ class TestReports < Test::Unit::TestCase
)
end
- config = mk_configuration(*objects)
+ config = mk_catalog(*objects)
# So the report works out.
config.retrieval_duration = 0.001
trans = config.apply
diff --git a/test/other/transactions.rb b/test/other/transactions.rb
index 8156ba478..79971a28b 100755
--- a/test/other/transactions.rb
+++ b/test/other/transactions.rb
@@ -131,7 +131,7 @@ class TestTransactions < Test::Unit::TestCase
inst = type.create :name => "yay"
# Create a transaction
- trans = Puppet::Transaction.new(mk_configuration(inst))
+ trans = Puppet::Transaction.new(mk_catalog(inst))
# Make sure prefetch works
assert_nothing_raised do
@@ -253,7 +253,7 @@ class TestTransactions < Test::Unit::TestCase
}
- component = mk_configuration("file",file)
+ component = mk_catalog("file",file)
require 'etc'
groupname = Etc.getgrgid(File.stat(file.name).gid).name
assert_nothing_raised() {
@@ -293,7 +293,7 @@ class TestTransactions < Test::Unit::TestCase
file[:check] = check
file[:group] = @groups[0]
- config = mk_configuration(file)
+ config = mk_catalog(file)
config.apply
@@tmpfiles << execfile
@@ -314,9 +314,9 @@ class TestTransactions < Test::Unit::TestCase
file[:mode] = "755"
}
- # Make a new configuration so the resource relationships get
+ # Make a new catalog so the resource relationships get
# set up.
- config = mk_configuration(file, exec)
+ config = mk_catalog(file, exec)
trans = assert_events([:file_changed, :triggered], config)
@@ -344,7 +344,7 @@ class TestTransactions < Test::Unit::TestCase
file[:group] = @groups[0]
assert_apply(file)
- config = Puppet::Node::Configuration.new
+ config = Puppet::Node::Catalog.new
fcomp = Puppet::Type.type(:component).create(:name => "file")
config.add_resource fcomp
config.add_resource file
@@ -445,7 +445,7 @@ class TestTransactions < Test::Unit::TestCase
:subscribe => ["file", file.name]
)
- config = mk_configuration(file, exec)
+ config = mk_catalog(file, exec)
# Run it once
assert_apply(config)
@@ -501,7 +501,7 @@ class TestTransactions < Test::Unit::TestCase
:ensure => :file
)
- config = mk_configuration(exec, file1, file2)
+ config = mk_catalog(exec, file1, file2)
assert_apply(config)
@@ -532,7 +532,7 @@ class TestTransactions < Test::Unit::TestCase
graph = trans.relationship_graph
end
- assert_instance_of(Puppet::Node::Configuration, graph,
+ assert_instance_of(Puppet::Node::Catalog, graph,
"Did not get relationship graph")
# Make sure all of the components are gone
@@ -560,7 +560,7 @@ class TestTransactions < Test::Unit::TestCase
end
end
- trans.configuration.leaves(config.resource("middle")).each do |child|
+ trans.catalog.leaves(config.resource("middle")).each do |child|
assert(graph.dependents(config.f(:h)).include?(child),
"%s not marked a dep of h" % [child.ref])
assert(sorted.index(child) < sorted.index(config.f(:h)),
@@ -596,7 +596,7 @@ class TestTransactions < Test::Unit::TestCase
yay = Puppet::Type.newgenerator :title => "yay"
rah = Puppet::Type.newgenerator :title => "rah"
- config = mk_configuration(yay, rah)
+ config = mk_catalog(yay, rah)
trans = Puppet::Transaction.new(config)
assert_nothing_raised do
@@ -604,7 +604,7 @@ class TestTransactions < Test::Unit::TestCase
end
%w{ya ra y r}.each do |name|
- assert(trans.configuration.vertex?(Puppet::Type.type(:generator)[name]),
+ assert(trans.catalog.vertex?(Puppet::Type.type(:generator)[name]),
"Generated %s was not a vertex" % name)
assert($finished.include?(name), "%s was not finished" % name)
end
@@ -615,7 +615,7 @@ class TestTransactions < Test::Unit::TestCase
end
%w{ya ra y r}.each do |name|
- assert(!trans.configuration.vertex?(Puppet::Type.type(:generator)[name]),
+ assert(!trans.catalog.vertex?(Puppet::Type.type(:generator)[name]),
"Generated vertex %s was not removed from graph" % name)
assert_nil(Puppet::Type.type(:generator)[name],
"Generated vertex %s was not removed from class" % name)
@@ -635,7 +635,7 @@ class TestTransactions < Test::Unit::TestCase
yay = Puppet::Type.newgenerator :title => "yay"
rah = Puppet::Type.newgenerator :title => "rah", :subscribe => yay
- config = mk_configuration(yay, rah)
+ config = mk_catalog(yay, rah)
trans = Puppet::Transaction.new(config)
trans.prepare
@@ -715,39 +715,39 @@ class TestTransactions < Test::Unit::TestCase
end
def test_ignore_tags?
- config = Puppet::Node::Configuration.new
+ config = Puppet::Node::Catalog.new
config.host_config = true
transaction = Puppet::Transaction.new(config)
- assert(! transaction.ignore_tags?, "Ignoring tags when applying a host configuration")
+ assert(! transaction.ignore_tags?, "Ignoring tags when applying a host catalog")
config.host_config = false
transaction = Puppet::Transaction.new(config)
- assert(transaction.ignore_tags?, "Not ignoring tags when applying a non-host configuration")
+ assert(transaction.ignore_tags?, "Not ignoring tags when applying a non-host catalog")
end
def test_missing_tags?
resource = stub 'resource', :tagged? => true
- config = Puppet::Node::Configuration.new
+ config = Puppet::Node::Catalog.new
# Mark it as a host config so we don't care which test is first
config.host_config = true
transaction = Puppet::Transaction.new(config)
assert(! transaction.missing_tags?(resource), "Considered a resource to be missing tags when none are set")
- # host configurations pay attention to tags, no one else does.
+ # host catalogs pay attention to tags, no one else does.
Puppet[:tags] = "three,four"
config.host_config = false
transaction = Puppet::Transaction.new(config)
- assert(! transaction.missing_tags?(resource), "Considered a resource to be missing tags when not running a host configuration")
+ assert(! transaction.missing_tags?(resource), "Considered a resource to be missing tags when not running a host catalog")
#
config.host_config = true
transaction = Puppet::Transaction.new(config)
- assert(! transaction.missing_tags?(resource), "Considered a resource to be missing tags when running a host configuration and all tags are present")
+ assert(! transaction.missing_tags?(resource), "Considered a resource to be missing tags when running a host catalog and all tags are present")
transaction = Puppet::Transaction.new(config)
resource.stubs :tagged? => false
- assert(transaction.missing_tags?(resource), "Considered a resource not to be missing tags when running a host configuration and tags are missing")
+ assert(transaction.missing_tags?(resource), "Considered a resource not to be missing tags when running a host catalog and tags are missing")
end
# Make sure changes generated by eval_generated resources have proxies
@@ -761,7 +761,7 @@ class TestTransactions < Test::Unit::TestCase
end
resource = type.create :name => "test"
- config = mk_configuration(resource)
+ config = mk_catalog(resource)
trans = Puppet::Transaction.new(config)
trans.prepare
@@ -820,7 +820,7 @@ class TestTransactions < Test::Unit::TestCase
end
# Make a graph with some stuff in it.
- graph = Puppet::Node::Configuration.new
+ graph = Puppet::Node::Catalog.new
# Add a non-triggering edge.
a = trigger.new(:a)
@@ -877,7 +877,7 @@ class TestTransactions < Test::Unit::TestCase
file = Puppet::Type.newfile(:path => tempfile(), :content => "yay")
exec1 = Puppet::Type.type(:exec).create :command => "/bin/echo exec1"
exec2 = Puppet::Type.type(:exec).create :command => "/bin/echo exec2"
- trans = Puppet::Transaction.new(mk_configuration(file, exec1, exec2))
+ trans = Puppet::Transaction.new(mk_catalog(file, exec1, exec2))
# First try it with an edge that has no callback
edge = Puppet::Relationship.new(file, exec1)
@@ -924,7 +924,7 @@ class TestTransactions < Test::Unit::TestCase
one[:require] = two
two[:require] = one
- config = mk_configuration(one, two)
+ config = mk_catalog(one, two)
trans = Puppet::Transaction.new(config)
assert_raise(Puppet::Error) do
trans.prepare
@@ -992,7 +992,7 @@ class TestTransactions < Test::Unit::TestCase
rels[dir] = file
rels.each do |after, before|
- config = mk_configuration(before, after)
+ config = mk_catalog(before, after)
trans = Puppet::Transaction.new(config)
str = "from %s to %s" % [before, after]
diff --git a/test/ral/manager/instances.rb b/test/ral/manager/instances.rb
index 88f766038..a50ecb213 100755
--- a/test/ral/manager/instances.rb
+++ b/test/ral/manager/instances.rb
@@ -93,8 +93,8 @@ class TestTypeInstances < Test::Unit::TestCase
# Make sure resources are entirely deleted.
def test_delete
aliases = %w{one}
- config = mk_configuration
- obj = @type.create(:name => "testing", :alias => "two", :configuration => config)
+ catalog = mk_catalog
+ obj = @type.create(:name => "testing", :alias => "two", :catalog => catalog)
aliases << "two"
@type.alias("two", obj)
diff --git a/test/ral/manager/type.rb b/test/ral/manager/type.rb
index 350d3dd15..6a044687e 100755
--- a/test/ral/manager/type.rb
+++ b/test/ral/manager/type.rb
@@ -138,9 +138,9 @@ class TestType < Test::Unit::TestCase
)
resource.stubs(:path).returns("")
- configuration = stub 'configuration'
- configuration.expects(:resource).with(:file, "/path/to/some/missing/file").returns(resource)
- resource.configuration = configuration
+ catalog = stub 'catalog'
+ catalog.expects(:resource).with(:file, "/path/to/some/missing/file").returns(resource)
+ resource.catalog = catalog
# Verify our adding ourselves as an alias isn't an error.
assert_nothing_raised("Could not add alias") {
@@ -150,17 +150,17 @@ class TestType < Test::Unit::TestCase
assert_equal(resource.object_id, Puppet.type(:file)["/path/to/some/missing/file"].object_id, "Could not retrieve alias to self")
end
- def test_aliases_are_added_to_class_and_configuration
+ def test_aliases_are_added_to_class_and_catalog
resource = Puppet.type(:file).create(
:name => "/path/to/some/missing/file",
:ensure => "file"
)
resource.stubs(:path).returns("")
- configuration = stub 'configuration'
- configuration.stubs(:resource).returns(nil)
- configuration.expects(:alias).with(resource, "funtest")
- resource.configuration = configuration
+ catalog = stub 'catalog'
+ catalog.stubs(:resource).returns(nil)
+ catalog.expects(:alias).with(resource, "funtest")
+ resource.catalog = catalog
assert_nothing_raised("Could not add alias") {
resource[:alias] = "funtest"
@@ -169,22 +169,22 @@ class TestType < Test::Unit::TestCase
assert_equal(resource.object_id, Puppet.type(:file)["funtest"].object_id, "Could not retrieve alias")
end
- def test_aliasing_fails_without_a_configuration
+ def test_aliasing_fails_without_a_catalog
resource = Puppet.type(:file).create(
:name => "/no/such/file",
:ensure => "file"
)
- assert_raise(Puppet::Error, "Did not fail to alias when no configuration was available") {
+ assert_raise(Puppet::Error, "Did not fail to alias when no catalog was available") {
resource[:alias] = "funtest"
}
end
- def test_configurations_are_set_during_initialization_if_present_on_the_transobject
+ def test_catalogs_are_set_during_initialization_if_present_on_the_transobject
trans = Puppet::TransObject.new("/path/to/some/file", :file)
- trans.configuration = :my_config
+ trans.catalog = :my_config
resource = trans.to_type
- assert_equal(resource.configuration, trans.configuration, "Did not set configuration on initialization")
+ assert_equal(resource.catalog, trans.catalog, "Did not set catalog on initialization")
end
# Verify that requirements don't depend on file order
@@ -207,7 +207,7 @@ class TestType < Test::Unit::TestCase
)
}
- comp = mk_configuration(twoobj, oneobj)
+ comp = mk_catalog(twoobj, oneobj)
assert_nothing_raised {
comp.finalize
@@ -695,7 +695,7 @@ class TestType < Test::Unit::TestCase
end
def test_path
- config = mk_configuration
+ config = mk_catalog
# Check that our paths are built correctly. Just pick a random, "normal" type.
type = Puppet::Type.type(:exec)
diff --git a/test/ral/types/basic.rb b/test/ral/types/basic.rb
index 4427238bf..7bbadc5bc 100755
--- a/test/ral/types/basic.rb
+++ b/test/ral/types/basic.rb
@@ -35,7 +35,7 @@ class TestBasic < Test::Unit::TestCase
:path => ENV["PATH"]
)
}
- @config = mk_configuration(@component, @configfile, @command)
+ @config = mk_catalog(@component, @configfile, @command)
@config.add_edge! @component, @configfile
@config.add_edge! @component, @command
end
diff --git a/test/ral/types/cron.rb b/test/ral/types/cron.rb
index ca60477ed..73e941894 100755
--- a/test/ral/types/cron.rb
+++ b/test/ral/types/cron.rb
@@ -90,7 +90,7 @@ class TestCron < Test::Unit::TestCase
text = obj.read
name = cron.name
- comp = mk_configuration(name, cron)
+ comp = mk_catalog(name, cron)
assert_events([:cron_created], comp)
cron.provider.class.prefetch
@@ -153,7 +153,7 @@ class TestCron < Test::Unit::TestCase
def test_makeandretrievecron
%w{storeandretrieve a-name another-name more_naming SomeName}.each do |name|
cron = mkcron(name)
- comp = mk_configuration(name, cron)
+ comp = mk_catalog(name, cron)
trans = assert_events([:cron_created], comp, name)
cron.provider.class.prefetch
diff --git a/test/ral/types/exec.rb b/test/ral/types/exec.rb
index 11a6d4055..f718f944e 100755
--- a/test/ral/types/exec.rb
+++ b/test/ral/types/exec.rb
@@ -179,7 +179,7 @@ class TestExec < Test::Unit::TestCase
)
}
- comp = mk_configuration("createstest", exec)
+ comp = mk_catalog("createstest", exec)
assert_events([:executed_command], comp, "creates")
assert_events([], comp, "creates")
end
@@ -202,7 +202,7 @@ class TestExec < Test::Unit::TestCase
:require => [:file, oexe]
)
- comp = mk_configuration("Testing", file, exec)
+ comp = mk_catalog("Testing", file, exec)
assert_events([:file_created, :executed_command], comp)
end
@@ -299,7 +299,7 @@ class TestExec < Test::Unit::TestCase
:path => ENV['PATH']
)
}
- comp = mk_configuration(exec)
+ comp = mk_catalog(exec)
assert_events([:executed_command], comp)
assert_events([:executed_command], comp)
@@ -344,7 +344,7 @@ class TestExec < Test::Unit::TestCase
exec = Puppet.type(:exec).create(args)
}
- comp = mk_configuration("usertest", exec)
+ comp = mk_catalog("usertest", exec)
assert_events([:executed_command], comp, "usertest")
assert(FileTest.exists?(file), "File does not exist")
@@ -425,7 +425,7 @@ class TestExec < Test::Unit::TestCase
)
}
- comp = mk_configuration(file, exec)
+ comp = mk_catalog(file, exec)
comp.finalize
assert_events([:executed_command, :file_changed], comp)
diff --git a/test/ral/types/file.rb b/test/ral/types/file.rb
index 402ca010d..fdb2eb656 100755
--- a/test/ral/types/file.rb
+++ b/test/ral/types/file.rb
@@ -130,7 +130,7 @@ class TestFile < Test::Unit::TestCase
)
}
- comp = mk_configuration("createusertest", file)
+ comp = mk_catalog("createusertest", file)
assert_events([:file_created], comp)
end
@@ -503,7 +503,7 @@ class TestFile < Test::Unit::TestCase
# Create a test directory
path = tempfile()
dir = @file.create :path => path, :mode => 0755, :recurse => true
- config = mk_configuration(dir)
+ config = mk_catalog(dir)
Dir.mkdir(path)
@@ -684,7 +684,7 @@ class TestFile < Test::Unit::TestCase
:check => %w{owner mode group}
)
}
- config = mk_configuration dir
+ config = mk_catalog dir
children = nil
@@ -769,7 +769,7 @@ class TestFile < Test::Unit::TestCase
:check => %w{owner mode group}
)
}
- mk_configuration dir
+ mk_catalog dir
assert_nothing_raised {
dir.eval_generate
@@ -812,7 +812,7 @@ class TestFile < Test::Unit::TestCase
:check => %w{mode owner group}
)
}
- mk_configuration dirobj
+ mk_catalog dirobj
assert_nothing_raised {
dirobj.eval_generate
@@ -901,7 +901,7 @@ class TestFile < Test::Unit::TestCase
)
}
- comp = mk_configuration("yay", file)
+ comp = mk_catalog("yay", file)
comp.finalize
assert_apply(comp)
#assert_events([:directory_created], comp)
@@ -1300,7 +1300,7 @@ class TestFile < Test::Unit::TestCase
:backup => false,
:recurse => true)
- config = mk_configuration(lfobj, destobj)
+ config = mk_catalog(lfobj, destobj)
config.apply
assert(FileTest.exists?(dsourcefile), "File did not get copied")
@@ -1351,7 +1351,7 @@ class TestFile < Test::Unit::TestCase
group = Puppet.type(:group).create(
:name => "pptestg"
)
- comp = mk_configuration(user, group, home)
+ comp = mk_catalog(user, group, home)
}
# Now make sure we get a relationship for each of these
@@ -1647,7 +1647,7 @@ class TestFile < Test::Unit::TestCase
file = File.join(dir, "file")
File.open(file, "w") { |f| f.puts "" }
obj = Puppet::Type.newfile :path => dir, :recurse => true, :mode => 0755
- mk_configuration obj
+ mk_catalog obj
assert_equal("/%s" % obj.ref, obj.path)
@@ -1758,7 +1758,7 @@ class TestFile < Test::Unit::TestCase
File.open(file, "w") { |f| f.puts "yay" }
File.chmod(0644, file)
obj = Puppet::Type.newfile(:path => dir, :mode => 0750, :recurse => "2")
- config = mk_configuration(obj)
+ config = mk_catalog(obj)
children = nil
assert_nothing_raised("Failure when recursing") do
@@ -1767,7 +1767,7 @@ class TestFile < Test::Unit::TestCase
assert(obj.class[subdir], "did not create subdir object")
children.each do |c|
assert_nothing_raised("Failure when recursing on %s" % c) do
- c.configuration = config
+ c.catalog = config
others = c.eval_generate
end
end
@@ -1801,7 +1801,7 @@ class TestFile < Test::Unit::TestCase
obj = Puppet::Type.newfile(:path => dir, :ensure => :directory,
:recurse => true)
- config = mk_configuration(obj)
+ config = mk_catalog(obj)
children = nil
assert_nothing_raised do
children = obj.eval_generate
diff --git a/test/ral/types/file/target.rb b/test/ral/types/file/target.rb
index ffb60e0fa..035ea905b 100755
--- a/test/ral/types/file/target.rb
+++ b/test/ral/types/file/target.rb
@@ -46,7 +46,7 @@ class TestFileTarget < Test::Unit::TestCase
def test_linkrecurse
dest = tempfile()
link = @file.create :path => tempfile(), :recurse => true, :ensure => dest
- mk_configuration link
+ mk_catalog link
ret = nil
@@ -320,7 +320,7 @@ class TestFileTarget < Test::Unit::TestCase
:source => dirs["source"],
:recurse => true
)
- config = mk_configuration obj
+ config = mk_catalog obj
config.apply
newfile = File.join(dirs["target"], "sourcefile")
diff --git a/test/ral/types/fileignoresource.rb b/test/ral/types/fileignoresource.rb
index 2314c8008..ff867c879 100755
--- a/test/ral/types/fileignoresource.rb
+++ b/test/ral/types/fileignoresource.rb
@@ -75,7 +75,7 @@ class TestFileIgnoreSources < Test::Unit::TestCase
)
}
- config = mk_configuration(tofile)
+ config = mk_catalog(tofile)
config.apply
@@ -141,7 +141,7 @@ class TestFileIgnoreSources < Test::Unit::TestCase
)
}
- config = mk_configuration(tofile)
+ config = mk_catalog(tofile)
config.apply
#topath should exist as a directory with sourcedir as a directory
@@ -216,7 +216,7 @@ class TestFileIgnoreSources < Test::Unit::TestCase
)
}
- config = mk_configuration(tofile)
+ config = mk_catalog(tofile)
config.apply
#topath should exist as a directory with sourcedir as a directory
diff --git a/test/ral/types/filesources.rb b/test/ral/types/filesources.rb
index 54d29968c..6180eed18 100755
--- a/test/ral/types/filesources.rb
+++ b/test/ral/types/filesources.rb
@@ -64,7 +64,7 @@ class TestFileSources < Test::Unit::TestCase
:name => path
)
}
- config = mk_configuration(file)
+ config = mk_catalog(file)
child = nil
assert_nothing_raised {
child = file.newchild("childtest", true)
@@ -278,7 +278,7 @@ class TestFileSources < Test::Unit::TestCase
# The sourcerecurse method will only ever get called when we're
# recursing, so we go ahead and set it.
obj = Puppet::Type.newfile :source => source, :path => dest, :recurse => true
- config = mk_configuration(obj)
+ config = mk_catalog(obj)
result = nil
sourced = nil
@@ -628,7 +628,7 @@ class TestFileSources < Test::Unit::TestCase
file.retrieve
}
- comp = mk_configuration(file)
+ comp = mk_catalog(file)
comp.apply
assert(!FileTest.exists?(name), "File with no source exists anyway")
@@ -678,7 +678,7 @@ class TestFileSources < Test::Unit::TestCase
)
}
- comp = mk_configuration(file)
+ comp = mk_catalog(file)
assert_events([:file_created], comp)
assert(File.exists?(to), "File does not exist")
@@ -764,7 +764,7 @@ class TestFileSources < Test::Unit::TestCase
trans = nil
assert_nothing_raised {
file[:links] = :manage
- comp = mk_configuration(file)
+ comp = mk_catalog(file)
trans = comp.apply
}
diff --git a/test/ral/types/group.rb b/test/ral/types/group.rb
index 944b7e074..d28c8eea5 100755
--- a/test/ral/types/group.rb
+++ b/test/ral/types/group.rb
@@ -65,7 +65,7 @@ class TestGroup < Test::Unit::TestCase
def attrtest_ensure(group)
group[:ensure] = :absent
- comp = mk_configuration("ensuretest", group)
+ comp = mk_catalog("ensuretest", group)
assert_apply(comp)
assert_equal(:absent, group.provider.ensure, "Group is still present")
group[:ensure] = :present
@@ -91,7 +91,7 @@ class TestGroup < Test::Unit::TestCase
assert_equal(15, group.should(:gid),
"Did not convert gid to number")
- comp = mk_configuration(group)
+ comp = mk_catalog(group)
trans = assert_events([:group_modified], comp, "group")
assert_equal(15, group.provider.gid, "GID was not changed")
diff --git a/test/ral/types/host.rb b/test/ral/types/host.rb
index 1013651c5..088f93c1f 100755
--- a/test/ral/types/host.rb
+++ b/test/ral/types/host.rb
@@ -39,7 +39,7 @@ class TestHost < Test::Unit::TestCase
@hcount = 1
end
- @configuration ||= mk_configuration
+ @catalog ||= mk_catalog
host = nil
assert_nothing_raised {
@@ -47,7 +47,7 @@ class TestHost < Test::Unit::TestCase
:name => "fakehost%s" % @hcount,
:ip => "192.168.27.%s" % @hcount,
:alias => "alias%s" % @hcount,
- :configuration => @configuration
+ :catalog => @catalog
)
}
diff --git a/test/ral/types/parameter.rb b/test/ral/types/parameter.rb
index 1d402cb85..e1b8e00b3 100755
--- a/test/ral/types/parameter.rb
+++ b/test/ral/types/parameter.rb
@@ -113,8 +113,8 @@ class TestParameter < Test::Unit::TestCase
inst = type.create(:name => "test")
- config = mk_configuration
- inst.configuration = config
+ config = mk_catalog
+ inst.catalog = config
assert_nothing_raised("Could not create shadowed param") {
inst[:alias] = "foo"
@@ -136,7 +136,7 @@ class TestParameter < Test::Unit::TestCase
# Now try it during initialization
other = nil
assert_nothing_raised("Could not create instance with shadow") do
- other = type.create(:name => "rah", :alias => "one", :configuration => config)
+ other = type.create(:name => "rah", :alias => "one", :catalog => config)
end
params = other.instance_variable_get("@parameters")
obj = params[:alias]
diff --git a/test/ral/types/sshkey.rb b/test/ral/types/sshkey.rb
index c99f7562a..b9aed20e8 100755
--- a/test/ral/types/sshkey.rb
+++ b/test/ral/types/sshkey.rb
@@ -47,7 +47,7 @@ class TestSSHKey < Test::Unit::TestCase
@kcount = 1
end
- @config ||= mk_configuration
+ @catalog ||= mk_catalog
assert_nothing_raised {
key = @sshkeytype.create(
@@ -55,7 +55,7 @@ class TestSSHKey < Test::Unit::TestCase
:key => "%sAAAAB3NzaC1kc3MAAACBAMnhSiku76y3EGkNCDsUlvpO8tRgS9wL4Eh54WZfQ2lkxqfd2uT/RTT9igJYDtm/+UHuBRdNGpJYW1Nw2i2JUQgQEEuitx4QKALJrBotejGOAWxxVk6xsh9xA0OW8Q3ZfuX2DDitfeC8ZTCl4xodUMD8feLtP+zEf8hxaNamLlt/AAAAFQDYJyf3vMCWRLjTWnlxLtOyj/bFpwAAAIEAmRxxXb4jjbbui9GYlZAHK00689DZuX0EabHNTl2yGO5KKxGC6Esm7AtjBd+onfu4Rduxut3jdI8GyQCIW8WypwpJofCIyDbTUY4ql0AQUr3JpyVytpnMijlEyr41FfIb4tnDqnRWEsh2H7N7peW+8DWZHDFnYopYZJ9Yu4/jHRYAAACAERG50e6aRRb43biDr7Ab9NUCgM9bC0SQscI/xdlFjac0B/kSWJYTGVARWBDWug705hTnlitY9cLC5Ey/t/OYOjylTavTEfd/bh/8FkAYO+pWdW3hx6p97TBffK0b6nrc6OORT2uKySbbKOn0681nNQh4a6ueR3JRppNkRPnTk5c=" % @kcount,
:type => "ssh-dss",
:alias => ["192.168.0.%s" % @kcount],
- :configuration => @config
+ :catalog => @catalog
)
}
diff --git a/test/ral/types/tidy.rb b/test/ral/types/tidy.rb
index 59a0e5e2d..60fad6516 100755
--- a/test/ral/types/tidy.rb
+++ b/test/ral/types/tidy.rb
@@ -57,7 +57,7 @@ class TestTidy < Test::Unit::TestCase
assert_nothing_raised {
link = newlink(:target => source, :recurse => true)
}
- comp = mk_configuration("linktest",link)
+ comp = mk_catalog("linktest",link)
cycle(comp)
path = link.name
diff --git a/test/ral/types/user.rb b/test/ral/types/user.rb
index 6cbe78f0f..b280acfed 100755
--- a/test/ral/types/user.rb
+++ b/test/ral/types/user.rb
@@ -82,7 +82,7 @@ class TestUser < Test::Unit::TestCase
old = user.provider.ensure
user[:ensure] = :absent
- comp = mk_configuration("ensuretest", user)
+ comp = mk_catalog("ensuretest", user)
assert_apply(user)
assert(!user.provider.exists?, "User is still present")
user[:ensure] = :present
@@ -102,7 +102,7 @@ class TestUser < Test::Unit::TestCase
old = user.provider.comment
user[:comment] = "A different comment"
- comp = mk_configuration("commenttest", user)
+ comp = mk_catalog("commenttest", user)
trans = assert_events([:user_changed], comp, "user")
@@ -117,7 +117,7 @@ class TestUser < Test::Unit::TestCase
def attrtest_home(user)
obj = nil
- comp = mk_configuration("hometest", user)
+ comp = mk_catalog("hometest", user)
old = user.provider.home
user[:home] = old
@@ -137,7 +137,7 @@ class TestUser < Test::Unit::TestCase
def attrtest_shell(user)
old = user.provider.shell
- comp = mk_configuration("shelltest", user)
+ comp = mk_catalog("shelltest", user)
user[:shell] = old
@@ -167,7 +167,7 @@ class TestUser < Test::Unit::TestCase
def attrtest_gid(user)
obj = nil
old = user.provider.gid
- comp = mk_configuration("gidtest", user)
+ comp = mk_catalog("gidtest", user)
user.retrieve
@@ -216,7 +216,7 @@ class TestUser < Test::Unit::TestCase
def attrtest_uid(user)
obj = nil
- comp = mk_configuration("uidtest", user)
+ comp = mk_catalog("uidtest", user)
user.provider.uid = 1
@@ -387,7 +387,7 @@ class TestUser < Test::Unit::TestCase
ogroup = Puppet.type(:group).create(
:name => "yayness"
)
- comp = mk_configuration(user, group, home, ogroup)
+ comp = mk_catalog(user, group, home, ogroup)
}
rels = nil
@@ -404,7 +404,7 @@ class TestUser < Test::Unit::TestCase
user = mkuser(name)
- comp = mk_configuration("usercomp", user)
+ comp = mk_catalog("usercomp", user)
trans = assert_events([:user_created], comp, "user")
@@ -424,7 +424,7 @@ class TestUser < Test::Unit::TestCase
assert(! user.provider.exists?, "User %s is present" % name)
- comp = mk_configuration("usercomp", user)
+ comp = mk_catalog("usercomp", user)
trans = assert_events([:user_created], comp, "user")