facter 1.5.8 → 1.5.9
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of facter might be problematic. Click here for more details.
- data/CHANGELOG +94 -0
- data/INSTALL +1 -1
- data/README +1 -1
- data/README.rst +3 -3
- data/Rakefile +9 -6
- data/bin/facter +18 -123
- data/conf/redhat/facter.spec +21 -3
- data/conf/solaris/pkginfo +2 -2
- data/install.rb +18 -10
- data/lib/facter.rb +27 -1
- data/lib/facter/application.rb +123 -0
- data/lib/facter/arp.rb +28 -0
- data/lib/facter/ec2.rb +32 -11
- data/lib/facter/hardwareisa.rb +1 -1
- data/lib/facter/id.rb +2 -9
- data/lib/facter/interfaces.rb +1 -1
- data/lib/facter/ipaddress.rb +2 -33
- data/lib/facter/ipaddress6.rb +68 -0
- data/lib/facter/lsb.rb +5 -5
- data/lib/facter/lsbmajdistrelease.rb +1 -1
- data/lib/facter/macaddress.rb +4 -14
- data/lib/facter/manufacturer.rb +9 -0
- data/lib/facter/memory.rb +110 -6
- data/lib/facter/netmask.rb +1 -1
- data/lib/facter/operatingsystem.rb +17 -2
- data/lib/facter/operatingsystemrelease.rb +34 -0
- data/lib/facter/processor.rb +8 -5
- data/lib/facter/selinux.rb +37 -4
- data/lib/facter/uniqueid.rb +1 -1
- data/lib/facter/util/#uptime.rb# +64 -0
- data/lib/facter/util/ip.rb +23 -15
- data/lib/facter/util/loader.rb +2 -2
- data/lib/facter/util/macaddress.rb +28 -0
- data/lib/facter/util/manufacturer.rb +39 -2
- data/lib/facter/util/memory.rb +43 -0
- data/lib/facter/util/netmask.rb +1 -1
- data/lib/facter/util/resolution.rb +7 -0
- data/lib/facter/util/uptime.rb +11 -1
- data/lib/facter/util/virtual.rb +13 -2
- data/lib/facter/util/vlans.rb +2 -2
- data/lib/facter/util/xendomains.rb +10 -0
- data/lib/facter/virtual.rb +45 -13
- data/lib/facter/xendomains.rb +10 -0
- data/spec/fixtures/ifconfig/bsd_ifconfig_all_with_multiple_interfaces +18 -0
- data/spec/fixtures/ifconfig/centos_5_5 +17 -0
- data/spec/fixtures/ifconfig/centos_5_5_eth0 +8 -0
- data/spec/fixtures/ifconfig/darwin_10_3_0 +26 -0
- data/spec/fixtures/ifconfig/darwin_10_3_0_en0 +6 -0
- data/spec/fixtures/ifconfig/darwin_10_6_4 +28 -0
- data/spec/fixtures/ifconfig/darwin_10_6_4_en1 +6 -0
- data/spec/fixtures/ifconfig/darwin_10_6_6_dualstack +8 -0
- data/spec/fixtures/ifconfig/darwin_10_6_6_dualstack_en1 +7 -0
- data/spec/fixtures/ifconfig/darwin_9_8_0 +26 -0
- data/spec/fixtures/ifconfig/darwin_9_8_0_en0 +6 -0
- data/spec/fixtures/ifconfig/darwin_ifconfig_all_with_multiple_interfaces +23 -0
- data/spec/fixtures/ifconfig/fedora_10 +36 -0
- data/spec/fixtures/ifconfig/fedora_10_eth0 +9 -0
- data/spec/fixtures/ifconfig/fedora_13 +18 -0
- data/spec/fixtures/ifconfig/fedora_13_eth0 +9 -0
- data/spec/fixtures/ifconfig/fedora_8 +38 -0
- data/spec/fixtures/ifconfig/fedora_8_eth0 +9 -0
- data/spec/fixtures/ifconfig/freebsd_6_0 +12 -0
- data/spec/fixtures/ifconfig/linux_ifconfig_all_with_multiple_interfaces +19 -0
- data/spec/fixtures/ifconfig/open_solaris_10 +12 -0
- data/spec/fixtures/ifconfig/open_solaris_b132 +20 -0
- data/spec/fixtures/ifconfig/sunos_ifconfig_all_with_multiple_interfaces +10 -0
- data/spec/fixtures/ifconfig/ubuntu_7_04 +38 -0
- data/spec/fixtures/ifconfig/ubuntu_7_04_eth0 +9 -0
- data/spec/fixtures/netstat/centos_5_5 +5 -0
- data/spec/fixtures/netstat/darwin_10_3_0 +35 -0
- data/spec/fixtures/netstat/darwin_10_6_4 +29 -0
- data/spec/fixtures/netstat/darwin_10_6_6_dualstack +34 -0
- data/spec/fixtures/netstat/darwin_9_8_0 +28 -0
- data/spec/fixtures/netstat/fedora_10 +7 -0
- data/spec/fixtures/netstat/open_solaris_10 +16 -0
- data/spec/fixtures/netstat/open_solaris_b132 +17 -0
- data/spec/fixtures/netstat/ubuntu_7_04 +7 -0
- data/spec/fixtures/uptime/kstat_boot_time +1 -0
- data/spec/fixtures/virtual/proc_self_status/vserver_2_1/guest +37 -0
- data/spec/fixtures/virtual/proc_self_status/vserver_2_1/host +36 -0
- data/spec/fixtures/virtual/proc_self_status/vserver_2_3/guest +39 -0
- data/spec/fixtures/virtual/proc_self_status/vserver_2_3/host +39 -0
- data/spec/integration/{facter.rb → facter_spec.rb} +1 -1
- data/spec/spec_helper.rb +8 -3
- data/spec/unit/data/debian_kfreebsd_ifconfig +40 -0
- data/spec/unit/data/hpux_netstat_all_interfaces +3 -6
- data/spec/unit/data/selinux_sestatus +6 -0
- data/spec/unit/data/xendomains +4 -0
- data/spec/unit/{facter.rb → facter_spec.rb} +28 -1
- data/spec/unit/id_spec.rb +27 -0
- data/spec/unit/{interfaces.rb → interfaces_spec.rb} +1 -1
- data/spec/unit/ipaddress6_spec.rb +36 -0
- data/spec/unit/memory_spec.rb +45 -0
- data/spec/unit/{operatingsystem.rb → operatingsystem_spec.rb} +22 -8
- data/spec/unit/operatingsystemrelease_spec.rb +49 -0
- data/spec/unit/selinux_spec.rb +89 -0
- data/spec/unit/{uptime.rb → uptime_spec.rb} +4 -4
- data/spec/unit/util/{collection.rb → collection_spec.rb} +1 -1
- data/spec/unit/util/{confine.rb → confine_spec.rb} +1 -1
- data/spec/unit/util/{fact.rb → fact_spec.rb} +1 -1
- data/spec/unit/util/{ip.rb → ip_spec.rb} +47 -12
- data/spec/unit/util/{loader.rb → loader_spec.rb} +51 -1
- data/spec/unit/util/macaddress_spec.rb +68 -0
- data/spec/unit/util/{macosx.rb → macosx_spec.rb} +1 -1
- data/spec/unit/util/{manufacturer.rb → manufacturer_spec.rb} +15 -4
- data/spec/unit/util/{resolution.rb → resolution_spec.rb} +1 -1
- data/spec/unit/util/uptime_spec.rb +73 -0
- data/spec/unit/util/{virtual.rb → virtual_spec.rb} +37 -3
- data/spec/unit/util/{vlans.rb → vlans_spec.rb} +1 -1
- data/spec/unit/util/xendomains_spec.rb +23 -0
- data/spec/unit/virtual_spec.rb +196 -0
- metadata +149 -98
- data/spec/Rakefile +0 -18
- data/spec/unit/data/hpux_ifconfig +0 -3
- data/spec/unit/data/hpux_netscan +0 -4
- data/spec/unit/operatingsystemrelease.rb +0 -39
- data/spec/unit/selinux.rb +0 -48
- data/spec/unit/util/uptime.rb +0 -53
- data/spec/unit/virtual.rb +0 -71
data/spec/unit/virtual.rb
DELETED
@@ -1,71 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
|
3
|
-
require 'facter'
|
4
|
-
require 'facter/util/virtual'
|
5
|
-
|
6
|
-
describe "Virtual fact" do
|
7
|
-
|
8
|
-
after do
|
9
|
-
Facter.clear
|
10
|
-
end
|
11
|
-
|
12
|
-
it "should be zone on Solaris when a zone" do
|
13
|
-
Facter.fact(:kernel).stubs(:value).returns("SunOS")
|
14
|
-
Facter::Util::Virtual.stubs(:zone?).returns(true)
|
15
|
-
Facter::Util::Virtual.stubs(:vserver?).returns(false)
|
16
|
-
Facter::Util::Virtual.stubs(:xen?).returns(false)
|
17
|
-
Facter.fact(:virtual).value.should == "zone"
|
18
|
-
end
|
19
|
-
|
20
|
-
it "should be jail on FreeBSD when a jail in kvm" do
|
21
|
-
Facter.fact(:kernel).stubs(:value).returns("FreeBSD")
|
22
|
-
Facter::Util::Virtual.stubs(:jail?).returns(true)
|
23
|
-
Facter::Util::Virtual.stubs(:kvm?).returns(true)
|
24
|
-
Facter.fact(:virtual).value.should == "jail"
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
28
|
-
|
29
|
-
describe "is_virtual fact" do
|
30
|
-
|
31
|
-
after do
|
32
|
-
Facter.clear
|
33
|
-
end
|
34
|
-
|
35
|
-
it "should be virtual when running on xen" do
|
36
|
-
Facter.fact(:kernel).stubs(:value).returns("Linux")
|
37
|
-
Facter.fact(:virtual).stubs(:value).returns("xenu")
|
38
|
-
Facter.fact(:is_virtual).value.should == true
|
39
|
-
end
|
40
|
-
|
41
|
-
it "should be false when running on xen0" do
|
42
|
-
Facter.fact(:kernel).stubs(:value).returns("Linux")
|
43
|
-
Facter.fact(:virtual).stubs(:value).returns("xen0")
|
44
|
-
Facter.fact(:is_virtual).value.should == false
|
45
|
-
end
|
46
|
-
|
47
|
-
it "should be true when running on vmware" do
|
48
|
-
Facter.fact(:kernel).stubs(:value).returns("Linux")
|
49
|
-
Facter.fact(:virtual).stubs(:value).returns("vmware")
|
50
|
-
Facter.fact(:is_virtual).value.should == true
|
51
|
-
end
|
52
|
-
|
53
|
-
it "should be true when running on openvz" do
|
54
|
-
Facter.fact(:kernel).stubs(:value).returns("Linux")
|
55
|
-
Facter.fact(:virtual).stubs(:value).returns("openvzve")
|
56
|
-
Facter.fact(:is_virtual).value.should == true
|
57
|
-
end
|
58
|
-
|
59
|
-
it "should be true when running on kvm" do
|
60
|
-
Facter.fact(:kernel).stubs(:value).returns("Linux")
|
61
|
-
Facter.fact(:virtual).stubs(:value).returns("kvm")
|
62
|
-
Facter.fact(:is_virtual).value.should == true
|
63
|
-
end
|
64
|
-
|
65
|
-
it "should be true when running in jail" do
|
66
|
-
Facter.fact(:kernel).stubs(:value).returns("FreeBSD")
|
67
|
-
Facter.fact(:virtual).stubs(:value).returns("jail")
|
68
|
-
Facter.fact(:is_virtual).value.should == true
|
69
|
-
end
|
70
|
-
|
71
|
-
end
|