summaryrefslogtreecommitdiffstats
path: root/test/network/client
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-11-27 13:57:05 -0600
committerLuke Kanies <luke@madstop.com>2007-11-27 13:57:05 -0600
commita38b4151244c0af4bdf058d3fec5a01dc271e1c3 (patch)
treec290ff6295c5ccc3effb77c5f5ffa462c4aa5473 /test/network/client
parent7ff8ea5a1a913cfc8b8044f19d6c214d8437cfdf (diff)
downloadpuppet-a38b4151244c0af4bdf058d3fec5a01dc271e1c3.tar.gz
puppet-a38b4151244c0af4bdf058d3fec5a01dc271e1c3.tar.xz
puppet-a38b4151244c0af4bdf058d3fec5a01dc271e1c3.zip
Fixing #927 -- rewriting the test to actually test what it's
supposed to be doing and to skip the whole network connect thing. FTR, the reason this is happening is because the keepalive patch causes http instances to start immediately, which wasn't previously the case. I have been noticing that not all failures that should result from this happen consistently.
Diffstat (limited to 'test/network/client')
-rwxr-xr-xtest/network/client/ca.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/test/network/client/ca.rb b/test/network/client/ca.rb
index 74de37900..9781e9589 100755
--- a/test/network/client/ca.rb
+++ b/test/network/client/ca.rb
@@ -30,10 +30,15 @@ class TestClientCA < Test::Unit::TestCase
# Make sure the ca defaults to specific ports and names
def test_ca_server
- client = nil
- assert_nothing_raised do
- client = Puppet::Network::Client.ca.new
- end
+ Puppet.settings.expects(:value).with(:ca_server).returns("myca")
+ Puppet.settings.expects(:value).with(:ca_port).returns(321)
+ Puppet.settings.stubs(:value).with(:http_proxy_host).returns(nil)
+ Puppet.settings.stubs(:value).with(:http_proxy_port).returns(nil)
+ Puppet.settings.stubs(:value).with(:http_keepalive).returns(false)
+
+ # Just throw an error; the important thing is the values, not what happens next.
+ Net::HTTP.stubs(:new).with("myca", 321, nil, nil).raises(ArgumentError)
+ assert_raise(ArgumentError) { Puppet::Network::Client.ca.new }
end
# #578