summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPaul Berry <paul@puppetlabs.com>2010-11-17 15:19:15 -0800
committerPaul Berry <paul@puppetlabs.com>2010-11-17 15:19:15 -0800
commite6ec6468c4a9eec58dc155858665a70eee4dfb8c (patch)
tree85cdb7614a1922752ff652b93f2947ef231fa8fb /test
parentfb2b9e65990477e81728402afa1aab6fbe4a9c7e (diff)
parent53bb805f118ccaca5598e60afadfa6b777410a0f (diff)
downloadpuppet-e6ec6468c4a9eec58dc155858665a70eee4dfb8c.tar.gz
puppet-e6ec6468c4a9eec58dc155858665a70eee4dfb8c.tar.xz
puppet-e6ec6468c4a9eec58dc155858665a70eee4dfb8c.zip
Merge commit '2.6.3' into next
Resolved conflicts manually: spec/integration/indirector/bucket_file/rest_spec.rb spec/integration/indirector/certificate_revocation_list/rest_spec.rb
Diffstat (limited to 'test')
-rwxr-xr-xtest/other/provider.rb13
-rwxr-xr-xtest/puppet/tc_suidmanager.rb19
-rwxr-xr-xtest/ral/manager/type.rb2
-rwxr-xr-xtest/ral/providers/provider.rb6
4 files changed, 10 insertions, 30 deletions
diff --git a/test/other/provider.rb b/test/other/provider.rb
index 052d7a0d0..a539ee5a7 100755
--- a/test/other/provider.rb
+++ b/test/other/provider.rb
@@ -70,24 +70,13 @@ class TestImpl < Test::Unit::TestCase
child = @type.provide("child", :parent => parent.name) {}
}
- assert_nothing_raised {
- child.commands :which => "which"
- }
-
- assert(child.command(:which), "Did not find 'which' command")
-
- assert(child.command(:which) =~ /^\//,
- "Command did not become fully qualified")
- assert(FileTest.exists?(child.command(:which)),
- "Did not find actual 'which' binary")
-
assert_raise(Puppet::DevError) do
child.command(:nosuchcommand)
end
# Now create a parent command
assert_nothing_raised {
- parent.commands :sh => Puppet::Util.binary('sh')
+ parent.commands :sh => Puppet::Util.which('sh')
}
assert(parent.command(:sh), "Did not find 'sh' command")
diff --git a/test/puppet/tc_suidmanager.rb b/test/puppet/tc_suidmanager.rb
index 449f2aef5..eeb56f2c9 100755
--- a/test/puppet/tc_suidmanager.rb
+++ b/test/puppet/tc_suidmanager.rb
@@ -80,20 +80,11 @@ class TestSUIDManager < Test::Unit::TestCase
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,
-
- :gid => @user.gid }
- ).returns('output')
-
-
- output = Puppet::Util::SUIDManager.run_and_capture 'yay',
- @user.uid,
- @user.gid
+ Puppet::Util.
+ expects(:execute).
+ with('yay',:combine => true, :failonfail => false, :uid => @user.uid, :gid => @user.gid).
+ returns('output')
+ output = Puppet::Util::SUIDManager.run_and_capture 'yay', @user.uid, @user.gid
assert_equal 'output', output.first
assert_kind_of Process::Status, output.last
diff --git a/test/ral/manager/type.rb b/test/ral/manager/type.rb
index 7df643005..145877722 100755
--- a/test/ral/manager/type.rb
+++ b/test/ral/manager/type.rb
@@ -276,7 +276,7 @@ class TestType < Test::Unit::TestCase
def test_isomorphic_names
catalog = mk_catalog
# First do execs, since they're not isomorphic.
- echo = Puppet::Util.binary "echo"
+ echo = Puppet::Util.which "echo"
exec1 = exec2 = nil
assert_nothing_raised do
diff --git a/test/ral/providers/provider.rb b/test/ral/providers/provider.rb
index cb0b2a19e..f46e03f82 100755
--- a/test/ral/providers/provider.rb
+++ b/test/ral/providers/provider.rb
@@ -9,7 +9,7 @@ class TestProvider < Test::Unit::TestCase
include PuppetTest
def echo
- echo = Puppet::Util.binary("echo")
+ echo = Puppet::Util.which("echo")
raise "Could not find 'echo' binary; cannot complete test" unless echo
@@ -95,7 +95,7 @@ class TestProvider < Test::Unit::TestCase
provider.commands :testing => "/no/such/path"
- provider.stubs(:binary).returns "/no/such/path"
+ provider.stubs(:which).returns "/no/such/path"
provider.command(:testing)
assert_equal("/no/such/path", provider.command(:testing), "Did not return correct binary path")
@@ -187,7 +187,7 @@ class TestProvider < Test::Unit::TestCase
dir = tstdir
file = File.join(dir, "mycmd")
- sh = Puppet::Util.binary("sh")
+ sh = Puppet::Util.which("sh")
File.open(file, "w") { |f|
f.puts %{#!#{sh}
echo A Failure >&2