diff options
author | Max Martin <max@puppetlabs.com> | 2011-04-07 12:21:42 -0700 |
---|---|---|
committer | Max Martin <max@puppetlabs.com> | 2011-04-07 12:21:42 -0700 |
commit | 20bff91c8b8e450d913deeb1750a00a14f1b1061 (patch) | |
tree | 38191b4766c8e2354c27c0868c12e0e254b4389f /spec/integration/transaction_spec.rb | |
parent | e17cc651a9625576aa79af428bbaec702e216ac8 (diff) | |
parent | da4457be4dedaed5368bacf81a08f0429e21cd45 (diff) | |
download | puppet-20bff91c8b8e450d913deeb1750a00a14f1b1061.tar.gz puppet-20bff91c8b8e450d913deeb1750a00a14f1b1061.tar.xz puppet-20bff91c8b8e450d913deeb1750a00a14f1b1061.zip |
Merge branch '2.6.x' into next
* 2.6.x:
(maint) Indentation fixes
(#6490) Add plugin initialization callback system to core
Fix #4339 - Locally save the last report to $lastrunreport
Fix #4339 - Save a last run report summary to $statedir/last_run_summary.yaml
Fixed #3127 - removed legacy debug code
Fixed #3127 - Fixed gem selection regex
(#5437) Invalidate cached TypeCollection when there was an error parsing
(#6937) Adjust formatting of recurse's desc
(#6937) Document the recurse parameter of File type.
(#6893) Document the cron type in the case of specials.
(#5670) Don't trigger refresh from a failed resource
Fixed #6554 - Missing $haveftool if/else conditional in install.rb breaking Ruby 1.9
Conflicts (Manually resolved):
lib/puppet/application/agent.rb
lib/puppet/application/apply.rb
lib/puppet/configurer.rb
lib/puppet/resource/type_collection.rb
lib/puppet/type/file.rb
spec/integration/configurer_spec.rb
spec/unit/application/agent_spec.rb
spec/unit/application/apply_spec.rb
spec/unit/configurer_spec.rb
spec/unit/indirector/report/yaml_spec.rb
spec/unit/resource/type_collection_spec.rb
Paired-with: Nick Lewis
Diffstat (limited to 'spec/integration/transaction_spec.rb')
-rwxr-xr-x | spec/integration/transaction_spec.rb | 61 |
1 files changed, 34 insertions, 27 deletions
diff --git a/spec/integration/transaction_spec.rb b/spec/integration/transaction_spec.rb index ff15e597d..e608faa27 100755 --- a/spec/integration/transaction_spec.rb +++ b/spec/integration/transaction_spec.rb @@ -135,33 +135,26 @@ describe Puppet::Transaction do it "should not let one failed refresh result in other refreshes failing" do path = tmpfile("path") newfile = tmpfile("file") - - file = Puppet::Type.type(:file).new( - + file = Puppet::Type.type(:file).new( :path => path, - :ensure => "file" ) - exec1 = Puppet::Type.type(:exec).new( - + exec1 = Puppet::Type.type(:exec).new( :path => ENV["PATH"], :command => "touch /this/cannot/possibly/exist", :logoutput => true, :refreshonly => true, :subscribe => file, - :title => "one" ) - exec2 = Puppet::Type.type(:exec).new( - + exec2 = Puppet::Type.type(:exec).new( :path => ENV["PATH"], :command => "touch #{newfile}", :logoutput => true, :refreshonly => true, :subscribe => [file, exec1], - :title => "two" ) @@ -178,22 +171,18 @@ describe Puppet::Transaction do Puppet[:ignoreschedules] = false - file = Puppet::Type.type(:file).new( - + file = Puppet::Type.type(:file).new( :name => tmpfile("file"), - :ensure => "file", :backup => false ) fname = tmpfile("exec") - exec = Puppet::Type.type(:exec).new( - + exec = Puppet::Type.type(:exec).new( :name => "touch #{fname}", :path => "/usr/bin:/bin", :schedule => "monthly", - :subscribe => Puppet::Resource.new("file", file.name) ) @@ -230,29 +219,21 @@ describe Puppet::Transaction do it "should not attempt to evaluate resources with failed dependencies" do - exec = Puppet::Type.type(:exec).new( - + exec = Puppet::Type.type(:exec).new( :command => "/bin/mkdir /this/path/cannot/possibly/exit", - :title => "mkdir" ) - - file1 = Puppet::Type.type(:file).new( - + file1 = Puppet::Type.type(:file).new( :title => "file1", :path => tmpfile("file1"), - :require => exec, :ensure => :file ) - - file2 = Puppet::Type.type(:file).new( - + file2 = Puppet::Type.type(:file).new( :title => "file2", :path => tmpfile("file2"), - :require => file1, :ensure => :file ) @@ -264,6 +245,32 @@ describe Puppet::Transaction do FileTest.should_not be_exists(file2[:path]) end + it "should not trigger subscribing resources on failure" do + file1 = tmpfile("file1") + file2 = tmpfile("file2") + + create_file1 = Puppet::Type.type(:exec).new( + :command => "/usr/bin/touch #{file1}" + ) + + exec = Puppet::Type.type(:exec).new( + :command => "/bin/mkdir /this/path/cannot/possibly/exit", + :title => "mkdir", + :notify => create_file1 + ) + + create_file2 = Puppet::Type.type(:exec).new( + :command => "/usr/bin/touch #{file2}", + :subscribe => exec + ) + + catalog = mk_catalog(exec, create_file1, create_file2) + catalog.apply + + FileTest.should_not be_exists(file1) + FileTest.should_not be_exists(file2) + end + # #801 -- resources only checked in noop should be rescheduled immediately. it "should immediately reschedule noop resources" do Puppet::Type.type(:schedule).mkdefaultschedules |