summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rwxr-xr-xspec/integration/defaults.rb20
-rwxr-xr-xspec/unit/indirector/yaml.rb15
2 files changed, 34 insertions, 1 deletions
diff --git a/spec/integration/defaults.rb b/spec/integration/defaults.rb
index a07743679..c506700c8 100755
--- a/spec/integration/defaults.rb
+++ b/spec/integration/defaults.rb
@@ -20,4 +20,24 @@ describe "Puppet defaults" do
lambda { Puppet.settings[:certname] = "Host.Domain.Com" }.should raise_error(ArgumentError)
end
end
+
+ it "should have a clientyamldir setting" do
+ Puppet.settings[:clientyamldir].should_not be_nil
+ end
+
+ it "should have different values for the yamldir and clientyamldir" do
+ Puppet.settings[:yamldir].should_not == Puppet.settings[:clientyamldir]
+ end
+
+ # See #1232
+ it "should not specify a user or group for the clientyamldir" do
+ Puppet.settings.element(:clientyamldir).owner.should be_nil
+ Puppet.settings.element(:clientyamldir).group.should be_nil
+ end
+
+ # See #1232
+ it "should not specify a user or group for the rundir" do
+ Puppet.settings.element(:rundir).owner.should be_nil
+ Puppet.settings.element(:rundir).group.should be_nil
+ end
end
diff --git a/spec/unit/indirector/yaml.rb b/spec/unit/indirector/yaml.rb
index 53d12f426..3875d70aa 100755
--- a/spec/unit/indirector/yaml.rb
+++ b/spec/unit/indirector/yaml.rb
@@ -20,12 +20,25 @@ describe Puppet::Indirector::Yaml, " when choosing file location" do
@subject.name = :me
@dir = "/what/ever"
- Puppet.settings.stubs(:value).with(:yamldir).returns(@dir)
+ Puppet.settings.stubs(:value).returns("fakesettingdata")
+ Puppet.settings.stubs(:value).with(:clientyamldir).returns(@dir)
@request = stub 'request', :key => :me, :instance => @subject
end
describe Puppet::Indirector::Yaml, " when choosing file location" do
+ it "should use the yamldir if the process name is 'puppetmasterd'" do
+ Puppet.settings.expects(:value).with(:name).returns "puppetmasterd"
+ Puppet.settings.expects(:value).with(:yamldir).returns "/main/yaml/dir"
+ @store.path(:me).should =~ %r{^/main/yaml/dir}
+ end
+
+ it "should use the client yamldir if the process name is not 'puppetmasterd'" do
+ Puppet.settings.expects(:value).with(:name).returns "cient"
+ Puppet.settings.expects(:value).with(:clientyamldir).returns "/client/yaml/dir"
+ @store.path(:me).should =~ %r{^/client/yaml/dir}
+ end
+
it "should store all files in a single file root set in the Puppet defaults" do
@store.path(:me).should =~ %r{^#{@dir}}
end