[Pkg-puppet-devel] [SCM] Packaging of Facter for debian branch, upstream, updated. 3a39dd8353b6308cf49522990104cc63e55d7cda

James Turnbull james at lovedthanlost.net
Fri Jan 29 17:22:26 UTC 2010


The following commit has been merged in the upstream branch:
commit 2fb91caa311ea20f8342289050c367f30a610827
Author: Paul Nasrat <pnasrat at googlemail.com>
Date:   Thu May 7 08:00:08 2009 +0100

    Tests for #2227 - multiple interfaces on Darwin
    
    This seems to have been fixed functionally on master
    
    (in /Users/pnasrat/Development/facter/spec)
    Finished in 1.604955 seconds
    183 examples, 0 failures
    
    However I want to take the opportunity to add tests to prevent regressions
    
    Paul

diff --git a/spec/unit/data/darwin_ifconfig_all_with_multiple_interfaces b/spec/unit/data/darwin_ifconfig_all_with_multiple_interfaces
new file mode 100644
index 0000000..fb94751
--- /dev/null
+++ b/spec/unit/data/darwin_ifconfig_all_with_multiple_interfaces
@@ -0,0 +1,10 @@
+lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
+	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
+	inet 127.0.0.1 netmask 0xff000000 
+	inet6 ::1 prefixlen 128 
+en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
+	inet6 fe80::223:6cff:fe99:602b%en1 prefixlen 64 scopeid 0x5 
+	inet 192.168.0.10 netmask 0xffffff00 broadcast 192.168.0.255
+	ether 00:23:6c:99:60:2b 
+	media: autoselect status: active
+	supported media: autoselect
diff --git a/spec/unit/util/ip.rb b/spec/unit/util/ip.rb
index 6290a30..512c07b 100644
--- a/spec/unit/util/ip.rb
+++ b/spec/unit/util/ip.rb
@@ -27,6 +27,12 @@ describe Facter::Util::IP do
         Facter::Util::IP.get_interfaces().should == ["eth0"]
     end
 
+    it "should return a list two interfaces on Darwin with two interfaces" do
+        sample_output_file = File.dirname(__FILE__) + '/../data/darwin_ifconfig_all_with_multiple_interfaces'
+        darwin_ifconfig = File.new(sample_output_file).read()
+        Facter::Util::IP.stubs(:get_all_interface_output).returns(darwin_ifconfig)
+        Facter::Util::IP.get_interfaces().should == ["lo0", "en0"]
+    end
 
     it "should return a value for a specific interface" do
         Facter::Util::IP.should respond_to(:get_interface_value)

-- 
Packaging of Facter for debian



More information about the Pkg-puppet-devel mailing list