diff options
Diffstat (limited to 'test/executables')
| -rwxr-xr-x | test/executables/puppetbin.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/executables/puppetbin.rb b/test/executables/puppetbin.rb index 4fde6ba59..1752848a8 100755 --- a/test/executables/puppetbin.rb +++ b/test/executables/puppetbin.rb @@ -64,6 +64,28 @@ class TestPuppetBin < Test::Unit::TestCase assert(FileTest.exists?(path), "Failed to create config'ed file") end + + def test_stdin_execution + path = tempfile() + manifest = tempfile() + env = %x{which env}.chomp + if env == "" + Puppet.info "cannot find env; cannot test stdin_execution" + return + end + File.open(manifest, "w") do |f| + f.puts "#!#{env} puppet + file { '#{path}': ensure => file }" + end + File.chmod(0755, manifest) + + assert_nothing_raised { + out = %x{#{manifest} 2>&1} + } + assert($? == 0, "manifest exited with code %s" % $?.to_i) + + assert(FileTest.exists?(path), "Failed to create config'ed file") + end end # $Id$ |
