ohai 8.7.0 → 8.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -3
- data/lib/ohai/application.rb +3 -1
- data/lib/ohai/loader.rb +4 -3
- data/lib/ohai/mixin/dmi_decode.rb +47 -0
- data/lib/ohai/mixin/os.rb +2 -0
- data/lib/ohai/plugins/aix/kernel.rb +2 -1
- data/lib/ohai/plugins/{freebsd → bsd}/filesystem.rb +21 -3
- data/lib/ohai/plugins/bsd/virtualization.rb +80 -0
- data/lib/ohai/plugins/dragonflybsd/cpu.rb +58 -0
- data/lib/ohai/plugins/dragonflybsd/memory.rb +60 -0
- data/lib/ohai/plugins/dragonflybsd/network.rb +126 -0
- data/lib/ohai/plugins/dragonflybsd/os.rb +32 -0
- data/lib/ohai/plugins/dragonflybsd/platform.rb +29 -0
- data/lib/ohai/plugins/freebsd/cpu.rb +14 -8
- data/lib/ohai/plugins/freebsd/os.rb +1 -1
- data/lib/ohai/plugins/hostname.rb +1 -1
- data/lib/ohai/plugins/kernel.rb +12 -0
- data/lib/ohai/plugins/linux/virtualization.rb +8 -37
- data/lib/ohai/plugins/network_listeners.rb +5 -0
- data/lib/ohai/plugins/ps.rb +2 -2
- data/lib/ohai/plugins/solaris2/filesystem.rb +9 -1
- data/lib/ohai/plugins/uptime.rb +1 -1
- data/lib/ohai/plugins/virtualbox.rb +44 -0
- data/lib/ohai/plugins/windows/cpu.rb +26 -27
- data/lib/ohai/plugins/windows/virtualization.rb +29 -17
- data/lib/ohai/system.rb +1 -1
- data/lib/ohai/version.rb +1 -1
- data/ohai.gemspec +50 -0
- data/spec/functional/loader_spec.rb +53 -0
- data/spec/unit/loader_spec.rb +51 -53
- data/spec/unit/plugins/aix/kernel_spec.rb +5 -0
- data/spec/unit/plugins/bsd/filesystem_spec.rb +126 -0
- data/spec/unit/plugins/{freebsd → bsd}/virtualization_spec.rb +7 -4
- data/spec/unit/plugins/freebsd/cpu_spec.rb +60 -14
- data/spec/unit/plugins/linux/virtualization_spec.rb +58 -5
- data/spec/unit/plugins/solaris2/filesystem.rb +84 -0
- data/spec/unit/plugins/virtualbox_spec.rb +88 -0
- data/spec/unit/plugins/windows/cpu_spec.rb +3 -1
- data/spec/unit/plugins/windows/virtualization_spec.rb +182 -32
- metadata +21 -26
- data/lib/ohai/plugins/freebsd/virtualization.rb +0 -94
- data/lib/ohai/plugins/netbsd/filesystem.rb +0 -57
- data/lib/ohai/plugins/netbsd/virtualization.rb +0 -68
- data/lib/ohai/plugins/openbsd/filesystem.rb +0 -57
- data/lib/ohai/plugins/openbsd/virtualization.rb +0 -68
@@ -1,6 +1,8 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Pavel Yudin (<pyudin@parallels.com>)
|
3
|
+
# Author:: Tim Smith (<tsmith@chef.io>)
|
3
4
|
# Copyright:: Copyright (c) 2015 Pavel Yudin
|
5
|
+
# Copyright:: Copyright (c) 2015 Chef Software, Inc.
|
4
6
|
# License:: Apache License, Version 2.0
|
5
7
|
#
|
6
8
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -18,47 +20,195 @@
|
|
18
20
|
|
19
21
|
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper.rb')
|
20
22
|
|
21
|
-
describe Ohai::System,
|
22
|
-
let(:plugin) { get_plugin(
|
23
|
+
describe Ohai::System, 'Windows virtualization platform' do
|
24
|
+
let(:plugin) { get_plugin('windows/virtualization') }
|
23
25
|
|
24
26
|
before(:each) do
|
25
27
|
allow(plugin).to receive(:collect_os).and_return(:windows)
|
26
|
-
allow(plugin).to receive(:powershell_exists?).and_return(false)
|
27
28
|
end
|
28
29
|
|
29
|
-
|
30
|
-
it
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
30
|
+
context 'when running on vmware' do
|
31
|
+
it 'system is vmware' do
|
32
|
+
allow_any_instance_of(WmiLite::Wmi).to receive(:instances_of).with('Win32_BIOS').and_return([{ 'bioscharacteristics' => [4, 7, 8, 9, 10, 11, 12, 14, 15, 16, 19, 26, 27, 28, 29, 30, 32, 39, 40, 41, 42, 50, 57, 58],
|
33
|
+
'biosversion' => ['INTEL - 6040000', 'PhoenixBIOS 4.0 Release 6.0 '],
|
34
|
+
'buildnumber' => nil,
|
35
|
+
'caption' => 'PhoenixBIOS 4.0 Release 6.0 ',
|
36
|
+
'codeset' => nil, 'currentlanguage' => nil,
|
37
|
+
'description' => 'PhoenixBIOS 4.0 Release 6.0 ',
|
38
|
+
'identificationcode' => nil,
|
39
|
+
'installablelanguages' => nil,
|
40
|
+
'installdate' => nil,
|
41
|
+
'languageedition' => nil,
|
42
|
+
'listoflanguages' => nil,
|
43
|
+
'manufacturer' => 'Phoenix Technologies LTD',
|
44
|
+
'name' => 'PhoenixBIOS 4.0 Release 6.0 ',
|
45
|
+
'othertargetos' => nil,
|
46
|
+
'primarybios' => true,
|
47
|
+
'releasedate' => '20130731000000.000000+000',
|
48
|
+
'serialnumber' => 'VMware-56 4d 65 24 ac cf ec 72-fa 29 b2 7d 8f df b2 7a',
|
49
|
+
'smbiosbiosversion' => '6.00',
|
50
|
+
'smbiosmajorversion' => 2,
|
51
|
+
'smbiosminorversion' => 4,
|
52
|
+
'smbiospresent' => true,
|
53
|
+
'softwareelementid' => 'PhoenixBIOS 4.0 Release 6.0 ',
|
54
|
+
'softwareelementstate' => 3,
|
55
|
+
'status' => 'OK',
|
56
|
+
'targetoperatingsystem' => 0,
|
57
|
+
'version' => 'INTEL - 6040000'
|
58
|
+
}])
|
42
59
|
plugin.run
|
43
|
-
expect(plugin[:virtualization][:system]).to eq(
|
44
|
-
expect(plugin[:virtualization][:role]).to eq(
|
45
|
-
expect(plugin[:virtualization][:systems][:
|
60
|
+
expect(plugin[:virtualization][:system]).to eq('vmware')
|
61
|
+
expect(plugin[:virtualization][:role]).to eq('guest')
|
62
|
+
expect(plugin[:virtualization][:systems][:vmware]).to eq('guest')
|
46
63
|
end
|
64
|
+
end
|
65
|
+
|
66
|
+
context 'when running on parallels desktop' do
|
67
|
+
it 'system is parallels' do
|
68
|
+
allow_any_instance_of(WmiLite::Wmi).to receive(:instances_of).with('Win32_BIOS').and_return([{ 'bioscharacteristics' => [4, 7, 9, 10, 15, 24, 25, 27, 28, 29, 30, 32, 42, 44, 48, 49, 51, 64, 65, 67],
|
69
|
+
'biosversion' => ['PRLS - 1'],
|
70
|
+
'buildnumber' => nil,
|
71
|
+
'caption' => 'Default System BIOS',
|
72
|
+
'codeset' => nil,
|
73
|
+
'currentlanguage' => nil,
|
74
|
+
'description' => 'Default System BIOS',
|
75
|
+
'identificationcode' => nil,
|
76
|
+
'installablelanguages' => nil,
|
77
|
+
'installdate' => nil,
|
78
|
+
'languageedition' => nil,
|
79
|
+
'listoflanguages' => nil,
|
80
|
+
'manufacturer' => 'Parallels Software International Inc.',
|
81
|
+
'name' => 'Default System BIOS',
|
82
|
+
'othertargetos' => nil,
|
83
|
+
'primarybios' => true,
|
84
|
+
'releasedate' => '20151005000000.000000+000',
|
85
|
+
'serialnumber' => 'Parallels-82 75 A0 A0 9B B4 47 7C 87 A9 D9 E1 2B 90 4B 1F',
|
86
|
+
'smbiosbiosversion' => '11.0.2 (31348)',
|
87
|
+
'smbiosmajorversion' => 2,
|
88
|
+
'smbiosminorversion' => 7,
|
89
|
+
'smbiospresent' => true,
|
90
|
+
'softwareelementid' => 'Default System BIOS',
|
91
|
+
'softwareelementstate' => 3,
|
92
|
+
'status' => 'OK',
|
93
|
+
'targetoperatingsystem' => 0,
|
94
|
+
'version' => 'PRLS - 1'
|
95
|
+
}])
|
96
|
+
plugin.run
|
97
|
+
expect(plugin[:virtualization][:system]).to eq('parallels')
|
98
|
+
expect(plugin[:virtualization][:role]).to eq('guest')
|
99
|
+
expect(plugin[:virtualization][:systems][:parallels]).to eq('guest')
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
context 'when running on kvm' do
|
104
|
+
it 'system is kvm' do
|
105
|
+
allow_any_instance_of(WmiLite::Wmi).to receive(:instances_of).with('Win32_BIOS').and_return([{ 'bioscharacteristics' => [3, 42, 48, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79],
|
106
|
+
'biosversion' => ['BOCHS - 1'],
|
107
|
+
'buildnumber' => nil,
|
108
|
+
'caption' => 'Default System BIOS',
|
109
|
+
'codeset' => nil,
|
110
|
+
'currentlanguage' => nil,
|
111
|
+
'description' => 'Default System BIOS',
|
112
|
+
'identificationcode' => nil,
|
113
|
+
'installablelanguages' => nil,
|
114
|
+
'installdate' => nil,
|
115
|
+
'languageedition' => nil,
|
116
|
+
'listoflanguages' => nil,
|
117
|
+
'manufacturer' => 'Bochs',
|
118
|
+
'name' => 'Default System BIOS',
|
119
|
+
'othertargetos' => nil,
|
120
|
+
'primarybios' => true,
|
121
|
+
'releasedate' => '20110101******.******+***',
|
122
|
+
'serialnumber' => nil,
|
123
|
+
'smbiosbiosversion' => 'Bochs',
|
124
|
+
'smbiosmajorversion' => 2,
|
125
|
+
'smbiosminorversion' => 4,
|
126
|
+
'smbiospresent' => true,
|
127
|
+
'softwareelementid' => 'Default System BIOS',
|
128
|
+
'softwareelementstate' => 3,
|
129
|
+
'status' => 'OK',
|
130
|
+
'targetoperatingsystem' => 0, 'version' => 'BOCHS -1'
|
131
|
+
}])
|
132
|
+
plugin.run
|
133
|
+
expect(plugin[:virtualization][:system]).to eq('kvm')
|
134
|
+
expect(plugin[:virtualization][:role]).to eq('guest')
|
135
|
+
expect(plugin[:virtualization][:systems][:kvm]).to eq('guest')
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
context 'when running on virtualbox' do
|
140
|
+
it 'system is vbox' do
|
141
|
+
allow_any_instance_of(WmiLite::Wmi).to receive(:instances_of).with('Win32_BIOS').and_return([{ 'bioscharacteristics' => [4, 7, 15, 16, 27, 30, 32],
|
142
|
+
'biosversion' => ['VBOX - 1'],
|
143
|
+
'buildnumber' => nil,
|
144
|
+
'caption' => 'Default System BIOS',
|
145
|
+
'codeset' => nil,
|
146
|
+
'currentlanguage' => nil,
|
147
|
+
'description' => 'Default System BIOS',
|
148
|
+
'identificationcode' => nil,
|
149
|
+
'installablelanguages' => nil,
|
150
|
+
'installdate' => nil,
|
151
|
+
'languageedition' => nil,
|
152
|
+
'listoflanguages' => nil,
|
153
|
+
'manufacturer' => 'innotek GmbH',
|
154
|
+
'name' => 'Default System BIOS',
|
155
|
+
'othertargetos' => nil,
|
156
|
+
'primarybios' => true,
|
157
|
+
'releasedate' => '20061201000000.000000+000',
|
158
|
+
'serialnumber' => '0',
|
159
|
+
'smbiosbiosversion' => 'VirtualBox',
|
160
|
+
'smbiosmajorversion' => 2,
|
161
|
+
'smbiosminorversion' => 5,
|
162
|
+
'smbiospresent' => true,
|
163
|
+
'softwareelementid' => 'Default System BIOS',
|
164
|
+
'softwareelementstate' => 3,
|
165
|
+
'status' => 'OK',
|
166
|
+
'targetoperatingsystem' => 0,
|
167
|
+
'version' => 'VBOX - 1'
|
168
|
+
}])
|
169
|
+
plugin.run
|
170
|
+
expect(plugin[:virtualization][:system]).to eq('vbox')
|
171
|
+
expect(plugin[:virtualization][:role]).to eq('guest')
|
172
|
+
expect(plugin[:virtualization][:systems][:vbox]).to eq('guest')
|
173
|
+
end
|
174
|
+
end
|
47
175
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
176
|
+
context 'when running on a hardware system' do
|
177
|
+
it 'does not set virtualization attributes' do
|
178
|
+
allow_any_instance_of(WmiLite::Wmi).to receive(:instances_of).with('Win32_BIOS').and_return([{ 'bioscharacteristics' => [7, 11, 12, 15, 16, 17, 19, 23, 24, 25, 26, 27, 28, 29, 32, 33, 40, 42, 43],
|
179
|
+
'biosversion' => ['DELL - 1072009', 'A10', 'American Megatrends - 4028D'],
|
180
|
+
'buildnumber' => nil,
|
181
|
+
'caption' => 'A10',
|
182
|
+
'codeset' => nil,
|
183
|
+
'currentlanguage' => nil,
|
184
|
+
'description' => 'A10',
|
185
|
+
'embeddedcontrollermajorversion' => 255,
|
186
|
+
'embeddedcontrollerminorversion' => 255,
|
187
|
+
'identificationcode' => nil,
|
188
|
+
'installablelanguages' => nil,
|
189
|
+
'installdate' => nil,
|
190
|
+
'languageedition' => nil,
|
191
|
+
'listoflanguages' => nil,
|
192
|
+
'manufacturer' => 'Dell Inc.',
|
193
|
+
'name' => 'A10',
|
194
|
+
'othertargetos' => nil,
|
195
|
+
'primarybios' => true,
|
196
|
+
'releasedate' => '20130513000000.000000+000',
|
197
|
+
'serialnumber' => '87GBNY1',
|
198
|
+
'smbiosbiosversion' => 'A10',
|
199
|
+
'smbiosmajorversion' => 2,
|
200
|
+
'smbiosminorversion' => 7,
|
201
|
+
'smbiospresent' => true,
|
202
|
+
'softwareelementid' => 'A10',
|
203
|
+
'softwareelementstate' => 3,
|
204
|
+
'status' => 'OK',
|
205
|
+
'systembiosmajorversion' => 4,
|
206
|
+
'systembiosminorversion' => 6,
|
207
|
+
'targetoperatingsystem' => 0,
|
208
|
+
'version' => 'DELL - 1072009'
|
209
|
+
}])
|
60
210
|
plugin.run
|
61
|
-
expect(plugin[:virtualization]).to eq(
|
211
|
+
expect(plugin[:virtualization]).to eq('systems' => {})
|
62
212
|
end
|
63
213
|
end
|
64
214
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ohai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.
|
4
|
+
version: 8.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Jacob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mime-types
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '3.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '3.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: systemu
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -254,20 +254,6 @@ dependencies:
|
|
254
254
|
- - ">="
|
255
255
|
- !ruby/object:Gem::Version
|
256
256
|
version: '0'
|
257
|
-
- !ruby/object:Gem::Dependency
|
258
|
-
name: chef
|
259
|
-
requirement: !ruby/object:Gem::Requirement
|
260
|
-
requirements:
|
261
|
-
- - ">="
|
262
|
-
- !ruby/object:Gem::Version
|
263
|
-
version: '0'
|
264
|
-
type: :development
|
265
|
-
prerelease: false
|
266
|
-
version_requirements: !ruby/object:Gem::Requirement
|
267
|
-
requirements:
|
268
|
-
- - ">="
|
269
|
-
- !ruby/object:Gem::Version
|
270
|
-
version: '0'
|
271
257
|
description: Ohai profiles your system and emits JSON
|
272
258
|
email: adam@chef.io
|
273
259
|
executables:
|
@@ -296,6 +282,7 @@ files:
|
|
296
282
|
- lib/ohai/mash.rb
|
297
283
|
- lib/ohai/mixin/command.rb
|
298
284
|
- lib/ohai/mixin/constant_helper.rb
|
285
|
+
- lib/ohai/mixin/dmi_decode.rb
|
299
286
|
- lib/ohai/mixin/ec2_metadata.rb
|
300
287
|
- lib/ohai/mixin/gce_metadata.rb
|
301
288
|
- lib/ohai/mixin/network_constants.rb
|
@@ -313,6 +300,8 @@ files:
|
|
313
300
|
- lib/ohai/plugins/aix/uptime.rb
|
314
301
|
- lib/ohai/plugins/aix/virtualization.rb
|
315
302
|
- lib/ohai/plugins/azure.rb
|
303
|
+
- lib/ohai/plugins/bsd/filesystem.rb
|
304
|
+
- lib/ohai/plugins/bsd/virtualization.rb
|
316
305
|
- lib/ohai/plugins/c.rb
|
317
306
|
- lib/ohai/plugins/chef.rb
|
318
307
|
- lib/ohai/plugins/cloud.rb
|
@@ -328,17 +317,20 @@ files:
|
|
328
317
|
- lib/ohai/plugins/darwin/virtualization.rb
|
329
318
|
- lib/ohai/plugins/digital_ocean.rb
|
330
319
|
- lib/ohai/plugins/dmi.rb
|
320
|
+
- lib/ohai/plugins/dragonflybsd/cpu.rb
|
321
|
+
- lib/ohai/plugins/dragonflybsd/memory.rb
|
322
|
+
- lib/ohai/plugins/dragonflybsd/network.rb
|
323
|
+
- lib/ohai/plugins/dragonflybsd/os.rb
|
324
|
+
- lib/ohai/plugins/dragonflybsd/platform.rb
|
331
325
|
- lib/ohai/plugins/ec2.rb
|
332
326
|
- lib/ohai/plugins/elixir.rb
|
333
327
|
- lib/ohai/plugins/erlang.rb
|
334
328
|
- lib/ohai/plugins/eucalyptus.rb
|
335
329
|
- lib/ohai/plugins/freebsd/cpu.rb
|
336
|
-
- lib/ohai/plugins/freebsd/filesystem.rb
|
337
330
|
- lib/ohai/plugins/freebsd/memory.rb
|
338
331
|
- lib/ohai/plugins/freebsd/network.rb
|
339
332
|
- lib/ohai/plugins/freebsd/os.rb
|
340
333
|
- lib/ohai/plugins/freebsd/platform.rb
|
341
|
-
- lib/ohai/plugins/freebsd/virtualization.rb
|
342
334
|
- lib/ohai/plugins/gce.rb
|
343
335
|
- lib/ohai/plugins/go.rb
|
344
336
|
- lib/ohai/plugins/groovy.rb
|
@@ -364,22 +356,18 @@ files:
|
|
364
356
|
- lib/ohai/plugins/lua.rb
|
365
357
|
- lib/ohai/plugins/mono.rb
|
366
358
|
- lib/ohai/plugins/netbsd/cpu.rb
|
367
|
-
- lib/ohai/plugins/netbsd/filesystem.rb
|
368
359
|
- lib/ohai/plugins/netbsd/memory.rb
|
369
360
|
- lib/ohai/plugins/netbsd/network.rb
|
370
361
|
- lib/ohai/plugins/netbsd/platform.rb
|
371
|
-
- lib/ohai/plugins/netbsd/virtualization.rb
|
372
362
|
- lib/ohai/plugins/network.rb
|
373
363
|
- lib/ohai/plugins/network_listeners.rb
|
374
364
|
- lib/ohai/plugins/nodejs.rb
|
375
365
|
- lib/ohai/plugins/ohai.rb
|
376
366
|
- lib/ohai/plugins/ohai_time.rb
|
377
367
|
- lib/ohai/plugins/openbsd/cpu.rb
|
378
|
-
- lib/ohai/plugins/openbsd/filesystem.rb
|
379
368
|
- lib/ohai/plugins/openbsd/memory.rb
|
380
369
|
- lib/ohai/plugins/openbsd/network.rb
|
381
370
|
- lib/ohai/plugins/openbsd/platform.rb
|
382
|
-
- lib/ohai/plugins/openbsd/virtualization.rb
|
383
371
|
- lib/ohai/plugins/openstack.rb
|
384
372
|
- lib/ohai/plugins/os.rb
|
385
373
|
- lib/ohai/plugins/passwd.rb
|
@@ -410,6 +398,7 @@ files:
|
|
410
398
|
- lib/ohai/plugins/solaris2/zpools.rb
|
411
399
|
- lib/ohai/plugins/ssh_host_key.rb
|
412
400
|
- lib/ohai/plugins/uptime.rb
|
401
|
+
- lib/ohai/plugins/virtualbox.rb
|
413
402
|
- lib/ohai/plugins/virtualization.rb
|
414
403
|
- lib/ohai/plugins/vmware.rb
|
415
404
|
- lib/ohai/plugins/windows/cpu.rb
|
@@ -427,6 +416,7 @@ files:
|
|
427
416
|
- lib/ohai/util/win32.rb
|
428
417
|
- lib/ohai/util/win32/group_helper.rb
|
429
418
|
- lib/ohai/version.rb
|
419
|
+
- ohai.gemspec
|
430
420
|
- spec/data/plugins/___lib64___libc.so.6.output
|
431
421
|
- spec/data/plugins/___lib___libc.so.6.output
|
432
422
|
- spec/data/plugins/cc.output
|
@@ -449,6 +439,7 @@ files:
|
|
449
439
|
- spec/data/plugins/what.output
|
450
440
|
- spec/data/plugins/xlc.output
|
451
441
|
- spec/functional/application_spec.rb
|
442
|
+
- spec/functional/loader_spec.rb
|
452
443
|
- spec/functional/plugins/powershell_spec.rb
|
453
444
|
- spec/functional/plugins/root_group_spec.rb
|
454
445
|
- spec/ohai_spec.rb
|
@@ -477,6 +468,8 @@ files:
|
|
477
468
|
- spec/unit/plugins/aix/uptime_spec.rb
|
478
469
|
- spec/unit/plugins/aix/virtualization_spec.rb
|
479
470
|
- spec/unit/plugins/azure_spec.rb
|
471
|
+
- spec/unit/plugins/bsd/filesystem_spec.rb
|
472
|
+
- spec/unit/plugins/bsd/virtualization_spec.rb
|
480
473
|
- spec/unit/plugins/c_spec.rb
|
481
474
|
- spec/unit/plugins/chef_spec.rb
|
482
475
|
- spec/unit/plugins/cloud_spec.rb
|
@@ -504,7 +497,6 @@ files:
|
|
504
497
|
- spec/unit/plugins/freebsd/kernel_spec.rb
|
505
498
|
- spec/unit/plugins/freebsd/os_spec.rb
|
506
499
|
- spec/unit/plugins/freebsd/platform_spec.rb
|
507
|
-
- spec/unit/plugins/freebsd/virtualization_spec.rb
|
508
500
|
- spec/unit/plugins/gce_spec.rb
|
509
501
|
- spec/unit/plugins/go_spec.rb
|
510
502
|
- spec/unit/plugins/groovy_spec.rb
|
@@ -555,6 +547,7 @@ files:
|
|
555
547
|
- spec/unit/plugins/softlayer_spec.rb
|
556
548
|
- spec/unit/plugins/solaris2/cpu_spec.rb
|
557
549
|
- spec/unit/plugins/solaris2/dmi_spec.rb
|
550
|
+
- spec/unit/plugins/solaris2/filesystem.rb
|
558
551
|
- spec/unit/plugins/solaris2/hostname_spec.rb
|
559
552
|
- spec/unit/plugins/solaris2/kernel_spec.rb
|
560
553
|
- spec/unit/plugins/solaris2/memory_spec.rb
|
@@ -563,6 +556,7 @@ files:
|
|
563
556
|
- spec/unit/plugins/solaris2/virtualization_spec.rb
|
564
557
|
- spec/unit/plugins/solaris2/zpools_spec.rb
|
565
558
|
- spec/unit/plugins/ssh_host_keys_spec.rb
|
559
|
+
- spec/unit/plugins/virtualbox_spec.rb
|
566
560
|
- spec/unit/plugins/vmware_spec.rb
|
567
561
|
- spec/unit/plugins/windows/cpu_spec.rb
|
568
562
|
- spec/unit/plugins/windows/memory_spec.rb
|
@@ -592,8 +586,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
592
586
|
version: '0'
|
593
587
|
requirements: []
|
594
588
|
rubyforge_project:
|
595
|
-
rubygems_version: 2.
|
589
|
+
rubygems_version: 2.2.2
|
596
590
|
signing_key:
|
597
591
|
specification_version: 4
|
598
592
|
summary: Ohai profiles your system and emits JSON
|
599
593
|
test_files: []
|
594
|
+
has_rdoc:
|
@@ -1,94 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Author:: Bryan McLellan (btm@loftninjas.org)
|
3
|
-
# Copyright:: Copyright (c) 2009 Bryan McLellan
|
4
|
-
# License:: Apache License, Version 2.0
|
5
|
-
#
|
6
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
-
# you may not use this file except in compliance with the License.
|
8
|
-
# You may obtain a copy of the License at
|
9
|
-
#
|
10
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
-
#
|
12
|
-
# Unless required by applicable law or agreed to in writing, software
|
13
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
-
# See the License for the specific language governing permissions and
|
16
|
-
# limitations under the License.
|
17
|
-
#
|
18
|
-
|
19
|
-
Ohai.plugin(:Virtualization) do
|
20
|
-
provides "virtualization"
|
21
|
-
|
22
|
-
collect_data(:freebsd) do
|
23
|
-
virtualization Mash.new
|
24
|
-
|
25
|
-
so = shell_out("sysctl -n security.jail.jailed")
|
26
|
-
if so.stdout.split($/)[0].to_i == 1
|
27
|
-
virtualization[:system] = "jail"
|
28
|
-
virtualization[:role] = "guest"
|
29
|
-
end
|
30
|
-
|
31
|
-
# detect from modules
|
32
|
-
so = shell_out("#{ Ohai.abs_path( "/sbin/kldstat" )}")
|
33
|
-
so.stdout.lines do |line|
|
34
|
-
case line
|
35
|
-
when /vboxdrv/
|
36
|
-
virtualization[:system] = "vbox"
|
37
|
-
virtualization[:role] = "host"
|
38
|
-
when /vboxguest/
|
39
|
-
virtualization[:system] = "vbox"
|
40
|
-
virtualization[:role] = "guest"
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
# XXX doesn't work when jail is there but not running (ezjail-admin stop)
|
45
|
-
so = shell_out("jls -n")
|
46
|
-
if ( so.stdout || "" ).lines.count >= 1
|
47
|
-
virtualization[:system] = "jail"
|
48
|
-
virtualization[:role] = "host"
|
49
|
-
end
|
50
|
-
|
51
|
-
# KVM Host support for FreeBSD is in development
|
52
|
-
# http://feanor.sssup.it/~fabio/freebsd/lkvm/
|
53
|
-
|
54
|
-
# Detect KVM/QEMU from cpu, report as KVM
|
55
|
-
# hw.model: QEMU Virtual CPU version 0.9.1
|
56
|
-
so = shell_out("sysctl -n hw.model")
|
57
|
-
if so.stdout.split($/)[0] =~ /QEMU Virtual CPU|Common KVM processor|Common 32-bit KVM processor/
|
58
|
-
virtualization[:system] = "kvm"
|
59
|
-
virtualization[:role] = "guest"
|
60
|
-
end
|
61
|
-
|
62
|
-
# http://www.dmo.ca/blog/detecting-virtualization-on-linux
|
63
|
-
if File.exists?("/usr/local/sbin/dmidecode")
|
64
|
-
so = shell_out("dmidecode")
|
65
|
-
found_virt_manufacturer = nil
|
66
|
-
found_virt_product = nil
|
67
|
-
so.stdout.lines do |line|
|
68
|
-
case line
|
69
|
-
when /Manufacturer: Microsoft/
|
70
|
-
found_virt_manufacturer = "microsoft"
|
71
|
-
when /Product Name: Virtual Machine/
|
72
|
-
found_virt_product = "microsoft"
|
73
|
-
when /Version: 5.0/
|
74
|
-
if found_virt_manufacturer == "microsoft" && found_virt_product == "microsoft"
|
75
|
-
virtualization[:system] = "virtualpc"
|
76
|
-
virtualization[:role] = "guest"
|
77
|
-
end
|
78
|
-
when /Version: VS2005R2/
|
79
|
-
if found_virt_manufacturer == "microsoft" && found_virt_product == "microsoft"
|
80
|
-
virtualization[:system] = "virtualserver"
|
81
|
-
virtualization[:role] = "guest"
|
82
|
-
end
|
83
|
-
when /Manufacturer: VMware/
|
84
|
-
found_virt_manufacturer = "vmware"
|
85
|
-
when /Product Name: VMware Virtual Platform/
|
86
|
-
if found_virt_manufacturer == "vmware"
|
87
|
-
virtualization[:system] = "vmware"
|
88
|
-
virtualization[:role] = "guest"
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|
93
|
-
end
|
94
|
-
end
|