diff options
| author | Luke Kanies <luke@madstop.com> | 2007-08-15 13:55:55 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-08-15 13:55:55 -0500 |
| commit | 65559af75e3da6522f4c3e952a73d80e0040609c (patch) | |
| tree | 3a7856db465f4f796fbdad9cac5880dbce563165 /test/network/handler | |
| parent | 90a9d09cd08ec072530e2f000e9f7b65f1c41095 (diff) | |
| download | puppet-65559af75e3da6522f4c3e952a73d80e0040609c.tar.gz puppet-65559af75e3da6522f4c3e952a73d80e0040609c.tar.xz puppet-65559af75e3da6522f4c3e952a73d80e0040609c.zip | |
Adding a "none" node source, which will be the default node source and will just return an empty node.
Diffstat (limited to 'test/network/handler')
| -rwxr-xr-x | test/network/handler/node.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/network/handler/node.rb b/test/network/handler/node.rb index 02da9eef0..37b63db69 100755 --- a/test/network/handler/node.rb +++ b/test/network/handler/node.rb @@ -529,6 +529,24 @@ class TestNodeSources < Test::Unit::TestCase assert_equal(%w{one two three four five}.sort, node.classes.sort, "node classes were not set correctly with the top node") assert_equal({"base" => "true", "center" => "boo", "master" => "far"}, node.parameters, "node parameters were not set correctly with the top node") end + + # Make sure we always get a node back from the 'none' nodesource. + def test_nodesource_none + source = Node.node_source(:none) + assert(source, "Could not find 'none' node source") + searcher = mk_searcher(:none) + assert(searcher.fact_merge?, "'none' node source does not merge facts") + + # Run a couple of node names through it + node = nil + %w{192.168.0.1 0:0:0:3:a:f host host.domain.com}.each do |name| + assert_nothing_raised("Could not create an empty node with name '%s'" % name) do + node = searcher.nodesearch(name) + end + assert_instance_of(SimpleNode, node, "Did not get a simple node back for %s" % name) + assert_equal(name, node.name, "Name was not set correctly") + end + end end class LdapNodeTest < PuppetTest::TestCase |
