diff options
| author | Luke Kanies <luke@madstop.com> | 2007-11-08 11:28:34 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-11-08 11:28:34 -0600 |
| commit | f465e7e96d62f9b18bdebd51319582d5b2ffa332 (patch) | |
| tree | c33a94d5430d42a702735554c2110c149eae349d /test | |
| parent | 65858356cb3170e04200a6d8204f0978223e2c61 (diff) | |
| parent | 1ffcce079fd7a677ebdc22453a9d10675fb4ed4d (diff) | |
Merge branch 'rest'
Diffstat (limited to 'test')
| -rwxr-xr-x | test/executables/puppetd.rb | 49 | ||||
| -rwxr-xr-x | test/other/transactions.rb | 31 |
2 files changed, 22 insertions, 58 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 diff --git a/test/other/transactions.rb b/test/other/transactions.rb index fb5cf4018..8156ba478 100755 --- a/test/other/transactions.rb +++ b/test/other/transactions.rb @@ -1006,37 +1006,6 @@ class TestTransactions < Test::Unit::TestCase end end - def test_labeled_deps_beat_unlabeled - one = Puppet::Type.type(:exec).create :command => "/bin/echo one" - two = Puppet::Type.type(:exec).create :command => "/bin/echo two" - - one[:require] = two - one[:subscribe] = two - - comp = mk_configuration(one, two) - trans = Puppet::Transaction.new(comp) - graph = trans.relationship_graph - - label = graph.edge_label(two, one) - assert(label, "require beat subscribe") - assert_equal(:refresh, label[:callback], - "did not get correct callback from subscribe") - - one.delete(:require) - one.delete(:subscribe) - - two[:before] = one - two[:notify] = one - - trans = Puppet::Transaction.new(comp) - graph = trans.relationship_graph - - label = graph.edge_label(two, one) - assert(label, "before beat notify") - assert_equal(:refresh, label[:callback], - "did not get correct callback from notify") - end - # #542 - make sure resources in noop mode still notify their resources, # so that users know if a service will get restarted. def test_noop_with_notify |
