summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-02-16 16:27:27 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-02-16 16:27:27 +0000
commit5f8d61553a9d83087604fe5b68146503cf55d1be (patch)
tree48ce04255a2eab6c7439f8db9fa3549cd4faab47 /test
parent6cc8157fb0e36f2435b201abad81affe3b8e17ac (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-xtest/types/exec.rb37
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$