diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-04-04 22:23:08 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-04-04 22:23:08 +0000 |
| commit | d8b4b0dbf35b2b183cd62adf591ebf4650448a0d (patch) | |
| tree | d51d99be35d0702ffc08bd0e8a28e82d8daf2e6b /test | |
| parent | c0a9e5f2e9df8e6e1aed74653ae675029af8a9bb (diff) | |
| download | puppet-d8b4b0dbf35b2b183cd62adf591ebf4650448a0d.tar.gz puppet-d8b4b0dbf35b2b183cd62adf591ebf4650448a0d.tar.xz puppet-d8b4b0dbf35b2b183cd62adf591ebf4650448a0d.zip | |
adding -e ability to puppet executable
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1065 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
| -rwxr-xr-x | test/executables/puppetbin.rb | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/test/executables/puppetbin.rb b/test/executables/puppetbin.rb index d787a704d..79fbd2358 100755 --- a/test/executables/puppetbin.rb +++ b/test/executables/puppetbin.rb @@ -22,7 +22,6 @@ class TestPuppetBin < Test::Unit::TestCase def test_execution file = mktestmanifest() - @@tmpfiles << tempfile() output = nil cmd = "puppet" @@ -32,7 +31,9 @@ class TestPuppetBin < Test::Unit::TestCase #cmd += " --fqdn %s" % fqdn cmd += " --confdir %s" % Puppet[:confdir] cmd += " --vardir %s" % Puppet[:vardir] - cmd += " --logdest %s" % "/dev/null" + unless Puppet[:debug] + cmd += " --logdest %s" % "/dev/null" + end assert_nothing_raised { system(cmd + " " + file) @@ -41,6 +42,32 @@ class TestPuppetBin < Test::Unit::TestCase assert(FileTest.exists?(@createdfile), "Failed to create config'ed file") end + + def test_inlineexecution + path = tempfile() + code = "file { '#{path}': ensure => file }" + + output = nil + cmd = "puppet" + if Puppet[:debug] + cmd += " --debug" + end + #cmd += " --fqdn %s" % fqdn + cmd += " --confdir %s" % Puppet[:confdir] + cmd += " --vardir %s" % Puppet[:vardir] + unless Puppet[:debug] + cmd += " --logdest %s" % "/dev/null" + end + + cmd += " -e \"#{code}\"" + + assert_nothing_raised { + system(cmd) + } + assert($? == 0, "Puppet exited with code %s" % $?.to_i) + + assert(FileTest.exists?(path), "Failed to create config'ed file") + end end -# $Id: $ +# $Id$ |
