summaryrefslogtreecommitdiffstats
path: root/test/ral/manager
diff options
context:
space:
mode:
authorLuke Kanies <luke@puppetlabs.com>2010-06-10 20:31:34 -0700
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commit0b95a8528e554df07efe970c9ecfc34535d17c92 (patch)
tree42ac163a4ab9497e3fb9f676365c1b3da35c5c7d /test/ral/manager
parent4627b8fe11dc14bf42e98b84121b885df73c709e (diff)
downloadpuppet-0b95a8528e554df07efe970c9ecfc34535d17c92.tar.gz
puppet-0b95a8528e554df07efe970c9ecfc34535d17c92.tar.xz
puppet-0b95a8528e554df07efe970c9ecfc34535d17c92.zip
Working #3139 - scheduling moved to resource harness
We previously had the schedule checking code in Puppet::Type, but it's more of a transactional function, and in order to do proper auditing in the transactional area, we need the cache checking done there. Scheduling is one of the few functions that actually uses cached data currently. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
Diffstat (limited to 'test/ral/manager')
-rwxr-xr-xtest/ral/manager/type.rb50
1 files changed, 0 insertions, 50 deletions
diff --git a/test/ral/manager/type.rb b/test/ral/manager/type.rb
index 8b146b613..e373cde30 100755
--- a/test/ral/manager/type.rb
+++ b/test/ral/manager/type.rb
@@ -315,54 +315,4 @@ class TestType < Test::Unit::TestCase
exec = Puppet::Type.newexec(:title => "yay", :command => "/bin/echo yay")
assert_equal("Exec[yay]", exec.ref)
end
-
- # Partially test #704, but also cover the rest of the schedule management bases.
- def test_schedule
- schedule = Puppet::Type.type(:schedule).new(:name => "maint")
- catalog = mk_catalog(schedule)
-
- {"maint" => true, nil => false, :fail => :fail}.each do |name, should|
- args = {:name => tempfile, :ensure => :file}
- if name
- args[:schedule] = name
- end
- resource = Puppet::Type.type(:file).new(args)
- catalog.add_resource(resource)
-
- if should == :fail
- assert_raise(Puppet::Error, "Did not fail on missing schedule") do
- resource.schedule
- end
- elsif should == false
- assert_nil(resource.schedule, "Set the schedule tho it is set to nil")
- else
- sched = nil
- assert_nothing_raised("Failed when schedule was %s" % sched) do
- sched = resource.schedule
- end
-
- assert(sched, "Did not find schedule %s" % sched.inspect)
-
- if should
- assert_equal(name, sched.name, "did not get correct schedule back")
- end
- end
- catalog.remove_resource(resource)
- end
- end
-
- # #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).new(:path => "/tmp/whatever", :mode => "755", :noop => true, :schedule => :daily, :ensure => :file)
- catalog = Puppet::Resource::Catalog.new
- catalog.add_resource
-
- assert(file.noop?, "File not considered in noop")
- assert(file.scheduled?, "File is not considered scheduled")
-
- catalog.apply
-
- assert(file.scheduled?, "File is not considered scheduled even though only a noop run was made")
- end
end