diff options
author | Luke Kanies <luke@madstop.com> | 2007-11-08 11:24:46 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2007-11-08 11:24:46 -0600 |
commit | 1ffcce079fd7a677ebdc22453a9d10675fb4ed4d (patch) | |
tree | 63111b68ec415ef41ec52b9c60fb0be22f099cef | |
parent | 065a1d0281ba326674e37a00d8ced1e3a2dd57e4 (diff) | |
download | puppet-1ffcce079fd7a677ebdc22453a9d10675fb4ed4d.tar.gz puppet-1ffcce079fd7a677ebdc22453a9d10675fb4ed4d.tar.xz puppet-1ffcce079fd7a677ebdc22453a9d10675fb4ed4d.zip |
Splitting the puppetd tests into two tests. It is still not a very good test, but I do not know of a good way to test this, really.
-rwxr-xr-x | test/executables/puppetd.rb | 49 |
1 files changed, 22 insertions, 27 deletions
diff --git a/test/executables/puppetd.rb b/test/executables/puppetd.rb index a482e4b34..3dd3856fd 100755 --- a/test/executables/puppetd.rb +++ b/test/executables/puppetd.rb @@ -10,49 +10,44 @@ require 'facter' class TestPuppetDExe < Test::Unit::TestCase include PuppetTest::ExeTest - def test_normalstart + def setup + super # start the master - file = startmasterd - - # create the client - client = Puppet::Network::Client.master.new(:Server => "localhost", :Port => @@port) - - # make a new fqdn - fqdn = Puppet[:certname].sub(/^\w+\./, "testing.") - - cmd = "puppetd" - cmd += " --verbose" - cmd += " --onetime" - cmd += " --masterport %s" % @@port - cmd += " --confdir %s" % Puppet[:confdir] - cmd += " --rundir %s" % File.join(Puppet[:vardir], "run") - cmd += " --vardir %s" % Puppet[:vardir] - cmd += " --server localhost" + @manifest = startmasterd + + @cmd = "puppetd" + @cmd += " --verbose" + @cmd += " --test" + @cmd += " --masterport %s" % @@port + @cmd += " --confdir %s" % Puppet[:confdir] + @cmd += " --rundir %s" % File.join(Puppet[:vardir], "run") + @cmd += " --vardir %s" % Puppet[:vardir] + @cmd += " --server localhost" + end + def test_normalstart # and verify our daemon runs + output = nil assert_nothing_raised { - %x{#{cmd} 2>&1} + output = %x{#{@cmd} 2>&1} } 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) + assert(FileTest.exists?(@createdfile), "Failed to create file %s" % @createdfile) + end - cmd += " --noop" + # now verify that --noop works + def test_noop_start + @cmd += " --noop" assert_nothing_raised { - output = %x{#{cmd}}.chomp + 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 |