summaryrefslogtreecommitdiffstats
path: root/test/puppet
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-02-07 23:12:33 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-02-07 23:12:33 +0000
commitb98e65f1fd858a1d0af415554db49a121a76232c (patch)
tree728f94dd17f88902c6bdf21ff6b17486babb08af /test/puppet
parentf1ffc34c0927840beeb21e1e2d864ce14de5d15e (diff)
downloadpuppet-b98e65f1fd858a1d0af415554db49a121a76232c.tar.gz
puppet-b98e65f1fd858a1d0af415554db49a121a76232c.tar.xz
puppet-b98e65f1fd858a1d0af415554db49a121a76232c.zip
There is now full support for configuration files, and the entire system has been modified to expect their new behaviour. I have not yet run the test across all test hosts, though.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@873 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/puppet')
-rwxr-xr-xtest/puppet/conffiles.rb8
-rwxr-xr-xtest/puppet/defaults.rb18
2 files changed, 15 insertions, 11 deletions
diff --git a/test/puppet/conffiles.rb b/test/puppet/conffiles.rb
index 49da5fa46..b63886488 100755
--- a/test/puppet/conffiles.rb
+++ b/test/puppet/conffiles.rb
@@ -76,11 +76,15 @@ class TestConfFiles < Test::Unit::TestCase
path = tempfile()
sampledata { |data|
+ config = Puppet::Config.new
+ data.each { |section, hash|
+ hash.each { |param, value|
+ config.setdefaults(section, [param, value, value])
+ }
+ }
# Write it out as a config file
File.open(path, "w") { |f| f.print data2config(data) }
- config = nil
assert_nothing_raised {
- config = Puppet::Config.new
config.parse(path)
}
diff --git a/test/puppet/defaults.rb b/test/puppet/defaults.rb
index 2fbd4fe46..73759ca6b 100755
--- a/test/puppet/defaults.rb
+++ b/test/puppet/defaults.rb
@@ -12,8 +12,8 @@ require 'test/unit'
class TestPuppetDefaults < Test::Unit::TestCase
include TestPuppet
- @@dirs = %w{rrddir puppetconf puppetvar logdir statedir}
- @@files = %w{logfile statefile manifest masterlog}
+ @@dirs = %w{rrddir confdir vardir logdir statedir}
+ @@files = %w{statefile manifest masterlog}
@@normals = %w{puppetport masterport server}
@@booleans = %w{rrdgraph noop}
@@ -43,8 +43,8 @@ class TestPuppetDefaults < Test::Unit::TestCase
if __FILE__ == $0
def disabled_testContained
- confdir = Regexp.new(Puppet[:puppetconf])
- vardir = Regexp.new(Puppet[:puppetvar])
+ confdir = Regexp.new(Puppet[:confdir])
+ vardir = Regexp.new(Puppet[:vardir])
[@@dirs,@@files].flatten.each { |param|
value = Puppet[param]
@@ -62,8 +62,8 @@ class TestPuppetDefaults < Test::Unit::TestCase
end
def testFailOnBogusArgs
- [0, "ashoweklj", ";", :thisisafakesymbol].each { |param|
- assert_raise(ArgumentError) { Puppet[param] }
+ [0, "ashoweklj", ";"].each { |param|
+ assert_raise(ArgumentError, "No error on %s" % param) { Puppet[param] }
}
end
@@ -87,15 +87,15 @@ class TestPuppetDefaults < Test::Unit::TestCase
def test_settingdefaults
testvals = {
- :fakeparam => [:puppetconf, "yaytest"],
- :anotherparam => proc { File.join(Puppet[:puppetvar], "goodtest") },
+ :fakeparam => "$confdir/yaytest",
+ :anotherparam => "$vardir/goodtest",
:string => "a yay string",
:boolean => true
}
testvals.each { |param, default|
assert_nothing_raised {
- Puppet.setdefault(param,default)
+ Puppet.setdefaults("testing", [param, default, "a value"])
}
}
end