diff --git a/acceptance/tests/resource/exec/should_accept_large_output.rb b/acceptance/tests/resource/exec/should_accept_large_output.rb new file mode 100644 index 00000000000..2e8c296f9db --- /dev/null +++ b/acceptance/tests/resource/exec/should_accept_large_output.rb @@ -0,0 +1,33 @@ +test_name "tests that puppet correctly captures large and empty output." + +@testfilename = master.tmpfile('should_accept_large_output').split('/')[-1] + +agents.each do |agent| + testfile = + if /windows/ =~ agent[:platform] + "C:/#{@testfilename}" + else + "/tmp/#{@testfilename}" + end + + # Generate >64KB file to exceed pipe buffer. + lorem_ipsum = < ['/bin', '/usr/bin', 'C:/cygwin32/bin', 'C:/cygwin64/bin'], logoutput => true}") do + fail_test "didn't seem to run the command" unless + stdout.include? 'executed successfully' + fail_test "didn't print output correctly" unless + stdout.lines.select {|line| line =~ /\/returns:/}.count == 4097 + end + + apply_manifest_on(agent, "exec {'echo': path => ['/bin', '/usr/bin', 'C:/cygwin32/bin', 'C:/cygwin64/bin'], logoutput => true}") do + fail_test "didn't seem to run the command" unless + stdout.include? 'executed successfully' + end +end