summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorNick Lewis <nick@puppetlabs.com>2011-07-21 11:52:50 -0700
committerJacob Helwig <jacob@puppetlabs.com>2011-08-19 13:52:56 -0700
commit9849d565ec4db6bf1a39413c3136da9713f9fa25 (patch)
treeac567dd0039442b5b63f77506c8755b2a3809bd7 /test
parent028b795e2c705baa3652f26d8eec090e6b428d33 (diff)
downloadpuppet-9849d565ec4db6bf1a39413c3136da9713f9fa25.tar.gz
puppet-9849d565ec4db6bf1a39413c3136da9713f9fa25.tar.xz
puppet-9849d565ec4db6bf1a39413c3136da9713f9fa25.zip
Remove use of Puppet::Util::Cacher in Puppet::SSL::Host
This class was previously using a cached_attr for its 'localhost' attribute, representing the Puppet::SSL::Host entry corresponding to the cert in Puppet[:certname]. We now no longer expire this attribute. This has the effect that a change to certname during the lifetime of an agent will not be reflected in the certificate it uses. If this behavior is desired, it will need to be reimplemented another way. Reviewed-By: Jacob Helwig <jacob@puppetlabs.com> (cherry picked from commit 7048b4c4d8c4a8ad45caf6a02b263ac0a9fa333e)
Diffstat (limited to 'test')
-rwxr-xr-xtest/network/handler/master.rb5
-rwxr-xr-xtest/network/server/webrick.rb26
2 files changed, 5 insertions, 26 deletions
diff --git a/test/network/handler/master.rb b/test/network/handler/master.rb
index 4c0374a76..9326e4b38 100755
--- a/test/network/handler/master.rb
+++ b/test/network/handler/master.rb
@@ -16,11 +16,6 @@ class TestMaster < Test::Unit::TestCase
Puppet::Resource::Catalog.indirection.stubs(:find).returns(@catalog)
end
- def teardown
- super
- Puppet::Util::Cacher.expire
- end
-
def test_freshness_is_always_now
now1 = mock 'now1'
Time.stubs(:now).returns(now1)
diff --git a/test/network/server/webrick.rb b/test/network/server/webrick.rb
index 9eed5d862..e1fd68921 100755
--- a/test/network/server/webrick.rb
+++ b/test/network/server/webrick.rb
@@ -11,10 +11,7 @@ class TestWebrickServer < Test::Unit::TestCase
def setup
Puppet::Util::SUIDManager.stubs(:asuser).yields
- super
- end
-
- def teardown
+ Puppet::SSL::Host.instance_variable_set(:@localhost, nil)
super
end
@@ -23,11 +20,8 @@ class TestWebrickServer < Test::Unit::TestCase
def test_basics
server = nil
assert_raise(Puppet::Error, "server succeeded with no cert") do
-
- server = Puppet::Network::HTTPServer::WEBrick.new(
-
+ server = Puppet::Network::HTTPServer::WEBrick.new(
:Port => @@port,
-
:Handlers => {
:Status => nil
}
@@ -35,11 +29,8 @@ class TestWebrickServer < Test::Unit::TestCase
end
assert_nothing_raised("Could not create simple server") do
-
- server = Puppet::Network::HTTPServer::WEBrick.new(
-
+ server = Puppet::Network::HTTPServer::WEBrick.new(
:Port => @@port,
-
:Handlers => {
:CA => {}, # so that certs autogenerate
:Status => nil
@@ -75,11 +66,8 @@ class TestWebrickServer < Test::Unit::TestCase
client = nil
assert_nothing_raised {
-
- client = Puppet::Network::Client.status.new(
-
+ client = Puppet::Network::Client.status.new(
:Server => "localhost",
-
:Port => @@port
)
}
@@ -90,17 +78,13 @@ class TestWebrickServer < Test::Unit::TestCase
server = nil
Puppet[:certdnsnames] = "localhost"
assert_nothing_raised {
-
- server = Puppet::Network::HTTPServer::WEBrick.new(
-
+ server = Puppet::Network::HTTPServer::WEBrick.new(
:Port => @@port,
-
:Handlers => {
:CA => {}, # so that certs autogenerate
:Status => nil
}
)
-
}
pid = fork {