summaryrefslogtreecommitdiffstats
path: root/test/executables/tc_puppetbin.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/executables/tc_puppetbin.rb')
-rwxr-xr-xtest/executables/tc_puppetbin.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/executables/tc_puppetbin.rb b/test/executables/tc_puppetbin.rb
index d1261dad7..decb46e9b 100755
--- a/test/executables/tc_puppetbin.rb
+++ b/test/executables/tc_puppetbin.rb
@@ -23,9 +23,15 @@ ENV["RUBYLIB"] = libdirs.join(":")
class TestPuppetBin < Test::Unit::TestCase
def setup
+ @@tmpfiles = []
end
def teardown
+ @@tmpfiles.each { |f|
+ if FileTest.exists?(f)
+ system("rm -rf %s" % f)
+ end
+ }
end
def test_version
@@ -35,4 +41,25 @@ class TestPuppetBin < Test::Unit::TestCase
}
assert(output == Puppet.version)
end
+
+ def test_execution
+ file = "/tmp/puppetbintestingmanifest.pp"
+ File.open(file, "w") { |f|
+ f.puts '
+file { "/tmp/puppetbintesting": create => true, mode => 755 }
+'
+ }
+
+ @@tmpfiles << file
+ @@tmpfiles << "/tmp/puppetbintesting"
+
+ output = nil
+ assert_nothing_raised {
+ system("puppet --logdest /dev/null %s" % file)
+ }
+ assert($? == 0, "Puppet exited with code %s" % $?.to_i)
+
+ assert(FileTest.exists?("/tmp/puppetbintesting"),
+ "Failed to create config'ed file")
+ end
end