summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/network/client/client.rb4
-rwxr-xr-xtest/network/handler/bucket.rb32
-rwxr-xr-xtest/network/xmlrpc/client.rb30
3 files changed, 22 insertions, 44 deletions
diff --git a/test/network/client/client.rb b/test/network/client/client.rb
index 4a7e9cdb6..918b9e86a 100755
--- a/test/network/client/client.rb
+++ b/test/network/client/client.rb
@@ -243,8 +243,8 @@ class TestClient < Test::Unit::TestCase
client = FakeClient.new :Test => FakeDriver.new
driver = client.driver
- driver.meta_def(:cert_setup) { |c| }
- driver.expects(:cert_setup).with(client)
+ driver.meta_def(:recycle_connection) { |c| }
+ driver.expects(:recycle_connection).with(client)
assert_nothing_raised("Could not read cert") do
client.read_cert
diff --git a/test/network/handler/bucket.rb b/test/network/handler/bucket.rb
index d72206e29..1a7063366 100755
--- a/test/network/handler/bucket.rb
+++ b/test/network/handler/bucket.rb
@@ -203,38 +203,6 @@ class TestBucket < Test::Unit::TestCase
checkfiles(client)
end
- # test that things work over the wire
- def test_webxmlmix
- Puppet::Util::SUIDManager.stubs(:asuser).yields
-
- files = filelist()
-
- tmpdir = File.join(tmpdir(),"tmpfiledir")
- @@tmpfiles << tmpdir
- FileUtils.mkdir_p(tmpdir)
-
- Puppet[:autosign] = true
- Puppet[:certname] = "localhost"
- client = nil
- port = Puppet[:masterport]
-
- pid = mkserver(:CA => {}, :FileBucket => { :Path => @bucket})
-
- assert_nothing_raised {
- client = Puppet::Network::Client.dipper.new(
- :Server => "localhost",
- :Port => @@port
- )
- }
-
- checkfiles(client)
-
- unless pid
- raise "Uh, we don't have a child pid"
- end
- Process.kill("TERM", pid)
- end
-
def test_no_path_duplicates
bucket = nil
assert_nothing_raised {
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