[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.4-89-gcbbd363

James Turnbull james at lovedthanlost.net
Tue May 18 09:03:35 UTC 2010


The following commit has been merged in the upstream branch:
commit 6416f91d107947fd2567ae6f6d20493e17aeacbb
Author: Jesse Wolfe <jes5199 at gmail.com>
Date:   Thu Jan 28 17:09:25 2010 -0800

    Fixing #2669 puppetmasterd integration has leaky state
    
    This patches two leaks in the puppetmasterd integration tests that were
    preventing the script from succesfully connecting to its child
    puppetmasterd process more than once:
    1) a race condition in shutting down puppetmasterd before restarting
    it
    2) holding onto stale SSH certificate information.
    
    Signed-off-by: Jesse Wolfe <jes5199 at gmail.com>

diff --git a/spec/integration/bin/puppetmasterd.rb b/spec/integration/bin/puppetmasterd.rb
index 27b0f52..f1d77ef 100755
--- a/spec/integration/bin/puppetmasterd.rb
+++ b/spec/integration/bin/puppetmasterd.rb
@@ -16,6 +16,10 @@ describe "puppetmasterd" do
         Puppet[:certdnsnames] = "localhost"
 
         @@port = 12345
+
+        Puppet::SSL::Host.instance_eval{
+            @value_cache = {}
+        }
     end
 
     after {
@@ -48,7 +52,7 @@ describe "puppetmasterd" do
             f.puts { "notify { testing: }" }
         end
 
-        args = arguments + addl_args
+        args = arguments + " " + addl_args
 
         bin = File.join(File.dirname(__FILE__), "..", "..", "..", "sbin", "puppetmasterd")
         lib = File.join(File.dirname(__FILE__), "..", "..", "..", "lib")
@@ -56,9 +60,22 @@ describe "puppetmasterd" do
     end
 
     def stop
-        if @pidfile and FileTest.exist?(@pidfile)
+        if @pidfile and File.exist?(@pidfile)
             pid = File.read(@pidfile).chomp.to_i
             Process.kill(:TERM, pid)
+            10.times do
+                break unless File.exist?(@pidfile)
+                sleep 1
+            end
+            begin
+                # sigkill and report if process was still running
+                Process.kill(:KILL, pid)
+
+                raise "Process didn't die from SIGTERM after 10 seconds"
+            rescue Errno::ESRCH
+                # process wasn't running. good.
+            end
+
         end
     end
 
@@ -73,16 +90,10 @@ describe "puppetmasterd" do
     it "should be serving status information over xmlrpc" do
         start
 
-        sleep 5
+        sleep 6
 
         client = Puppet::Network::Client.status.new(:Server => "localhost", :Port => @@port)
 
-        FileUtils.mkdir_p(File.dirname(Puppet[:autosign]))
-        File.open(Puppet[:autosign], "w") { |f|
-            f.puts Puppet[:certname]
-        }
-
-        client.cert
         retval = client.status
 
         retval.should == 1

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list