summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-04-24 18:03:34 -0500
committerLuke Kanies <luke@madstop.com>2009-04-24 18:03:34 -0500
commit606a6891a5662a37f481cbada7cfd59c81cf9469 (patch)
tree66913b4c37a86ed86b6eab91862f1433ddbaa1db /spec/unit
parentf489c30411e8fdee4e43a4f580d135acdaeae946 (diff)
downloadpuppet-606a6891a5662a37f481cbada7cfd59c81cf9469.tar.gz
puppet-606a6891a5662a37f481cbada7cfd59c81cf9469.tar.xz
puppet-606a6891a5662a37f481cbada7cfd59c81cf9469.zip
Making sure the cert name is searched first
The cert name should be searched first in default circumstances, even if it disagrees with the hostname. Brice's change to the way catalogs are searched for didn't quite work when the hostname and certname didn't agree *and* the certname was fully qualified. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/unit')
-rwxr-xr-xspec/unit/node.rb21
1 files changed, 12 insertions, 9 deletions
diff --git a/spec/unit/node.rb b/spec/unit/node.rb
index fb7d3639f..025bdc898 100755
--- a/spec/unit/node.rb
+++ b/spec/unit/node.rb
@@ -147,23 +147,26 @@ describe Puppet::Node, "when generating the list of names to search through" do
@node.names.should be_instance_of(Array)
end
- it "should have the node's fqdn as the second name" do
- @node.names[1].should == "yay.domain.com"
+ describe "and the node name is fully qualified" do
+ it "should contain an entry for each part of the node name" do
+ @node.names.should be_include("foo.domain.com")
+ @node.names.should be_include("foo.domain")
+ @node.names.should be_include("foo")
+ end
end
- it "should set the fqdn to the node's 'fqdn' fact if it is available" do
- @node.parameters["fqdn"] = "boo.domain.com"
- @node.names[1].should == "boo.domain.com"
+ it "should include the node's fqdn" do
+ @node.names.should be_include("yay.domain.com")
end
- it "should set the fqdn to the node's hostname and domain if no fqdn is available" do
- @node.names[1].should == "yay.domain.com"
+ it "should combine and include the node's hostname and domain if no fqdn is available" do
+ @node.names.should be_include("yay.domain.com")
end
it "should contain an entry for each name available by stripping a segment of the fqdn" do
@node.parameters["fqdn"] = "foo.deep.sub.domain.com"
- @node.names[2].should == "foo.deep.sub.domain"
- @node.names[3].should == "foo.deep.sub"
+ @node.names.should be_include("foo.deep.sub.domain")
+ @node.names.should be_include("foo.deep.sub")
end
describe "and :node_name is set to 'cert'" do