summaryrefslogtreecommitdiffstats
path: root/test/puppet
diff options
context:
space:
mode:
authorchristian <christian@980ebf18-57e1-0310-9a29-db15c13687c0>2007-08-10 03:01:55 +0000
committerchristian <christian@980ebf18-57e1-0310-9a29-db15c13687c0>2007-08-10 03:01:55 +0000
commit6ab30eb649fc9fa506381af71a988627030ebea4 (patch)
tree996a6c63328da798710fd636b561783346e01880 /test/puppet
parent0195893a75fcc5a3ccbcd15a23a39963821c31f4 (diff)
Fix for setting global exit code ($?) in SUIDManager tests
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2767 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/puppet')
-rwxr-xr-xtest/puppet/tc_suidmanager.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/puppet/tc_suidmanager.rb b/test/puppet/tc_suidmanager.rb
index 6db59d165..ba16b5ef8 100755
--- a/test/puppet/tc_suidmanager.rb
+++ b/test/puppet/tc_suidmanager.rb
@@ -49,6 +49,7 @@ class TestSUIDManager < Test::Unit::TestCase
def test_system
+ set_exit_status!
expects_id_set_and_revert @user.uid, @user.gid
Kernel.expects(:system).with('blah')
Puppet::Util::SUIDManager.system('blah', @user.uid, @user.gid)
@@ -58,6 +59,8 @@ class TestSUIDManager < Test::Unit::TestCase
if (RUBY_VERSION <=> "1.8.4") < 0
warn "Cannot run this test on ruby < 1.8.4"
else
+ set_exit_status!
+
Puppet::Util.expects(:execute).with( 'yay',
{ :failonfail => false,
:uid => @user.uid,
@@ -91,6 +94,11 @@ class TestSUIDManager < Test::Unit::TestCase
Process.expects(:euid=).with(99997)
Process.expects(:egid=).with(99996)
end
+
+ def set_exit_status!
+ # We want to make sure $? is set, this is the only way I know how.
+ Kernel.system '' if $?.nil?
+ end
end
# $Id$