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

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


The following commit has been merged in the upstream branch:
commit 73e665629ce45230250afc5a354b7f9d7a0a4206
Author: Paul Nasrat <pnasrat at googlemail.com>
Date:   Sun May 10 20:16:54 2009 +0100

    Facter fix #2231 typo
    
    Added a test to pickup typo and fix

diff --git a/lib/facter/util/ip.rb b/lib/facter/util/ip.rb
index a2125ea..fb32d70 100644
--- a/lib/facter/util/ip.rb
+++ b/lib/facter/util/ip.rb
@@ -16,7 +16,7 @@ module Facter::Util::IP
             :netmask    => /netmask\s+0x(\w{8})/
         },
         :sunos => {
-            :ipadddress => /inet\s+([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/,
+            :ipaddress => /inet\s+([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/,
             :macaddress => /(?:ether|lladdr)\s+(\w?\w:\w?\w:\w?\w:\w?\w:\w?\w:\w?\w)/,
             :netmask    => /netmask\s+(\w{8})/
         }
diff --git a/spec/unit/util/ip.rb b/spec/unit/util/ip.rb
index a1d2458..6290a30 100644
--- a/spec/unit/util/ip.rb
+++ b/spec/unit/util/ip.rb
@@ -37,6 +37,16 @@ describe Facter::Util::IP do
         Facter::Util::IP.get_interface_value("e1000g0", "netmask").should == []
     end
 
+    it "should return ipaddress information for Solaris" do
+        sample_output_file = File.dirname(__FILE__) + "/../data/solaris_ifconfig_single_interface"
+        solaris_ifconfig_interface = File.new(sample_output_file).read()
+
+        Facter::Util::IP.expects(:get_single_interface_output).with("e1000g0").returns(solaris_ifconfig_interface)
+        Facter.stubs(:value).with(:kernel).returns("SunOS")
+
+        Facter::Util::IP.get_interface_value("e1000g0", "ipaddress").should == "172.16.15.138"
+    end
+
     it "should return netmask information for Solaris" do
         sample_output_file = File.dirname(__FILE__) + "/../data/solaris_ifconfig_single_interface"
         solaris_ifconfig_interface = File.new(sample_output_file).read()

-- 
Packaging of Facter for debian



More information about the Pkg-puppet-devel mailing list