From d24c1ccc56b912e0ff69f7572dd36912c8c739c2 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Mon, 8 Oct 2007 19:12:39 -0500 Subject: All tests should now pass again. This is the first real pass towards using caching. The `puppet` executable actually uses the indirection work, instead of handlers and such (and man! is it cleaner). Most of this work was a result of trying to get the client-side story working, with correct yaml caching of configurations, which means this commit also covers converting configurations to yaml, which was a much bigger PITA than it needed to be. I still need to write integration tests, and I also need to cover the server-side story of a normal configuration retrieval. --- test/network/client/client.rb | 2 ++ test/network/client/master.rb | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'test/network/client') diff --git a/test/network/client/client.rb b/test/network/client/client.rb index e08da357c..a297a87e1 100755 --- a/test/network/client/client.rb +++ b/test/network/client/client.rb @@ -143,6 +143,8 @@ class TestClient < Test::Unit::TestCase def test_classfile Puppet[:code] = "class yaytest {}\n class bootest {}\n include yaytest, bootest" + Puppet::Node::Facts.indirection.stubs(:save) + master = client = nil assert_nothing_raised() { master = Puppet::Network::Handler.master.new( diff --git a/test/network/client/master.rb b/test/network/client/master.rb index aaa38b223..4ae77abc2 100755 --- a/test/network/client/master.rb +++ b/test/network/client/master.rb @@ -397,6 +397,8 @@ end manifest = tempfile() File.open(manifest, "w") { |f| f.puts "file { '#{file}': content => yay }" } + Puppet::Node::Facts.indirection.stubs(:save) + driver = mkmaster(:Manifest => manifest) driver.local = false master = mkclient(driver) @@ -406,7 +408,7 @@ end assert(! master.fresh?(master.class.facts), "Considered fresh with no compile at all") - + assert_nothing_raised { master.run } assert(master.fresh?(master.class.facts), "not considered fresh after compile") @@ -481,7 +483,9 @@ end master.local = false driver = master.send(:instance_variable_get, "@driver") driver.local = false + Puppet::Node::Facts.indirection.stubs(:save) # Retrieve the configuration + master.getconfig # Now the config is up to date, so get rid of the @objects var and @@ -509,6 +513,8 @@ end driver = master.send(:instance_variable_get, "@driver") driver.local = false + Puppet::Node::Facts.indirection.stubs(:save) + assert_nothing_raised("Could not compile config") do master.getconfig end -- cgit