diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-06-13 18:09:40 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-06-13 18:09:40 +0000 |
commit | b4b3c27ff4d0c748c68efd856865dffb65f0ba90 (patch) | |
tree | 3460c6de945fc8d04a202a375c4ba415f1aa9788 /test/language/interpreter.rb | |
parent | ba4071cba3fc4c975538199933945f09bd4d28b2 (diff) | |
download | puppet-b4b3c27ff4d0c748c68efd856865dffb65f0ba90.tar.gz puppet-b4b3c27ff4d0c748c68efd856865dffb65f0ba90.tar.xz puppet-b4b3c27ff4d0c748c68efd856865dffb65f0ba90.zip |
Adding support for default nodes as requested in #136.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1261 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/language/interpreter.rb')
-rwxr-xr-x | test/language/interpreter.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/language/interpreter.rb b/test/language/interpreter.rb index 22a2e71e8..4ce35d48e 100755 --- a/test/language/interpreter.rb +++ b/test/language/interpreter.rb @@ -135,7 +135,7 @@ class TestInterpreter < Test::Unit::TestCase "(&(objectclass=puppetclient)(cn=%s))" % node ) do |entry| parent = entry.vals("parentnode").shift - classes = entry.vals("puppetclass") + classes = entry.vals("puppetclass") || [] end return parent, classes @@ -173,6 +173,17 @@ class TestInterpreter < Test::Unit::TestCase parent = nil classes = nil + # First make sure we get the default node for unknown hosts + dparent, dclasses = ldaphost("default") + + assert_nothing_raised { + parent, classes = interp.nodesearch("nosuchhostokay") + } + + assert_equal(dparent, parent, "Default parent node did not match") + assert_equal(dclasses, classes, "Default parent class list did not match") + + # Now look for our normal host assert_nothing_raised { parent, classes = interp.nodesearch_ldap(hostname) } |