diff options
author | Luke Kanies <luke@madstop.com> | 2009-01-28 17:11:19 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2009-02-06 18:08:42 -0600 |
commit | fc14b81f99adc9c9308a26d322adaa59a7b7716d (patch) | |
tree | dc731383d3195e37ea3658b9cbc7b0c428579d9f /test | |
parent | e8be6dcad2150769b51bf81e95c57491921e68c1 (diff) | |
download | puppet-fc14b81f99adc9c9308a26d322adaa59a7b7716d.tar.gz puppet-fc14b81f99adc9c9308a26d322adaa59a7b7716d.tar.xz puppet-fc14b81f99adc9c9308a26d322adaa59a7b7716d.zip |
Splitting the Agent class into Agent and Configurer
Once I went to add runinterval support to the Agent class,
I realized it's really two classes: One that handles starting,
stopping, running, et al (still called Agent), and one that
handles downloading the catalog, running it, etc. (now
called Configurer).
This commit includes some additional code, but 95% of it is just moving code around.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'test')
-rwxr-xr-x | test/agent.rb | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/test/agent.rb b/test/agent.rb deleted file mode 100755 index 3ead157be..000000000 --- a/test/agent.rb +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env ruby - -require File.dirname(__FILE__) + '/lib/puppettest' - -require 'puppettest' -require 'puppet/agent' -require 'mocha' - -class TestAgent < Test::Unit::TestCase - include PuppetTest::ServerTest - - def setup - super - @agent_class = Puppet::Agent - end - - # Make sure we get a value for timeout - def test_config_timeout - master = Puppet::Agent - time = Integer(Puppet[:configtimeout]) - assert_equal(time, master.timeout, "Did not get default value for timeout") - assert_equal(time, master.timeout, "Did not get default value for timeout on second run") - - # Reset it - Puppet[:configtimeout] = "50" - assert_equal(50, master.timeout, "Did not get changed default value for timeout") - assert_equal(50, master.timeout, "Did not get changed default value for timeout on second run") - - # Now try an integer - Puppet[:configtimeout] = 100 - assert_equal(100, master.timeout, "Did not get changed integer default value for timeout") - assert_equal(100, master.timeout, "Did not get changed integer default value for timeout on second run") - end - - def test_splay - client = Puppet::Agent.new - - # Make sure we default to no splay - client.expects(:sleep).never - - assert_nothing_raised("Failed to call splay") do - client.send(:splay) - end - - # Now set it to true and make sure we get the right value - client = Puppet::Agent.new - client.expects(:sleep) - - Puppet[:splay] = true - assert_nothing_raised("Failed to call sleep when splay is true") do - client.send(:splay) - end - - # Now try it again - client = Puppet::Agent.new - client.expects(:sleep) - - assert_nothing_raised("Failed to call sleep when splay is true with a cached value") do - client.send(:splay) - end - end -end |