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/puppetd.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/puppetd.rb')
-rwxr-xr-x | test/executables/puppetd.rb | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/test/executables/puppetd.rb b/test/executables/puppetd.rb new file mode 100755 index 000000000..72cf1f031 --- /dev/null +++ b/test/executables/puppetd.rb @@ -0,0 +1,70 @@ +if __FILE__ == $0 + $:.unshift '../../lib' + $:.unshift '..' + $puppetbase = "../.." +end + +require 'puppet' +require 'puppet/server' +require 'test/unit' +require 'puppettest.rb' +require 'socket' +require 'facter' + +# $Id$ + +# ok, we have to 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 TestPuppetDExe < Test::Unit::TestCase + include ExeTest + def test_normalstart + # start the master + file = startmasterd + + # create the client + client = Puppet::Client.new(:Server => "localhost", :Port => @@port) + + # make a new fqdn + fqdn = client.fqdn.sub(/^\w+\./, "testing.") + + cmd = "puppetd" + cmd += " --verbose" + #cmd += " --fqdn %s" % fqdn + cmd += " --port %s" % @@port + cmd += " --ssldir %s" % Puppet[:ssldir] + cmd += " --server localhost" + + # and verify our daemon runs + assert_nothing_raised { + output = %x{#{cmd}}.chomp + puts output + } + sleep 1 + assert($? == 0, "Puppetd exited with code %s" % $?) + + assert(FileTest.exists?(@createdfile), + "Failed to create config'ed file") + + # now verify that --noop works + File.unlink(@createdfile) + + cmd += " --noop" + assert_nothing_raised { + output = %x{#{cmd}}.chomp + } + sleep 1 + assert($? == 0, "Puppetd exited with code %s" % $?) + + assert(! FileTest.exists?(@createdfile), + "Noop created config'ed file") + + stopmasterd + end +end |