facter 1.6.13 → 1.6.14.rc1

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 (90) hide show
  1. data/Rakefile +1 -5
  2. data/bin/facter +11 -0
  3. data/ext/redhat/facter.spec.erb +16 -15
  4. data/lib/facter/application.rb +0 -1
  5. data/lib/facter/hardwareisa.rb +7 -2
  6. data/lib/facter/physicalprocessorcount.rb +13 -1
  7. data/lib/facter/processor.rb +37 -39
  8. data/lib/facter/util/ip.rb +2 -2
  9. data/lib/facter/util/monkey_patches.rb +32 -0
  10. data/lib/facter/util/processor.rb +74 -23
  11. data/lib/facter/util/uptime.rb +27 -16
  12. data/lib/facter/util/virtual.rb +15 -0
  13. data/lib/facter/version.rb +1 -1
  14. data/lib/facter/virtual.rb +34 -1
  15. data/spec/fixtures/ifconfig/centos_5_5 +1 -1
  16. data/spec/fixtures/ifconfig/centos_5_5_eth0 +1 -1
  17. data/spec/fixtures/ifconfig/darwin_10_3_0 +1 -1
  18. data/spec/fixtures/ifconfig/darwin_10_3_0_en0 +1 -1
  19. data/spec/fixtures/ifconfig/darwin_9_8_0 +1 -1
  20. data/spec/fixtures/ifconfig/darwin_9_8_0_en0 +1 -1
  21. data/spec/fixtures/ifconfig/fedora_10 +1 -1
  22. data/spec/fixtures/ifconfig/fedora_10_eth0 +1 -1
  23. data/spec/fixtures/ifconfig/fedora_13 +1 -1
  24. data/spec/fixtures/ifconfig/fedora_13_eth0 +1 -1
  25. data/spec/fixtures/ifconfig/fedora_8 +1 -1
  26. data/spec/fixtures/ifconfig/fedora_8_eth0 +1 -1
  27. data/spec/fixtures/ifconfig/freebsd_6_0 +1 -1
  28. data/spec/fixtures/ifconfig/open_solaris_10 +1 -1
  29. data/spec/fixtures/ifconfig/open_solaris_b132 +1 -1
  30. data/spec/fixtures/ifconfig/ubuntu_7_04 +1 -1
  31. data/spec/fixtures/ifconfig/ubuntu_7_04_eth0 +1 -1
  32. data/spec/fixtures/netstat/centos_5_5 +1 -1
  33. data/spec/fixtures/netstat/darwin_10_3_0 +1 -1
  34. data/spec/fixtures/netstat/darwin_9_8_0 +1 -1
  35. data/spec/fixtures/netstat/fedora_10 +1 -1
  36. data/spec/fixtures/netstat/open_solaris_10 +1 -1
  37. data/spec/fixtures/netstat/open_solaris_b132 +1 -1
  38. data/spec/fixtures/netstat/ubuntu_7_04 +1 -1
  39. data/spec/fixtures/unit/util/ec2/centos-arp-ec2.out +1 -1
  40. data/spec/fixtures/unit/util/ec2/windows-2008-arp-a.out +1 -1
  41. data/spec/fixtures/unit/util/ip/6.0-STABLE_FreeBSD_ifconfig +1 -1
  42. data/spec/fixtures/unit/util/ip/linux_get_single_interface_ib0 +1 -1
  43. data/spec/fixtures/unit/util/ip/linux_ifconfig_all_with_single_interface +1 -1
  44. data/spec/fixtures/unit/util/ip/linux_ifconfig_ib0 +1 -1
  45. data/spec/fixtures/unit/util/ip/solaris_ifconfig_single_interface +1 -1
  46. data/spec/integration/facter_spec.rb +1 -1
  47. data/spec/unit/architecture_spec.rb +1 -1
  48. data/spec/unit/domain_spec.rb +1 -1
  49. data/spec/unit/ec2_spec.rb +1 -1
  50. data/spec/unit/facter_spec.rb +1 -1
  51. data/spec/unit/hardwareisa_spec.rb +7 -0
  52. data/spec/unit/hostname_spec.rb +1 -1
  53. data/spec/unit/id_spec.rb +1 -1
  54. data/spec/unit/interfaces_spec.rb +1 -1
  55. data/spec/unit/ipaddress6_spec.rb +1 -1
  56. data/spec/unit/lsbdistcodename_spec.rb +1 -1
  57. data/spec/unit/lsbdistdescription_spec.rb +1 -1
  58. data/spec/unit/lsbdistid_spec.rb +1 -1
  59. data/spec/unit/lsbdistrelease_spec.rb +1 -1
  60. data/spec/unit/lsbrelease_spec.rb +1 -1
  61. data/spec/unit/macaddress_spec.rb +1 -1
  62. data/spec/unit/memory_spec.rb +1 -1
  63. data/spec/unit/operatingsystem_spec.rb +1 -1
  64. data/spec/unit/operatingsystemrelease_spec.rb +1 -1
  65. data/spec/unit/physicalprocessorcount_spec.rb +24 -5
  66. data/spec/unit/processor_spec.rb +75 -9
  67. data/spec/unit/selinux_spec.rb +1 -1
  68. data/spec/unit/uptime_spec.rb +1 -1
  69. data/spec/unit/util/collection_spec.rb +1 -1
  70. data/spec/unit/util/config_spec.rb +1 -1
  71. data/spec/unit/util/confine_spec.rb +1 -1
  72. data/spec/unit/util/ec2_spec.rb +1 -1
  73. data/spec/unit/util/fact_spec.rb +1 -1
  74. data/spec/unit/util/ip_spec.rb +3 -3
  75. data/spec/unit/util/loader_spec.rb +1 -1
  76. data/spec/unit/util/macaddress_spec.rb +1 -1
  77. data/spec/unit/util/macosx_spec.rb +1 -1
  78. data/spec/unit/util/manufacturer_spec.rb +1 -1
  79. data/spec/unit/util/monkey_patches_spec.rb +42 -0
  80. data/spec/unit/util/processor_spec.rb +1 -9
  81. data/spec/unit/util/registry_spec.rb +1 -1
  82. data/spec/unit/util/resolution_spec.rb +1 -1
  83. data/spec/unit/util/uptime_spec.rb +61 -20
  84. data/spec/unit/util/virtual_spec.rb +1 -1
  85. data/spec/unit/util/vlans_spec.rb +1 -1
  86. data/spec/unit/util/wmi_spec.rb +1 -1
  87. data/spec/unit/util/xendomains_spec.rb +1 -1
  88. data/spec/unit/virtual_spec.rb +66 -34
  89. metadata +7 -7
  90. data/spec/fixtures/unit/util/uptime/who_b_boottime +0 -1
@@ -1,4 +1,19 @@
1
1
  module Facter::Util::Virtual
2
+ ##
3
+ # virt_what is a delegating helper method intended to make it easier to stub
4
+ # the system call without affecting other calls to
5
+ # Facter::Util::Resolution.exec
6
+ def self.virt_what(command = "virt-what")
7
+ Facter::Util::Resolution.exec command
8
+ end
9
+
10
+ ##
11
+ # lspci is a delegating helper method intended to make it easier to stub the
12
+ # system call without affecting other calls to Facter::Util::Resolution.exec
13
+ def self.lspci(command = "lspci 2>/dev/null")
14
+ Facter::Util::Resolution.exec command
15
+ end
16
+
2
17
  def self.openvz?
3
18
  FileTest.directory?("/proc/vz") and not self.openvz_cloudlinux?
4
19
  end
@@ -1,6 +1,6 @@
1
1
  module Facter
2
2
  if not defined? FACTERVERSION then
3
- FACTERVERSION = '1.6.13'
3
+ FACTERVERSION = '1.6.14-rc1'
4
4
  end
5
5
 
6
6
  def self.version
@@ -89,7 +89,7 @@ Facter.add("virtual") do
89
89
  end
90
90
 
91
91
  if result == "physical"
92
- output = Facter::Util::Resolution.exec('lspci 2>/dev/null')
92
+ output = Facter::Util::Virtual.lspci
93
93
  if not output.nil?
94
94
  output.each_line do |p|
95
95
  # --- look for the vmware video card to determine if it is virtual => vmware.
@@ -153,6 +153,39 @@ Facter.add("virtual") do
153
153
  end
154
154
  end
155
155
 
156
+ ##
157
+ # virtual fact based on virt-what command.
158
+ #
159
+ # The output is mapped onto existing known values for the virtual fact in an
160
+ # effort to preserve consistency. This fact has a high weight becuase the
161
+ # virt-what tool is expected to be maintained upstream.
162
+ #
163
+ # If the virt-what command is not available, this fact will not resolve to a
164
+ # value and lower-weight virtual facts will be attempted.
165
+ #
166
+ # Only the last line of the virt-what command is returned
167
+ Facter.add("virtual") do
168
+ has_weight 500
169
+
170
+ setcode do
171
+ output = Facter::Util::Virtual.virt_what
172
+ case output
173
+ when 'linux_vserver'
174
+ Facter::Util::Virtual.vserver_type
175
+ when /xen-hvm/i
176
+ 'xenhvm'
177
+ when /xen-dom0/i
178
+ 'xen0'
179
+ when /xen-domU/i
180
+ 'xenu'
181
+ when /ibm_systemz/i
182
+ 'zlinux'
183
+ else
184
+ output.to_s.split("\n").last
185
+ end
186
+ end
187
+ end
188
+
156
189
  # Fact: is_virtual
157
190
  #
158
191
  # Purpose: returning true or false for if a machine is virtualised or not.
@@ -14,4 +14,4 @@ lo Link encap:Local Loopback
14
14
  RX packets:0 errors:0 dropped:0 overruns:0 frame:0
15
15
  TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
16
16
  collisions:0 txqueuelen:0
17
- RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
17
+ RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
@@ -5,4 +5,4 @@ eth0 Link encap:Ethernet HWaddr 16:8D:2A:15:17:91
5
5
  RX packets:1914871 errors:0 dropped:0 overruns:0 frame:0
6
6
  TX packets:3960 errors:0 dropped:0 overruns:0 carrier:0
7
7
  collisions:0 txqueuelen:1000
8
- RX bytes:178738891 (170.4 MiB) TX bytes:393862 (384.6 KiB)
8
+ RX bytes:178738891 (170.4 MiB) TX bytes:393862 (384.6 KiB)
@@ -23,4 +23,4 @@ vmnet8: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
23
23
  inet 172.16.95.1 netmask 0xffffff00 broadcast 172.16.95.255
24
24
  vmnet1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
25
25
  ether 00:50:56:c0:00:01
26
- inet 172.16.201.1 netmask 0xffffff00 broadcast 172.16.201.255
26
+ inet 172.16.201.1 netmask 0xffffff00 broadcast 172.16.201.255
@@ -3,4 +3,4 @@ en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
3
3
  inet6 fe80::217:f2ff:fe06:e3c2%en0 prefixlen 64 scopeid 0x4
4
4
  inet 100.100.104.12 netmask 0xffffff00 broadcast 100.100.104.255
5
5
  media: autoselect (1000baseT <full-duplex>)
6
- status: active
6
+ status: active
@@ -23,4 +23,4 @@ vmnet8: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
23
23
  ether 00:50:56:c0:00:08
24
24
  vmnet1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
25
25
  inet 192.168.61.1 netmask 0xffffff00 broadcast 192.168.61.255
26
- ether 00:50:56:c0:00:01
26
+ ether 00:50:56:c0:00:01
@@ -3,4 +3,4 @@ en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
3
3
  inet 100.100.107.4 netmask 0xffffff00 broadcast 100.100.107.255
4
4
  ether 00:17:f2:06:e4:2e
5
5
  media: autoselect (1000baseT <full-duplex>) status: active
6
- supported media: autoselect 10baseT/UTP <half-duplex> 10baseT/UTP <full-duplex> 10baseT/UTP <full-duplex,hw-loopback> 10baseT/UTP <full-duplex,flow-control> 100baseTX <half-duplex> 100baseTX <full-duplex> 100baseTX <full-duplex,hw-loopback> 100baseTX <full-duplex,flow-control> 1000baseT <full-duplex> 1000baseT <full-duplex,hw-loopback> 1000baseT <full-duplex,flow-control>
6
+ supported media: autoselect 10baseT/UTP <half-duplex> 10baseT/UTP <full-duplex> 10baseT/UTP <full-duplex,hw-loopback> 10baseT/UTP <full-duplex,flow-control> 100baseTX <half-duplex> 100baseTX <full-duplex> 100baseTX <full-duplex,hw-loopback> 100baseTX <full-duplex,flow-control> 1000baseT <full-duplex> 1000baseT <full-duplex,hw-loopback> 1000baseT <full-duplex,flow-control>
@@ -33,4 +33,4 @@ vmnet8 Link encap:Ethernet HWaddr 00:50:56:C0:00:08
33
33
  RX packets:0 errors:0 dropped:0 overruns:0 frame:0
34
34
  TX packets:20 errors:0 dropped:0 overruns:0 carrier:0
35
35
  collisions:0 txqueuelen:1000
36
- RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
36
+ RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
@@ -6,4 +6,4 @@ eth0 Link encap:Ethernet HWaddr 00:17:F2:06:E4:26
6
6
  TX packets:45447195 errors:0 dropped:0 overruns:0 carrier:0
7
7
  collisions:0 txqueuelen:1000
8
8
  RX bytes:17037147877 (15.8 GiB) TX bytes:9198873602 (8.5 GiB)
9
- Memory:92c20000-92c40000
9
+ Memory:92c20000-92c40000
@@ -15,4 +15,4 @@ lo Link encap:Local Loopback
15
15
  RX packets:482 errors:0 dropped:0 overruns:0 frame:0
16
16
  TX packets:482 errors:0 dropped:0 overruns:0 carrier:0
17
17
  collisions:0 txqueuelen:0
18
- RX bytes:48488 (47.3 KiB) TX bytes:48488 (47.3 KiB)
18
+ RX bytes:48488 (47.3 KiB) TX bytes:48488 (47.3 KiB)
@@ -6,4 +6,4 @@ eth0 Link encap:Ethernet HWaddr 00:17:F2:0D:9B:A8
6
6
  TX packets:1539208 errors:0 dropped:0 overruns:0 carrier:0
7
7
  collisions:0 txqueuelen:1000
8
8
  RX bytes:1729726282 (1.6 GiB) TX bytes:1606599653 (1.4 GiB)
9
- Memory:f2c20000-f2c40000
9
+ Memory:f2c20000-f2c40000
@@ -35,4 +35,4 @@ lo Link encap:Local Loopback
35
35
  RX packets:59385736 errors:0 dropped:0 overruns:0 frame:0
36
36
  TX packets:59385736 errors:0 dropped:0 overruns:0 carrier:0
37
37
  collisions:0 txqueuelen:0
38
- RX bytes:3519026710 (3.2 GiB) TX bytes:3519026710 (3.2 GiB)
38
+ RX bytes:3519026710 (3.2 GiB) TX bytes:3519026710 (3.2 GiB)
@@ -6,4 +6,4 @@ eth0 Link encap:Ethernet HWaddr 00:18:F3:F6:33:E5
6
6
  TX packets:1241890434 errors:0 dropped:0 overruns:0 carrier:0
7
7
  collisions:0 txqueuelen:1000
8
8
  RX bytes:3777811119 (3.5 GiB) TX bytes:2061606027 (1.9 GiB)
9
- Interrupt:21
9
+ Interrupt:21
@@ -9,4 +9,4 @@ fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
9
9
  media: Ethernet autoselect (100baseTX <full-duplex>)
10
10
  status: active
11
11
  lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
12
- inet 127.0.0.1 netmask 0xff000000
12
+ inet 127.0.0.1 netmask 0xff000000
@@ -9,4 +9,4 @@ hme0: flags=2000841<UP,RUNNING,MULTICAST,IPv6> mtu 1500 index 2
9
9
  inet6 fe80::a00:20ff:fed1:6d79/10
10
10
  ether 8:0:20:d1:6d:79
11
11
  hme0:1: flags=2080841<UP,RUNNING,MULTICAST,ADDRCONF,IPv6> mtu 1500 index 2
12
- inet6 2404:130:0:1000:a00:20ff:fed1:6d79/64
12
+ inet6 2404:130:0:1000:a00:20ff:fed1:6d79/64
@@ -17,4 +17,4 @@ int0: flags=2100841<UP,RUNNING,MULTICAST,ROUTER,IPv6> mtu 9000 index 3
17
17
  inet6 fe80::ff:0/10
18
18
  ether 2:8:20:89:75:75
19
19
  int0:1: flags=2180841<UP,RUNNING,MULTICAST,ADDRCONF,ROUTER,IPv6> mtu 9000 index 3
20
- inet6 2404:130:40:18::ff:0/64
20
+ inet6 2404:130:40:18::ff:0/64
@@ -35,4 +35,4 @@ wifi0 Link encap:UNSPEC HWaddr 00-17-F2-49-E0-E6-00-00-00-00-00-00-00-00-00
35
35
  TX packets:193 errors:0 dropped:0 overruns:0 carrier:0
36
36
  collisions:0 txqueuelen:199
37
37
  RX bytes:754290 (736.6 KiB) TX bytes:8878 (8.6 KiB)
38
- Interrupt:16
38
+ Interrupt:16
@@ -6,4 +6,4 @@ eth0 Link encap:Ethernet HWaddr 00:16:CB:A6:D4:3A
6
6
  TX packets:280 errors:0 dropped:0 overruns:0 carrier:0
7
7
  collisions:0 txqueuelen:1000
8
8
  RX bytes:73859 (72.1 KiB) TX bytes:35243 (34.4 KiB)
9
- Interrupt:17
9
+ Interrupt:17
@@ -2,4 +2,4 @@ Kernel IP routing table
2
2
  Destination Gateway Genmask Flags MSS Window irtt Iface
3
3
  100.100.100.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
4
4
  169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
5
- 0.0.0.0 100.100.100.1 0.0.0.0 UG 0 0 0 eth0
5
+ 0.0.0.0 100.100.100.1 0.0.0.0 UG 0 0 0 eth0
@@ -32,4 +32,4 @@ fe80::217:f2ff:fe06:e3c2%en0 0:17:f2:6:e3:c2 UHL
32
32
  ff01::/32 ::1 Um lo0
33
33
  ff02::/32 ::1 UmC lo0
34
34
  ff02::/32 link#4 UmC en0
35
- ff02::fb link#4 UHmLW en0
35
+ ff02::fb link#4 UHmLW en0
@@ -25,4 +25,4 @@ fe80::%en0/64 link#4 UC
25
25
  fe80::217:f2ff:fe06:e42e%en0 0:17:f2:6:e4:2e UHL lo0
26
26
  ff01::/32 ::1 U lo0
27
27
  ff02::/32 fe80::1%lo0 UC lo0
28
- ff02::/32 link#4 UC en0
28
+ ff02::/32 link#4 UC en0
@@ -4,4 +4,4 @@ Destination Gateway Genmask Flags MSS Window irtt Iface
4
4
  192.168.183.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet8
5
5
  100.100.108.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
6
6
  169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
7
- 0.0.0.0 100.100.108.1 0.0.0.0 UG 0 0 0 eth0
7
+ 0.0.0.0 100.100.108.1 0.0.0.0 UG 0 0 0 eth0
@@ -13,4 +13,4 @@ Routing Table: IPv6
13
13
  fe80::/10 fe80::a00:20ff:fed1:6d79 U 1 0 hme0
14
14
  ff00::/8 fe80::a00:20ff:fed1:6d79 U 1 0 hme0
15
15
  default fe80::214:22ff:fe0a:1c46 UG 1 0 hme0
16
- ::1 ::1 UH 1 140 lo0
16
+ ::1 ::1 UH 1 140 lo0
@@ -14,4 +14,4 @@ Routing Table: IPv6
14
14
  2404:130:40:18::/64 2404:130:40:18::ff:0 U 4 1302106 int0
15
15
  fe80::/10 fe80::ff:0 U 3 16283 int0
16
16
  fe80::/10 fe80::ff:0 U 5 314822 bge0
17
- default fe80::20d:edff:fe9d:782e UG 2 420100 bge0
17
+ default fe80::20d:edff:fe9d:782e UG 2 420100 bge0
@@ -4,4 +4,4 @@ Destination Gateway Genmask Flags MSS Window irtt Iface
4
4
  169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 ath0
5
5
  169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
6
6
  0.0.0.0 100.100.106.1 0.0.0.0 UG 0 0 0 eth0
7
- 0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 ath0
7
+ 0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 ath0
@@ -1 +1 @@
1
- ? (10.240.93.1) at FE:FF:FF:FF:FF:FF [ether] on eth0
1
+ ? (10.240.93.1) at FE:FF:FF:FF:FF:FF [ether] on eth0
@@ -7,4 +7,4 @@ Interface: 10.32.123.54 --- 0xd
7
7
  169.254.169.254 fe-ff-ff-ff-ff-ff dynamic
8
8
  224.0.0.22 01-00-5e-00-00-16 static
9
9
  224.0.0.252 01-00-5e-00-00-fc static
10
- 255.255.255.255 ff-ff-ff-ff-ff-ff static
10
+ 255.255.255.255 ff-ff-ff-ff-ff-ff static
@@ -9,4 +9,4 @@ fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
9
9
  media: Ethernet autoselect (100baseTX <full-duplex>)
10
10
  status: active
11
11
  lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
12
- inet 127.0.0.1 netmask 0xff000000
12
+ inet 127.0.0.1 netmask 0xff000000
@@ -5,4 +5,4 @@ ib0 Link encap:InfiniBand HWaddr 80:00:00:4a:fe:80:00:00:00:00:00:00:00:0
5
5
  RX packets:8 errors:0 dropped:0 overruns:0 frame:0
6
6
  TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
7
7
  collisions:0 txqueuelen:1024
8
- RX bytes:448 (448.0 b) TX bytes:0 (0.0 b)
8
+ RX bytes:448 (448.0 b) TX bytes:0 (0.0 b)
@@ -15,4 +15,4 @@ lo Link encap:Local Loopback
15
15
  RX packets:1630 errors:0 dropped:0 overruns:0 frame:0
16
16
  TX packets:1630 errors:0 dropped:0 overruns:0 carrier:0
17
17
  collisions:0 txqueuelen:0
18
- RX bytes:81500 (79.5 KB) TX bytes:81500 (79.5 KB)
18
+ RX bytes:81500 (79.5 KB) TX bytes:81500 (79.5 KB)
@@ -5,4 +5,4 @@ ib0 Link encap:InfiniBand HWaddr 80:00:00:4A:FE:80:00:00:00:00:00:00:00:0
5
5
  RX packets:8 errors:0 dropped:0 overruns:0 frame:0
6
6
  TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
7
7
  collisions:0 txqueuelen:1024
8
- RX bytes:448 (448.0 b) TX bytes:0 (0.0 b)
8
+ RX bytes:448 (448.0 b) TX bytes:0 (0.0 b)
@@ -1,3 +1,3 @@
1
1
  e1000g0: flags=201004843<UP,BROADCAST,RUNNING,MULTICAST,DHCP,IPv4,CoS> mtu 1500 index 2
2
2
  inet 172.16.15.138 netmask ffffff00 broadcast 172.16.15.255
3
- ether 0:c:29:c1:70:2a
3
+ ether 0:c:29:c1:70:2a
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rspec
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  require 'spec_helper'
4
4
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rspec
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  require 'spec_helper'
4
4
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rspec
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  require 'spec_helper'
4
4
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rspec
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  require 'spec_helper'
4
4
  require 'facter/util/ec2'
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rspec
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  require 'spec_helper'
4
4
 
@@ -31,4 +31,11 @@ describe "Hardwareisa fact" do
31
31
 
32
32
  Facter.fact(:hardwareisa).value.should == "Clyde"
33
33
  end
34
+
35
+ it "should match uname -m on HP-UX" do
36
+ Facter.fact(:kernel).stubs(:value).returns("HP-UX")
37
+ Facter::Util::Resolution.stubs(:exec).with("uname -m").returns("Pac-Man")
38
+
39
+ Facter.fact(:hardwareisa).value.should == "Pac-Man"
40
+ end
34
41
  end
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rspec
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  require 'spec_helper'
4
4
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rspec
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  require 'spec_helper'
4
4
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rspec
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  require 'spec_helper'
4
4
  require 'facter/util/ip'
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rspec
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  require 'spec_helper'
4
4
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rspec
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  require 'spec_helper'
4
4
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rspec
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  require 'spec_helper'
4
4
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rspec
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  require 'spec_helper'
4
4
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rspec
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  require 'spec_helper'
4
4
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rspec
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  require 'spec_helper'
4
4
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rspec
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  require 'spec_helper'
4
4
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rspec
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  require 'spec_helper'
4
4
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rspec
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  require 'spec_helper'
4
4
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rspec
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  require 'spec_helper'
4
4
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rspec
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  require 'spec_helper'
4
4
 
@@ -48,10 +48,29 @@ describe "Physical processor count facts" do
48
48
  end
49
49
 
50
50
  describe "on solaris" do
51
- it "should use the output of psrinfo" do
52
- Facter.fact(:kernel).stubs(:value).returns(:sunos)
53
- Facter::Util::Resolution.expects(:exec).with("/usr/sbin/psrinfo -p").returns(1)
54
- Facter.fact(:physicalprocessorcount).value.should == 1
51
+ let(:psrinfo) do
52
+ "0 on-line since 10/16/2012 14:06:12\n" +
53
+ "1 on-line since 10/16/2012 14:06:14\n"
54
+ end
55
+
56
+ %w{ 5.8 5.9 5.10 5.11 }.each do |release|
57
+ it "should use the output of psrinfo -p on #{release}" do
58
+ Facter.fact(:kernel).stubs(:value).returns(:sunos)
59
+ Facter.stubs(:value).with(:kernelrelease).returns(release)
60
+
61
+ Facter::Util::Resolution.expects(:exec).with("/usr/sbin/psrinfo -p").returns("1")
62
+ Facter.fact(:physicalprocessorcount).value.should == "1"
63
+ end
64
+ end
65
+
66
+ %w{ 5.5.1 5.6 5.7 }.each do |release|
67
+ it "uses psrinfo with no -p for kernelrelease #{release}" do
68
+ Facter.fact(:kernel).stubs(:value).returns(:sunos)
69
+ Facter.stubs(:value).with(:kernelrelease).returns(release)
70
+
71
+ Facter::Util::Resolution.expects(:exec).with("/usr/sbin/psrinfo").returns(psrinfo)
72
+ Facter.fact(:physicalprocessorcount).value.should == "2"
73
+ end
55
74
  end
56
75
  end
57
76
  end