~ubuntu-branches/ubuntu/quantal/puppet/quantal

« back to all changes in this revision

Viewing changes to acceptance/tests/resource/exec/should_not_run_command_creates.rb

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-07-14 01:56:30 UTC
  • mfrom: (1.1.29) (3.1.43 sid)
  • Revision ID: package-import@ubuntu.com-20120714015630-ntj41rkvkq4zph4y
Tags: 2.7.18-1ubuntu1
* Resynchronise with Debian. (LP: #1023931) Remaining changes:
  - debian/puppetmaster-passenger.postinst: Make sure we error if puppet
    config print doesn't work
  - debian/puppetmaster-passenger.postinst: Ensure upgrades from
    <= 2.7.11-1 fixup passenger apache configuration.
* Dropped upstreamed patches:
  - debian/patches/CVE-2012-1906_CVE-2012-1986_to_CVE-2012-1989.patch
  - debian/patches/puppet-12844
  - debian/patches/2.7.17-Puppet-July-2012-CVE-fixes.patch
* Drop Build-Depends on ruby-rspec (in universe):
  - debian/control: remove ruby-rspec from Build-Depends
  - debian/patches/no-rspec.patch: make Rakefile work anyway if rspec
    isn't installed so we can use it in debian/rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
test_name "should not run command creates"
2
 
 
3
 
touch      = "/tmp/touched-#{Time.new.to_i}"
4
 
donottouch = "/tmp/not-touched-#{Time.new.to_i}"
5
 
 
6
 
manifest = %Q{
7
 
  exec { "test#{Time.new.to_i}": command => '/bin/touch #{donottouch}', creates => "#{touch}"}
8
 
}
9
 
 
10
 
step "prepare the agents for the test"
11
 
on agents, "touch #{touch} ; rm -f #{donottouch}"
12
 
 
13
 
step "test using puppet apply"
14
 
apply_manifest_on(agents, manifest) do
15
 
    fail_test "looks like the thing executed, which it shouldn't" if
16
 
        stdout.include? 'executed successfully'
17
 
end
18
 
 
19
 
step "verify the file didn't get created"
20
 
on agents, "test -f #{donottouch}", :acceptable_exit_codes => [1]
21
 
 
22
 
step "prepare the agents for the second part of the test"
23
 
on agents, "touch #{touch} ; rm -f #{donottouch}"
24
 
 
25
 
step "test using puppet resource"
26
 
on(agents, puppet_resource('exec', "test#{Time.new.to_i}",
27
 
              "command='/bin/touch #{donottouch}'",
28
 
              "creates='#{touch}'")) do
29
 
    fail_test "looks like the thing executed, which it shouldn't" if
30
 
        stdout.include? 'executed successfully'
31
 
end
32
 
 
33
 
step "verify the file didn't get created the second time"
34
 
on agents, "test -f #{donottouch}", :acceptable_exit_codes => [1]