summaryrefslogtreecommitdiffstats
path: root/spec/unit/node.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-04-18 21:23:10 -0500
committerJames Turnbull <james@lovedthanlost.net>2009-04-22 03:27:58 +1000
commit4e0de3881b55a728ee54e1cab5d3b9a6ab52a5a9 (patch)
treecbfc5497e1bf20d68c36f3522b800dd58301f897 /spec/unit/node.rb
parentc1f562dc6e6b58a2de504019b7ad8381da57e2cb (diff)
downloadpuppet-4e0de3881b55a728ee54e1cab5d3b9a6ab52a5a9.tar.gz
puppet-4e0de3881b55a728ee54e1cab5d3b9a6ab52a5a9.tar.xz
puppet-4e0de3881b55a728ee54e1cab5d3b9a6ab52a5a9.zip
Partially fixing #1765 - node searching supports strict hostname checking
With the new 'strict_hostname_checking' option enabled, the compiler will only search for the literal certificate name in its list of nodes. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/unit/node.rb')
-rwxr-xr-xspec/unit/node.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/unit/node.rb b/spec/unit/node.rb
index 99c53e008..fb7d3639f 100755
--- a/spec/unit/node.rb
+++ b/spec/unit/node.rb
@@ -168,16 +168,25 @@ describe Puppet::Node, "when generating the list of names to search through" do
describe "and :node_name is set to 'cert'" do
before do
+ Puppet.settings.stubs(:value).with(:strict_hostname_checking).returns false
Puppet.settings.stubs(:value).with(:node_name).returns "cert"
end
it "should use the passed-in key as the first value" do
@node.names[0].should == "foo.domain.com"
end
+
+ describe "and strict hostname checking is enabled" do
+ it "should only use the passed-in key" do
+ Puppet.settings.expects(:value).with(:strict_hostname_checking).returns true
+ @node.names.should == ["foo.domain.com"]
+ end
+ end
end
describe "and :node_name is set to 'facter'" do
before do
+ Puppet.settings.stubs(:value).with(:strict_hostname_checking).returns false
Puppet.settings.stubs(:value).with(:node_name).returns "facter"
end