diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2005-08-29 22:31:22 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2005-08-29 22:31:22 +0000 |
| commit | 062906591bc21d761ed00d33f9fa95c425b16ccd (patch) | |
| tree | 78b572ef620644f0a07dddb4404bcdad678c06a2 /test | |
| parent | 82ac86e1996e156eb98bb0b06a8926ec61c8fdcc (diff) | |
| download | puppet-062906591bc21d761ed00d33f9fa95c425b16ccd.tar.gz puppet-062906591bc21d761ed00d33f9fa95c425b16ccd.tar.xz puppet-062906591bc21d761ed00d33f9fa95c425b16ccd.zip | |
fixing puppet to use correct method and adding a real test case for it
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@605 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
| -rwxr-xr-x | test/executables/tc_puppetbin.rb | 27 |
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 |
