summaryrefslogtreecommitdiffstats
path: root/test/ral
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/ral
parent7ac3bd79621f6c66cd3b5b7041aeba83c27c3602 (diff)
Renaming 'configuration' to 'catalog', fixing #954.
Diffstat (limited to 'test/ral')
-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
15 files changed, 66 insertions, 66 deletions
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")