diff options
| author | Luke Kanies <luke@madstop.com> | 2007-11-24 14:54:38 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-11-24 14:54:38 -0600 |
| commit | 8de1412d97ac9d80500efb5cb94451ab67908448 (patch) | |
| tree | f45fd7794ad7c33a4f0ae2639d5ba1ced896934a /test/network/xmlrpc | |
| parent | 7c36ae9f6bc8f6043443a0cf12f769c603895b00 (diff) | |
| download | puppet-8de1412d97ac9d80500efb5cb94451ab67908448.tar.gz puppet-8de1412d97ac9d80500efb5cb94451ab67908448.tar.xz puppet-8de1412d97ac9d80500efb5cb94451ab67908448.zip | |
Integrating most of Matt Palmer's from
http://theshed.hezmatt.org/mattshacks/puppet/_patches/puppet-0.23.2/.
There are still a few that haven't made it in, notably those related
to the plugins module, which I'm planning on integrating separately.
Diffstat (limited to 'test/network/xmlrpc')
| -rwxr-xr-x | test/network/xmlrpc/client.rb | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/test/network/xmlrpc/client.rb b/test/network/xmlrpc/client.rb index e740e57b4..f6d234324 100755 --- a/test/network/xmlrpc/client.rb +++ b/test/network/xmlrpc/client.rb @@ -51,24 +51,34 @@ class TestXMLRPCClient < Test::Unit::TestCase client = Puppet::Network::XMLRPCClient.new() end - ca = Puppet::Network::Handler.ca.new - caclient = Puppet::Network::Client.ca.new :CA => ca - caclient.request_cert + caclient = mock 'client', :cert => :ccert, :key => :ckey + + FileTest.expects(:exist?).with(Puppet[:localcacert]).returns(true) + + store = mock 'sslstore' + OpenSSL::X509::Store.expects(:new).returns(store) + store.expects(:add_file).with(Puppet[:localcacert]) + store.expects(:purpose=).with(OpenSSL::X509::PURPOSE_SSL_CLIENT) class << client attr_accessor :http end - client.http.expects(:ca_file=).with(Puppet[:localcacert]) - client.http.expects(:cert=).with(caclient.cert) - client.http.expects(:key=).with(caclient.key) - client.http.expects(:verify_mode=).with(OpenSSL::SSL::VERIFY_PEER) - client.http.expects(:cert_store=) + http = mock 'http' + client.http = http + + http.expects(:ca_file).returns(false) + http.expects(:ca_file=).with(Puppet[:localcacert]) + http.expects(:cert=).with(:ccert) + http.expects(:key=).with(:ckey) + http.expects(:verify_mode=).with(OpenSSL::SSL::VERIFY_PEER) + http.expects(:cert_store=) assert_nothing_raised do client.cert_setup(caclient) end end -end - + def test_http_cache + end +end |
