diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2005-10-22 22:27:20 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2005-10-22 22:27:20 +0000 |
| commit | f7328804d00d8a82d7ab3a955ff579ff956ef3d0 (patch) | |
| tree | 7a6d5119dea6a6309675120fd99f5cc023ad644a /test/executables/puppetbin.rb | |
| parent | 8fe558cca075ab85619a73f4a80408de58810ef7 (diff) | |
| download | puppet-f7328804d00d8a82d7ab3a955ff579ff956ef3d0.tar.gz puppet-f7328804d00d8a82d7ab3a955ff579ff956ef3d0.tar.xz puppet-f7328804d00d8a82d7ab3a955ff579ff956ef3d0.zip | |
Getting rid of the tc_ prefix to test cases
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@724 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/executables/puppetbin.rb')
| -rwxr-xr-x | test/executables/puppetbin.rb | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/test/executables/puppetbin.rb b/test/executables/puppetbin.rb new file mode 100755 index 000000000..4a3eb7946 --- /dev/null +++ b/test/executables/puppetbin.rb @@ -0,0 +1,46 @@ +if __FILE__ == $0 + $:.unshift '../../lib' + $:.unshift '..' + $puppetbase = "../.." +end + +# $ID: $ + +require 'puppet' +require 'puppet/server' +require 'puppet/sslcertificates' +require 'test/unit' +require 'puppettest.rb' + +# add the bin directory to our search path +ENV["PATH"] += ":" + File.join($puppetbase, "bin") + +# and then the library directories +libdirs = $:.find_all { |dir| + dir =~ /puppet/ or dir =~ /\.\./ +} +ENV["RUBYLIB"] = libdirs.join(":") + +class TestPuppetBin < Test::Unit::TestCase + include ServerTest + def test_version + output = nil + assert_nothing_raised { + output = %x{puppet --version}.chomp + } + assert(output == Puppet.version) + end + + def test_execution + file = mktestmanifest() + @@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?(@createdfile), "Failed to create config'ed file") + end +end |
