summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorPaul Nasrat <pnasrat@googlemail.com>2009-08-23 09:09:44 -0500
committerPaul Nasrat <pnasrat@googlemail.com>2009-08-24 07:47:33 -0500
commit9515a403b2a3350b3b6eb2c1578c5871e9588ac2 (patch)
tree91f049ecfed5ac31c84a2b50124aa6cb2804b6c6 /spec
parent33be9e0f5afdd81e32f2b4654f90d86b93278744 (diff)
downloadfacter-9515a403b2a3350b3b6eb2c1578c5871e9588ac2.tar.gz
facter-9515a403b2a3350b3b6eb2c1578c5871e9588ac2.tar.xz
facter-9515a403b2a3350b3b6eb2c1578c5871e9588ac2.zip
Issue #2548 netblock fact
We already have a network fact it's just missing a test. Paul
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/util/ip.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/unit/util/ip.rb b/spec/unit/util/ip.rb
index 60ec09e..e97b5df 100644
--- a/spec/unit/util/ip.rb
+++ b/spec/unit/util/ip.rb
@@ -70,6 +70,16 @@ describe Facter::Util::IP do
Facter::Util::IP.get_interface_value("e1000g0", "netmask").should == "255.255.255.0"
end
+ it "should return calculated network 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.stubs(:get_single_interface_output).with("e1000g0").returns(solaris_ifconfig_interface)
+ Facter.stubs(:value).with(:kernel).returns("SunOS")
+
+ Facter::Util::IP.get_network_value("e1000g0").should == "172.16.15.0"
+ end
+
it "should return interface information for FreeBSD supported via an alias" do
sample_output_file = File.dirname(__FILE__) + "/../data/6.0-STABLE_FreeBSD_ifconfig"
ifconfig_interface = File.new(sample_output_file).read()