diff options
| author | Luke Kanies <luke@madstop.com> | 2008-12-18 18:06:45 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-12-18 18:06:45 -0600 |
| commit | 566bf7820e56b3be503a05645cad54152309b20f (patch) | |
| tree | f773fa8ea389790c01ae8a6eb92de7cd8a44874c /spec/unit/network/http/webrick.rb | |
| parent | 0cf9decfeab5a45f8457af2e51633fd6e0f877fc (diff) | |
| download | puppet-566bf7820e56b3be503a05645cad54152309b20f.tar.gz puppet-566bf7820e56b3be503a05645cad54152309b20f.tar.xz puppet-566bf7820e56b3be503a05645cad54152309b20f.zip | |
Fixing #1729 - puppetmasterd can now read certs at startup
The main aspect of this solution is to create a site-wide
Puppet::SSL::Host instance to cache ssl key and certificate,
so that by the time we've switched UIDs, we've got the key and
cert in memory. Then webrick just uses that, rather than creating
a new Host instance.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/unit/network/http/webrick.rb')
| -rwxr-xr-x | spec/unit/network/http/webrick.rb | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/spec/unit/network/http/webrick.rb b/spec/unit/network/http/webrick.rb index 7e5084bbc..e02d5c213 100755 --- a/spec/unit/network/http/webrick.rb +++ b/spec/unit/network/http/webrick.rb @@ -298,24 +298,16 @@ describe Puppet::Network::HTTP::WEBrick do Puppet::SSL::Certificate.stubs(:find).with('ca').returns @cert - Puppet::SSL::Host.stubs(:new).returns @host + Puppet::SSL::Host.stubs(:localhost).returns @host end - it "should use the key from an SSL::Host instance created with the default name" do - Puppet::SSL::Host.expects(:new).returns @host + it "should use the key from the localhost SSL::Host instance" do + Puppet::SSL::Host.expects(:localhost).returns @host @host.expects(:key).returns @key @server.setup_ssl[:SSLPrivateKey].should == "mykey" end - it "should generate its files if no certificate can be found" do - @host.expects(:certificate).times(2).returns(nil).then.returns(@cert) - - @host.expects(:generate) - - @server.setup_ssl - end - it "should configure the certificate" do @server.setup_ssl[:SSLCertificate].should == "mycert" end |
