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
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: facter
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 5
9
- - 8
10
- version: 1.5.8
9
+ - 9
10
+ version: 1.5.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Puppet Labs
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-28 00:00:00 +10:00
18
+ date: 2011-05-20 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -29,123 +29,174 @@ extra_rdoc_files: []
29
29
 
30
30
  files:
31
31
  - README.rst
32
- - COPYING
33
32
  - INSTALL
34
- - CHANGELOG
35
33
  - Rakefile
36
- - TODO
37
- - LICENSE
34
+ - COPYING
38
35
  - README
36
+ - CHANGELOG
37
+ - LICENSE
38
+ - TODO
39
39
  - install.rb
40
40
  - bin/facter
41
- - lib/facter/path.rb
42
- - lib/facter/operatingsystemrelease.rb
43
- - lib/facter/macosx.rb
44
- - lib/facter/selinux.rb
45
- - lib/facter/physicalprocessorcount.rb
46
- - lib/facter/fqdn.rb
47
- - lib/facter/ec2.rb
48
- - lib/facter/rubyversion.rb
49
- - lib/facter/manufacturer.rb
50
- - lib/facter/iphostnumber.rb
51
- - lib/facter/architecture.rb
41
+ - lib/facter.rb
42
+ - lib/facter/timezone.rb
43
+ - lib/facter/uptime_hours.rb
52
44
  - lib/facter/id.rb
53
- - lib/facter/kernelmajversion.rb
54
- - lib/facter/uptime_days.rb
55
- - lib/facter/netmask.rb
56
- - lib/facter/hardwaremodel.rb
57
- - lib/facter/Cfkey.rb
58
- - lib/facter/virtual.rb
59
- - lib/facter/kernelrelease.rb
60
45
  - lib/facter/network.rb
61
- - lib/facter/uptime_hours.rb
62
- - lib/facter/operatingsystem.rb
63
- - lib/facter/lsbmajdistrelease.rb
64
- - lib/facter/puppetversion.rb
65
- - lib/facter/rubysitedir.rb
66
- - lib/facter/uniqueid.rb
67
- - lib/facter/processor.rb
68
- - lib/facter/macaddress.rb
69
- - lib/facter/facterversion.rb
46
+ - lib/facter/ec2.rb
47
+ - lib/facter/operatingsystemrelease.rb
48
+ - lib/facter/application.rb
70
49
  - lib/facter/vlans.rb
50
+ - lib/facter/netmask.rb
51
+ - lib/facter/arp.rb
52
+ - lib/facter/util/#uptime.rb#
53
+ - lib/facter/util/fact.rb
54
+ - lib/facter/util/resolution.rb
55
+ - lib/facter/util/confine.rb
56
+ - lib/facter/util/ip.rb
57
+ - lib/facter/util/vlans.rb
58
+ - lib/facter/util/netmask.rb
59
+ - lib/facter/util/values.rb
60
+ - lib/facter/util/uptime.rb
61
+ - lib/facter/util/collection.rb
62
+ - lib/facter/util/macaddress.rb
63
+ - lib/facter/util/manufacturer.rb
64
+ - lib/facter/util/xendomains.rb
65
+ - lib/facter/util/memory.rb
66
+ - lib/facter/util/macosx.rb
67
+ - lib/facter/util/virtual.rb
68
+ - lib/facter/util/loader.rb
69
+ - lib/facter/util/plist.rb
70
+ - lib/facter/util/plist/parser.rb
71
+ - lib/facter/util/plist/generator.rb
72
+ - lib/facter/interfaces.rb
71
73
  - lib/facter/kernelversion.rb
74
+ - lib/facter/puppetversion.rb
72
75
  - lib/facter/ssh.rb
73
- - lib/facter/interfaces.rb
74
- - lib/facter/hardwareisa.rb
75
- - lib/facter/timezone.rb
76
- - lib/facter/ps.rb
77
- - lib/facter/uptime_seconds.rb
78
- - lib/facter/lsb.rb
76
+ - lib/facter/hardwaremodel.rb
79
77
  - lib/facter/uptime.rb
80
- - lib/facter/memory.rb
78
+ - lib/facter/processor.rb
79
+ - lib/facter/rubysitedir.rb
81
80
  - lib/facter/hostname.rb
82
- - lib/facter/kernel.rb
83
- - lib/facter/domain.rb
81
+ - lib/facter/iphostnumber.rb
82
+ - lib/facter/hardwareisa.rb
83
+ - lib/facter/rubyversion.rb
84
+ - lib/facter/macaddress.rb
85
+ - lib/facter/fqdn.rb
84
86
  - lib/facter/ipaddress.rb
85
- - lib/facter/util/macosx.rb
86
- - lib/facter/util/plist/generator.rb
87
- - lib/facter/util/plist/parser.rb
88
- - lib/facter/util/manufacturer.rb
89
- - lib/facter/util/netmask.rb
90
- - lib/facter/util/plist.rb
91
- - lib/facter/util/virtual.rb
92
- - lib/facter/util/ip.rb
93
- - lib/facter/util/resolution.rb
94
- - lib/facter/util/values.rb
95
- - lib/facter/util/vlans.rb
96
- - lib/facter/util/loader.rb
97
- - lib/facter/util/collection.rb
98
- - lib/facter/util/uptime.rb
99
- - lib/facter/util/confine.rb
100
- - lib/facter/util/memory.rb
101
- - lib/facter/util/fact.rb
102
- - lib/facter.rb
103
- - conf/solaris/pkginfo
104
- - conf/osx/preflight
105
- - conf/osx/createpackage.sh
87
+ - lib/facter/physicalprocessorcount.rb
88
+ - lib/facter/manufacturer.rb
89
+ - lib/facter/Cfkey.rb
90
+ - lib/facter/xendomains.rb
91
+ - lib/facter/uniqueid.rb
92
+ - lib/facter/path.rb
93
+ - lib/facter/kernelrelease.rb
94
+ - lib/facter/memory.rb
95
+ - lib/facter/macosx.rb
96
+ - lib/facter/uptime_days.rb
97
+ - lib/facter/selinux.rb
98
+ - lib/facter/ipaddress6.rb
99
+ - lib/facter/domain.rb
100
+ - lib/facter/kernel.rb
101
+ - lib/facter/architecture.rb
102
+ - lib/facter/operatingsystem.rb
103
+ - lib/facter/virtual.rb
104
+ - lib/facter/kernelmajversion.rb
105
+ - lib/facter/lsbmajdistrelease.rb
106
+ - lib/facter/lsb.rb
107
+ - lib/facter/uptime_seconds.rb
108
+ - lib/facter/ps.rb
109
+ - lib/facter/facterversion.rb
106
110
  - conf/osx/PackageInfo.plist
111
+ - conf/osx/createpackage.sh
112
+ - conf/osx/preflight
107
113
  - conf/redhat/facter.spec
114
+ - conf/solaris/pkginfo
108
115
  - etc/facter.conf
109
- - spec/fixtures/uptime/who_b_boottime
110
- - spec/fixtures/uptime/ubuntu_proc_uptime
111
- - spec/fixtures/uptime/sysctl_kern_boottime
112
- - spec/Rakefile
113
- - spec/spec_helper.rb
114
116
  - spec/spec.opts
115
- - spec/unit/data/Mac_OS_X_10.5.5_ifconfig
116
- - spec/unit/data/darwin_ifconfig_all_with_multiple_interfaces
117
- - spec/unit/data/linux_vlan_config
118
- - spec/unit/data/linux_ifconfig_all_with_single_interface
117
+ - spec/spec_helper.rb
118
+ - spec/fixtures/netstat/ubuntu_7_04
119
+ - spec/fixtures/netstat/open_solaris_10
120
+ - spec/fixtures/netstat/centos_5_5
121
+ - spec/fixtures/netstat/darwin_10_6_4
122
+ - spec/fixtures/netstat/open_solaris_b132
123
+ - spec/fixtures/netstat/fedora_10
124
+ - spec/fixtures/netstat/darwin_10_6_6_dualstack
125
+ - spec/fixtures/netstat/darwin_10_3_0
126
+ - spec/fixtures/netstat/darwin_9_8_0
127
+ - spec/fixtures/ifconfig/darwin_10_6_4_en1
128
+ - spec/fixtures/ifconfig/ubuntu_7_04
129
+ - spec/fixtures/ifconfig/centos_5_5_eth0
130
+ - spec/fixtures/ifconfig/darwin_10_3_0_en0
131
+ - spec/fixtures/ifconfig/open_solaris_10
132
+ - spec/fixtures/ifconfig/centos_5_5
133
+ - spec/fixtures/ifconfig/sunos_ifconfig_all_with_multiple_interfaces
134
+ - spec/fixtures/ifconfig/fedora_10_eth0
135
+ - spec/fixtures/ifconfig/darwin_10_6_6_dualstack_en1
136
+ - spec/fixtures/ifconfig/darwin_9_8_0_en0
137
+ - spec/fixtures/ifconfig/bsd_ifconfig_all_with_multiple_interfaces
138
+ - spec/fixtures/ifconfig/darwin_10_6_4
139
+ - spec/fixtures/ifconfig/open_solaris_b132
140
+ - spec/fixtures/ifconfig/fedora_10
141
+ - spec/fixtures/ifconfig/darwin_ifconfig_all_with_multiple_interfaces
142
+ - spec/fixtures/ifconfig/fedora_13
143
+ - spec/fixtures/ifconfig/fedora_13_eth0
144
+ - spec/fixtures/ifconfig/darwin_10_6_6_dualstack
145
+ - spec/fixtures/ifconfig/linux_ifconfig_all_with_multiple_interfaces
146
+ - spec/fixtures/ifconfig/darwin_10_3_0
147
+ - spec/fixtures/ifconfig/darwin_9_8_0
148
+ - spec/fixtures/ifconfig/freebsd_6_0
149
+ - spec/fixtures/ifconfig/fedora_8_eth0
150
+ - spec/fixtures/ifconfig/fedora_8
151
+ - spec/fixtures/ifconfig/ubuntu_7_04_eth0
152
+ - spec/fixtures/virtual/proc_self_status/vserver_2_1/host
153
+ - spec/fixtures/virtual/proc_self_status/vserver_2_1/guest
154
+ - spec/fixtures/virtual/proc_self_status/vserver_2_3/host
155
+ - spec/fixtures/virtual/proc_self_status/vserver_2_3/guest
156
+ - spec/fixtures/uptime/kstat_boot_time
157
+ - spec/fixtures/uptime/sysctl_kern_boottime
158
+ - spec/fixtures/uptime/ubuntu_proc_uptime
159
+ - spec/fixtures/uptime/who_b_boottime
160
+ - spec/unit/id_spec.rb
161
+ - spec/unit/facter_spec.rb
162
+ - spec/unit/data/debian_kfreebsd_ifconfig
119
163
  - spec/unit/data/darwin_ifconfig_single_interface
164
+ - spec/unit/data/selinux_sestatus
165
+ - spec/unit/data/linux_vlan_config
166
+ - spec/unit/data/hpux_ifconfig_single_interface
167
+ - spec/unit/data/darwin_ifconfig_all_with_multiple_interfaces
168
+ - spec/unit/data/freebsd_dmidecode
169
+ - spec/unit/data/solaris_ifconfig_all_with_multiple_interfaces
120
170
  - spec/unit/data/solaris_ifconfig_single_interface
121
171
  - spec/unit/data/opensolaris_smbios
122
- - spec/unit/data/freebsd_dmidecode
123
172
  - spec/unit/data/hpux_netstat_all_interfaces
124
- - spec/unit/data/hpux_ifconfig_single_interface
125
173
  - spec/unit/data/linux_dmidecode_with_spaces
126
- - spec/unit/data/hpux_ifconfig
127
- - spec/unit/data/hpux_netscan
128
- - spec/unit/data/solaris_ifconfig_all_with_multiple_interfaces
174
+ - spec/unit/data/xendomains
129
175
  - spec/unit/data/6.0-STABLE_FreeBSD_ifconfig
130
- - spec/unit/operatingsystemrelease.rb
131
- - spec/unit/selinux.rb
132
- - spec/unit/virtual.rb
133
- - spec/unit/operatingsystem.rb
134
- - spec/unit/interfaces.rb
135
- - spec/unit/uptime.rb
136
- - spec/unit/facter.rb
137
- - spec/unit/util/macosx.rb
138
- - spec/unit/util/manufacturer.rb
139
- - spec/unit/util/virtual.rb
140
- - spec/unit/util/ip.rb
141
- - spec/unit/util/resolution.rb
142
- - spec/unit/util/vlans.rb
143
- - spec/unit/util/loader.rb
144
- - spec/unit/util/collection.rb
145
- - spec/unit/util/uptime.rb
146
- - spec/unit/util/confine.rb
147
- - spec/unit/util/fact.rb
148
- - spec/integration/facter.rb
176
+ - spec/unit/data/Mac_OS_X_10.5.5_ifconfig
177
+ - spec/unit/data/linux_ifconfig_all_with_single_interface
178
+ - spec/unit/util/macosx_spec.rb
179
+ - spec/unit/util/vlans_spec.rb
180
+ - spec/unit/util/collection_spec.rb
181
+ - spec/unit/util/uptime_spec.rb
182
+ - spec/unit/util/loader_spec.rb
183
+ - spec/unit/util/resolution_spec.rb
184
+ - spec/unit/util/confine_spec.rb
185
+ - spec/unit/util/xendomains_spec.rb
186
+ - spec/unit/util/virtual_spec.rb
187
+ - spec/unit/util/macaddress_spec.rb
188
+ - spec/unit/util/fact_spec.rb
189
+ - spec/unit/util/manufacturer_spec.rb
190
+ - spec/unit/util/ip_spec.rb
191
+ - spec/unit/memory_spec.rb
192
+ - spec/unit/operatingsystem_spec.rb
193
+ - spec/unit/uptime_spec.rb
194
+ - spec/unit/selinux_spec.rb
195
+ - spec/unit/ipaddress6_spec.rb
196
+ - spec/unit/virtual_spec.rb
197
+ - spec/unit/interfaces_spec.rb
198
+ - spec/unit/operatingsystemrelease_spec.rb
199
+ - spec/integration/facter_spec.rb
149
200
  has_rdoc: true
150
201
  homepage: http://puppetlabs.com
151
202
  licenses: []
@@ -1,18 +0,0 @@
1
- require File.join(File.dirname(__FILE__), "spec_helper.rb")
2
- require 'rake'
3
- require 'spec/rake/spectask'
4
-
5
- basedir = File.dirname(__FILE__)
6
- puppetlibdir = File.join(basedir, "../lib")
7
- puppettestlibdir = File.join(basedir, "../test/lib")
8
- speclibdir = File.join(basedir, "lib")
9
-
10
- libs = [puppetlibdir, puppettestlibdir, speclibdir]
11
- desc "Run all specs"
12
- Spec::Rake::SpecTask.new('all') do |t|
13
- t.spec_files = FileList['integration/**/*.rb', 'unit/**/*.rb']
14
- t.libs = libs
15
- t.spec_opts = ['--options', 'spec.opts']
16
- end
17
-
18
- task :default => [:all]
@@ -1,3 +0,0 @@
1
- lan0: flags=1843<UP,BROADCAST,RUNNING,MULTICAST,CKO>
2
- inet 168.24.80.71 netmask ffffff00 broadcast 168.24.80.255
3
- 00:13:21:BD:9C:B7
@@ -1,4 +0,0 @@
1
- Hardware Station Crd Hdw Net-Interface NM MAC HP-DLPI DLPI
2
- Path Address In# State NamePPA ID Type Support Mjr#
3
- 0/1/2/0 0x001321BD9CB7 0 UP lan0 snap0 1 ETHER Yes 119
4
- 0/6/1/0 0x001321BDACDB 1 UP lan1 snap1 2 ETHER Yes 119
@@ -1,39 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require File.dirname(__FILE__) + '/../spec_helper'
4
-
5
- require 'facter'
6
-
7
- describe "Operating System Release fact" do
8
-
9
- before do
10
- Facter.clear
11
- end
12
-
13
- after do
14
- Facter.clear
15
- end
16
-
17
- test_cases = {
18
- "CentOS" => "/etc/redhat-release",
19
- "RedHat" => "/etc/redhat-release",
20
- "Fedora" => "/etc/fedora-release",
21
- "MeeGo" => "/etc/meego-release",
22
- "OEL" => "/etc/enterprise-release",
23
- "oel" => "/etc/enterprise-release",
24
- "OVS" => "/etc/ovs-release",
25
- "ovs" => "/etc/ovs-release"
26
- }
27
-
28
- test_cases.each do |system, file|
29
- context "with operatingsystem reported as #{system.inspect}" do
30
- it "should read the #{file.inspect} file" do
31
- Facter.fact(:operatingsystem).stubs(:value).returns(system)
32
-
33
- File.expects(:open).with(file, "r").at_least(1)
34
-
35
- Facter.fact(:operatingsystemrelease).value
36
- end
37
- end
38
- end
39
- end
@@ -1,48 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require File.dirname(__FILE__) + '/../spec_helper'
4
-
5
- require 'facter'
6
-
7
- describe "SELinux facts" do
8
-
9
-
10
- after do
11
- Facter.clear
12
- end
13
-
14
- it "should return true if SELinux enabled" do
15
- Facter.fact(:kernel).stubs(:value).returns("Linux")
16
-
17
- FileTest.stubs(:exists?).returns false
18
- File.stubs(:read).with("/proc/self/attr/current").returns("notkernel")
19
-
20
- FileTest.expects(:exists?).with("/selinux/enforce").returns true
21
- FileTest.expects(:exists?).with("/proc/self/attr/current").returns true
22
- File.expects(:read).with("/proc/self/attr/current").returns("kernel")
23
-
24
- Facter.fact(:selinux).value.should == "true"
25
- end
26
-
27
- it "should return true if SELinux policy enabled" do
28
- Facter.fact(:selinux).stubs(:value).returns("true")
29
-
30
- FileTest.stubs(:exists?).returns false
31
- File.stubs(:read).with("/selinux/enforce").returns("0")
32
-
33
- FileTest.expects(:exists?).with("/selinux/enforce").returns true
34
- File.expects(:read).with("/selinux/enforce").returns("1")
35
-
36
- Facter.fact(:selinux_enforced).value.should == "true"
37
- end
38
-
39
- it "should return an SELinux policy version" do
40
- Facter.fact(:selinux).stubs(:value).returns("true")
41
-
42
- File.stubs(:read).with("/selinux/policyvers").returns("")
43
-
44
- File.expects(:read).with("/selinux/policyvers").returns("1")
45
-
46
- Facter.fact(:selinux_policyversion).value.should == "1"
47
- end
48
- end
@@ -1,53 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require File.dirname(__FILE__) + '/../../spec_helper'
4
-
5
- require 'facter/util/uptime'
6
-
7
- describe Facter::Util::Uptime do
8
-
9
- describe ".get_uptime_seconds_unix" do
10
- context "when /proc/uptime is available" do
11
- before do
12
- uptime_file = File.join(SPECDIR, "fixtures", "uptime", "ubuntu_proc_uptime")
13
- Facter::Util::Uptime.stubs(:uptime_file).returns(uptime_file)
14
- end
15
-
16
- it "should return the uptime in seconds as an integer" do
17
- Facter::Util::Uptime.get_uptime_seconds_unix.should == 5097686
18
- end
19
-
20
- end
21
-
22
- it "should use sysctl kern.boottime when /proc/uptime not available" do
23
- nonexistent_file = '/non/existent/file'
24
- File.exists?(nonexistent_file).should == false
25
- Facter::Util::Uptime.stubs(:uptime_file).returns(nonexistent_file)
26
- sysctl_output_file = File.join(SPECDIR, 'fixtures', 'uptime', 'sysctl_kern_boottime') # Aug 01 14:13:47 -0700 2010
27
- Facter::Util::Uptime.stubs(:uptime_sysctl_cmd).returns("cat #{sysctl_output_file}")
28
- Time.stubs(:now).returns Time.parse("Aug 01 15:13:47 -0700 2010") # one hour later
29
- Facter::Util::Uptime.get_uptime_seconds_unix.should == 60 * 60
30
- end
31
-
32
- it "should use who -b when neither /proc/uptime nor sysctl kern.boottime is available" do
33
- nonexistent_file = '/non/existent/file'
34
- File.exists?(nonexistent_file).should == false
35
- Facter::Util::Uptime.stubs(:uptime_file).returns(nonexistent_file)
36
- Facter::Util::Uptime.stubs(:uptime_sysctl_cmd).returns("cat #{nonexistent_file}")
37
- who_b_output_file = File.join(SPECDIR, 'fixtures', 'uptime', 'who_b_boottime') # Aug 1 14:13
38
- Facter::Util::Uptime.stubs(:uptime_who_cmd).returns("cat #{who_b_output_file}")
39
- Time.stubs(:now).returns Time.parse("Aug 01 15:13") # one hour later
40
- Facter::Util::Uptime.get_uptime_seconds_unix.should == 60 * 60
41
- end
42
-
43
- it "should return nil when none of /proc/uptime, sysctl kern.boottime, or who -b is available" do
44
- nonexistent_file = '/non/existent/file'
45
- File.exists?(nonexistent_file).should == false
46
- Facter::Util::Uptime.stubs(:uptime_file).returns(nonexistent_file)
47
- Facter::Util::Uptime.stubs(:uptime_sysctl_cmd).returns("cat #{nonexistent_file}")
48
- Facter::Util::Uptime.stubs(:uptime_who_cmd).returns("cat #{nonexistent_file}")
49
- Facter::Util::Uptime.get_uptime_seconds_unix.should == nil
50
- end
51
- end
52
-
53
- end