diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-02-16 16:27:27 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-02-16 16:27:27 +0000 |
| commit | 5f8d61553a9d83087604fe5b68146503cf55d1be (patch) | |
| tree | 48ce04255a2eab6c7439f8db9fa3549cd4faab47 /test | |
| parent | 6cc8157fb0e36f2435b201abad81affe3b8e17ac (diff) | |
Removed some of the autorequire stuff from :exec because it created untenable require loops, and created a test case for some complicated exec + file recursion. The test case fails, and I want to have a clean committed repository before i mess much more in trying to fix it, which might actually not be possible.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@921 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
| -rwxr-xr-x | test/types/exec.rb | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/test/types/exec.rb b/test/types/exec.rb index f097e1860..004cd6c29 100755 --- a/test/types/exec.rb +++ b/test/types/exec.rb @@ -9,8 +9,6 @@ require 'puppettest' require 'test/unit' require 'facter' -# $Id$ - class TestExec < Test::Unit::TestCase include TestPuppet def test_execution @@ -399,4 +397,39 @@ class TestExec < Test::Unit::TestCase assert_apply(exec) end + + def test_execthenfile + exec = nil + file = nil + basedir = tempfile() + path = File.join(basedir, "subfile") + assert_nothing_raised { + exec = Puppet.type(:exec).create( + :name => "mkdir", + :path => "/usr/bin:/bin", + :creates => basedir, + :command => "mkdir %s; touch %s" % [basedir, path] + + ) + } + + assert_nothing_raised { + file = Puppet.type(:file).create( + :path => basedir, + :recurse => true, + :mode => "755", + :require => ["exec", "mkdir"] + ) + } + + Puppet::Type.finalize + + comp = newcomp(file, exec) + assert_events([:executed_command, :file_changed], comp) + + assert(FileTest.exists?(path), "Exec ran first") + assert(File.stat(path).mode & 007777 == 0755) + end end + +# $Id$ |
