ohai 14.2.0 → 14.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Rakefile +1 -1
- data/lib/ohai/application.rb +29 -29
- data/lib/ohai/common/dmi.rb +5 -5
- data/lib/ohai/dsl/plugin.rb +3 -3
- data/lib/ohai/dsl/plugin/versionvii.rb +3 -3
- data/lib/ohai/mixin/azure_metadata.rb +2 -2
- data/lib/ohai/mixin/do_metadata.rb +3 -3
- data/lib/ohai/mixin/ec2_metadata.rb +8 -8
- data/lib/ohai/mixin/gce_metadata.rb +2 -2
- data/lib/ohai/mixin/network_constants.rb +1 -1
- data/lib/ohai/mixin/scaleway_metadata.rb +3 -3
- data/lib/ohai/mixin/softlayer_metadata.rb +1 -1
- data/lib/ohai/mixin/string.rb +2 -2
- data/lib/ohai/plugins/aix/cpu.rb +3 -3
- data/lib/ohai/plugins/aix/filesystem.rb +1 -1
- data/lib/ohai/plugins/aix/kernel.rb +1 -1
- data/lib/ohai/plugins/aix/memory.rb +1 -1
- data/lib/ohai/plugins/aix/network.rb +3 -3
- data/lib/ohai/plugins/bsd/virtualization.rb +1 -1
- data/lib/ohai/plugins/cloud.rb +1 -1
- data/lib/ohai/plugins/darwin/hardware.rb +1 -1
- data/lib/ohai/plugins/darwin/network.rb +5 -5
- data/lib/ohai/plugins/darwin/platform.rb +1 -1
- data/lib/ohai/plugins/dmi.rb +6 -6
- data/lib/ohai/plugins/filesystem.rb +5 -5
- data/lib/ohai/plugins/hostname.rb +5 -5
- data/lib/ohai/plugins/kernel.rb +8 -8
- data/lib/ohai/plugins/linux/lspci.rb +4 -4
- data/lib/ohai/plugins/linux/memory.rb +4 -4
- data/lib/ohai/plugins/linux/network.rb +16 -16
- data/lib/ohai/plugins/linux/platform.rb +7 -1
- data/lib/ohai/plugins/netbsd/network.rb +1 -1
- data/lib/ohai/plugins/network.rb +5 -5
- data/lib/ohai/plugins/openbsd/network.rb +1 -1
- data/lib/ohai/plugins/packages.rb +1 -1
- data/lib/ohai/plugins/passwd.rb +4 -4
- data/lib/ohai/plugins/ruby.rb +13 -13
- data/lib/ohai/plugins/solaris2/dmi.rb +3 -3
- data/lib/ohai/plugins/solaris2/filesystem.rb +6 -6
- data/lib/ohai/plugins/solaris2/memory.rb +2 -2
- data/lib/ohai/plugins/solaris2/network.rb +36 -36
- data/lib/ohai/plugins/windows/network.rb +2 -2
- data/lib/ohai/util/win32/group_helper.rb +1 -1
- data/lib/ohai/version.rb +1 -1
- data/spec/functional/application_spec.rb +6 -6
- data/spec/functional/loader_spec.rb +4 -4
- data/spec/functional/plugins/windows/uptime_spec.rb +1 -2
- data/spec/spec_helper.rb +5 -5
- data/spec/unit/application_spec.rb +11 -11
- data/spec/unit/config_spec.rb +5 -5
- data/spec/unit/dsl/plugin_spec.rb +5 -5
- data/spec/unit/hints_spec.rb +2 -2
- data/spec/unit/loader_spec.rb +41 -41
- data/spec/unit/mixin/azure_metadata_spec.rb +3 -3
- data/spec/unit/mixin/command_spec.rb +64 -64
- data/spec/unit/mixin/ec2_metadata_spec.rb +6 -6
- data/spec/unit/mixin/softlayer_metadata_spec.rb +1 -1
- data/spec/unit/plugin_config_spec.rb +9 -9
- data/spec/unit/plugins/abort_spec.rb +6 -6
- data/spec/unit/plugins/aix/cpu_spec.rb +16 -16
- data/spec/unit/plugins/aix/filesystem_spec.rb +57 -57
- data/spec/unit/plugins/aix/network_spec.rb +35 -35
- data/spec/unit/plugins/aix/virtualization_spec.rb +210 -210
- data/spec/unit/plugins/azure_spec.rb +49 -49
- data/spec/unit/plugins/bsd/filesystem_spec.rb +13 -13
- data/spec/unit/plugins/bsd/virtualization_spec.rb +10 -10
- data/spec/unit/plugins/c_spec.rb +54 -54
- data/spec/unit/plugins/chef_spec.rb +3 -3
- data/spec/unit/plugins/darwin/cpu_spec.rb +54 -54
- data/spec/unit/plugins/darwin/filesystem_spec.rb +34 -34
- data/spec/unit/plugins/darwin/hardware_system_profiler_output.rb +1070 -1070
- data/spec/unit/plugins/darwin/memory_spec.rb +16 -16
- data/spec/unit/plugins/darwin/network_spec.rb +382 -382
- data/spec/unit/plugins/digital_ocean_spec.rb +7 -7
- data/spec/unit/plugins/dmi_spec.rb +83 -83
- data/spec/unit/plugins/docker_spec.rb +2 -2
- data/spec/unit/plugins/ec2_spec.rb +156 -156
- data/spec/unit/plugins/eucalyptus_spec.rb +19 -19
- data/spec/unit/plugins/fail_spec.rb +14 -14
- data/spec/unit/plugins/freebsd/cpu_spec.rb +18 -18
- data/spec/unit/plugins/freebsd/kernel_spec.rb +1 -1
- data/spec/unit/plugins/gce_spec.rb +1 -1
- data/spec/unit/plugins/init_package_spec.rb +1 -1
- data/spec/unit/plugins/java_spec.rb +4 -4
- data/spec/unit/plugins/joyent_spec.rb +9 -9
- data/spec/unit/plugins/linux/block_device_spec.rb +1 -1
- data/spec/unit/plugins/linux/cpu_spec.rb +155 -155
- data/spec/unit/plugins/linux/filesystem_spec.rb +229 -229
- data/spec/unit/plugins/linux/kernel_spec.rb +9 -9
- data/spec/unit/plugins/linux/lsb_spec.rb +18 -18
- data/spec/unit/plugins/linux/lspci_spec.rb +58 -58
- data/spec/unit/plugins/linux/mdadm_spec.rb +54 -54
- data/spec/unit/plugins/linux/memory_spec.rb +35 -35
- data/spec/unit/plugins/linux/network_spec.rb +464 -464
- data/spec/unit/plugins/linux/platform_spec.rb +84 -68
- data/spec/unit/plugins/linux/systemd_paths_spec.rb +40 -40
- data/spec/unit/plugins/linux/uptime_spec.rb +1 -1
- data/spec/unit/plugins/linux/virtualization_spec.rb +197 -197
- data/spec/unit/plugins/mono_spec.rb +11 -11
- data/spec/unit/plugins/netbsd/kernel_spec.rb +1 -1
- data/spec/unit/plugins/network_spec.rb +2 -2
- data/spec/unit/plugins/openstack_spec.rb +43 -43
- data/spec/unit/plugins/os_spec.rb +1 -1
- data/spec/unit/plugins/passwd_spec.rb +9 -9
- data/spec/unit/plugins/php_spec.rb +22 -22
- data/spec/unit/plugins/powershell_spec.rb +13 -13
- data/spec/unit/plugins/rackspace_spec.rb +38 -38
- data/spec/unit/plugins/ruby_spec.rb +14 -14
- data/spec/unit/plugins/scaleway_spec.rb +6 -6
- data/spec/unit/plugins/scsi_spec.rb +7 -7
- data/spec/unit/plugins/solaris2/cpu_spec.rb +2594 -2594
- data/spec/unit/plugins/solaris2/dmi_spec.rb +91 -91
- data/spec/unit/plugins/solaris2/filesystem.rb +8 -8
- data/spec/unit/plugins/solaris2/kernel_spec.rb +1 -1
- data/spec/unit/plugins/solaris2/network_spec.rb +92 -93
- data/spec/unit/plugins/solaris2/platform_spec.rb +24 -24
- data/spec/unit/plugins/solaris2/virtualization_spec.rb +22 -22
- data/spec/unit/plugins/ssh_host_keys_spec.rb +12 -12
- data/spec/unit/plugins/sysconf_spec.rb +321 -321
- data/spec/unit/plugins/virtualbox_spec.rb +27 -27
- data/spec/unit/plugins/windows/cpu_spec.rb +9 -9
- data/spec/unit/plugins/windows/kernel_spec.rb +12 -12
- data/spec/unit/plugins/windows/uptime_spec.rb +1 -1
- data/spec/unit/plugins/zpools_spec.rb +41 -41
- data/spec/unit/runner_spec.rb +2 -2
- data/spec/unit/system_spec.rb +55 -55
- metadata +3 -4
- data/docs/man/man1/ohai.1 +0 -97
@@ -17,34 +17,34 @@
|
|
17
17
|
|
18
18
|
require_relative "../../spec_helper.rb"
|
19
19
|
|
20
|
-
vbox_output =
|
21
|
-
Oracle VM VirtualBox Guest Additions Command Line Management Interface Version 5.0.2
|
22
|
-
(C) 2008-2015 Oracle Corporation
|
23
|
-
All rights reserved.
|
20
|
+
vbox_output = <<~EOF
|
21
|
+
Oracle VM VirtualBox Guest Additions Command Line Management Interface Version 5.0.2
|
22
|
+
(C) 2008-2015 Oracle Corporation
|
23
|
+
All rights reserved.
|
24
24
|
|
25
|
-
Name: /VirtualBox/GuestInfo/OS/Product, value: Linux, timestamp: 1448390422246549000, flags: <NULL>
|
26
|
-
Name: /VirtualBox/GuestInfo/Net/0/V4/IP, value: 10.0.2.15, timestamp: 1448390422248366000, flags: <NULL>
|
27
|
-
Name: /VirtualBox/HostInfo/GUI/LanguageID, value: en_US, timestamp: 1448390412061749000, flags: <NULL>
|
28
|
-
Name: /VirtualBox/GuestInfo/Net/0/MAC, value: 080027FBB38C, timestamp: 1448390422248652000, flags: <NULL>
|
29
|
-
Name: /VirtualBox/GuestInfo/OS/ServicePack, value: <NULL>, timestamp: 1448390422246976000, flags: <NULL>
|
30
|
-
Name: /VirtualBox/HostInfo/VBoxVerExt, value: 5.0.10, timestamp: 1448390411701508000, flags: TRANSIENT, RDONLYGUEST
|
31
|
-
Name: /VirtualBox/GuestInfo/Net/0/V4/Netmask, value: 255.255.255.0, timestamp: 1448390422248569000, flags: <NULL>
|
32
|
-
Name: /VirtualBox/GuestInfo/OS/Version, value: #36~14.04.1-Ubuntu SMP Thu Oct 8 10:21:08 UTC 2015, timestamp: 1448390422246810000, flags: <NULL>
|
33
|
-
Name: /VirtualBox/GuestAdd/VersionExt, value: 5.0.2, timestamp: 1448390422247220000, flags: <NULL>
|
34
|
-
Name: /VirtualBox/GuestAdd/Revision, value: 102096, timestamp: 1448390422247266000, flags: <NULL>
|
35
|
-
Name: /VirtualBox/HostGuest/SysprepExec, value: <NULL>, timestamp: 1448390411701168000, flags: TRANSIENT, RDONLYGUEST
|
36
|
-
Name: /VirtualBox/GuestInfo/OS/LoggedInUsers, value: 1, timestamp: 1448390452251425000, flags: TRANSIENT, TRANSRESET
|
37
|
-
Name: /VirtualBox/GuestInfo/Net/0/Status, value: Up, timestamp: 1448390422248755000, flags: <NULL>
|
38
|
-
Name: /VirtualBox/GuestInfo/Net/0/Name, value: eth0, timestamp: 1448390422248814000, flags: <NULL>
|
39
|
-
Name: /VirtualBox/HostGuest/SysprepArgs, value: <NULL>, timestamp: 1448390411701220000, flags: TRANSIENT, RDONLYGUEST
|
40
|
-
Name: /VirtualBox/GuestAdd/Version, value: 5.0.2, timestamp: 1448390422247066000, flags: <NULL>
|
41
|
-
Name: /VirtualBox/HostInfo/VBoxRev, value: 104061, timestamp: 1448390411701536000, flags: TRANSIENT, RDONLYGUEST
|
42
|
-
Name: /VirtualBox/GuestInfo/Net/0/V4/Broadcast, value: 10.0.2.255, timestamp: 1448390422248498000, flags: <NULL>
|
43
|
-
Name: /VirtualBox/HostInfo/VBoxVer, value: 5.0.10, timestamp: 1448390411701485000, flags: TRANSIENT, RDONLYGUEST
|
44
|
-
Name: /VirtualBox/GuestInfo/OS/LoggedInUsersList, value: tim, timestamp: 1448390452251274000, flags: TRANSIENT, TRANSRESET
|
45
|
-
Name: /VirtualBox/GuestInfo/Net/Count, value: 1, timestamp: 1448391352440445000, flags: <NULL>
|
46
|
-
Name: /VirtualBox/GuestInfo/OS/Release, value: 3.19.0-31-generic, timestamp: 1448390422246638000, flags: <NULL>
|
47
|
-
Name: /VirtualBox/GuestInfo/OS/NoLoggedInUsers, value: false, timestamp: 1448390452251532000, flags: TRANSIENT, TRANSRESET
|
25
|
+
Name: /VirtualBox/GuestInfo/OS/Product, value: Linux, timestamp: 1448390422246549000, flags: <NULL>
|
26
|
+
Name: /VirtualBox/GuestInfo/Net/0/V4/IP, value: 10.0.2.15, timestamp: 1448390422248366000, flags: <NULL>
|
27
|
+
Name: /VirtualBox/HostInfo/GUI/LanguageID, value: en_US, timestamp: 1448390412061749000, flags: <NULL>
|
28
|
+
Name: /VirtualBox/GuestInfo/Net/0/MAC, value: 080027FBB38C, timestamp: 1448390422248652000, flags: <NULL>
|
29
|
+
Name: /VirtualBox/GuestInfo/OS/ServicePack, value: <NULL>, timestamp: 1448390422246976000, flags: <NULL>
|
30
|
+
Name: /VirtualBox/HostInfo/VBoxVerExt, value: 5.0.10, timestamp: 1448390411701508000, flags: TRANSIENT, RDONLYGUEST
|
31
|
+
Name: /VirtualBox/GuestInfo/Net/0/V4/Netmask, value: 255.255.255.0, timestamp: 1448390422248569000, flags: <NULL>
|
32
|
+
Name: /VirtualBox/GuestInfo/OS/Version, value: #36~14.04.1-Ubuntu SMP Thu Oct 8 10:21:08 UTC 2015, timestamp: 1448390422246810000, flags: <NULL>
|
33
|
+
Name: /VirtualBox/GuestAdd/VersionExt, value: 5.0.2, timestamp: 1448390422247220000, flags: <NULL>
|
34
|
+
Name: /VirtualBox/GuestAdd/Revision, value: 102096, timestamp: 1448390422247266000, flags: <NULL>
|
35
|
+
Name: /VirtualBox/HostGuest/SysprepExec, value: <NULL>, timestamp: 1448390411701168000, flags: TRANSIENT, RDONLYGUEST
|
36
|
+
Name: /VirtualBox/GuestInfo/OS/LoggedInUsers, value: 1, timestamp: 1448390452251425000, flags: TRANSIENT, TRANSRESET
|
37
|
+
Name: /VirtualBox/GuestInfo/Net/0/Status, value: Up, timestamp: 1448390422248755000, flags: <NULL>
|
38
|
+
Name: /VirtualBox/GuestInfo/Net/0/Name, value: eth0, timestamp: 1448390422248814000, flags: <NULL>
|
39
|
+
Name: /VirtualBox/HostGuest/SysprepArgs, value: <NULL>, timestamp: 1448390411701220000, flags: TRANSIENT, RDONLYGUEST
|
40
|
+
Name: /VirtualBox/GuestAdd/Version, value: 5.0.2, timestamp: 1448390422247066000, flags: <NULL>
|
41
|
+
Name: /VirtualBox/HostInfo/VBoxRev, value: 104061, timestamp: 1448390411701536000, flags: TRANSIENT, RDONLYGUEST
|
42
|
+
Name: /VirtualBox/GuestInfo/Net/0/V4/Broadcast, value: 10.0.2.255, timestamp: 1448390422248498000, flags: <NULL>
|
43
|
+
Name: /VirtualBox/HostInfo/VBoxVer, value: 5.0.10, timestamp: 1448390411701485000, flags: TRANSIENT, RDONLYGUEST
|
44
|
+
Name: /VirtualBox/GuestInfo/OS/LoggedInUsersList, value: tim, timestamp: 1448390452251274000, flags: TRANSIENT, TRANSRESET
|
45
|
+
Name: /VirtualBox/GuestInfo/Net/Count, value: 1, timestamp: 1448391352440445000, flags: <NULL>
|
46
|
+
Name: /VirtualBox/GuestInfo/OS/Release, value: 3.19.0-31-generic, timestamp: 1448390422246638000, flags: <NULL>
|
47
|
+
Name: /VirtualBox/GuestInfo/OS/NoLoggedInUsers, value: false, timestamp: 1448390452251532000, flags: TRANSIENT, TRANSRESET
|
48
48
|
EOF
|
49
49
|
|
50
50
|
describe Ohai::System, "plugin virtualbox" do
|
@@ -21,41 +21,41 @@ require_relative "../../../spec_helper.rb"
|
|
21
21
|
shared_examples "a cpu" do |cpu_no|
|
22
22
|
describe "cpu #{cpu_no}" do
|
23
23
|
it "should set physical_id to CPU#{cpu_no}" do
|
24
|
-
expect(@plugin[:cpu][
|
24
|
+
expect(@plugin[:cpu][cpu_no.to_s][:physical_id]).to eq("CPU#{cpu_no}")
|
25
25
|
end
|
26
26
|
|
27
27
|
it "should set mhz to 2793" do
|
28
|
-
expect(@plugin[:cpu][
|
28
|
+
expect(@plugin[:cpu][cpu_no.to_s][:mhz]).to eq("2793")
|
29
29
|
end
|
30
30
|
|
31
31
|
it "should set vendor_id to GenuineIntel" do
|
32
|
-
expect(@plugin[:cpu][
|
32
|
+
expect(@plugin[:cpu][cpu_no.to_s][:vendor_id]).to eq("GenuineIntel")
|
33
33
|
end
|
34
34
|
|
35
35
|
it "should set model_name to Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz" do
|
36
|
-
expect(@plugin[:cpu][
|
36
|
+
expect(@plugin[:cpu][cpu_no.to_s][:model_name])
|
37
37
|
.to eq("Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz")
|
38
38
|
end
|
39
39
|
|
40
40
|
it "should set description to Intel64 Family 6 Model 70 Stepping 1" do
|
41
|
-
expect(@plugin[:cpu][
|
41
|
+
expect(@plugin[:cpu][cpu_no.to_s][:description])
|
42
42
|
.to eq("Intel64 Family 6 Model 70 Stepping 1")
|
43
43
|
end
|
44
44
|
|
45
45
|
it "should set model to 17921" do
|
46
|
-
expect(@plugin[:cpu][
|
46
|
+
expect(@plugin[:cpu][cpu_no.to_s][:model]).to eq("17921")
|
47
47
|
end
|
48
48
|
|
49
49
|
it "should set family to 2" do
|
50
|
-
expect(@plugin[:cpu][
|
50
|
+
expect(@plugin[:cpu][cpu_no.to_s][:family]).to eq("2")
|
51
51
|
end
|
52
52
|
|
53
53
|
it "should set stepping to 9" do
|
54
|
-
expect(@plugin[:cpu][
|
54
|
+
expect(@plugin[:cpu][cpu_no.to_s][:stepping]).to eq(9)
|
55
55
|
end
|
56
56
|
|
57
57
|
it "should set cache_size to 64 KB" do
|
58
|
-
expect(@plugin[:cpu][
|
58
|
+
expect(@plugin[:cpu][cpu_no.to_s][:cache_size]).to eq("64 KB")
|
59
59
|
end
|
60
60
|
end
|
61
61
|
end
|
@@ -24,17 +24,17 @@ describe Ohai::System, "Windows kernel plugin", :windows_only do
|
|
24
24
|
require "wmi-lite/wmi"
|
25
25
|
|
26
26
|
# Mock a Win32_OperatingSystem OLE32 WMI object
|
27
|
-
caption = double("WIN32OLE", :
|
28
|
-
version = double("WIN32OLE", :
|
29
|
-
build_number = double("WIN32OLE", :
|
30
|
-
csd_version = double("WIN32OLE", :
|
31
|
-
os_type = double("WIN32OLE", :
|
32
|
-
product_type = double("WIN32OLE", :
|
33
|
-
operating_system_sku = double("WIN32OLE", :
|
27
|
+
caption = double("WIN32OLE", name: "Caption")
|
28
|
+
version = double("WIN32OLE", name: "Version")
|
29
|
+
build_number = double("WIN32OLE", name: "BuildNumber")
|
30
|
+
csd_version = double("WIN32OLE", name: "CsdVersion")
|
31
|
+
os_type = double("WIN32OLE", name: "OsType")
|
32
|
+
product_type = double("WIN32OLE", name: "ProductType")
|
33
|
+
operating_system_sku = double("WIN32OLE", name: "OperatingSystemSKU")
|
34
34
|
os_properties = [ caption, version, build_number, csd_version, os_type, product_type, operating_system_sku ]
|
35
35
|
|
36
36
|
os = double( "WIN32OLE",
|
37
|
-
:
|
37
|
+
properties_: os_properties)
|
38
38
|
|
39
39
|
allow(os).to receive(:invoke).with(build_number.name).and_return("7601")
|
40
40
|
allow(os).to receive(:invoke).with(csd_version.name).and_return("Service Pack 1")
|
@@ -47,13 +47,13 @@ describe Ohai::System, "Windows kernel plugin", :windows_only do
|
|
47
47
|
os_wmi = WmiLite::Wmi::Instance.new(os)
|
48
48
|
expect_any_instance_of(WmiLite::Wmi).to receive(:first_of).with("Win32_OperatingSystem").and_return(os_wmi)
|
49
49
|
|
50
|
-
system_type = double("WIN32OLE", :
|
51
|
-
pc_system_type = double("WIN32OLE", :
|
52
|
-
free_virtual_memory = double("WIN32OLE", :
|
50
|
+
system_type = double("WIN32OLE", name: "SystemType")
|
51
|
+
pc_system_type = double("WIN32OLE", name: "PCSystemType")
|
52
|
+
free_virtual_memory = double("WIN32OLE", name: "FreeVirtualMemory")
|
53
53
|
cs_properties = [ system_type, pc_system_type, free_virtual_memory]
|
54
54
|
|
55
55
|
cs = double("WIN32OLE",
|
56
|
-
:
|
56
|
+
properties_: cs_properties)
|
57
57
|
|
58
58
|
allow(cs).to receive(:invoke).with(system_type.name).and_return("x64-based PC")
|
59
59
|
allow(cs).to receive(:invoke).with(pc_system_type.name).and_return(2)
|
@@ -21,7 +21,7 @@ require_relative "../../../spec_helper.rb"
|
|
21
21
|
describe Ohai::System, "Windows plugin uptime" do
|
22
22
|
|
23
23
|
let(:plugin) { get_plugin("uptime") }
|
24
|
-
let(:wmi) { double("wmi", { :
|
24
|
+
let(:wmi) { double("wmi", { first_of: "" }) }
|
25
25
|
|
26
26
|
before(:each) do
|
27
27
|
allow(WmiLite::Wmi).to receive(:new).and_return(wmi)
|
@@ -45,9 +45,9 @@ describe Ohai::System, "zpools plugin" do
|
|
45
45
|
EOST
|
46
46
|
end
|
47
47
|
let(:zpool_out) do
|
48
|
-
|
49
|
-
rpool 109G 66.2G 42.8G 60% 1.00x ONLINE -
|
50
|
-
tank 130T 4.91M 130T 0% 1.00x ONLINE -
|
48
|
+
<<~EOZO
|
49
|
+
rpool 109G 66.2G 42.8G 60% 1.00x ONLINE -
|
50
|
+
tank 130T 4.91M 130T 0% 1.00x ONLINE -
|
51
51
|
EOZO
|
52
52
|
end
|
53
53
|
let(:zpool_status_rpool) do
|
@@ -131,50 +131,50 @@ EOSR
|
|
131
131
|
|
132
132
|
context "on Solaris2" do
|
133
133
|
let(:zpool_status_tank) do
|
134
|
-
|
135
|
-
pool: tank
|
136
|
-
state: ONLINE
|
137
|
-
scan: scrub repaired 0 in 0h0m with 0 errors on Fri Jun 6 14:43:40 2014
|
138
|
-
config:
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
134
|
+
<<~EOST
|
135
|
+
pool: tank
|
136
|
+
state: ONLINE
|
137
|
+
scan: scrub repaired 0 in 0h0m with 0 errors on Fri Jun 6 14:43:40 2014
|
138
|
+
config:
|
139
|
+
|
140
|
+
NAME STATE READ WRITE CKSUM
|
141
|
+
tank ONLINE 0 0 0
|
142
|
+
raidz2-0 ONLINE 0 0 0
|
143
|
+
c1t50014EE209D1DBA9d0 ONLINE 0 0 0
|
144
|
+
c1t50014EE20A0ECED2d0 ONLINE 0 0 0
|
145
|
+
c1t50014EE20A106BFFd0 ONLINE 0 0 0
|
146
|
+
c1t50014EE20A1423E8d0 ONLINE 0 0 0
|
147
|
+
c1t50014EE20A145447d0 ONLINE 0 0 0
|
148
|
+
c1t50014EE20A29EE56d0 ONLINE 0 0 0
|
149
|
+
raidz2-1 ONLINE 0 0 0
|
150
|
+
c1t50014EE20A2B984Cd0 ONLINE 0 0 0
|
151
|
+
c1t50014EE20A2BBC78d0 ONLINE 0 0 0
|
152
|
+
c1t50014EE20A2BDCA9d0 ONLINE 0 0 0
|
153
|
+
c1t50014EE25F697DC4d0 ONLINE 0 0 0
|
154
|
+
c1t50014EE25F698BECd0 ONLINE 0 0 0
|
155
|
+
c1t50014EE25F6998DAd0 ONLINE 0 0 0
|
156
156
|
EOST
|
157
157
|
end
|
158
158
|
let(:zpool_out) do
|
159
|
-
|
160
|
-
rpool 109G 66.2G 42.8G 60% 1.00x ONLINE 34
|
161
|
-
tank 130T 4.91M 130T 0% 1.00x ONLINE 34
|
159
|
+
<<~EOZO
|
160
|
+
rpool 109G 66.2G 42.8G 60% 1.00x ONLINE 34
|
161
|
+
tank 130T 4.91M 130T 0% 1.00x ONLINE 34
|
162
162
|
EOZO
|
163
163
|
end
|
164
164
|
let(:zpool_status_rpool) do
|
165
|
-
|
166
|
-
pool: rpool
|
167
|
-
state: ONLINE
|
168
|
-
scan: resilvered 65.6G in 0h8m with 0 errors on Fri Jun 6 14:22:40 2014
|
169
|
-
config:
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
errors: No known data errors
|
165
|
+
<<~EOSR
|
166
|
+
pool: rpool
|
167
|
+
state: ONLINE
|
168
|
+
scan: resilvered 65.6G in 0h8m with 0 errors on Fri Jun 6 14:22:40 2014
|
169
|
+
config:
|
170
|
+
|
171
|
+
NAME STATE READ WRITE CKSUM
|
172
|
+
rpool ONLINE 0 0 0
|
173
|
+
mirror-0 ONLINE 0 0 0
|
174
|
+
c3t5d0s0 ONLINE 0 0 0
|
175
|
+
c3t4d0s0 ONLINE 0 0 0
|
176
|
+
|
177
|
+
errors: No known data errors
|
178
178
|
EOSR
|
179
179
|
end
|
180
180
|
before do
|
data/spec/unit/runner_spec.rb
CHANGED
@@ -34,7 +34,7 @@ describe Ohai::Runner, "run_plugin" do
|
|
34
34
|
end
|
35
35
|
|
36
36
|
describe "when running a plugin" do
|
37
|
-
let(:plugin) { double("Ohai::DSL::Plugin",
|
37
|
+
let(:plugin) { double("Ohai::DSL::Plugin", kind_of?: true, version: version, name: :Test, has_run?: has_run, dependencies: [ ]) }
|
38
38
|
let(:version) { :version7 }
|
39
39
|
let(:has_run) { false }
|
40
40
|
|
@@ -334,7 +334,7 @@ describe Ohai::Runner, "fetch_plugins" do
|
|
334
334
|
before(:each) do
|
335
335
|
@provides_map = Ohai::ProvidesMap.new
|
336
336
|
@data = Mash.new
|
337
|
-
@ohai = double("Ohai::System", :
|
337
|
+
@ohai = double("Ohai::System", data: @data, provides_map: @provides_map, logger: Ohai::Log.with_child)
|
338
338
|
@runner = Ohai::Runner.new(@ohai, true)
|
339
339
|
end
|
340
340
|
|
data/spec/unit/system_spec.rb
CHANGED
@@ -87,28 +87,28 @@ describe "Ohai::System" do
|
|
87
87
|
end
|
88
88
|
|
89
89
|
when_plugins_directory "contains directories inside" do
|
90
|
-
with_plugin("repo1/zoo.rb",
|
91
|
-
Ohai.plugin(:Zoo) do
|
92
|
-
|
93
|
-
end
|
90
|
+
with_plugin("repo1/zoo.rb", <<~EOF)
|
91
|
+
Ohai.plugin(:Zoo) do
|
92
|
+
provides 'seals'
|
93
|
+
end
|
94
94
|
EOF
|
95
95
|
|
96
|
-
with_plugin("repo1/lake.rb",
|
97
|
-
Ohai.plugin(:Nature) do
|
98
|
-
provides 'fish'
|
99
|
-
end
|
96
|
+
with_plugin("repo1/lake.rb", <<~EOF)
|
97
|
+
Ohai.plugin(:Nature) do
|
98
|
+
provides 'fish'
|
99
|
+
end
|
100
100
|
EOF
|
101
101
|
|
102
|
-
with_plugin("repo2/nature.rb",
|
103
|
-
Ohai.plugin(:Nature) do
|
104
|
-
|
105
|
-
end
|
102
|
+
with_plugin("repo2/nature.rb", <<~EOF)
|
103
|
+
Ohai.plugin(:Nature) do
|
104
|
+
provides 'crabs'
|
105
|
+
end
|
106
106
|
EOF
|
107
107
|
|
108
|
-
with_plugin("repo2/mountain.rb",
|
109
|
-
Ohai.plugin(:Nature) do
|
110
|
-
provides 'bear'
|
111
|
-
end
|
108
|
+
with_plugin("repo2/mountain.rb", <<~EOF)
|
109
|
+
Ohai.plugin(:Nature) do
|
110
|
+
provides 'bear'
|
111
|
+
end
|
112
112
|
EOF
|
113
113
|
|
114
114
|
before do
|
@@ -127,18 +127,18 @@ EOF
|
|
127
127
|
|
128
128
|
describe "when running plugins" do
|
129
129
|
when_plugins_directory "contains a v7 plugins with :default and platform specific blocks" do
|
130
|
-
with_plugin("message.rb",
|
131
|
-
Ohai.plugin(:Message) do
|
132
|
-
|
130
|
+
with_plugin("message.rb", <<~EOF)
|
131
|
+
Ohai.plugin(:Message) do
|
132
|
+
provides 'message'
|
133
133
|
|
134
|
-
|
135
|
-
|
136
|
-
|
134
|
+
collect_data(:default) do
|
135
|
+
message("default")
|
136
|
+
end
|
137
137
|
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
end
|
138
|
+
collect_data(:#{Ohai::Mixin::OS.collect_os}) do
|
139
|
+
message("platform_specific_message")
|
140
|
+
end
|
141
|
+
end
|
142
142
|
EOF
|
143
143
|
|
144
144
|
it "should collect platform specific" do
|
@@ -149,43 +149,43 @@ EOF
|
|
149
149
|
end
|
150
150
|
|
151
151
|
when_plugins_directory "contains v7 plugins only" do
|
152
|
-
with_plugin("zoo.rb",
|
153
|
-
Ohai.plugin(:Zoo) do
|
154
|
-
|
152
|
+
with_plugin("zoo.rb", <<~EOF)
|
153
|
+
Ohai.plugin(:Zoo) do
|
154
|
+
provides 'zoo'
|
155
155
|
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
end
|
156
|
+
collect_data(:default) do
|
157
|
+
zoo("animals")
|
158
|
+
end
|
159
|
+
end
|
160
160
|
EOF
|
161
161
|
|
162
|
-
with_plugin("park.rb",
|
163
|
-
Ohai.plugin(:Park) do
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
end
|
162
|
+
with_plugin("park.rb", <<~EOF)
|
163
|
+
Ohai.plugin(:Park) do
|
164
|
+
provides 'park'
|
165
|
+
collect_data(:default) do
|
166
|
+
park("plants")
|
167
|
+
end
|
168
|
+
end
|
169
169
|
EOF
|
170
170
|
|
171
|
-
with_plugin("fails.rb",
|
172
|
-
Ohai.plugin(:Fails) do
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
end
|
171
|
+
with_plugin("fails.rb", <<~EOF)
|
172
|
+
Ohai.plugin(:Fails) do
|
173
|
+
provides 'fails'
|
174
|
+
collect_data(:default) do
|
175
|
+
fail 'thing'
|
176
|
+
end
|
177
|
+
end
|
178
178
|
EOF
|
179
179
|
|
180
|
-
with_plugin("optional.rb",
|
181
|
-
Ohai.plugin(:Optional) do
|
182
|
-
|
183
|
-
|
180
|
+
with_plugin("optional.rb", <<~EOF)
|
181
|
+
Ohai.plugin(:Optional) do
|
182
|
+
provides 'optional'
|
183
|
+
optional true
|
184
184
|
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
end
|
185
|
+
collect_data(:default) do
|
186
|
+
optional("canteloupe")
|
187
|
+
end
|
188
|
+
end
|
189
189
|
EOF
|
190
190
|
|
191
191
|
it "should collect data from all the plugins" do
|
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: 14.
|
4
|
+
version: 14.3.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: 2018-
|
11
|
+
date: 2018-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: systemu
|
@@ -188,7 +188,6 @@ files:
|
|
188
188
|
- README.md
|
189
189
|
- Rakefile
|
190
190
|
- bin/ohai
|
191
|
-
- docs/man/man1/ohai.1
|
192
191
|
- lib/ohai.rb
|
193
192
|
- lib/ohai/application.rb
|
194
193
|
- lib/ohai/common/dmi.rb
|
@@ -542,7 +541,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
542
541
|
version: '0'
|
543
542
|
requirements: []
|
544
543
|
rubyforge_project:
|
545
|
-
rubygems_version: 2.7.
|
544
|
+
rubygems_version: 2.7.5
|
546
545
|
signing_key:
|
547
546
|
specification_version: 4
|
548
547
|
summary: Ohai profiles your system and emits JSON
|