diff options
| author | Luke Kanies <luke@madstop.com> | 2007-12-10 21:13:48 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-12-10 21:13:48 -0600 |
| commit | f127d04934b679b3e5edd7f55d31342abce3c96e (patch) | |
| tree | bb8bc15e086b473bc27104cd6fcbbf548a68678e /spec/unit/node | |
| parent | 7a4ae082c216d68092f140ed1f5cca40ffb1a09e (diff) | |
| download | puppet-f127d04934b679b3e5edd7f55d31342abce3c96e.tar.gz puppet-f127d04934b679b3e5edd7f55d31342abce3c96e.tar.xz puppet-f127d04934b679b3e5edd7f55d31342abce3c96e.zip | |
Fixing #951 -- external nodes work again, but you have to
set the 'node_terminus' setting to 'exec'.
Diffstat (limited to 'spec/unit/node')
| -rwxr-xr-x | spec/unit/node/searching.rb | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/spec/unit/node/searching.rb b/spec/unit/node/searching.rb deleted file mode 100755 index e747996e4..000000000 --- a/spec/unit/node/searching.rb +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env ruby - -require File.dirname(__FILE__) + '/../../spec_helper' -require 'puppet/node/searching' -require 'puppet/node/facts' - -describe Puppet::Node::Searching, " when searching for nodes" do - before do - @searcher = Object.new - @searcher.extend(Puppet::Node::Searching) - @facts = Puppet::Node::Facts.new("foo", "hostname" => "yay", "domain" => "domain.com") - @node = Puppet::Node.new("foo") - Puppet::Node::Facts.stubs(:find).with("foo").returns(@facts) - end - - it "should search for the node by its key first" do - names = [] - @searcher.expects(:find).with do |name| - names << name - names == %w{foo} - end.returns(@node) - @searcher.search("foo").should equal(@node) - end - - it "should return the first node found using the generated list of names" do - names = [] - @searcher.expects(:find).with("foo").returns(nil) - @searcher.expects(:find).with("yay.domain.com").returns(@node) - @searcher.search("foo").should equal(@node) - end - - it "should search for the rest of the names inversely by length" do - names = [] - @facts.values["fqdn"] = "longer.than.the.normal.fqdn.com" - @searcher.stubs(:find).with do |name| - names << name - end - @searcher.search("foo") - # Strip off the key - names.shift - - # And the 'default' - names.pop - - length = 100 - names.each do |name| - (name.length < length).should be_true - length = name.length - end - end - - it "should attempt to find a default node if no names are found" do - names = [] - @searcher.stubs(:find).with do |name| - names << name - end.returns(nil) - @searcher.search("foo") - names[-1].should == "default" - end - - it "should cache the nodes" do - @searcher.expects(:find).with("foo").returns(@node) - @searcher.search("foo").should equal(@node) - @searcher.search("foo").should equal(@node) - end - - it "should flush the node cache using the :filetimeout parameter" do - node2 = Puppet::Node.new("foo2") - Puppet[:filetimeout] = -1 - # I couldn't get this to work with :expects - @searcher.stubs(:find).returns(@node, node2).then.raises(ArgumentError) - @searcher.search("foo").should equal(@node) - @searcher.search("foo").should equal(node2) - end - - after do - Puppet.settings.clear - end -end |
