diff options
Diffstat (limited to 'test/util/settings.rb')
| -rwxr-xr-x | test/util/settings.rb | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/test/util/settings.rb b/test/util/settings.rb index 286b14800..c4096f0bc 100755 --- a/test/util/settings.rb +++ b/test/util/settings.rb @@ -468,91 +468,6 @@ yay = /a/path assert_equal(should, result, "Add args functional test failed") end - def test_usesection - # We want to make sure that config processes do not result in graphing. - Puppet[:graphdir] = tempfile() - Puppet[:graph] = true - Dir.mkdir(Puppet[:graphdir]) - c = mkconfig - - dir = tempfile() - file = "$mydir/myfile" - realfile = File.join(dir, "myfile") - otherfile = File.join(dir, "otherfile") - section = "testing" - assert_nothing_raised { - @config.setdefaults(section, - :mydir => [dir, "A dir arg"], - :otherfile => { - :default => "$mydir/otherfile", - :create => true, - :desc => "A file arg" - }, - :myfile => [file, "A file arg"] - ) - } - - assert_nothing_raised("Could not use a section") { - @config.use(section) - } - - assert_nothing_raised("Could not reuse a section") { - @config.use(section) - } - - # Make sure it didn't graph anything, which is the only real way - # to test that the transaction was marked as a configurator. - assert(Dir.entries(Puppet[:graphdir]).reject { |f| f =~ /^\.\.?$/ }.empty?, "Graphed config process") - - assert(FileTest.directory?(dir), "Did not create directory") - assert(FileTest.exists?(otherfile), "Did not create file") - assert(!FileTest.exists?(realfile), "Created file") - end - - def test_setdefaultsarray - c = mkconfig - - assert_nothing_raised { - @config.setdefaults("yay", - :a => [false, "some value"], - :b => ["/my/file", "a file"] - ) - } - - assert_equal(false, @config[:a], "Values are not equal") - assert_equal("/my/file", @config[:b], "Values are not equal") - end - - def test_setdefaultshash - c = mkconfig - - assert_nothing_raised { - @config.setdefaults("yay", - :a => {:default => false, :desc => "some value"}, - :b => {:default => "/my/file", :desc => "a file"} - ) - } - - assert_equal(false, @config[:a], "Values are not equal") - assert_equal("/my/file", @config[:b], "Values are not equal") - end - - def test_notmanagingdev - c = mkconfig - path = "/dev/testing" - @config.setdefaults(:test, - :file => { - :default => path, - :mode => 0640, - :desc => 'yay' - } - ) - - config = @config.to_catalog - - assert(! config.resource(:file, "/dev/testing"), "Created dev file") - end - def test_groupsetting cfile = tempfile() |
