diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-04-30 19:42:58 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-04-30 19:42:58 +0000 |
| commit | 80ec4943a9db1272fb405a459a763f8b8a6abd52 (patch) | |
| tree | 6e117abe234ecc9b9301344a2f95fcb68756be09 /test | |
| parent | 483c25e04314f66e48290c9e3141000872b23145 (diff) | |
Fixing #430 (I hope) -- execs now autorequire the specified user
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2442 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
| -rwxr-xr-x | test/ral/types/exec.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/ral/types/exec.rb b/test/ral/types/exec.rb index e36316031..ede6361cd 100755 --- a/test/ral/types/exec.rb +++ b/test/ral/types/exec.rb @@ -208,7 +208,7 @@ class TestExec < Test::Unit::TestCase end # Verify that we auto-require any managed scripts. - def test_autorequire + def test_autorequire_files exe = tempfile() oexe = tempfile() sh = %x{which sh} @@ -713,6 +713,19 @@ and stuff" assert(FileTest.exists?(refresher), "refresh param was ignored") assert(! FileTest.exists?(maker), "refresh param also ran command") end + + if Puppet.features.root? + def test_autorequire_user + user = Puppet::Type.type(:user).create(:name => "yay") + exec = Puppet::Type.type(:exec).create(:command => "/bin/echo fun", :user => "yay") + + rels = nil + assert_nothing_raised("Could not evaluate autorequire") do + rels = exec.autorequire + end + assert(rels.find { |r| r.source == user and r.target == exec }, "Exec did not autorequire user") + end + end end # $Id$ |
