summaryrefslogtreecommitdiffstats
path: root/spec/integration
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-05-13 16:00:58 -0500
committerLuke Kanies <luke@madstop.com>2008-05-13 16:00:58 -0500
commit6efe4000dda3379e867786a9c2d4ae0f0cdfc3be (patch)
treea16fd1ae1f4aab7fe04af88daa78f1be1a2b1f3e /spec/integration
parent68d8d0ae0686939d94dae8ccc70e5582187335dc (diff)
downloadpuppet-6efe4000dda3379e867786a9c2d4ae0f0cdfc3be.tar.gz
puppet-6efe4000dda3379e867786a9c2d4ae0f0cdfc3be.tar.xz
puppet-6efe4000dda3379e867786a9c2d4ae0f0cdfc3be.zip
Using the new Cacher class for handling cached data.
This provides a single, global bit for determining whether a given piece of cached data is still valid.
Diffstat (limited to 'spec/integration')
-rwxr-xr-xspec/integration/file_serving/configuration.rb4
-rwxr-xr-xspec/integration/indirector/rest.rb8
-rwxr-xr-xspec/integration/network/server/webrick.rb5
-rwxr-xr-xspec/integration/node/catalog.rb2
-rwxr-xr-xspec/integration/node/facts.rb6
-rwxr-xr-xspec/integration/ssl/certificate_authority.rb5
-rwxr-xr-xspec/integration/ssl/certificate_request.rb4
-rwxr-xr-xspec/integration/ssl/certificate_revocation_list.rb5
-rwxr-xr-xspec/integration/ssl/host.rb7
-rwxr-xr-xspec/integration/transaction/report.rb2
10 files changed, 16 insertions, 32 deletions
diff --git a/spec/integration/file_serving/configuration.rb b/spec/integration/file_serving/configuration.rb
index 6975594a8..cb5a23d3b 100755
--- a/spec/integration/file_serving/configuration.rb
+++ b/spec/integration/file_serving/configuration.rb
@@ -10,7 +10,7 @@ require 'puppet/file_serving/configuration'
describe Puppet::FileServing::Configuration, " when finding files with Puppet::FileServing::Mount" do
before do
# Just in case it already exists.
- Puppet::FileServing::Configuration.clear_cache
+ Puppet::Util::Cacher.invalidate
@mount = Puppet::FileServing::Mount.new("mymount")
FileTest.stubs(:exists?).with("/my/path").returns(true)
@@ -38,6 +38,6 @@ describe Puppet::FileServing::Configuration, " when finding files with Puppet::F
end
after do
- Puppet::FileServing::Configuration.clear_cache
+ Puppet::Util::Cacher.invalidate
end
end
diff --git a/spec/integration/indirector/rest.rb b/spec/integration/indirector/rest.rb
index 2db3b31fd..1a9671265 100755
--- a/spec/integration/indirector/rest.rb
+++ b/spec/integration/indirector/rest.rb
@@ -57,6 +57,8 @@ describe Puppet::Indirector::REST do
describe "when using webrick" do
before :each do
+ Puppet::Util::Cacher.invalidate
+
Puppet[:servertype] = 'webrick'
Puppet[:server] = '127.0.0.1'
Puppet[:certname] = '127.0.0.1'
@@ -73,11 +75,7 @@ describe Puppet::Indirector::REST do
@server.unlisten
@tmpfile.delete
Puppet.settings.clear
-
- # This is necessary so the terminus instances don't lie around.
- Puppet::SSL::Key.indirection.clear_cache
- Puppet::SSL::Certificate.indirection.clear_cache
- Puppet::SSL::CertificateRequest.indirection.clear_cache
+ Puppet::Util::Cacher.invalidate
end
describe "when finding a model instance over REST" do
diff --git a/spec/integration/network/server/webrick.rb b/spec/integration/network/server/webrick.rb
index f2b55ef92..0e66ee955 100755
--- a/spec/integration/network/server/webrick.rb
+++ b/spec/integration/network/server/webrick.rb
@@ -30,10 +30,7 @@ describe Puppet::Network::Server do
system("rm -rf %s" % @dir)
- # This is necessary so the terminus instances don't lie around.
- Puppet::SSL::Key.indirection.clear_cache
- Puppet::SSL::Certificate.indirection.clear_cache
- Puppet::SSL::CertificateRequest.indirection.clear_cache
+ Puppet::Util::Cacher.invalidate
end
describe "before listening" do
diff --git a/spec/integration/node/catalog.rb b/spec/integration/node/catalog.rb
index ca14c2ea8..b0e651511 100755
--- a/spec/integration/node/catalog.rb
+++ b/spec/integration/node/catalog.rb
@@ -7,7 +7,7 @@ require File.dirname(__FILE__) + '/../../spec_helper'
describe Puppet::Node::Catalog do
describe "when using the indirector" do
- after { Puppet::Node::Catalog.indirection.clear_cache }
+ after { Puppet::Util::Cacher.invalidate }
it "should be able to delegate to the :yaml terminus" do
Puppet::Node::Catalog.indirection.stubs(:terminus_class).returns :yaml
diff --git a/spec/integration/node/facts.rb b/spec/integration/node/facts.rb
index c2f876578..cef3d79d4 100755
--- a/spec/integration/node/facts.rb
+++ b/spec/integration/node/facts.rb
@@ -7,13 +7,15 @@ require File.dirname(__FILE__) + '/../../spec_helper'
describe Puppet::Node::Facts do
describe "when using the indirector" do
- after { Puppet::Node::Facts.indirection.clear_cache }
+ after { Puppet::Util::Cacher.invalidate }
it "should expire any cached node instances when it is saved" do
Puppet::Node::Facts.indirection.stubs(:terminus_class).returns :yaml
+
+ Puppet::Node::Facts.indirection.terminus(:yaml).should equal(Puppet::Node::Facts.indirection.terminus(:yaml))
terminus = Puppet::Node::Facts.indirection.terminus(:yaml)
+ terminus.stubs :save
- terminus.expects(:save)
Puppet::Node.expects(:expire).with("me")
facts = Puppet::Node::Facts.new("me")
diff --git a/spec/integration/ssl/certificate_authority.rb b/spec/integration/ssl/certificate_authority.rb
index 28f880ede..d838bc586 100755
--- a/spec/integration/ssl/certificate_authority.rb
+++ b/spec/integration/ssl/certificate_authority.rb
@@ -28,10 +28,7 @@ describe Puppet::SSL::CertificateAuthority do
system("rm -rf %s" % @dir)
Puppet.settings.clear
- # This is necessary so the terminus instances don't lie around.
- Puppet::SSL::Key.indirection.clear_cache
- Puppet::SSL::Certificate.indirection.clear_cache
- Puppet::SSL::CertificateRequest.indirection.clear_cache
+ Puppet::Util::Cacher.invalidate
Puppet::SSL::CertificateAuthority.instance_variable_set("@instance", nil)
}
diff --git a/spec/integration/ssl/certificate_request.rb b/spec/integration/ssl/certificate_request.rb
index 01b1f4a29..f428718e7 100755
--- a/spec/integration/ssl/certificate_request.rb
+++ b/spec/integration/ssl/certificate_request.rb
@@ -16,8 +16,6 @@ describe Puppet::SSL::CertificateRequest do
file.delete
Puppet.settings.clear
- # This is necessary so the terminus instances don't lie around.
- Puppet::SSL::CertificateRequest.indirection.clear_cache
Puppet.settings[:confdir] = @dir
Puppet.settings[:vardir] = @dir
@@ -32,7 +30,7 @@ describe Puppet::SSL::CertificateRequest do
Puppet.settings.clear
# This is necessary so the terminus instances don't lie around.
- Puppet::SSL::CertificateRequest.indirection.clear_cache
+ Puppet::Util::Cacher.invalidate
end
it "should be able to generate CSRs" do
diff --git a/spec/integration/ssl/certificate_revocation_list.rb b/spec/integration/ssl/certificate_revocation_list.rb
index 74e45b239..246654816 100755
--- a/spec/integration/ssl/certificate_revocation_list.rb
+++ b/spec/integration/ssl/certificate_revocation_list.rb
@@ -28,10 +28,7 @@ describe Puppet::SSL::CertificateRevocationList do
Puppet.settings.clear
# This is necessary so the terminus instances don't lie around.
- Puppet::SSL::Key.indirection.clear_cache
- Puppet::SSL::Certificate.indirection.clear_cache
- Puppet::SSL::CertificateRequest.indirection.clear_cache
- Puppet::SSL::CertificateRevocationList.indirection.clear_cache
+ Puppet::Util::Cacher.invalidate
}
it "should be able to read in written out CRLs with no revoked certificates" do
diff --git a/spec/integration/ssl/host.rb b/spec/integration/ssl/host.rb
index d4834c341..65f10cef3 100755
--- a/spec/integration/ssl/host.rb
+++ b/spec/integration/ssl/host.rb
@@ -29,12 +29,7 @@ describe Puppet::SSL::Host do
system("rm -rf %s" % @dir)
Puppet.settings.clear
-
- # This is necessary so the terminus instances don't lie around.
- Puppet::SSL::Key.indirection.clear_cache
- Puppet::SSL::Certificate.indirection.clear_cache
- Puppet::SSL::CertificateRevocationList.indirection.clear_cache
- Puppet::SSL::CertificateRequest.indirection.clear_cache
+ Puppet::Util::Cacher.invalidate
}
it "should be considered a CA host if its name is equal to 'ca'" do
diff --git a/spec/integration/transaction/report.rb b/spec/integration/transaction/report.rb
index 48e59f203..6bbd5eb10 100755
--- a/spec/integration/transaction/report.rb
+++ b/spec/integration/transaction/report.rb
@@ -7,7 +7,7 @@ require File.dirname(__FILE__) + '/../../spec_helper'
describe Puppet::Transaction::Report do
describe "when using the indirector" do
- after { Puppet::Transaction::Report.indirection.clear_cache }
+ after { Puppet::Util::Cacher.invalidate }
it "should be able to delegate to the :processor terminus" do
Puppet::Transaction::Report.indirection.stubs(:terminus_class).returns :processor