summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-09-07 10:58:07 -0500
committerLuke Kanies <luke@madstop.com>2007-09-07 10:58:07 -0500
commitca57c793d4f1ad249f63f26609be2fa9208ca244 (patch)
tree61fdc868bb4637c3661f79fa6fdf74443ed6da86 /test
parentcaad11a9d15210017f75918b50184bc12f2cc1d0 (diff)
downloadpuppet-ca57c793d4f1ad249f63f26609be2fa9208ca244.tar.gz
puppet-ca57c793d4f1ad249f63f26609be2fa9208ca244.tar.xz
puppet-ca57c793d4f1ad249f63f26609be2fa9208ca244.zip
Fixing #801 -- resources that have changes when running in noop mode do not record that they were checked, so that they will be scheduled on the next run. This is a somewhat murky solution, but considering that no one had submitted this bug before, I expect it will not hit many people.
Diffstat (limited to 'test')
-rwxr-xr-xtest/ral/manager/type.rb21
1 files changed, 19 insertions, 2 deletions
diff --git a/test/ral/manager/type.rb b/test/ral/manager/type.rb
index cbe969fb3..292d66b28 100755
--- a/test/ral/manager/type.rb
+++ b/test/ral/manager/type.rb
@@ -815,6 +815,23 @@ class TestType < Test::Unit::TestCase
end
end
end
-end
-# $Id$
+ # #801 -- resources only checked in noop should be rescheduled immediately.
+ def test_reschedule_when_noop
+ Puppet::Type.type(:schedule).mkdefaultschedules
+ file = Puppet::Type.type(:file).create(:path => "/tmp/whatever", :mode => "755", :noop => true, :schedule => :daily, :ensure => :file)
+
+ assert(file.noop?, "File not considered in noop")
+ assert(file.scheduled?, "File is not considered scheduled")
+
+ file.evaluate
+
+ assert_nil(file.cached(:checked), "Stored a checked time when running in noop mode when there were changes")
+ file.cache(:checked, nil)
+
+ file.stubs(:propertychanges).returns([])
+
+ file.evaluate
+ assert_instance_of(Time, file.cached(:checked), "Did not store a checked time when running in noop mode when there were no changes")
+ end
+end