summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLuke Kanies <luke@puppetlabs.com>2010-05-19 09:32:44 -0700
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commite9627a060619eaf0f8eeb012979dddb047c6648e (patch)
tree697304e0850d89aad99fca266e7dcd809775992d /test
parent61a719f41c5448ca9ab7bdbd6a05f6c97ee80b7f (diff)
downloadpuppet-e9627a060619eaf0f8eeb012979dddb047c6648e.tar.gz
puppet-e9627a060619eaf0f8eeb012979dddb047c6648e.tar.xz
puppet-e9627a060619eaf0f8eeb012979dddb047c6648e.zip
Fixing #2658 - adding backward compatibility for 0.24
The way stages were implemented caused backward compatibility to be completely broken for 0.24.x. This commit fixes that, mostly by assuming Stage[main] will be the top node in the graph rather than Class[main]. Other stages are not supported in 0.24.x, and explicitly throw a warning (although not an error). Signed-off-by: Luke Kanies <luke@puppetlabs.com>
Diffstat (limited to 'test')
-rwxr-xr-xtest/language/scope.rb10
-rwxr-xr-xtest/language/snippets.rb6
-rw-r--r--test/lib/puppettest/parsertesting.rb14
-rwxr-xr-xtest/ral/type/file/target.rb1
4 files changed, 6 insertions, 25 deletions
diff --git a/test/language/scope.rb b/test/language/scope.rb
index 17e97ecfb..0bed35c14 100755
--- a/test/language/scope.rb
+++ b/test/language/scope.rb
@@ -201,13 +201,9 @@ Host <<||>>"
node = mknode
node.merge "hostname" => node.name
2.times { |i|
- config = Puppet::Parser::Compiler.new(node).compile
-
- flat = config.extract.flatten
-
- %w{puppet myhost}.each do |name|
- assert(flat.find{|o| o.name == name }, "Did not find #{name}")
- end
+ catalog = Puppet::Parser::Compiler.new(node).compile
+ assert_instance_of(Puppet::Parser::Resource, catalog.resource(:host, "puppet"))
+ assert_instance_of(Puppet::Parser::Resource, catalog.resource(:host, "myhost"))
}
ensure
Puppet[:storeconfigs] = false
diff --git a/test/language/snippets.rb b/test/language/snippets.rb
index f083c355c..0d647f7de 100755
--- a/test/language/snippets.rb
+++ b/test/language/snippets.rb
@@ -204,11 +204,7 @@ class TestSnippets < Test::Unit::TestCase
file = @catalog.resource(:file, path)
assert(file, "did not create file %s" % path)
- assert_nothing_raised {
- assert_equal(
- "//Testing/Mytype[componentname]/File[/tmp/classtest]",
- file.path)
- }
+ assert_equal( "/Stage[main]/Testing/Mytype[componentname]/File[/tmp/classtest]", file.path)
end
def snippet_argumentdefaults
diff --git a/test/lib/puppettest/parsertesting.rb b/test/lib/puppettest/parsertesting.rb
index 0cc3ddef4..5ca5123e8 100644
--- a/test/lib/puppettest/parsertesting.rb
+++ b/test/lib/puppettest/parsertesting.rb
@@ -297,21 +297,11 @@ module PuppetTest::ParserTesting
# This assumes no nodes
def assert_creates(manifest, *files)
- interp = nil
oldmanifest = Puppet[:manifest]
Puppet[:manifest] = manifest
- trans = nil
- assert_nothing_raised {
- trans = Puppet::Parser::Compiler.new(mknode).compile
- }
-
- config = nil
- assert_nothing_raised {
- config = trans.extract.to_catalog
- }
-
- config.apply
+ catalog = Puppet::Parser::Compiler.new(mknode).compile.to_ral
+ catalog.apply
files.each do |file|
assert(FileTest.exists?(file), "Did not create %s" % file)
diff --git a/test/ral/type/file/target.rb b/test/ral/type/file/target.rb
index f2a7de6f4..89792c4b6 100755
--- a/test/ral/type/file/target.rb
+++ b/test/ral/type/file/target.rb
@@ -69,7 +69,6 @@ class TestFileTarget < Test::Unit::TestCase
assert_equal(file, File.readlink(linkpath))
# Use classes for comparison, because the resource inspection is so large
- assert_equal(NilClass, catalog.resource(:file, sublink).class, "dynamically generated resources were not removed")
assert_events([], link, "Link is not in sync")
end