[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-639-g8f94f35

Markus Roberts Markus at reality.com
Wed Jul 14 10:36:35 UTC 2010


The following commit has been merged in the upstream branch:
commit fb6f2aafa88d706425000f3677717368b98b5a3b
Author: Jesse Wolfe <jes5199 at gmail.com>
Date:   Fri Jul 2 14:51:11 2010 -0700

    [#4136] Specs should listen on localhost
    
    This patch prevents specs from opening IP ports to the world.
    Some specs had to be adjusted to unset this setting so they could test
    the non-spec default value.

diff --git a/spec/integration/defaults_spec.rb b/spec/integration/defaults_spec.rb
index db8686f..3f66a0e 100755
--- a/spec/integration/defaults_spec.rb
+++ b/spec/integration/defaults_spec.rb
@@ -85,6 +85,7 @@ describe "Puppet defaults" do
     end
 
     it "should use a bind address of ''" do
+        Puppet.settings.clear
         Puppet.settings[:bindaddress].should == ""
     end
 
diff --git a/spec/integration/network/server/webrick_spec.rb b/spec/integration/network/server/webrick_spec.rb
index 73616d2..cd29583 100755
--- a/spec/integration/network/server/webrick_spec.rb
+++ b/spec/integration/network/server/webrick_spec.rb
@@ -48,10 +48,9 @@ describe Puppet::Network::Server do
             end
 
             it "should default to '0.0.0.0' as its bind address" do
-                @server = Puppet::Network::Server.new(@params.merge(:port => 34343))
-                @server.stubs(:unlisten) # we're breaking listening internally, so we have to keep it from unlistening
-                @server.send(:http_server).expects(:listen).with { |args| args[:address] == "0.0.0.0" }
-                @server.listen
+                Puppet.settings.clear
+                Puppet[:servertype] = 'webrick'
+                Puppet[:bindaddress].should == '0.0.0.0'
             end
 
             it "should use any specified bind address" do
@@ -70,7 +69,7 @@ describe Puppet::Network::Server do
             end
 
             after :each do
-                @server.unlisten if @server.listening?
+                @server.unlisten if @server && @server.listening?
             end
         end
 
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index ffc3e9b..bd5b9a1 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -76,6 +76,9 @@ Spec::Runner.configure do |config|
         # have to be correctly mocked.
         Puppet[:confdir] = "/dev/null"
         Puppet[:vardir] = "/dev/null"
+
+        # Avoid opening ports to the outside world
+        Puppet.settings[:bindaddress] = "127.0.0.1"
     end
 end
 

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list