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.

Files changed (119) hide show
  1. data/CHANGELOG +94 -0
  2. data/INSTALL +1 -1
  3. data/README +1 -1
  4. data/README.rst +3 -3
  5. data/Rakefile +9 -6
  6. data/bin/facter +18 -123
  7. data/conf/redhat/facter.spec +21 -3
  8. data/conf/solaris/pkginfo +2 -2
  9. data/install.rb +18 -10
  10. data/lib/facter.rb +27 -1
  11. data/lib/facter/application.rb +123 -0
  12. data/lib/facter/arp.rb +28 -0
  13. data/lib/facter/ec2.rb +32 -11
  14. data/lib/facter/hardwareisa.rb +1 -1
  15. data/lib/facter/id.rb +2 -9
  16. data/lib/facter/interfaces.rb +1 -1
  17. data/lib/facter/ipaddress.rb +2 -33
  18. data/lib/facter/ipaddress6.rb +68 -0
  19. data/lib/facter/lsb.rb +5 -5
  20. data/lib/facter/lsbmajdistrelease.rb +1 -1
  21. data/lib/facter/macaddress.rb +4 -14
  22. data/lib/facter/manufacturer.rb +9 -0
  23. data/lib/facter/memory.rb +110 -6
  24. data/lib/facter/netmask.rb +1 -1
  25. data/lib/facter/operatingsystem.rb +17 -2
  26. data/lib/facter/operatingsystemrelease.rb +34 -0
  27. data/lib/facter/processor.rb +8 -5
  28. data/lib/facter/selinux.rb +37 -4
  29. data/lib/facter/uniqueid.rb +1 -1
  30. data/lib/facter/util/#uptime.rb# +64 -0
  31. data/lib/facter/util/ip.rb +23 -15
  32. data/lib/facter/util/loader.rb +2 -2
  33. data/lib/facter/util/macaddress.rb +28 -0
  34. data/lib/facter/util/manufacturer.rb +39 -2
  35. data/lib/facter/util/memory.rb +43 -0
  36. data/lib/facter/util/netmask.rb +1 -1
  37. data/lib/facter/util/resolution.rb +7 -0
  38. data/lib/facter/util/uptime.rb +11 -1
  39. data/lib/facter/util/virtual.rb +13 -2
  40. data/lib/facter/util/vlans.rb +2 -2
  41. data/lib/facter/util/xendomains.rb +10 -0
  42. data/lib/facter/virtual.rb +45 -13
  43. data/lib/facter/xendomains.rb +10 -0
  44. data/spec/fixtures/ifconfig/bsd_ifconfig_all_with_multiple_interfaces +18 -0
  45. data/spec/fixtures/ifconfig/centos_5_5 +17 -0
  46. data/spec/fixtures/ifconfig/centos_5_5_eth0 +8 -0
  47. data/spec/fixtures/ifconfig/darwin_10_3_0 +26 -0
  48. data/spec/fixtures/ifconfig/darwin_10_3_0_en0 +6 -0
  49. data/spec/fixtures/ifconfig/darwin_10_6_4 +28 -0
  50. data/spec/fixtures/ifconfig/darwin_10_6_4_en1 +6 -0
  51. data/spec/fixtures/ifconfig/darwin_10_6_6_dualstack +8 -0
  52. data/spec/fixtures/ifconfig/darwin_10_6_6_dualstack_en1 +7 -0
  53. data/spec/fixtures/ifconfig/darwin_9_8_0 +26 -0
  54. data/spec/fixtures/ifconfig/darwin_9_8_0_en0 +6 -0
  55. data/spec/fixtures/ifconfig/darwin_ifconfig_all_with_multiple_interfaces +23 -0
  56. data/spec/fixtures/ifconfig/fedora_10 +36 -0
  57. data/spec/fixtures/ifconfig/fedora_10_eth0 +9 -0
  58. data/spec/fixtures/ifconfig/fedora_13 +18 -0
  59. data/spec/fixtures/ifconfig/fedora_13_eth0 +9 -0
  60. data/spec/fixtures/ifconfig/fedora_8 +38 -0
  61. data/spec/fixtures/ifconfig/fedora_8_eth0 +9 -0
  62. data/spec/fixtures/ifconfig/freebsd_6_0 +12 -0
  63. data/spec/fixtures/ifconfig/linux_ifconfig_all_with_multiple_interfaces +19 -0
  64. data/spec/fixtures/ifconfig/open_solaris_10 +12 -0
  65. data/spec/fixtures/ifconfig/open_solaris_b132 +20 -0
  66. data/spec/fixtures/ifconfig/sunos_ifconfig_all_with_multiple_interfaces +10 -0
  67. data/spec/fixtures/ifconfig/ubuntu_7_04 +38 -0
  68. data/spec/fixtures/ifconfig/ubuntu_7_04_eth0 +9 -0
  69. data/spec/fixtures/netstat/centos_5_5 +5 -0
  70. data/spec/fixtures/netstat/darwin_10_3_0 +35 -0
  71. data/spec/fixtures/netstat/darwin_10_6_4 +29 -0
  72. data/spec/fixtures/netstat/darwin_10_6_6_dualstack +34 -0
  73. data/spec/fixtures/netstat/darwin_9_8_0 +28 -0
  74. data/spec/fixtures/netstat/fedora_10 +7 -0
  75. data/spec/fixtures/netstat/open_solaris_10 +16 -0
  76. data/spec/fixtures/netstat/open_solaris_b132 +17 -0
  77. data/spec/fixtures/netstat/ubuntu_7_04 +7 -0
  78. data/spec/fixtures/uptime/kstat_boot_time +1 -0
  79. data/spec/fixtures/virtual/proc_self_status/vserver_2_1/guest +37 -0
  80. data/spec/fixtures/virtual/proc_self_status/vserver_2_1/host +36 -0
  81. data/spec/fixtures/virtual/proc_self_status/vserver_2_3/guest +39 -0
  82. data/spec/fixtures/virtual/proc_self_status/vserver_2_3/host +39 -0
  83. data/spec/integration/{facter.rb → facter_spec.rb} +1 -1
  84. data/spec/spec_helper.rb +8 -3
  85. data/spec/unit/data/debian_kfreebsd_ifconfig +40 -0
  86. data/spec/unit/data/hpux_netstat_all_interfaces +3 -6
  87. data/spec/unit/data/selinux_sestatus +6 -0
  88. data/spec/unit/data/xendomains +4 -0
  89. data/spec/unit/{facter.rb → facter_spec.rb} +28 -1
  90. data/spec/unit/id_spec.rb +27 -0
  91. data/spec/unit/{interfaces.rb → interfaces_spec.rb} +1 -1
  92. data/spec/unit/ipaddress6_spec.rb +36 -0
  93. data/spec/unit/memory_spec.rb +45 -0
  94. data/spec/unit/{operatingsystem.rb → operatingsystem_spec.rb} +22 -8
  95. data/spec/unit/operatingsystemrelease_spec.rb +49 -0
  96. data/spec/unit/selinux_spec.rb +89 -0
  97. data/spec/unit/{uptime.rb → uptime_spec.rb} +4 -4
  98. data/spec/unit/util/{collection.rb → collection_spec.rb} +1 -1
  99. data/spec/unit/util/{confine.rb → confine_spec.rb} +1 -1
  100. data/spec/unit/util/{fact.rb → fact_spec.rb} +1 -1
  101. data/spec/unit/util/{ip.rb → ip_spec.rb} +47 -12
  102. data/spec/unit/util/{loader.rb → loader_spec.rb} +51 -1
  103. data/spec/unit/util/macaddress_spec.rb +68 -0
  104. data/spec/unit/util/{macosx.rb → macosx_spec.rb} +1 -1
  105. data/spec/unit/util/{manufacturer.rb → manufacturer_spec.rb} +15 -4
  106. data/spec/unit/util/{resolution.rb → resolution_spec.rb} +1 -1
  107. data/spec/unit/util/uptime_spec.rb +73 -0
  108. data/spec/unit/util/{virtual.rb → virtual_spec.rb} +37 -3
  109. data/spec/unit/util/{vlans.rb → vlans_spec.rb} +1 -1
  110. data/spec/unit/util/xendomains_spec.rb +23 -0
  111. data/spec/unit/virtual_spec.rb +196 -0
  112. metadata +149 -98
  113. data/spec/Rakefile +0 -18
  114. data/spec/unit/data/hpux_ifconfig +0 -3
  115. data/spec/unit/data/hpux_netscan +0 -4
  116. data/spec/unit/operatingsystemrelease.rb +0 -39
  117. data/spec/unit/selinux.rb +0 -48
  118. data/spec/unit/util/uptime.rb +0 -53
  119. data/spec/unit/virtual.rb +0 -71
@@ -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