ohai 15.2.5 → 15.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ohai/application.rb +2 -2
- data/lib/ohai/mixin/dmi_decode.rb +4 -1
- data/lib/ohai/plugins/linux/sysctl.rb +38 -0
- data/lib/ohai/plugins/linux/virtualization.rb +11 -10
- data/lib/ohai/plugins/openstack.rb +8 -3
- data/lib/ohai/plugins/passwd.rb +4 -0
- data/lib/ohai/version.rb +1 -1
- data/spec/functional/application_spec.rb +5 -5
- data/spec/functional/loader_spec.rb +2 -2
- data/spec/functional/plugins/powershell_spec.rb +11 -5
- data/spec/functional/plugins/root_group_spec.rb +1 -1
- data/spec/functional/plugins/windows/uptime_spec.rb +3 -3
- data/spec/ohai_spec.rb +1 -1
- data/spec/spec_helper.rb +8 -8
- data/spec/support/integration_helper.rb +3 -3
- data/spec/unit/application_spec.rb +5 -5
- data/spec/unit/dsl/plugin_spec.rb +8 -7
- data/spec/unit/mixin/command_spec.rb +2 -2
- data/spec/unit/mixin/dmi_decode.rb +8 -1
- data/spec/unit/plugins/abort_spec.rb +4 -4
- data/spec/unit/plugins/aix/cpu_spec.rb +1 -1
- data/spec/unit/plugins/aix/filesystem_spec.rb +1 -1
- data/spec/unit/plugins/aix/hostname_spec.rb +2 -2
- data/spec/unit/plugins/aix/kernel_spec.rb +1 -1
- data/spec/unit/plugins/aix/memory_spec.rb +5 -5
- data/spec/unit/plugins/aix/network_spec.rb +4 -1
- data/spec/unit/plugins/aix/platform_spec.rb +4 -4
- data/spec/unit/plugins/aix/uptime_spec.rb +3 -3
- data/spec/unit/plugins/aix/virtualization_spec.rb +1 -1
- data/spec/unit/plugins/azure_spec.rb +8 -8
- data/spec/unit/plugins/bsd/filesystem_spec.rb +17 -16
- data/spec/unit/plugins/bsd/virtualization_spec.rb +1 -1
- data/spec/unit/plugins/c_spec.rb +6 -5
- data/spec/unit/plugins/chef_spec.rb +2 -2
- data/spec/unit/plugins/cloud_spec.rb +4 -4
- data/spec/unit/plugins/darwin/cpu_spec.rb +11 -11
- data/spec/unit/plugins/darwin/filesystem_spec.rb +14 -13
- data/spec/unit/plugins/darwin/hardware_spec.rb +2 -1
- data/spec/unit/plugins/darwin/hostname_spec.rb +3 -3
- data/spec/unit/plugins/darwin/kernel_spec.rb +5 -5
- data/spec/unit/plugins/darwin/memory_spec.rb +5 -5
- data/spec/unit/plugins/darwin/network_spec.rb +3 -3
- data/spec/unit/plugins/darwin/platform_spec.rb +9 -9
- data/spec/unit/plugins/darwin/virtualization_spec.rb +10 -10
- data/spec/unit/plugins/digital_ocean_spec.rb +14 -12
- data/spec/unit/plugins/dmi_spec.rb +1 -1
- data/spec/unit/plugins/docker_spec.rb +2 -2
- data/spec/unit/plugins/ec2_spec.rb +41 -30
- data/spec/unit/plugins/elixir_spec.rb +2 -2
- data/spec/unit/plugins/erlang_spec.rb +1 -1
- data/spec/unit/plugins/eucalyptus_spec.rb +17 -13
- data/spec/unit/plugins/fail_spec.rb +15 -15
- data/spec/unit/plugins/freebsd/cpu_spec.rb +2 -2
- data/spec/unit/plugins/freebsd/hostname_spec.rb +1 -1
- data/spec/unit/plugins/freebsd/kernel_spec.rb +2 -2
- data/spec/unit/plugins/freebsd/platform_spec.rb +3 -3
- data/spec/unit/plugins/gce_spec.rb +9 -7
- data/spec/unit/plugins/go_spec.rb +2 -2
- data/spec/unit/plugins/groovy_spec.rb +1 -1
- data/spec/unit/plugins/haskell_spec.rb +10 -10
- data/spec/unit/plugins/hostname_spec.rb +15 -14
- data/spec/unit/plugins/init_package_spec.rb +4 -4
- data/spec/unit/plugins/java_spec.rb +7 -3
- data/spec/unit/plugins/joyent_spec.rb +4 -4
- data/spec/unit/plugins/kernel_spec.rb +1 -1
- data/spec/unit/plugins/linux/block_device_spec.rb +2 -2
- data/spec/unit/plugins/linux/cpu_spec.rb +9 -8
- data/spec/unit/plugins/linux/filesystem_spec.rb +36 -35
- data/spec/unit/plugins/linux/fips_spec.rb +7 -5
- data/spec/unit/plugins/linux/hostname_spec.rb +4 -4
- data/spec/unit/plugins/linux/hostnamectl_spec.rb +3 -3
- data/spec/unit/plugins/linux/kernel_spec.rb +1 -1
- data/spec/unit/plugins/linux/lsb_spec.rb +18 -18
- data/spec/unit/plugins/linux/lspci_spec.rb +2 -1
- data/spec/unit/plugins/linux/machineid_spec.rb +3 -3
- data/spec/unit/plugins/linux/mdadm_spec.rb +13 -13
- data/spec/unit/plugins/linux/memory_spec.rb +39 -39
- data/spec/unit/plugins/linux/network_spec.rb +20 -19
- data/spec/unit/plugins/linux/platform_spec.rb +60 -57
- data/spec/unit/plugins/linux/sessions_spec.rb +3 -3
- data/spec/unit/plugins/linux/sysctl_spec.rb +53 -0
- data/spec/unit/plugins/linux/systemd_paths_spec.rb +3 -3
- data/spec/unit/plugins/linux/uptime_spec.rb +5 -5
- data/spec/unit/plugins/linux/virtualization_spec.rb +4 -4
- data/spec/unit/plugins/lua_spec.rb +1 -1
- data/spec/unit/plugins/mono_spec.rb +1 -1
- data/spec/unit/plugins/netbsd/hostname_spec.rb +3 -3
- data/spec/unit/plugins/netbsd/kernel_spec.rb +2 -2
- data/spec/unit/plugins/netbsd/platform_spec.rb +3 -3
- data/spec/unit/plugins/network_spec.rb +3 -3
- data/spec/unit/plugins/nodejs_spec.rb +1 -1
- data/spec/unit/plugins/ohai_spec.rb +2 -2
- data/spec/unit/plugins/ohai_time_spec.rb +4 -4
- data/spec/unit/plugins/openbsd/hostname_spec.rb +3 -3
- data/spec/unit/plugins/openbsd/kernel_spec.rb +2 -2
- data/spec/unit/plugins/openbsd/platform_spec.rb +2 -2
- data/spec/unit/plugins/openstack_spec.rb +13 -8
- data/spec/unit/plugins/os_spec.rb +12 -12
- data/spec/unit/plugins/packages_spec.rb +10 -7
- data/spec/unit/plugins/passwd_spec.rb +18 -19
- data/spec/unit/plugins/perl_spec.rb +1 -1
- data/spec/unit/plugins/php_spec.rb +1 -1
- data/spec/unit/plugins/platform_spec.rb +7 -7
- data/spec/unit/plugins/powershell_spec.rb +1 -1
- data/spec/unit/plugins/rackspace_spec.rb +25 -20
- data/spec/unit/plugins/root_group_spec.rb +14 -10
- data/spec/unit/plugins/ruby_spec.rb +2 -2
- data/spec/unit/plugins/rust_spec.rb +3 -3
- data/spec/unit/plugins/scala_spec.rb +2 -2
- data/spec/unit/plugins/scaleway_spec.rb +14 -12
- data/spec/unit/plugins/scsi_spec.rb +2 -1
- data/spec/unit/plugins/shard_spec.rb +18 -16
- data/spec/unit/plugins/solaris2/cpu_spec.rb +29 -29
- data/spec/unit/plugins/solaris2/dmi_spec.rb +4 -4
- data/spec/unit/plugins/solaris2/filesystem.rb +3 -3
- data/spec/unit/plugins/solaris2/hostname_spec.rb +2 -2
- data/spec/unit/plugins/solaris2/kernel_spec.rb +4 -4
- data/spec/unit/plugins/solaris2/memory_spec.rb +4 -4
- data/spec/unit/plugins/solaris2/platform_spec.rb +9 -9
- data/spec/unit/plugins/solaris2/virtualization_spec.rb +6 -6
- data/spec/unit/plugins/ssh_host_keys_spec.rb +4 -1
- data/spec/unit/plugins/sysconf_spec.rb +2 -2
- data/spec/unit/plugins/timezone_spec.rb +2 -2
- data/spec/unit/plugins/virtualbox_spec.rb +10 -10
- data/spec/unit/plugins/vmware_spec.rb +4 -4
- data/spec/unit/plugins/windows/cpu_spec.rb +13 -13
- data/spec/unit/plugins/windows/filesystem_spec.rb +1 -1
- data/spec/unit/plugins/windows/fips_spec.rb +7 -5
- data/spec/unit/plugins/windows/kernel_spec.rb +1 -1
- data/spec/unit/plugins/windows/memory_spec.rb +4 -4
- data/spec/unit/plugins/windows/network_spec.rb +1 -1
- data/spec/unit/plugins/windows/system_enclosure_spec.rb +2 -2
- data/spec/unit/plugins/windows/uptime_spec.rb +1 -1
- data/spec/unit/plugins/windows/virtualization_spec.rb +1 -1
- data/spec/unit/plugins/zpools_spec.rb +2 -0
- data/spec/unit/provides_map_spec.rb +18 -18
- data/spec/unit/runner_spec.rb +29 -29
- data/spec/unit/system_spec.rb +13 -13
- data/spec/unit/util/file_helper_spec.rb +1 -1
- data/spec/unit/util/ip_helper_spec.rb +6 -6
- metadata +4 -2
data/spec/unit/system_spec.rb
CHANGED
@@ -152,7 +152,7 @@ describe "Ohai::System" do
|
|
152
152
|
end
|
153
153
|
EOF
|
154
154
|
|
155
|
-
it "
|
155
|
+
it "collects platform specific" do
|
156
156
|
Ohai.config[:plugin_path] = [ path_to(".") ]
|
157
157
|
ohai.all_plugins
|
158
158
|
expect(ohai.data[:message]).to eq("platform_specific_message")
|
@@ -199,7 +199,7 @@ describe "Ohai::System" do
|
|
199
199
|
end
|
200
200
|
EOF
|
201
201
|
|
202
|
-
it "
|
202
|
+
it "collects data from all the plugins" do
|
203
203
|
Ohai.config[:plugin_path] = [ path_to(".") ]
|
204
204
|
ohai.all_plugins
|
205
205
|
expect(ohai.data[:zoo]).to eq("animals")
|
@@ -208,7 +208,7 @@ describe "Ohai::System" do
|
|
208
208
|
expect(ohai.data[:park]).to be_frozen
|
209
209
|
end
|
210
210
|
|
211
|
-
it "
|
211
|
+
it "writes an error to Ohai::Log" do
|
212
212
|
Ohai.config[:plugin_path] = [ path_to(".") ]
|
213
213
|
# Make sure the stubbing of runner is not overriden with reset_system during test
|
214
214
|
allow(ohai).to receive(:reset_system)
|
@@ -226,7 +226,7 @@ describe "Ohai::System" do
|
|
226
226
|
Ohai.config[:disabled_plugins] = [ ]
|
227
227
|
end
|
228
228
|
|
229
|
-
it "
|
229
|
+
it "does not run disabled plugins" do
|
230
230
|
Ohai.config[:plugin_path] = [ path_to(".") ]
|
231
231
|
ohai.all_plugins
|
232
232
|
expect(ohai.data[:zoo]).to be_nil
|
@@ -246,7 +246,7 @@ describe "Ohai::System" do
|
|
246
246
|
Ohai.config[:critical_plugins] = []
|
247
247
|
end
|
248
248
|
|
249
|
-
it "
|
249
|
+
it "fails when critical plugins fail" do
|
250
250
|
Ohai.config[:plugin_path] = [ path_to(".") ]
|
251
251
|
expect { ohai.all_plugins }.to raise_error(Ohai::Exceptions::CriticalPluginFailure,
|
252
252
|
"The following Ohai plugins marked as critical failed: [:Fails]. Failing Chef run.")
|
@@ -254,20 +254,20 @@ describe "Ohai::System" do
|
|
254
254
|
end
|
255
255
|
|
256
256
|
describe "when using :optional_plugins" do
|
257
|
-
it "
|
257
|
+
it "does not run optional plugins by default" do
|
258
258
|
Ohai.config[:plugin_path] = [ path_to(".") ]
|
259
259
|
ohai.all_plugins
|
260
260
|
expect(ohai.data[:optional]).to be_nil
|
261
261
|
end
|
262
262
|
|
263
|
-
it "
|
263
|
+
it "runs optional plugins when specifically enabled" do
|
264
264
|
Ohai.config[:optional_plugins] = [ :Optional ]
|
265
265
|
Ohai.config[:plugin_path] = [ path_to(".") ]
|
266
266
|
ohai.all_plugins
|
267
267
|
expect(ohai.data[:optional]).to eq("canteloupe")
|
268
268
|
end
|
269
269
|
|
270
|
-
it "
|
270
|
+
it "runs optional plugins when all plugins are enabled" do
|
271
271
|
Ohai.config[:run_all_plugins] = true
|
272
272
|
Ohai.config[:plugin_path] = [ path_to(".") ]
|
273
273
|
ohai.all_plugins
|
@@ -294,7 +294,7 @@ describe "Ohai::System" do
|
|
294
294
|
Ohai.config[:plugin_path] = [ path_to(".") ]
|
295
295
|
end
|
296
296
|
|
297
|
-
it "
|
297
|
+
it "reruns the plugin providing the desired attributes" do
|
298
298
|
ohai.all_plugins
|
299
299
|
initial_value = ohai.data["random"]
|
300
300
|
ohai.all_plugins
|
@@ -347,19 +347,19 @@ describe "Ohai::System" do
|
|
347
347
|
Ohai.config[:plugin_path] = [ path_to(".") ]
|
348
348
|
end
|
349
349
|
|
350
|
-
it "
|
350
|
+
it "runs all the plugins when a top level attribute is specified" do
|
351
351
|
ohai.all_plugins("languages")
|
352
352
|
expect(ohai.data[:languages][:english][:version]).to eq(2014)
|
353
353
|
expect(ohai.data[:languages][:french][:version]).to eq(2012)
|
354
354
|
end
|
355
355
|
|
356
|
-
it "
|
356
|
+
it "runs the first parent when a non-existent child is specified" do
|
357
357
|
ohai.all_plugins("languages/english/version")
|
358
358
|
expect(ohai.data[:languages][:english][:version]).to eq(2014)
|
359
359
|
expect(ohai.data[:languages][:french]).to be_nil
|
360
360
|
end
|
361
361
|
|
362
|
-
it "
|
362
|
+
it "is able to run multiple plugins" do
|
363
363
|
ohai.all_plugins(["languages/english", "languages/french"])
|
364
364
|
expect(ohai.data[:languages][:english][:version]).to eq(2014)
|
365
365
|
expect(ohai.data[:languages][:french][:version]).to eq(2012)
|
@@ -406,7 +406,7 @@ describe "Ohai::System" do
|
|
406
406
|
end
|
407
407
|
E
|
408
408
|
|
409
|
-
it "
|
409
|
+
it "runs all the plugins" do
|
410
410
|
ohai.run_additional_plugins(@plugins_directory)
|
411
411
|
expect(ohai.data[:canteloupe][:english][:version]).to eq(2014)
|
412
412
|
expect(ohai.data[:canteloupe][:french][:version]).to eq(2012)
|
@@ -26,7 +26,7 @@ end
|
|
26
26
|
describe "Ohai::Util::FileHelper" do
|
27
27
|
let(:file_helper) { FileHelperMock.new }
|
28
28
|
|
29
|
-
before
|
29
|
+
before do
|
30
30
|
allow(file_helper).to receive(:name).and_return("Fakeclass")
|
31
31
|
logger = instance_double("Mixlib::Log::Child", trace: nil, debug: nil, warn: nil)
|
32
32
|
allow(file_helper).to receive(:logger).and_return(logger)
|
@@ -78,12 +78,12 @@ describe "Ohai::Util::IpHelper" do
|
|
78
78
|
allow(ip_helper).to receive(:private_address?)
|
79
79
|
end
|
80
80
|
|
81
|
-
it "
|
81
|
+
it "calls #private_address?" do
|
82
82
|
expect(ip_helper).to receive(:private_address?)
|
83
83
|
ip_helper.public_address?(address)
|
84
84
|
end
|
85
85
|
|
86
|
-
it "
|
86
|
+
it "returns the inverse of #private_address?" do
|
87
87
|
expect(ip_helper.public_address?(address)).to equal !ip_helper.private_address?(address)
|
88
88
|
end
|
89
89
|
end
|
@@ -93,7 +93,7 @@ describe "Ohai::Util::IpHelper" do
|
|
93
93
|
context "that is a loopback address" do
|
94
94
|
let(:address) { "127.0.0.1" }
|
95
95
|
|
96
|
-
it "
|
96
|
+
it "identifies the address as a loopback address" do
|
97
97
|
expect(ip_helper.loopback?(address)).to be_truthy
|
98
98
|
end
|
99
99
|
end
|
@@ -101,7 +101,7 @@ describe "Ohai::Util::IpHelper" do
|
|
101
101
|
context "that is not a loopback address" do
|
102
102
|
let(:address) { "1.2.3.4" }
|
103
103
|
|
104
|
-
it "
|
104
|
+
it "does not identify the address as a loopback address" do
|
105
105
|
expect(ip_helper.loopback?(address)).to be_falsey
|
106
106
|
end
|
107
107
|
end
|
@@ -111,7 +111,7 @@ describe "Ohai::Util::IpHelper" do
|
|
111
111
|
context "that is a loopback address" do
|
112
112
|
let(:address) { "0:0:0:0:0:0:0:1" }
|
113
113
|
|
114
|
-
it "
|
114
|
+
it "identifies the address as a loopback address" do
|
115
115
|
expect(ip_helper.loopback?(address)).to be_truthy
|
116
116
|
end
|
117
117
|
end
|
@@ -119,7 +119,7 @@ describe "Ohai::Util::IpHelper" do
|
|
119
119
|
context "that is not a loopback address" do
|
120
120
|
let(:address) { "2400:6180:0000:00D0:0000:0000:0009:7001" }
|
121
121
|
|
122
|
-
it "
|
122
|
+
it "does not identify the address as a loopback address" do
|
123
123
|
expect(ip_helper.loopback?(address)).to be_falsey
|
124
124
|
end
|
125
125
|
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: 15.
|
4
|
+
version: 15.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Jacob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: systemu
|
@@ -282,6 +282,7 @@ files:
|
|
282
282
|
- lib/ohai/plugins/linux/network.rb
|
283
283
|
- lib/ohai/plugins/linux/platform.rb
|
284
284
|
- lib/ohai/plugins/linux/sessions.rb
|
285
|
+
- lib/ohai/plugins/linux/sysctl.rb
|
285
286
|
- lib/ohai/plugins/linux/systemd_paths.rb
|
286
287
|
- lib/ohai/plugins/linux/virtualization.rb
|
287
288
|
- lib/ohai/plugins/lua.rb
|
@@ -436,6 +437,7 @@ files:
|
|
436
437
|
- spec/unit/plugins/linux/network_spec.rb
|
437
438
|
- spec/unit/plugins/linux/platform_spec.rb
|
438
439
|
- spec/unit/plugins/linux/sessions_spec.rb
|
440
|
+
- spec/unit/plugins/linux/sysctl_spec.rb
|
439
441
|
- spec/unit/plugins/linux/systemd_paths_spec.rb
|
440
442
|
- spec/unit/plugins/linux/uptime_spec.rb
|
441
443
|
- spec/unit/plugins/linux/virtualization_spec.rb
|