Imported Upstream version 1.7.2
Stig Sandbeck Mathisen
10 years ago
5 | 5 | |
6 | 6 | $LOAD_PATH << File.join(File.dirname(__FILE__), 'tasks') |
7 | 7 | |
8 | require 'rake' | |
9 | ||
8 | 10 | begin |
11 | load File.join(File.dirname(__FILE__), 'ext', 'packaging', 'packaging.rake') | |
9 | 12 | require 'rubygems' |
10 | 13 | require 'rspec' |
11 | 14 | require 'rspec/core/rake_task' |
13 | 16 | rescue LoadError |
14 | 17 | end |
15 | 18 | |
16 | require 'rake' | |
17 | ||
18 | 19 | Dir['tasks/**/*.rake'].each { |t| load t } |
19 | Dir['ext/packaging/tasks/**/*'].sort.each { |t| load t } | |
20 | 20 | |
21 | 21 | build_defs_file = 'ext/build_defaults.yaml' |
22 | 22 | if File.exist?(build_defs_file) |
1 | 1 | packaging_url: 'git://github.com/puppetlabs/packaging.git --branch=master' |
2 | 2 | packaging_repo: 'packaging' |
3 | 3 | default_cow: 'base-squeeze-i386.cow' |
4 | cows: 'base-lucid-i386.cow base-lucid-amd64.cow base-oneiric-i386.cow base-oneiric-amd64.cow base-precise-i386.cow base-precise-amd64.cow base-quantal-i386.cow base-quantal-amd64.cow base-sid-i386.cow base-sid-amd64.cow base-squeeze-i386.cow base-squeeze-amd64.cow base-stable-i386.cow base-stable-amd64.cow base-testing-i386.cow base-testing-amd64.cow base-unstable-i386.cow base-unstable-amd64.cow base-wheezy-i386.cow base-wheezy-amd64.cow' | |
4 | cows: 'base-lucid-i386.cow base-lucid-amd64.cow base-precise-i386.cow base-precise-amd64.cow base-quantal-i386.cow base-quantal-amd64.cow base-raring-i386.cow base-raring-amd64.cow base-sid-i386.cow base-sid-amd64.cow base-squeeze-i386.cow base-squeeze-amd64.cow base-stable-i386.cow base-stable-amd64.cow base-testing-i386.cow base-testing-amd64.cow base-unstable-i386.cow base-unstable-amd64.cow base-wheezy-i386.cow base-wheezy-amd64.cow' | |
5 | 5 | pbuild_conf: '/etc/pbuilderrc' |
6 | 6 | packager: 'puppetlabs' |
7 | 7 | gpg_name: 'info@puppetlabs.com' |
8 | 8 | gpg_key: '4BD6EC30' |
9 | 9 | sign_tar: FALSE |
10 | 10 | # a space separated list of mock configs |
11 | final_mocks: 'pl-el-5-i386 pl-el-5-x86_64 pl-el-6-i386 pl-el-6-x86_64 pl-fedora-16-i386 pl-fedora-16-x86_64 pl-fedora-17-i386 pl-fedora-17-x86_64 pl-fedora-18-i386 pl-fedora-18-x86_64' | |
11 | final_mocks: 'pl-el-5-i386 pl-el-5-x86_64 pl-el-6-i386 pl-el-6-x86_64 pl-fedora-17-i386 pl-fedora-17-x86_64 pl-fedora-18-i386 pl-fedora-18-x86_64' | |
12 | 12 | yum_host: 'burji.puppetlabs.com' |
13 | 13 | yum_repo_path: '/opt/repository/yum/' |
14 | 14 | build_gem: TRUE |
0 | facter (1.7.0-1puppetlabs1) hardy lucid oneiric unstable sid wheezy lucid squeeze precise quantal; urgency=low | |
0 | facter (1.7.2-1puppetlabs1) hardy lucid oneiric unstable sid wheezy lucid squeeze precise quantal; urgency=low | |
1 | 1 | |
2 | 2 | * Update to version |
3 | 3 | |
4 | -- Puppet Labs Release <info@puppetlabs.com> Mon, 15 Apr 2013 11:13:19 -0700 | |
4 | -- Puppet Labs Release <info@puppetlabs.com> Wed, 10 Jul 2013 23:00:17 +0000 | |
5 | 5 | |
6 | 6 | facter (1.7.0-0.1rc1puppetlabs1) hardy lucid oneiric unstable sid wheezy lucid squeeze precise; urgency=low |
7 | 7 |
0 | set name=pkg.fmri value=pkg://puppetlabs.com/application/facter@1.7.0,11.4.2-0 | |
0 | set name=pkg.fmri value=pkg://puppetlabs.com/application/facter@1.7.2,11.4.2-0 | |
1 | 1 | set name=pkg.summary value="Facter, a system inventory tool" |
2 | set name=pkg.human-version value="1.7.0" | |
2 | set name=pkg.human-version value="1.7.2" | |
3 | 3 | set name=pkg.description value="You can prove anything with facts!" |
4 | 4 | set name=info.classification value="org.opensolaris.category.2008:Applications/System Utilities" |
5 | 5 | set name=org.opensolaris.consolidation value="puppet" |
15 | 15 | # remove libdir |
16 | 16 | |
17 | 17 | |
18 | /bin/rm -Rf "${3}/facter/util/loader.rb" | |
19 | ||
20 | /bin/rm -Rf "${3}/facter/util/uptime.rb" | |
21 | ||
22 | /bin/rm -Rf "${3}/facter/util/virtual.rb" | |
23 | ||
24 | /bin/rm -Rf "${3}/facter/util/netmask.rb" | |
25 | ||
26 | /bin/rm -Rf "${3}/facter/util/nothing_loader.rb" | |
27 | ||
28 | /bin/rm -Rf "${3}/facter/util/macaddress.rb" | |
29 | ||
30 | /bin/rm -Rf "${3}/facter/util/cfpropertylist/README" | |
31 | ||
32 | /bin/rm -Rf "${3}/facter/util/cfpropertylist/THANKS" | |
33 | ||
34 | /bin/rm -Rf "${3}/facter/util/cfpropertylist/lib/rbCFTypes.rb" | |
35 | ||
36 | /bin/rm -Rf "${3}/facter/util/cfpropertylist/lib/rbCFPlistError.rb" | |
37 | ||
38 | /bin/rm -Rf "${3}/facter/util/cfpropertylist/lib/rbBinaryCFPropertyList.rb" | |
39 | ||
40 | /bin/rm -Rf "${3}/facter/util/cfpropertylist/lib/rbCFPropertyList.rb" | |
41 | ||
42 | /bin/rm -Rf "${3}/facter/util/cfpropertylist/lib/rbNokogiriParser.rb" | |
43 | ||
44 | /bin/rm -Rf "${3}/facter/util/cfpropertylist/lib/rbREXMLParser.rb" | |
45 | ||
46 | /bin/rm -Rf "${3}/facter/util/cfpropertylist/lib/cfpropertylist.rb" | |
47 | ||
48 | /bin/rm -Rf "${3}/facter/util/cfpropertylist/lib/rbLibXMLParser.rb" | |
49 | ||
50 | /bin/rm -Rf "${3}/facter/util/cfpropertylist/LICENSE" | |
51 | ||
52 | /bin/rm -Rf "${3}/facter/util/cfpropertylist/Rakefile" | |
53 | ||
54 | /bin/rm -Rf "${3}/facter/util/xendomains.rb" | |
55 | ||
56 | /bin/rm -Rf "${3}/facter/util/wmi.rb" | |
57 | ||
58 | /bin/rm -Rf "${3}/facter/util/file_read.rb" | |
59 | ||
60 | /bin/rm -Rf "${3}/facter/util/registry.rb" | |
61 | ||
62 | /bin/rm -Rf "${3}/facter/util/values.rb" | |
63 | ||
64 | /bin/rm -Rf "${3}/facter/util/parser.rb" | |
65 | ||
66 | /bin/rm -Rf "${3}/facter/util/vlans.rb" | |
67 | ||
68 | /bin/rm -Rf "${3}/facter/util/processor.rb" | |
69 | ||
70 | /bin/rm -Rf "${3}/facter/util/plist.rb" | |
71 | ||
72 | /bin/rm -Rf "${3}/facter/util/ec2.rb" | |
73 | ||
74 | /bin/rm -Rf "${3}/facter/util/manufacturer.rb" | |
75 | ||
76 | /bin/rm -Rf "${3}/facter/util/fact.rb" | |
77 | ||
78 | /bin/rm -Rf "${3}/facter/util/resolution.rb" | |
79 | ||
80 | /bin/rm -Rf "${3}/facter/util/collection.rb" | |
81 | ||
82 | /bin/rm -Rf "${3}/facter/util/memory.rb" | |
83 | ||
84 | /bin/rm -Rf "${3}/facter/util/ip.rb" | |
85 | ||
86 | /bin/rm -Rf "${3}/facter/util/solaris_zones.rb" | |
87 | ||
88 | /bin/rm -Rf "${3}/facter/util/cfpropertylist.rb" | |
89 | ||
90 | /bin/rm -Rf "${3}/facter/util/config.rb" | |
91 | ||
92 | /bin/rm -Rf "${3}/facter/util/monkey_patches.rb" | |
93 | ||
94 | /bin/rm -Rf "${3}/facter/util/plist/parser.rb" | |
95 | ||
96 | /bin/rm -Rf "${3}/facter/util/plist/generator.rb" | |
97 | ||
98 | /bin/rm -Rf "${3}/facter/util/directory_loader.rb" | |
99 | ||
100 | /bin/rm -Rf "${3}/facter/util/confine.rb" | |
101 | ||
102 | /bin/rm -Rf "${3}/facter/util/composite_loader.rb" | |
103 | ||
104 | /bin/rm -Rf "${3}/facter/util/macosx.rb" | |
105 | ||
106 | /bin/rm -Rf "${3}/facter/lsbrelease.rb" | |
107 | ||
108 | /bin/rm -Rf "${3}/facter/hardwareisa.rb" | |
109 | ||
110 | /bin/rm -Rf "${3}/facter/zonename.rb" | |
111 | ||
112 | /bin/rm -Rf "${3}/facter/lsbdistcodename.rb" | |
113 | ||
114 | /bin/rm -Rf "${3}/facter/kernelmajversion.rb" | |
115 | ||
116 | /bin/rm -Rf "${3}/facter/uptime_seconds.rb" | |
117 | ||
118 | /bin/rm -Rf "${3}/facter/interfaces.rb" | |
119 | ||
120 | /bin/rm -Rf "${3}/facter/augeasversion.rb" | |
121 | ||
122 | /bin/rm -Rf "${3}/facter/ipaddress6.rb" | |
123 | ||
124 | /bin/rm -Rf "${3}/facter/uptime.rb" | |
125 | ||
126 | /bin/rm -Rf "${3}/facter/virtual.rb" | |
127 | ||
128 | /bin/rm -Rf "${3}/facter/operatingsystem.rb" | |
129 | ||
130 | /bin/rm -Rf "${3}/facter/physicalprocessorcount.rb" | |
131 | ||
132 | /bin/rm -Rf "${3}/facter/ldom.rb" | |
133 | ||
134 | /bin/rm -Rf "${3}/facter/blockdevices.rb" | |
135 | ||
136 | /bin/rm -Rf "${3}/facter/netmask.rb" | |
137 | ||
138 | /bin/rm -Rf "${3}/facter/version.rb" | |
139 | ||
140 | /bin/rm -Rf "${3}/facter/uptime_days.rb" | |
141 | ||
142 | /bin/rm -Rf "${3}/facter/uptime_hours.rb" | |
143 | ||
144 | /bin/rm -Rf "${3}/facter/operatingsystemrelease.rb" | |
145 | ||
146 | /bin/rm -Rf "${3}/facter/selinux.rb" | |
147 | ||
148 | /bin/rm -Rf "${3}/facter/kernelversion.rb" | |
149 | ||
150 | /bin/rm -Rf "${3}/facter/macaddress.rb" | |
151 | ||
152 | /bin/rm -Rf "${3}/facter/xendomains.rb" | |
153 | ||
154 | /bin/rm -Rf "${3}/facter/hostname.rb" | |
155 | ||
156 | /bin/rm -Rf "${3}/facter/rubyversion.rb" | |
157 | ||
158 | /bin/rm -Rf "${3}/facter/path.rb" | |
159 | ||
160 | /bin/rm -Rf "${3}/facter/zones.rb" | |
161 | ||
162 | /bin/rm -Rf "${3}/facter/operatingsystemmajrelease.rb" | |
163 | ||
164 | /bin/rm -Rf "${3}/facter/vlans.rb" | |
165 | ||
166 | /bin/rm -Rf "${3}/facter/application.rb" | |
167 | ||
168 | /bin/rm -Rf "${3}/facter/processor.rb" | |
169 | ||
170 | /bin/rm -Rf "${3}/facter/id.rb" | |
171 | ||
18 | 172 | /bin/rm -Rf "${3}/facter/fqdn.rb" |
19 | 173 | |
174 | /bin/rm -Rf "${3}/facter/ec2.rb" | |
175 | ||
176 | /bin/rm -Rf "${3}/facter/architecture.rb" | |
177 | ||
178 | /bin/rm -Rf "${3}/facter/ssh.rb" | |
179 | ||
180 | /bin/rm -Rf "${3}/facter/ipaddress.rb" | |
181 | ||
182 | /bin/rm -Rf "${3}/facter/uniqueid.rb" | |
183 | ||
184 | /bin/rm -Rf "${3}/facter/manufacturer.rb" | |
185 | ||
186 | /bin/rm -Rf "${3}/facter/kernel.rb" | |
187 | ||
188 | /bin/rm -Rf "${3}/facter/kernelrelease.rb" | |
189 | ||
190 | /bin/rm -Rf "${3}/facter/timezone.rb" | |
191 | ||
192 | /bin/rm -Rf "${3}/facter/puppetversion.rb" | |
193 | ||
194 | /bin/rm -Rf "${3}/facter/rubysitedir.rb" | |
195 | ||
196 | /bin/rm -Rf "${3}/facter/facterversion.rb" | |
197 | ||
198 | /bin/rm -Rf "${3}/facter/filesystems.rb" | |
199 | ||
20 | 200 | /bin/rm -Rf "${3}/facter/lsbdistid.rb" |
21 | 201 | |
22 | /bin/rm -Rf "${3}/facter/operatingsystemmajrelease.rb" | |
23 | ||
24 | /bin/rm -Rf "${3}/facter/version.rb" | |
202 | /bin/rm -Rf "${3}/facter/memory.rb" | |
203 | ||
204 | /bin/rm -Rf "${3}/facter/lsbdistdescription.rb" | |
205 | ||
206 | /bin/rm -Rf "${3}/facter/network.rb" | |
207 | ||
208 | /bin/rm -Rf "${3}/facter/zpool_version.rb" | |
209 | ||
210 | /bin/rm -Rf "${3}/facter/zfs_version.rb" | |
211 | ||
212 | /bin/rm -Rf "${3}/facter/domain.rb" | |
213 | ||
214 | /bin/rm -Rf "${3}/facter/lsbdistrelease.rb" | |
215 | ||
216 | /bin/rm -Rf "${3}/facter/Cfkey.rb" | |
25 | 217 | |
26 | 218 | /bin/rm -Rf "${3}/facter/osfamily.rb" |
27 | 219 | |
28 | /bin/rm -Rf "${3}/facter/ipaddress6.rb" | |
29 | ||
30 | /bin/rm -Rf "${3}/facter/puppetversion.rb" | |
31 | ||
32 | /bin/rm -Rf "${3}/facter/rubysitedir.rb" | |
220 | /bin/rm -Rf "${3}/facter/ps.rb" | |
221 | ||
222 | /bin/rm -Rf "${3}/facter/hardwaremodel.rb" | |
223 | ||
224 | /bin/rm -Rf "${3}/facter/macosx.rb" | |
225 | ||
226 | /bin/rm -Rf "${3}/facter/lsbmajdistrelease.rb" | |
33 | 227 | |
34 | 228 | /bin/rm -Rf "${3}/facter/iphostnumber.rb" |
35 | ||
36 | /bin/rm -Rf "${3}/facter/util/solaris_zones.rb" | |
37 | ||
38 | /bin/rm -Rf "${3}/facter/util/file_read.rb" | |
39 | ||
40 | /bin/rm -Rf "${3}/facter/util/confine.rb" | |
41 | ||
42 | /bin/rm -Rf "${3}/facter/util/cfpropertylist/THANKS" | |
43 | ||
44 | /bin/rm -Rf "${3}/facter/util/cfpropertylist/Rakefile" | |
45 | ||
46 | /bin/rm -Rf "${3}/facter/util/cfpropertylist/lib/rbCFPlistError.rb" | |
47 | ||
48 | /bin/rm -Rf "${3}/facter/util/cfpropertylist/lib/rbLibXMLParser.rb" | |
49 | ||
50 | /bin/rm -Rf "${3}/facter/util/cfpropertylist/lib/rbCFPropertyList.rb" | |
51 | ||
52 | /bin/rm -Rf "${3}/facter/util/cfpropertylist/lib/cfpropertylist.rb" | |
53 | ||
54 | /bin/rm -Rf "${3}/facter/util/cfpropertylist/lib/rbNokogiriParser.rb" | |
55 | ||
56 | /bin/rm -Rf "${3}/facter/util/cfpropertylist/lib/rbREXMLParser.rb" | |
57 | ||
58 | /bin/rm -Rf "${3}/facter/util/cfpropertylist/lib/rbBinaryCFPropertyList.rb" | |
59 | ||
60 | /bin/rm -Rf "${3}/facter/util/cfpropertylist/lib/rbCFTypes.rb" | |
61 | ||
62 | /bin/rm -Rf "${3}/facter/util/cfpropertylist/LICENSE" | |
63 | ||
64 | /bin/rm -Rf "${3}/facter/util/cfpropertylist/README" | |
65 | ||
66 | /bin/rm -Rf "${3}/facter/util/ip.rb" | |
67 | ||
68 | /bin/rm -Rf "${3}/facter/util/vlans.rb" | |
69 | ||
70 | /bin/rm -Rf "${3}/facter/util/resolution.rb" | |
71 | ||
72 | /bin/rm -Rf "${3}/facter/util/ec2.rb" | |
73 | ||
74 | /bin/rm -Rf "${3}/facter/util/plist/generator.rb" | |
75 | ||
76 | /bin/rm -Rf "${3}/facter/util/plist/parser.rb" | |
77 | ||
78 | /bin/rm -Rf "${3}/facter/util/composite_loader.rb" | |
79 | ||
80 | /bin/rm -Rf "${3}/facter/util/cfpropertylist.rb" | |
81 | ||
82 | /bin/rm -Rf "${3}/facter/util/registry.rb" | |
83 | ||
84 | /bin/rm -Rf "${3}/facter/util/memory.rb" | |
85 | ||
86 | /bin/rm -Rf "${3}/facter/util/plist.rb" | |
87 | ||
88 | /bin/rm -Rf "${3}/facter/util/manufacturer.rb" | |
89 | ||
90 | /bin/rm -Rf "${3}/facter/util/fact.rb" | |
91 | ||
92 | /bin/rm -Rf "${3}/facter/util/collection.rb" | |
93 | ||
94 | /bin/rm -Rf "${3}/facter/util/netmask.rb" | |
95 | ||
96 | /bin/rm -Rf "${3}/facter/util/config.rb" | |
97 | ||
98 | /bin/rm -Rf "${3}/facter/util/xendomains.rb" | |
99 | ||
100 | /bin/rm -Rf "${3}/facter/util/processor.rb" | |
101 | ||
102 | /bin/rm -Rf "${3}/facter/util/macosx.rb" | |
103 | ||
104 | /bin/rm -Rf "${3}/facter/util/wmi.rb" | |
105 | ||
106 | /bin/rm -Rf "${3}/facter/util/parser.rb" | |
107 | ||
108 | /bin/rm -Rf "${3}/facter/util/virtual.rb" | |
109 | ||
110 | /bin/rm -Rf "${3}/facter/util/values.rb" | |
111 | ||
112 | /bin/rm -Rf "${3}/facter/util/uptime.rb" | |
113 | ||
114 | /bin/rm -Rf "${3}/facter/util/monkey_patches.rb" | |
115 | ||
116 | /bin/rm -Rf "${3}/facter/util/nothing_loader.rb" | |
117 | ||
118 | /bin/rm -Rf "${3}/facter/util/directory_loader.rb" | |
119 | ||
120 | /bin/rm -Rf "${3}/facter/util/loader.rb" | |
121 | ||
122 | /bin/rm -Rf "${3}/facter/util/macaddress.rb" | |
123 | ||
124 | /bin/rm -Rf "${3}/facter/ps.rb" | |
125 | ||
126 | /bin/rm -Rf "${3}/facter/vlans.rb" | |
127 | ||
128 | /bin/rm -Rf "${3}/facter/lsbdistrelease.rb" | |
129 | ||
130 | /bin/rm -Rf "${3}/facter/kernel.rb" | |
131 | ||
132 | /bin/rm -Rf "${3}/facter/zonename.rb" | |
133 | ||
134 | /bin/rm -Rf "${3}/facter/kernelversion.rb" | |
135 | ||
136 | /bin/rm -Rf "${3}/facter/ec2.rb" | |
137 | ||
138 | /bin/rm -Rf "${3}/facter/lsbdistdescription.rb" | |
139 | ||
140 | /bin/rm -Rf "${3}/facter/augeasversion.rb" | |
141 | ||
142 | /bin/rm -Rf "${3}/facter/ssh.rb" | |
143 | ||
144 | /bin/rm -Rf "${3}/facter/memory.rb" | |
145 | ||
146 | /bin/rm -Rf "${3}/facter/lsbrelease.rb" | |
147 | ||
148 | /bin/rm -Rf "${3}/facter/manufacturer.rb" | |
149 | ||
150 | /bin/rm -Rf "${3}/facter/kernelrelease.rb" | |
151 | ||
152 | /bin/rm -Rf "${3}/facter/blockdevices.rb" | |
153 | ||
154 | /bin/rm -Rf "${3}/facter/hardwaremodel.rb" | |
155 | ||
156 | /bin/rm -Rf "${3}/facter/facterversion.rb" | |
157 | ||
158 | /bin/rm -Rf "${3}/facter/zfs_version.rb" | |
159 | ||
160 | /bin/rm -Rf "${3}/facter/lsbdistcodename.rb" | |
161 | ||
162 | /bin/rm -Rf "${3}/facter/ldom.rb" | |
163 | ||
164 | /bin/rm -Rf "${3}/facter/architecture.rb" | |
165 | ||
166 | /bin/rm -Rf "${3}/facter/netmask.rb" | |
167 | ||
168 | /bin/rm -Rf "${3}/facter/filesystems.rb" | |
169 | ||
170 | /bin/rm -Rf "${3}/facter/id.rb" | |
171 | ||
172 | /bin/rm -Rf "${3}/facter/xendomains.rb" | |
173 | ||
174 | /bin/rm -Rf "${3}/facter/uptime_seconds.rb" | |
175 | ||
176 | /bin/rm -Rf "${3}/facter/hardwareisa.rb" | |
177 | ||
178 | /bin/rm -Rf "${3}/facter/interfaces.rb" | |
179 | ||
180 | /bin/rm -Rf "${3}/facter/zones.rb" | |
181 | ||
182 | /bin/rm -Rf "${3}/facter/processor.rb" | |
183 | ||
184 | /bin/rm -Rf "${3}/facter/lsbmajdistrelease.rb" | |
185 | ||
186 | /bin/rm -Rf "${3}/facter/macosx.rb" | |
187 | ||
188 | /bin/rm -Rf "${3}/facter/zpool_version.rb" | |
189 | ||
190 | /bin/rm -Rf "${3}/facter/Cfkey.rb" | |
191 | ||
192 | /bin/rm -Rf "${3}/facter/network.rb" | |
193 | ||
194 | /bin/rm -Rf "${3}/facter/uniqueid.rb" | |
195 | ||
196 | /bin/rm -Rf "${3}/facter/virtual.rb" | |
197 | ||
198 | /bin/rm -Rf "${3}/facter/hostname.rb" | |
199 | ||
200 | /bin/rm -Rf "${3}/facter/kernelmajversion.rb" | |
201 | ||
202 | /bin/rm -Rf "${3}/facter/domain.rb" | |
203 | ||
204 | /bin/rm -Rf "${3}/facter/uptime.rb" | |
205 | ||
206 | /bin/rm -Rf "${3}/facter/path.rb" | |
207 | ||
208 | /bin/rm -Rf "${3}/facter/uptime_hours.rb" | |
209 | ||
210 | /bin/rm -Rf "${3}/facter/application.rb" | |
211 | ||
212 | /bin/rm -Rf "${3}/facter/operatingsystemrelease.rb" | |
213 | ||
214 | /bin/rm -Rf "${3}/facter/rubyversion.rb" | |
215 | ||
216 | /bin/rm -Rf "${3}/facter/uptime_days.rb" | |
217 | ||
218 | /bin/rm -Rf "${3}/facter/ipaddress.rb" | |
219 | ||
220 | /bin/rm -Rf "${3}/facter/timezone.rb" | |
221 | ||
222 | /bin/rm -Rf "${3}/facter/physicalprocessorcount.rb" | |
223 | ||
224 | /bin/rm -Rf "${3}/facter/macaddress.rb" | |
225 | ||
226 | /bin/rm -Rf "${3}/facter/selinux.rb" | |
227 | ||
228 | /bin/rm -Rf "${3}/facter/operatingsystem.rb" | |
229 | 229 | |
230 | 230 | /bin/rm -Rf "${3}/facter.rb" |
231 | 231 |
4 | 4 | <key>CFBundleIdentifier</key> |
5 | 5 | <string></string> |
6 | 6 | <key>CFBundleShortVersionString</key> |
7 | <string>1.7.0</string> | |
7 | <string>1.7.2</string> | |
8 | 8 | <key>IFMajorVersion</key> |
9 | 9 | <integer></integer> |
10 | 10 | <key>IFMinorVersion</key> |
6 | 6 | %endif |
7 | 7 | |
8 | 8 | # VERSION is subbed out during rake srpm process |
9 | %global realversion 1.7.0 | |
10 | %global rpmversion 1.7.0 | |
9 | %global realversion 1.7.2 | |
10 | %global rpmversion 1.7.2 | |
11 | 11 | |
12 | 12 | Summary: Ruby module for collecting simple facts about a host operating system |
13 | 13 | Name: facter |
69 | 69 | |
70 | 70 | |
71 | 71 | %changelog |
72 | * Mon Apr 15 2013 Puppet Labs Release <info@puppetlabs.com> - 1:1.7.0-1 | |
73 | - Build for 1.7.0 | |
72 | * Wed Jul 10 2013 Puppet Labs Release <info@puppetlabs.com> - 1:1.7.2-1 | |
73 | - Build for 1.7.2 | |
74 | 74 | |
75 | 75 | * Mon Apr 01 2013 Matthaus Owens <matthaus@puppetlabs.com> - 1:1.7.0-0.1rc1 |
76 | 76 | - Add dependency on virt-what to facter for better virutalization detection |
22 | 22 | # Get the domain from various sources; the order of these |
23 | 23 | # steps is important |
24 | 24 | |
25 | # In some OS 'hostname -f' will change the hostname to '-f' | |
26 | # We know that Solaris and HP-UX exhibit this behavior | |
27 | # On good OS, 'hostname -f' will return the FQDN which is preferable | |
28 | # Due to dangerous behavior of 'hostname -f' on old OS, we will explicitly opt-in | |
25 | # In some OS 'hostname -f' will change the hostname to '-f' | |
26 | # We know that Solaris and HP-UX exhibit this behavior | |
27 | # On good OS, 'hostname -f' will return the FQDN which is preferable | |
28 | # Due to dangerous behavior of 'hostname -f' on old OS, we will explicitly opt-in | |
29 | 29 | # 'hostname -f' --hkenney May 9, 2012 |
30 | hostname_command = 'hostname' | |
30 | basic_hostname = 'hostname 2> /dev/null' | |
31 | full_hostname = 'hostname -f 2> /dev/null' | |
31 | 32 | can_do_hostname_f = Regexp.union /Linux/i, /FreeBSD/i, /Darwin/i |
32 | hostname_command = 'hostname -f' if Facter.value(:kernel) =~ can_do_hostname_f | |
33 | 33 | |
34 | ||
34 | hostname_command = if Facter.value(:kernel) =~ can_do_hostname_f | |
35 | full_hostname | |
36 | else | |
37 | basic_hostname | |
38 | end | |
39 | ||
35 | 40 | if name = Facter::Util::Resolution.exec(hostname_command) \ |
36 | 41 | and name =~ /.*?\.(.+$)/ |
37 | 42 | |
38 | 43 | return_value = $1 |
39 | elsif domain = Facter::Util::Resolution.exec('dnsdomainname') \ | |
44 | elsif domain = Facter::Util::Resolution.exec('dnsdomainname 2> /dev/null') \ | |
40 | 45 | and domain =~ /.+/ |
41 | 46 | |
42 | 47 | return_value = domain |
27 | 27 | confine :kernel => :linux |
28 | 28 | setcode do |
29 | 29 | ip = nil |
30 | if output = Facter::Util::IP.exec_ifconfig(["2>/dev/null"]) | |
30 | output = Facter::Util::IP.exec_ifconfig(["2>/dev/null"]) | |
31 | if output | |
31 | 32 | regexp = /inet (?:addr:)?([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/ |
32 | if match = regexp.match(output) | |
33 | match[1] unless /^127/.match(match[1]) | |
33 | output.split("\n").each do |line| | |
34 | match = regexp.match(line) | |
35 | if match | |
36 | break match[1] unless /^127/.match(match[1]) | |
37 | end | |
34 | 38 | end |
35 | 39 | end |
36 | 40 | end |
116 | 116 | # get each physical processor |
117 | 117 | Facter::Util::WMI.execquery("select * from Win32_Processor").each do |proc| |
118 | 118 | # not supported before 2008 |
119 | begin | |
119 | if proc.respond_to?(:NumberOfLogicalProcessors) | |
120 | 120 | processor_num = proc.NumberOfLogicalProcessors |
121 | rescue RuntimeError => e | |
121 | else | |
122 | 122 | processor_num = 1 |
123 | 123 | end |
124 | 124 |
26 | 26 | Facter.debug "Could not read #{path}: #{detail.message}" |
27 | 27 | nil |
28 | 28 | end |
29 | ||
30 | def self.read_binary(path) | |
31 | File.open(path, "rb") { |contents| contents.read } | |
32 | end | |
29 | 33 | end |
30 | 34 | end |
31 | 35 | end |
7 | 7 | :ipaddress => /inet (?:addr:)?([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/, |
8 | 8 | :ipaddress6 => /inet6 (?:addr: )?((?![fe80|::1])(?>[0-9,a-f,A-F]*\:{1,2})+[0-9,a-f,A-F]{0,4})/, |
9 | 9 | :macaddress => /(?:ether|HWaddr)\s+((\w{1,2}:){5,}\w{1,2})/, |
10 | :netmask => /Mask:([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/, | |
10 | :netmask => /(?:Mask:|netmask )([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/, | |
11 | 11 | :mtu => /MTU:(\d+)/ |
12 | 12 | }, |
13 | 13 | :bsd => { |
7 | 7 | when 'Linux' |
8 | 8 | ops = { |
9 | 9 | :ifconfig_opts => ['2>/dev/null'], |
10 | :regex => %r{\s+ inet\saddr: #{Facter.ipaddress} .*? Mask: (#{ipregex})}x, | |
10 | :regex => %r{#{Facter.ipaddress}.*?(?:Mask:|netmask)\s*(#{ipregex})}x, | |
11 | 11 | :munge => nil, |
12 | 12 | } |
13 | 13 | when 'SunOS' |
168 | 168 | |
169 | 169 | begin |
170 | 170 | out = %x{#{code}}.chomp |
171 | Facter.warnonce 'Using Facter::Util::Resolution.exec with a shell built-in is deprecated. Most built-ins can be replaced with native ruby commands. If you really have to run a built-in, pass "cmd /c your_builtin" as a command' unless expanded_code | |
171 | Facter.warnonce "Using Facter::Util::Resolution.exec with a shell built-in is deprecated. Most built-ins can be replaced with native ruby commands. If you really have to run a built-in, pass \"cmd /c your_builtin\" as a command (command responsible for this message was \"#{code}\")" unless expanded_code | |
172 | 172 | rescue Errno::ENOENT => detail |
173 | 173 | # command not found on Windows |
174 | 174 | return nil |
0 | require 'facter/util/file_read' | |
1 | ||
0 | 2 | module Facter::Util::Virtual |
1 | 3 | ## |
2 | 4 | # virt_what is a delegating helper method intended to make it easier to stub |
62 | 64 | return false unless FileTest.exists?("/proc/self/status") |
63 | 65 | txt = File.open("/proc/self/status", "rb").read |
64 | 66 | if txt.respond_to?(:encode!) |
65 | txt.encode!('UTF-8', 'UTF-8', :invalid => :replace) | |
67 | txt.encode!('UTF-16', 'UTF-8', :invalid => :replace) | |
68 | txt.encode!('UTF-8', 'UTF-16') | |
66 | 69 | end |
67 | 70 | return true if txt =~ /^(s_context|VxID):[[:blank:]]*[0-9]/ |
68 | 71 | return false |
141 | 144 | # @return [String] or nil if the path does not exist |
142 | 145 | def self.read_sysfs_dmi_entries(path="/sys/firmware/dmi/entries/1-0/raw") |
143 | 146 | if File.exists?(path) |
144 | File.read(path) | |
147 | Facter::Util::FileRead.read_binary(path) | |
145 | 148 | end |
146 | 149 | end |
147 | 150 | end |
0 | 0 | module Facter |
1 | 1 | if not defined? FACTERVERSION then |
2 | FACTERVERSION = '1.7.0' | |
2 | FACTERVERSION = '1.7.2' | |
3 | 3 | end |
4 | 4 | |
5 | 5 | ## |
43 | 43 | end |
44 | 44 | end |
45 | 45 | |
46 | Facter.add("virtual") do | |
47 | confine :kernel => ["FreeBSD", "GNU/kFreeBSD"] | |
48 | ||
49 | setcode do | |
50 | "jail" if Facter::Util::Virtual.jail? | |
51 | end | |
52 | end | |
53 | ||
54 | Facter.add("virtual") do | |
55 | confine :kernel => 'SunOS' | |
56 | ||
57 | setcode do | |
58 | next "zone" if Facter::Util::Virtual.zone? | |
59 | ||
60 | resolver = Facter::Util::Resolution.new('prtdiag') | |
61 | resolver.timeout = 6 | |
62 | resolver.setcode('prtdiag') | |
63 | output = resolver.value | |
64 | if output | |
65 | lines = output.split("\n") | |
66 | next "parallels" if lines.any? {|l| l =~ /Parallels/ } | |
67 | next "vmware" if lines.any? {|l| l =~ /VM[wW]are/ } | |
68 | next "virtualbox" if lines.any? {|l| l =~ /VirtualBox/ } | |
69 | next "xenhvm" if lines.any? {|l| l =~ /HVM domU/ } | |
70 | end | |
71 | end | |
72 | end | |
73 | ||
74 | Facter.add("virtual") do | |
75 | confine :kernel => 'HP-UX' | |
76 | ||
77 | setcode do | |
78 | "hpvm" if Facter::Util::Virtual.hpvm? | |
79 | end | |
80 | end | |
81 | ||
82 | Facter.add("virtual") do | |
83 | confine :architecture => 's390x' | |
84 | ||
85 | setcode do | |
86 | "zlinux" if Facter::Util::Virtual.zlinux? | |
87 | end | |
88 | end | |
89 | ||
90 | Facter.add("virtual") do | |
91 | confine :kernel => 'OpenBSD' | |
92 | ||
93 | setcode do | |
94 | output = Facter::Util::Resolution.exec('sysctl -n hw.product 2>/dev/null') | |
95 | if output | |
96 | lines = output.split("\n") | |
97 | next "parallels" if lines.any? {|l| l =~ /Parallels/ } | |
98 | next "vmware" if lines.any? {|l| l =~ /VMware/ } | |
99 | next "virtualbox" if lines.any? {|l| l =~ /VirtualBox/ } | |
100 | next "xenhvm" if lines.any? {|l| l =~ /HVM domU/ } | |
101 | end | |
102 | end | |
103 | end | |
46 | 104 | |
47 | 105 | Facter.add("virtual") do |
48 | 106 | confine :kernel => %w{Linux FreeBSD OpenBSD SunOS HP-UX GNU/kFreeBSD} |
49 | 107 | |
50 | result = "physical" | |
51 | ||
52 | setcode do | |
53 | ||
54 | if Facter.value(:kernel) == "SunOS" and Facter::Util::Virtual.zone? | |
55 | result = "zone" | |
56 | end | |
57 | ||
58 | if Facter.value(:kernel)=="HP-UX" | |
59 | result = "hpvm" if Facter::Util::Virtual.hpvm? | |
60 | end | |
61 | ||
62 | if Facter.value(:architecture)=="s390x" | |
63 | result = "zlinux" if Facter::Util::Virtual.zlinux? | |
64 | end | |
65 | ||
66 | if Facter::Util::Virtual.openvz? | |
67 | result = Facter::Util::Virtual.openvz_type() | |
68 | end | |
69 | ||
70 | if Facter::Util::Virtual.vserver? | |
71 | result = Facter::Util::Virtual.vserver_type() | |
72 | end | |
108 | setcode do | |
109 | next Facter::Util::Virtual.openvz_type if Facter::Util::Virtual.openvz? | |
110 | next Facter::Util::Virtual.vserver_type if Facter::Util::Virtual.vserver? | |
73 | 111 | |
74 | 112 | if Facter::Util::Virtual.xen? |
75 | if FileTest.exists?("/dev/xen/evtchn") | |
76 | result = "xen0" | |
77 | elsif FileTest.exists?("/proc/xen") | |
78 | result = "xenu" | |
79 | end | |
80 | end | |
81 | ||
82 | if Facter::Util::Virtual.virtualbox? | |
83 | result = "virtualbox" | |
84 | end | |
85 | ||
86 | if Facter::Util::Virtual.kvm? | |
87 | result = Facter::Util::Virtual.kvm_type() | |
88 | end | |
89 | ||
90 | if ["FreeBSD", "GNU/kFreeBSD"].include? Facter.value(:kernel) | |
91 | result = "jail" if Facter::Util::Virtual.jail? | |
92 | end | |
93 | ||
94 | if Facter::Util::Virtual.rhev? | |
95 | result = "rhev" | |
96 | end | |
97 | ||
98 | if Facter::Util::Virtual.ovirt? | |
99 | result = "ovirt" | |
100 | end | |
101 | ||
102 | if result == "physical" | |
103 | output = Facter::Util::Virtual.lspci | |
104 | if not output.nil? | |
105 | output.each_line do |p| | |
106 | # --- look for the vmware video card to determine if it is virtual => vmware. | |
107 | # --- 00:0f.0 VGA compatible controller: VMware Inc [VMware SVGA II] PCI Display Adapter | |
108 | result = "vmware" if p =~ /VM[wW]are/ | |
109 | # --- look for virtualbox video card to determine if it is virtual => virtualbox. | |
110 | # --- 00:02.0 VGA compatible controller: InnoTek Systemberatung GmbH VirtualBox Graphics Adapter | |
111 | result = "virtualbox" if p =~ /VirtualBox/ | |
112 | # --- look for pci vendor id used by Parallels video card | |
113 | # --- 01:00.0 VGA compatible controller: Unknown device 1ab8:4005 | |
114 | result = "parallels" if p =~ /1ab8:|[Pp]arallels/ | |
115 | # --- look for pci vendor id used by Xen HVM device | |
116 | # --- 00:03.0 Unassigned class [ff80]: XenSource, Inc. Xen Platform Device (rev 01) | |
117 | result = "xenhvm" if p =~ /XenSource/ | |
118 | # --- look for Hyper-V video card | |
119 | # --- 00:08.0 VGA compatible controller: Microsoft Corporation Hyper-V virtual VGA | |
120 | result = "hyperv" if p =~ /Microsoft Corporation Hyper-V/ | |
121 | # --- look for gmetrics for GCE | |
122 | # --- 00:05.0 Class 8007: Google, Inc. Device 6442 | |
123 | result = "gce" if p =~ /Class 8007: Google, Inc/ | |
124 | end | |
125 | else | |
126 | output = Facter::Util::Resolution.exec('dmidecode') | |
127 | if not output.nil? | |
128 | output.each_line do |pd| | |
129 | result = "parallels" if pd =~ /Parallels/ | |
130 | result = "vmware" if pd =~ /VMware/ | |
131 | result = "virtualbox" if pd =~ /VirtualBox/ | |
132 | result = "xenhvm" if pd =~ /HVM domU/ | |
133 | result = "hyperv" if pd =~ /Product Name: Virtual Machine/ | |
134 | result = "rhev" if pd =~ /Product Name: RHEV Hypervisor/ | |
135 | result = "ovirt" if pd =~ /Product Name: oVirt Node/ | |
136 | end | |
137 | elsif Facter.value(:kernel) == 'SunOS' | |
138 | res = Facter::Util::Resolution.new('prtdiag') | |
139 | res.timeout = 6 | |
140 | res.setcode('prtdiag') | |
141 | output = res.value | |
142 | if not output.nil? | |
143 | output.each_line do |pd| | |
144 | result = "parallels" if pd =~ /Parallels/ | |
145 | result = "vmware" if pd =~ /VMware/ | |
146 | result = "virtualbox" if pd =~ /VirtualBox/ | |
147 | result = "xenhvm" if pd =~ /HVM domU/ | |
148 | end | |
149 | end | |
150 | elsif Facter.value(:kernel) == 'OpenBSD' | |
151 | output = Facter::Util::Resolution.exec('sysctl -n hw.product 2>/dev/null') | |
152 | if not output.nil? | |
153 | output.each_line do |pd| | |
154 | result = "parallels" if pd =~ /Parallels/ | |
155 | result = "vmware" if pd =~ /VMware/ | |
156 | result = "virtualbox" if pd =~ /VirtualBox/ | |
157 | result = "xenhvm" if pd =~ /HVM domU/ | |
158 | end | |
159 | end | |
160 | end | |
161 | end | |
162 | ||
163 | if output = Facter::Util::Resolution.exec("vmware -v") | |
164 | result = output.sub(/(\S+)\s+(\S+).*/) { | text | "#{$1}_#{$2}"}.downcase | |
165 | end | |
166 | end | |
167 | ||
168 | result | |
113 | next "xen0" if FileTest.exists?("/dev/xen/evtchn") | |
114 | next "xenu" if FileTest.exists?("/proc/xen") | |
115 | end | |
116 | ||
117 | next "virtualbox" if Facter::Util::Virtual.virtualbox? | |
118 | next Facter::Util::Virtual.kvm_type if Facter::Util::Virtual.kvm? | |
119 | next "rhev" if Facter::Util::Virtual.rhev? | |
120 | next "ovirt" if Facter::Util::Virtual.ovirt? | |
121 | ||
122 | # Parse lspci | |
123 | output = Facter::Util::Virtual.lspci | |
124 | if output | |
125 | lines = output.split("\n") | |
126 | next "vmware" if lines.any? {|l| l =~ /VM[wW]are/ } | |
127 | next "virtualbox" if lines.any? {|l| l =~ /VirtualBox/ } | |
128 | next "parallels" if lines.any? {|l| l =~ /1ab8:|[Pp]arallels/ } | |
129 | next "xenhvm" if lines.any? {|l| l =~ /XenSource/ } | |
130 | next "hyperv" if lines.any? {|l| l =~ /Microsoft Corporation Hyper-V/ } | |
131 | next "gce" if lines.any? {|l| l =~ /Class 8007: Google, Inc/ } | |
132 | end | |
133 | ||
134 | # Parse dmidecode | |
135 | output = Facter::Util::Resolution.exec('dmidecode') | |
136 | if output | |
137 | lines = output.split("\n") | |
138 | next "parallels" if lines.any? {|l| l =~ /Parallels/ } | |
139 | next "vmware" if lines.any? {|l| l =~ /VMware/ } | |
140 | next "virtualbox" if lines.any? {|l| l =~ /VirtualBox/ } | |
141 | next "xenhvm" if lines.any? {|l| l =~ /HVM domU/ } | |
142 | next "hyperv" if lines.any? {|l| l =~ /Product Name: Virtual Machine/ } | |
143 | next "rhev" if lines.any? {|l| l =~ /Product Name: RHEV Hypervisor/ } | |
144 | next "ovirt" if lines.any? {|l| l =~ /Product Name: oVirt Node/ } | |
145 | end | |
146 | ||
147 | # Sample output of vmware -v `VMware Server 1.0.5 build-80187` | |
148 | output = Facter::Util::Resolution.exec("vmware -v") | |
149 | if output | |
150 | mdata = output.match /(\S+)\s+(\S+)/ | |
151 | next "#{mdata[1]}_#{mdata[2]}".downcase if mdata | |
152 | end | |
153 | ||
154 | # Default to 'physical' | |
155 | next 'physical' | |
169 | 156 | end |
170 | 157 | end |
171 | 158 |
0 | em1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 | |
1 | inet 131.252.209.153 netmask 255.255.255.0 broadcast 192.168.76.255 | |
2 | inet6 2610:10:20:209:212:3fff:febe:2201 prefixlen 128 scopeid 0x0<global> | |
3 | inet6 fe80::221:ccff:fe4b:297d prefixlen 64 scopeid 0x20<link> | |
4 | ether 00:21:cc:4b:29:7d txqueuelen 1000 (Ethernet) | |
5 | RX packets 27222144 bytes 31247414760 (29.1 GiB) | |
6 | RX errors 0 dropped 0 overruns 0 frame 0 | |
7 | TX packets 10259038 bytes 7784519352 (7.2 GiB) | |
8 | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 | |
9 | device interrupt 20 memory 0xd2600000-d2620000 | |
10 | ||
11 | lo: flags=73<UP,LOOPBACK,RUNNING> mtu 16436 | |
12 | inet 127.0.0.1 netmask 255.0.0.0 | |
13 | inet6 ::1 prefixlen 128 scopeid 0x10<host> | |
14 | loop txqueuelen 0 (Local Loopback) | |
15 | RX packets 257371 bytes 37104110 (35.3 MiB) | |
16 | RX errors 0 dropped 0 overruns 0 frame 0 | |
17 | TX packets 257371 bytes 37104110 (35.3 MiB) | |
18 | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 |
0 | em1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 | |
1 | inet 131.252.209.153 netmask 255.255.255.0 broadcast 192.168.76.255 | |
2 | inet6 2610:10:20:209:212:3fff:febe:2201 prefixlen 128 scopeid 0x0<global> | |
3 | inet6 fe80::221:ccff:fe4b:297d prefixlen 64 scopeid 0x20<link> | |
4 | ether 00:21:cc:4b:29:7d txqueuelen 1000 (Ethernet) | |
5 | RX packets 27222144 bytes 31247414760 (29.1 GiB) | |
6 | RX errors 0 dropped 0 overruns 0 frame 0 | |
7 | TX packets 10259038 bytes 7784519352 (7.2 GiB) | |
8 | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 | |
9 | device interrupt 20 memory 0xd2600000-d2620000 |
0 | lo: flags=73<UP,LOOPBACK,RUNNING> mtu 16436 | |
1 | inet 127.0.0.1 netmask 255.0.0.0 | |
2 | inet6 ::1 prefixlen 128 scopeid 0x10<host> | |
3 | loop txqueuelen 0 (Local Loopback) | |
4 | RX packets 257371 bytes 37104110 (35.3 MiB) | |
5 | RX errors 0 dropped 0 overruns 0 frame 0 | |
6 | TX packets 257371 bytes 37104110 (35.3 MiB) | |
7 | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 |
0 | lo Link encap:Local Loopback | |
1 | inet addr:127.0.0.1 Mask:255.0.0.0 | |
2 | inet6 addr: ::1/128 Scope:Host | |
3 | UP LOOPBACK RUNNING MTU:16436 Metric:1 | |
4 | RX packets:9031461 errors:0 dropped:0 overruns:0 frame:0 | |
5 | TX packets:9031461 errors:0 dropped:0 overruns:0 carrier:0 | |
6 | collisions:0 txqueuelen:0 | |
7 | RX bytes:3205490447 (2.9 GiB) TX bytes:3205490447 (2.9 GiB) | |
8 | ||
9 | venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 | |
10 | inet addr:127.0.0.1 P-t-P:127.0.0.1 Bcast:0.0.0.0 Mask:255.255.255.255 | |
11 | UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1 | |
12 | RX packets:38161277 errors:0 dropped:0 overruns:0 frame:0 | |
13 | TX packets:24601924 errors:0 dropped:0 overruns:0 carrier:0 | |
14 | collisions:0 txqueuelen:0 | |
15 | RX bytes:3847964603 (3.5 GiB) TX bytes:5770630041 (5.3 GiB) | |
16 | ||
17 | venet0:1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 | |
18 | inet addr:10.0.222.20 P-t-P:10.0.222.20 Bcast:10.0.222.20 Mask:255.255.255.255 | |
19 | UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1 |
0 | em1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 | |
1 | inet 131.252.209.153 netmask 255.255.255.0 broadcast 192.168.76.255 | |
2 | inet6 2610:10:20:209:212:3fff:febe:2201 prefixlen 128 scopeid 0x0<global> | |
3 | inet6 fe80::221:ccff:fe4b:297d prefixlen 64 scopeid 0x20<link> | |
4 | ether 00:21:cc:4b:29:7d txqueuelen 1000 (Ethernet) | |
5 | RX packets 27222144 bytes 31247414760 (29.1 GiB) | |
6 | RX errors 0 dropped 0 overruns 0 frame 0 | |
7 | TX packets 10259038 bytes 7784519352 (7.2 GiB) | |
8 | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 | |
9 | device interrupt 20 memory 0xd2600000-d2620000 | |
10 | ||
11 | lo: flags=73<UP,LOOPBACK,RUNNING> mtu 16436 | |
12 | inet 127.0.0.1 netmask 255.0.0.0 | |
13 | inet6 ::1 prefixlen 128 scopeid 0x10<host> | |
14 | loop txqueuelen 0 (Local Loopback) | |
15 | RX packets 257371 bytes 37104110 (35.3 MiB) | |
16 | RX errors 0 dropped 0 overruns 0 frame 0 | |
17 | TX packets 257371 bytes 37104110 (35.3 MiB) | |
18 | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 |
0 | eth0 Link encap:Ethernet HWaddr 42:01:0a:57:50:6e | |
1 | inet addr:10.87.80.110 Bcast:10.87.80.110 Mask:255.255.255.255 | |
2 | UP BROADCAST RUNNING MULTICAST MTU:1460 Metric:1 | |
3 | RX packets:1609444 errors:0 dropped:0 overruns:0 frame:0 | |
4 | TX packets:1479569 errors:0 dropped:0 overruns:0 carrier:0 | |
5 | collisions:0 txqueuelen:1000 | |
6 | RX bytes:673812693 (673.8 MB) TX bytes:221186872 (221.1 MB) | |
7 | ||
8 | lo Link encap:Local Loopback | |
9 | inet addr:127.0.0.1 Mask:255.0.0.0 | |
10 | UP LOOPBACK RUNNING MTU:16436 Metric:1 | |
11 | RX packets:5435415 errors:0 dropped:0 overruns:0 frame:0 | |
12 | TX packets:5435415 errors:0 dropped:0 overruns:0 carrier:0 | |
13 | collisions:0 txqueuelen:0 | |
14 | RX bytes:734540224 (734.5 MB) TX bytes:734540224 (734.5 MB) | |
15 |
Binary diff not shown
0 | RSpec.configure do |config| | |
1 | config.alias_it_should_behave_like_to :example_behavior_for, "parses" | |
2 | end |
0 | 0 | #! /usr/bin/env ruby |
1 | 1 | |
2 | 2 | require 'spec_helper' |
3 | require 'stringio' | |
3 | 4 | |
4 | 5 | describe "Domain name facts" do |
5 | 6 | |
6 | { :linux => {:kernel => "Linux", :hostname_command => "hostname -f"}, | |
7 | :solaris => {:kernel => "SunOS", :hostname_command => "hostname"}, | |
8 | :darwin => {:kernel => "Darwin", :hostname_command => "hostname -f"}, | |
9 | :freebsd => {:kernel => "FreeBSD", :hostname_command => "hostname -f"}, | |
10 | :hpux => {:kernel => "HP-UX", :hostname_command => "hostname"}, | |
11 | }.each do |key, nested_hash| | |
12 | ||
13 | describe "on #{key}" do | |
7 | def resolv_conf_contains(*lines) | |
8 | file_handle = StringIO.new(lines.join("\n")) | |
9 | FileTest.stubs(:exists?).with("/etc/resolv.conf").returns(true) | |
10 | File.stubs(:open).with("/etc/resolv.conf").yields(file_handle) | |
11 | end | |
12 | ||
13 | [ | |
14 | { :kernel => "Linux", :hostname_command => "hostname -f 2> /dev/null" }, | |
15 | { :kernel => "SunOS", :hostname_command => "hostname 2> /dev/null" }, | |
16 | { :kernel => "Darwin", :hostname_command => "hostname -f 2> /dev/null" }, | |
17 | { :kernel => "FreeBSD", :hostname_command => "hostname -f 2> /dev/null" }, | |
18 | { :kernel => "HP-UX", :hostname_command => "hostname 2> /dev/null" }, | |
19 | ].each do |scenario| | |
20 | ||
21 | describe "on #{scenario[:kernel]}" do | |
22 | let(:hostname_command) { scenario[:hostname_command] } | |
23 | let(:dnsdomain_command) { "dnsdomainname 2> /dev/null" } | |
24 | ||
25 | def the_hostname_is(value) | |
26 | Facter::Util::Resolution.stubs(:exec).with(hostname_command).returns(value) | |
27 | end | |
28 | ||
29 | def the_dnsdomainname_is(value) | |
30 | Facter::Util::Resolution.stubs(:exec).with(dnsdomain_command).returns(value) | |
31 | end | |
32 | ||
14 | 33 | before do |
15 | Facter.fact(:kernel).stubs(:value).returns(nested_hash[:kernel]) | |
16 | FileTest.stubs(:exists?).with("/etc/resolv.conf").returns(true) | |
17 | end | |
18 | ||
19 | let :hostname_command do | |
20 | nested_hash[:hostname_command] | |
21 | end | |
22 | ||
34 | Facter.fact(:kernel).stubs(:value).returns(scenario[:kernel]) | |
35 | end | |
36 | ||
23 | 37 | it "should use the hostname binary" do |
24 | Facter::Util::Resolution.expects(:exec).with(hostname_command).returns "test.example.com" | |
38 | the_hostname_is("test.example.com") | |
39 | ||
25 | 40 | Facter.fact(:domain).value.should == "example.com" |
26 | 41 | end |
27 | ||
42 | ||
28 | 43 | it "should fall back to the dnsdomainname binary" do |
29 | Facter::Util::Resolution.expects(:exec).with(hostname_command).returns("myhost") | |
30 | Facter::Util::Resolution.expects(:exec).with("dnsdomainname").returns("example.com") | |
44 | the_hostname_is("myhost") | |
45 | the_dnsdomainname_is("example.com") | |
46 | ||
31 | 47 | Facter.fact(:domain).value.should == "example.com" |
32 | 48 | end |
33 | ||
34 | ||
49 | ||
35 | 50 | it "should fall back to /etc/resolv.conf" do |
36 | Facter::Util::Resolution.expects(:exec).with(hostname_command).at_least_once.returns("myhost") | |
37 | Facter::Util::Resolution.expects(:exec).with("dnsdomainname").at_least_once.returns("") | |
38 | File.expects(:open).with('/etc/resolv.conf').at_least_once | |
39 | Facter.fact(:domain).value | |
40 | end | |
41 | ||
42 | it "should attempt to resolve facts in a specific order" do | |
43 | seq = sequence('domain') | |
44 | Facter::Util::Resolution.stubs(:exec).with(hostname_command).in_sequence(seq).at_least_once | |
45 | Facter::Util::Resolution.stubs(:exec).with("dnsdomainname").in_sequence(seq).at_least_once | |
46 | File.expects(:open).with('/etc/resolv.conf').in_sequence(seq).at_least_once | |
47 | Facter.fact(:domain).value | |
48 | end | |
49 | ||
50 | describe "Top level domain" do | |
51 | the_hostname_is("myhost") | |
52 | the_dnsdomainname_is("") | |
53 | ||
54 | resolv_conf_contains("domain testing.com") | |
55 | ||
56 | Facter.fact(:domain).value.should == "testing.com" | |
57 | end | |
58 | ||
59 | describe "Top level domain" do | |
51 | 60 | it "should find the domain name" do |
52 | Facter::Util::Resolution.expects(:exec).with(hostname_command).returns "ns01.tld" | |
53 | Facter::Util::Resolution.expects(:exec).with("dnsdomainname").never | |
54 | File.expects(:exists?).with('/etc/resolv.conf').never | |
55 | Facter.fact(:domain).value.should == "tld" | |
56 | end | |
57 | end | |
58 | ||
61 | the_hostname_is("ns01.tld") | |
62 | ||
63 | Facter.fact(:domain).value.should == "tld" | |
64 | end | |
65 | end | |
66 | ||
59 | 67 | describe "when using /etc/resolv.conf" do |
60 | 68 | before do |
61 | Facter::Util::Resolution.stubs(:exec).with(hostname_command) | |
62 | Facter::Util::Resolution.stubs(:exec).with("dnsdomainname") | |
63 | @mock_file = mock() | |
64 | File.stubs(:open).with("/etc/resolv.conf").yields(@mock_file) | |
65 | end | |
66 | ||
69 | the_hostname_is("") | |
70 | the_dnsdomainname_is("") | |
71 | end | |
72 | ||
67 | 73 | it "should use the domain field over the search field" do |
68 | lines = [ | |
69 | "nameserver 4.2.2.1", | |
70 | "search example.org", | |
71 | "domain example.com", | |
72 | ] | |
73 | @mock_file.expects(:each).multiple_yields(*lines) | |
74 | resolv_conf_contains( | |
75 | "nameserver 4.2.2.1", | |
76 | "search example.org", | |
77 | "domain example.com" | |
78 | ) | |
79 | ||
74 | 80 | Facter.fact(:domain).value.should == 'example.com' |
75 | 81 | end |
76 | 82 | |
77 | 83 | it "should fall back to the search field" do |
78 | lines = [ | |
79 | "nameserver 4.2.2.1", | |
80 | "search example.org", | |
81 | ] | |
82 | @mock_file.expects(:each).multiple_yields(*lines) | |
84 | resolv_conf_contains( | |
85 | "nameserver 4.2.2.1", | |
86 | "search example.org" | |
87 | ) | |
88 | ||
83 | 89 | Facter.fact(:domain).value.should == 'example.org' |
84 | 90 | end |
85 | ||
91 | ||
86 | 92 | it "should use the first domain in the search field" do |
87 | lines = [ | |
88 | "search example.org example.net", | |
89 | ] | |
90 | @mock_file.expects(:each).multiple_yields(*lines) | |
93 | resolv_conf_contains("search example.org example.net") | |
94 | ||
91 | 95 | Facter.fact(:domain).value.should == 'example.org' |
92 | 96 | end |
93 | ||
97 | ||
94 | 98 | # Test permutations of domain and search, where 'domain' can be a value of |
95 | 99 | # the search keyword and the domain keyword |
96 | 100 | # and also where 'search' can be a value of the search keyword and the |
106 | 110 | # Why someone would have their machines named 'www.domain' or 'www.search', I |
107 | 111 | # don't know, but we'll at least handle it properly |
108 | 112 | [ |
109 | ["domain domain", "domain"], | |
110 | ["domain search", "search"], | |
111 | ["search domain", "domain"], | |
112 | ["search search", "search"], | |
113 | ["search domain notdomain", "domain"], | |
114 | [["#search notdomain","search search"], "search"], | |
115 | [["# search notdomain","search search"], "search"], | |
116 | [["#domain notdomain","domain domain"], "domain"], | |
117 | [["# domain notdomain","domain domain"], "domain"], | |
113 | [["domain domain"], "domain"], | |
114 | [["domain search"], "search"], | |
115 | [["search domain"], "domain"], | |
116 | [["search search"], "search"], | |
117 | [["search domain notdomain"], "domain"], | |
118 | [["#search notdomain", "search search"], "search"], | |
119 | [["# search notdomain", "search search"], "search"], | |
120 | [["#domain notdomain", "domain domain"], "domain"], | |
121 | [["# domain notdomain", "domain domain"], "domain"], | |
118 | 122 | ].each do |tuple| |
119 | field = tuple[0] | |
123 | conf = tuple[0] | |
120 | 124 | expect = tuple[1] |
121 | it "should return #{expect} from \"#{field}\"" do | |
122 | lines = [ | |
123 | field | |
124 | ].flatten | |
125 | @mock_file.expects(:each).multiple_yields(*lines) | |
125 | it "should return #{expect} from \"#{conf}\"" do | |
126 | resolv_conf_contains(*conf) | |
127 | ||
126 | 128 | Facter.fact(:domain).value.should == expect |
127 | 129 | end |
128 | 130 | end |
129 | 131 | end |
130 | 132 | end |
131 | end | |
133 | end | |
132 | 134 | |
133 | 135 | describe "on Windows" do |
134 | 136 | before(:each) do |
172 | 174 | end |
173 | 175 | end |
174 | 176 | |
175 | describe "with trailing dots" do | |
176 | describe "on Windows" do | |
177 | describe "with trailing dots" do | |
178 | describe "on Windows" do | |
177 | 179 | before do |
178 | 180 | Facter.fact(:kernel).stubs(:value).returns("windows") |
179 | 181 | require 'facter/util/registry' |
180 | 182 | require 'facter/util/wmi' |
181 | 183 | end |
182 | ||
184 | ||
183 | 185 | [{:registry => 'testdomain.', :wmi => '', :expect => 'testdomain'}, |
184 | 186 | {:registry => '', :wmi => 'testdomain.', :expect => 'testdomain'}, |
185 | 187 | ].each do |scenario| |
186 | 188 | |
187 | describe "scenarios" do | |
189 | describe "scenarios" do | |
188 | 190 | before(:each) do |
189 | 191 | Facter::Util::Registry.stubs(:hklm_read).returns(scenario[:registry]) |
190 | 192 | nic = stubs 'nic' |
191 | 193 | nic.stubs(:DNSDomain).returns(scenario[:wmi]) |
192 | 194 | Facter::Util::WMI.stubs(:execquery).with("select DNSDomain from Win32_NetworkAdapterConfiguration where IPEnabled = True").returns([nic]) |
193 | 195 | end |
194 | ||
196 | ||
195 | 197 | it "should return #{scenario[:expect]}" do |
196 | 198 | Facter.fact(:domain).value.should == scenario[:expect] |
197 | 199 | end |
198 | ||
200 | ||
199 | 201 | it "should remove trailing dots" do |
200 | 202 | Facter.fact(:domain).value.should_not =~ /\.$/ |
201 | 203 | end |
202 | end | |
203 | end | |
204 | end | |
205 | end | |
204 | 206 | end |
205 | 207 | |
206 | 208 | describe "on everything else" do |
209 | 211 | FileTest.stubs(:exists?).with("/etc/resolv.conf").returns(true) |
210 | 212 | end |
211 | 213 | |
212 | [{:hostname => 'host.testdomain.', :dnsdomainname => '', :resolve_domain => '', :resolve_search => '', :expect => 'testdomain'}, | |
213 | {:hostname => '', :dnsdomainname => 'testdomain.', :resolve_domain => '', :resolve_search => '', :expect => 'testdomain'}, | |
214 | {:hostname => '', :dnsdomainname => '', :resolve_domain => 'testdomain.', :resolve_search => '', :expect => 'testdomain'}, | |
215 | {:hostname => '', :dnsdomainname => '', :resolve_domain => '', :resolve_search => 'testdomain.', :expect => 'testdomain'}, | |
216 | {:hostname => '', :dnsdomainname => '', :resolve_domain => '', :resolve_search => '', :expect => nil} | |
214 | [ | |
215 | { | |
216 | :scenario => 'when there is only a hostname', | |
217 | :hostname => 'host.testdomain.', | |
218 | :dnsdomainname => '', | |
219 | :resolve_domain => '', | |
220 | :resolve_search => '', | |
221 | :expect => 'testdomain' | |
222 | }, | |
223 | { | |
224 | :scenario => 'when there is only a domain name', | |
225 | :hostname => '', | |
226 | :dnsdomainname => 'testdomain.', | |
227 | :resolve_domain => '', | |
228 | :resolve_search => '', | |
229 | :expect => 'testdomain' | |
230 | }, | |
231 | { | |
232 | :scenario => 'when there is only a resolve domain', | |
233 | :hostname => '', | |
234 | :dnsdomainname => '', | |
235 | :resolve_domain => 'testdomain.', | |
236 | :resolve_search => '', | |
237 | :expect => 'testdomain' | |
238 | }, | |
239 | { | |
240 | :scenario => 'when there is only a resolve search', | |
241 | :hostname => '', | |
242 | :dnsdomainname => '', | |
243 | :resolve_domain => '', | |
244 | :resolve_search => 'testdomain.', | |
245 | :expect => 'testdomain' | |
246 | }, | |
247 | { | |
248 | :scenario => 'when there is no information available', | |
249 | :hostname => '', | |
250 | :dnsdomainname => '', | |
251 | :resolve_domain => '', | |
252 | :resolve_search => '', | |
253 | :expect => nil | |
254 | } | |
217 | 255 | ].each do |scenario| |
218 | 256 | |
219 | describe "scenarios" do | |
220 | before(:each) do | |
221 | Facter::Util::Resolution.stubs(:exec).with("hostname -f").returns(scenario[:hostname]) | |
222 | Facter::Util::Resolution.stubs(:exec).with("dnsdomainname").returns(scenario[:dnsdomainname]) | |
223 | @mock_file = mock() | |
224 | File.stubs(:open).with("/etc/resolv.conf").yields(@mock_file) | |
225 | lines = [ | |
226 | "search #{scenario[:resolve_search]}", | |
227 | "domain #{scenario[:resolve_domain]}", | |
228 | ] | |
229 | @mock_file.stubs(:each).multiple_yields(*lines) | |
257 | describe scenario[:scenario] do | |
258 | before(:each) do | |
259 | Facter::Util::Resolution.stubs(:exec).with("hostname -f 2> /dev/null").returns(scenario[:hostname]) | |
260 | Facter::Util::Resolution.stubs(:exec).with("dnsdomainname 2> /dev/null").returns(scenario[:dnsdomainname]) | |
261 | resolv_conf_contains( | |
262 | "search #{scenario[:resolve_search]}", | |
263 | "domain #{scenario[:resolve_domain]}" | |
264 | ) | |
230 | 265 | end |
231 | 266 | |
232 | 267 | it "should remove trailing dots" do |
237 | 272 | Facter.fact(:domain).value.should == scenario[:expect] |
238 | 273 | end |
239 | 274 | end |
240 | end | |
275 | end | |
241 | 276 | end |
242 | 277 | end |
243 | 278 | end |
0 | 0 | #! /usr/bin/env ruby |
1 | 1 | |
2 | 2 | require 'spec_helper' |
3 | require 'shared_formats/parses' | |
3 | 4 | require 'facter/util/ip' |
5 | ||
6 | shared_examples_for "netmask_* from ifconfig output" do |platform, interface, address, fixture| | |
7 | it "correctly on #{platform} interface #{interface}" do | |
8 | Facter::Util::IP.stubs(:exec_ifconfig).returns(my_fixture_read(fixture)) | |
9 | Facter::Util::IP.stubs(:get_output_for_interface_and_label). | |
10 | returns(my_fixture_read("#{fixture}.#{interface}")) | |
11 | Facter.collection.internal_loader.load(:interfaces) | |
12 | ||
13 | fact = Facter.fact("netmask_#{interface}".intern) | |
14 | fact.value.should eq(address) | |
15 | end | |
16 | end | |
4 | 17 | |
5 | 18 | describe "Per Interface IP facts" do |
6 | 19 | it "should replace the ':' in an interface list with '_'" do |
18 | 31 | Facter.fact(:interfaces).value.should == %{Local_Area_Connection,Loopback__Pseudo_Interface____1_} |
19 | 32 | end |
20 | 33 | end |
34 | ||
35 | describe "Netmask handling on Linux" do | |
36 | before :each do | |
37 | Facter.fact(:kernel).stubs(:value).returns("Linux") | |
38 | end | |
39 | ||
40 | example_behavior_for "netmask_* from ifconfig output", | |
41 | "Archlinux (net-tools 1.60)", "em1", | |
42 | "255.255.255.0", "ifconfig_net_tools_1.60.txt" | |
43 | example_behavior_for "netmask_* from ifconfig output", | |
44 | "Archlinux (net-tools 1.60)", "lo", | |
45 | "255.0.0.0", "ifconfig_net_tools_1.60.txt" | |
46 | end |
27 | 27 | "Ubuntu 12.04", "10.87.80.110", "ifconfig_ubuntu_1204.txt" |
28 | 28 | example_behavior_for "ifconfig output", |
29 | 29 | "Fedora 17", "131.252.209.153", "ifconfig_net_tools_1.60.txt" |
30 | example_behavior_for "ifconfig output", | |
31 | "Linux with multiple loopback addresses", | |
32 | "10.0.222.20", | |
33 | "ifconfig_multiple_127_addresses.txt" | |
30 | 34 | end |
31 | 35 | end |
0 | #! /usr/bin/env ruby | |
1 | ||
2 | require 'spec_helper' | |
3 | require 'shared_formats/parses' | |
4 | require 'facter/util/ip' | |
5 | ||
6 | shared_examples_for "netmask from ifconfig output" do |platform, address, fixture| | |
7 | it "correctly on #{platform}" do | |
8 | Facter::Util::IP.stubs(:exec_ifconfig).returns(my_fixture_read(fixture)) | |
9 | Facter.collection.internal_loader.load(:netmask) | |
10 | ||
11 | Facter.fact(:netmask).value.should eq(address) | |
12 | end | |
13 | end | |
14 | ||
15 | describe "netmask fact" do | |
16 | before :each do | |
17 | Facter.fact(:kernel).stubs(:value).returns("Linux") | |
18 | end | |
19 | ||
20 | context "on Linux" do | |
21 | example_behavior_for "netmask from ifconfig output", | |
22 | "Archlinux (net-tools 1.60)", "255.255.255.0", | |
23 | "ifconfig_net_tools_1.60.txt" | |
24 | example_behavior_for "netmask from ifconfig output", | |
25 | "Ubuntu 12.04", "255.255.255.255", | |
26 | "ifconfig_ubuntu_1204.txt" | |
27 | end | |
28 | end |
28 | 28 | describe "2003" do |
29 | 29 | before :each do |
30 | 30 | proc = stubs 'proc' |
31 | proc.stubs(:NumberOfLogicalProcessors).raises(RuntimeError) | |
32 | 31 | proc.stubs(:Name).returns("Intel(R) Celeron(R) processor") |
33 | 32 | |
34 | 33 | load(Array.new(2, proc)) |
35 | 34 | end |
36 | 35 | |
37 | 36 | it "should count 2 processors" do |
37 | proc.expects(:NumberOfLogicalProcessors).never | |
38 | ||
38 | 39 | Facter.fact(:processorcount).value.should == "2" |
39 | 40 | end |
40 | 41 |
684 | 684 | it "should try to run the command and return output of a shell-builtin" do |
685 | 685 | Facter::Util::Resolution.expects(:expand_command).with(%q{echo foo}).returns nil |
686 | 686 | Facter::Util::Resolution.expects(:`).with(%q{echo foo}).returns 'foo' |
687 | Facter.expects(:warnonce).with('Using Facter::Util::Resolution.exec with a shell built-in is deprecated. Most built-ins can be replaced with native ruby commands. If you really have to run a built-in, pass "cmd /c your_builtin" as a command') | |
687 | Facter.expects(:warnonce).with 'Using Facter::Util::Resolution.exec with a shell built-in is deprecated. Most built-ins can be replaced with native ruby commands. If you really have to run a built-in, pass "cmd /c your_builtin" as a command (command responsible for this message was "echo foo")' | |
688 | 688 | Facter::Util::Resolution.exec(%q{echo foo}).should == 'foo' |
689 | 689 | end |
690 | 690 | it "should try to run the command and return nil if not shell-builtin" do |
146 | 146 | end |
147 | 147 | end |
148 | 148 | |
149 | it "reads dmi entries as ascii data" do | |
150 | entries_file = my_fixture('invalid_unicode_dmi_entries') | |
151 | expected_contents = 'Virtual' | |
152 | ||
153 | entries = Facter::Util::Virtual.read_sysfs_dmi_entries(entries_file) | |
154 | ||
155 | entries.should =~ /#{expected_contents}/ | |
156 | end | |
157 | ||
149 | 158 | it "should identify vserver_host when /proc/virtual exists" do |
150 | 159 | Facter::Util::Virtual.expects(:vserver?).returns(true) |
151 | 160 | FileTest.stubs(:exists?).with("/proc/virtual").returns(true) |
204 | 204 | end |
205 | 205 | end |
206 | 206 | end |
207 | ||
208 | it "(#20236) is vmware when dmidecode contains vmware and lspci returns insufficient information" do | |
209 | Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns("garbage\ninformation\n") | |
210 | Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns("On Board Device 1 Information\nType: Video\nStatus: Disabled\nDescription: VMware SVGA II") | |
211 | Facter.fact(:virtual).value.should eq("vmware") | |
212 | end | |
207 | 213 | end |
208 | 214 | |
209 | 215 | describe "on Solaris" do |
271 | 277 | require 'facter/util/wmi' |
272 | 278 | before do |
273 | 279 | Facter.fact(:kernel).stubs(:value).returns("windows") |
280 | Facter.fact(:architecture).stubs(:value).returns("x64") | |
274 | 281 | end |
275 | 282 | |
276 | 283 | it "should be kvm with KVM model name from Win32_ComputerSystem" do |