summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-02-07 05:58:00 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-02-07 05:58:00 +0000
commit6affe220db1248cee8489347dc7d7ac071a534e4 (patch)
treee885f7ac374336c818374556065da70036b71211 /test
parent59c7b02f8fb0c5f2820577f11c9c34935ac16a0a (diff)
downloadpuppet-6affe220db1248cee8489347dc7d7ac071a534e4.tar.gz
puppet-6affe220db1248cee8489347dc7d7ac071a534e4.tar.xz
puppet-6affe220db1248cee8489347dc7d7ac071a534e4.zip
Committing both the finalization of the config code, plus all of the code necessary to get basic isomorphism from code to transportables and back. Mostly keyword and autoname stuff.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@871 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rwxr-xr-xtest/language/ast.rb6
-rwxr-xr-xtest/language/scope.rb2
-rwxr-xr-xtest/other/config.rb3
-rw-r--r--test/other/transactions.rb1
-rw-r--r--test/parser/parser.rb4
-rwxr-xr-xtest/puppet/conffiles.rb16
6 files changed, 18 insertions, 14 deletions
diff --git a/test/language/ast.rb b/test/language/ast.rb
index 3dc5fd582..b5497eb0d 100755
--- a/test/language/ast.rb
+++ b/test/language/ast.rb
@@ -172,6 +172,10 @@ class TestAST < Test::Unit::TestCase
scope = nil
assert_nothing_raised("Could not evaluate node") {
scope = Puppet::Parser::Scope.new()
+ scope.name = "nodetest"
+ scope.type = "nodetest"
+ scope.keyword = "nodetest"
+ scope.top = true
top.evaluate(scope)
}
@@ -339,7 +343,7 @@ class TestAST < Test::Unit::TestCase
end
# Test that node inheritance works correctly
- def test_znodeinheritance
+ def test_nodeinheritance
children = []
# create the base node
diff --git a/test/language/scope.rb b/test/language/scope.rb
index 67792daae..707372d1a 100755
--- a/test/language/scope.rb
+++ b/test/language/scope.rb
@@ -396,6 +396,8 @@ class TestScope < Test::Unit::TestCase
scope = nil
assert_nothing_raised("Could not evaluate") {
scope = Puppet::Parser::Scope.new()
+ scope.name = "topscope"
+ scope.type = "topscope"
objects = scope.evaluate(top)
}
diff --git a/test/other/config.rb b/test/other/config.rb
index 849fa1c97..298480484 100755
--- a/test/other/config.rb
+++ b/test/other/config.rb
@@ -137,6 +137,7 @@ yay = /a/path
assert_equal("value", c[:attr])
assert_equal("/some/dir", c[:attr2])
+ assert_equal(:directory, c.element(:attr2).type)
assert_equal("/some/dir/other", c[:attr3])
elem = nil
@@ -146,8 +147,6 @@ yay = /a/path
assert(elem)
assert_equal("puppet", elem.user)
-
- puts c.to_manifest
end
end
diff --git a/test/other/transactions.rb b/test/other/transactions.rb
index ed6843104..862a28b85 100644
--- a/test/other/transactions.rb
+++ b/test/other/transactions.rb
@@ -124,6 +124,7 @@ class TestTransactions < Test::Unit::TestCase
file[:mode] = "755"
}
trans = assert_events([:file_changed, :file_changed], component)
+ file.retrieve
assert_rollback_events(trans, [:file_changed, :file_changed], "file")
diff --git a/test/parser/parser.rb b/test/parser/parser.rb
index 68209a0d2..13b8a2e85 100644
--- a/test/parser/parser.rb
+++ b/test/parser/parser.rb
@@ -95,7 +95,7 @@ class TestParser < Test::Unit::TestCase
}
end
- def test_zdefaults
+ def test_defaults
basedir = File.join(tmpdir(), "defaulttesting")
@@tmpfiles << basedir
Dir.mkdir(basedir)
@@ -151,6 +151,8 @@ class TestParser < Test::Unit::TestCase
scope = nil
assert_nothing_raised("Could not evaluate defaults parse tree") {
scope = Puppet::Parser::Scope.new()
+ scope.name = "parsetest"
+ scope.type = "parsetest"
objects = scope.evaluate(ast)
}
diff --git a/test/puppet/conffiles.rb b/test/puppet/conffiles.rb
index f966322f7..49da5fa46 100755
--- a/test/puppet/conffiles.rb
+++ b/test/puppet/conffiles.rb
@@ -27,11 +27,6 @@ class TestConfFiles < Test::Unit::TestCase
"boo" => {
"eb" => "fb"
},
- "rah" => {
- "aa" => "this is a sentence",
- "ca" => "dk",
- "ea" => "fk"
- },
},
{
"puppet" => {
@@ -41,7 +36,7 @@ class TestConfFiles < Test::Unit::TestCase
"okay" => "rah"
},
"back" => {
- "okay" => "rah"
+ "yayness" => "rah"
},
}
]
@@ -54,7 +49,7 @@ class TestConfFiles < Test::Unit::TestCase
data = data.dup
str += "[puppet]\n"
data["puppet"].each { |var, value|
- str += "%s %s\n" % [var, value]
+ str += "%s = %s\n" % [var, value]
}
data.delete("puppet")
end
@@ -62,7 +57,7 @@ class TestConfFiles < Test::Unit::TestCase
data.each { |type, settings|
str += "[%s]\n" % type
settings.each { |var, value|
- str += "%s %s\n" % [var, value]
+ str += "%s = %s\n" % [var, value]
}
}
@@ -85,14 +80,15 @@ class TestConfFiles < Test::Unit::TestCase
File.open(path, "w") { |f| f.print data2config(data) }
config = nil
assert_nothing_raised {
- config = Puppet::Config.new(path)
+ config = Puppet::Config.new
+ config.parse(path)
}
data.each { |section, hash|
hash.each { |var, value|
assert_equal(
data[section][var],
- config[section][var],
+ config[var],
"Got different values at %s/%s" % [section, var]
)
}