ohai 14.15.0 → 15.0.35
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/lib/ohai/application.rb +0 -4
- data/lib/ohai/common/dmi.rb +43 -43
- data/lib/ohai/config.rb +1 -1
- data/lib/ohai/loader.rb +32 -47
- data/lib/ohai/mixin/dmi_decode.rb +29 -32
- data/lib/ohai/mixin/os.rb +0 -2
- data/lib/ohai/mixin/softlayer_metadata.rb +5 -5
- data/lib/ohai/plugins/aix/virtualization.rb +4 -4
- data/lib/ohai/plugins/bsd/virtualization.rb +10 -12
- data/lib/ohai/plugins/c.rb +0 -20
- data/lib/ohai/plugins/elixir.rb +13 -13
- data/lib/ohai/plugins/filesystem.rb +10 -10
- data/lib/ohai/plugins/gce.rb +42 -8
- data/lib/ohai/plugins/go.rb +11 -11
- data/lib/ohai/plugins/groovy.rb +12 -12
- data/lib/ohai/plugins/hostname.rb +9 -2
- data/lib/ohai/plugins/linux/fips.rb +2 -9
- data/lib/ohai/plugins/linux/memory.rb +5 -0
- data/lib/ohai/plugins/linux/network.rb +1 -1
- data/lib/ohai/plugins/linux/platform.rb +84 -83
- data/lib/ohai/plugins/linux/systemd_paths.rb +0 -3
- data/lib/ohai/plugins/linux/virtualization.rb +10 -20
- data/lib/ohai/plugins/lua.rb +13 -13
- data/lib/ohai/plugins/mono.rb +23 -23
- data/lib/ohai/plugins/nodejs.rb +13 -13
- data/lib/ohai/plugins/openstack.rb +1 -1
- data/lib/ohai/plugins/packages.rb +1 -28
- data/lib/ohai/plugins/perl.rb +17 -17
- data/lib/ohai/plugins/php.rb +22 -22
- data/lib/ohai/plugins/powershell.rb +30 -30
- data/lib/ohai/plugins/ps.rb +1 -1
- data/lib/ohai/plugins/python.rb +15 -15
- data/lib/ohai/plugins/rust.rb +11 -11
- data/lib/ohai/plugins/solaris2/dmi.rb +48 -48
- data/lib/ohai/plugins/solaris2/virtualization.rb +8 -10
- data/lib/ohai/plugins/virtualbox.rb +21 -21
- data/lib/ohai/plugins/windows/filesystem.rb +2 -2
- data/lib/ohai/plugins/windows/fips.rb +2 -21
- data/lib/ohai/plugins/windows/virtualization.rb +9 -35
- data/lib/ohai/runner.rb +2 -2
- data/lib/ohai/system.rb +0 -17
- data/lib/ohai/version.rb +1 -1
- data/ohai.gemspec +2 -2
- data/spec/data/plugins/rpmquery.output +0 -2
- data/spec/functional/application_spec.rb +1 -1
- data/spec/functional/loader_spec.rb +2 -2
- data/spec/functional/plugins/powershell_spec.rb +2 -2
- data/spec/functional/plugins/root_group_spec.rb +1 -1
- data/spec/functional/plugins/windows/uptime_spec.rb +2 -2
- data/spec/ohai_spec.rb +1 -1
- data/spec/unit/application_spec.rb +1 -1
- data/spec/unit/config_spec.rb +1 -1
- data/spec/unit/dsl/plugin_spec.rb +1 -1
- data/spec/unit/hints_spec.rb +2 -2
- data/spec/unit/loader_spec.rb +12 -12
- data/spec/unit/mixin/azure_metadata_spec.rb +1 -1
- data/spec/unit/mixin/command_spec.rb +1 -1
- data/spec/unit/mixin/dmi_decode.rb +68 -0
- data/spec/unit/mixin/ec2_metadata_spec.rb +1 -1
- data/spec/unit/mixin/softlayer_metadata_spec.rb +1 -1
- data/spec/unit/plugin_config_spec.rb +1 -1
- data/spec/unit/plugins/abort_spec.rb +9 -9
- data/spec/unit/plugins/aix/cpu_spec.rb +4 -4
- data/spec/unit/plugins/aix/filesystem_spec.rb +5 -5
- data/spec/unit/plugins/aix/hostname_spec.rb +1 -1
- data/spec/unit/plugins/aix/kernel_spec.rb +1 -1
- data/spec/unit/plugins/aix/memory_spec.rb +1 -1
- data/spec/unit/plugins/aix/network_spec.rb +6 -6
- data/spec/unit/plugins/aix/platform_spec.rb +1 -1
- data/spec/unit/plugins/aix/uptime_spec.rb +1 -1
- data/spec/unit/plugins/aix/virtualization_spec.rb +2 -2
- data/spec/unit/plugins/azure_spec.rb +1 -1
- data/spec/unit/plugins/bsd/filesystem_spec.rb +4 -4
- data/spec/unit/plugins/bsd/virtualization_spec.rb +3 -3
- data/spec/unit/plugins/c_spec.rb +1 -53
- data/spec/unit/plugins/chef_spec.rb +1 -1
- data/spec/unit/plugins/cloud_spec.rb +1 -1
- data/spec/unit/plugins/darwin/cpu_spec.rb +2 -2
- data/spec/unit/plugins/darwin/filesystem_spec.rb +5 -5
- data/spec/unit/plugins/darwin/hardware_spec.rb +2 -2
- data/spec/unit/plugins/darwin/hardware_system_profiler_output.rb +3 -3
- data/spec/unit/plugins/darwin/hostname_spec.rb +1 -1
- data/spec/unit/plugins/darwin/kernel_spec.rb +1 -1
- data/spec/unit/plugins/darwin/memory_spec.rb +1 -1
- data/spec/unit/plugins/darwin/network_spec.rb +1 -1
- data/spec/unit/plugins/darwin/platform_spec.rb +1 -1
- data/spec/unit/plugins/darwin/virtualization_spec.rb +1 -1
- data/spec/unit/plugins/dmi_spec.rb +1 -1
- data/spec/unit/plugins/docker_spec.rb +1 -1
- data/spec/unit/plugins/ec2_spec.rb +1 -1
- data/spec/unit/plugins/elixir_spec.rb +1 -1
- data/spec/unit/plugins/erlang_spec.rb +1 -1
- data/spec/unit/plugins/eucalyptus_spec.rb +1 -1
- data/spec/unit/plugins/fail_spec.rb +28 -28
- data/spec/unit/plugins/freebsd/cpu_spec.rb +1 -1
- data/spec/unit/plugins/freebsd/hostname_spec.rb +1 -1
- data/spec/unit/plugins/freebsd/kernel_spec.rb +1 -1
- data/spec/unit/plugins/freebsd/platform_spec.rb +1 -1
- data/spec/unit/plugins/gce_spec.rb +1 -1
- data/spec/unit/plugins/go_spec.rb +1 -1
- data/spec/unit/plugins/groovy_spec.rb +1 -1
- data/spec/unit/plugins/haskell_spec.rb +1 -1
- data/spec/unit/plugins/hostname_spec.rb +68 -1
- data/spec/unit/plugins/init_package_spec.rb +1 -1
- data/spec/unit/plugins/java_spec.rb +1 -1
- data/spec/unit/plugins/joyent_spec.rb +3 -3
- data/spec/unit/plugins/kernel_spec.rb +1 -1
- data/spec/unit/plugins/linode_spec.rb +1 -1
- data/spec/unit/plugins/linux/block_device_spec.rb +1 -1
- data/spec/unit/plugins/linux/cpu_spec.rb +6 -6
- data/spec/unit/plugins/linux/filesystem_spec.rb +21 -21
- data/spec/unit/plugins/linux/fips_spec.rb +13 -45
- data/spec/unit/plugins/linux/hostname_spec.rb +1 -1
- data/spec/unit/plugins/linux/hostnamectl_spec.rb +2 -2
- data/spec/unit/plugins/linux/kernel_spec.rb +8 -8
- data/spec/unit/plugins/linux/lsb_spec.rb +3 -3
- data/spec/unit/plugins/linux/lspci_spec.rb +2 -2
- data/spec/unit/plugins/linux/machineid_spec.rb +1 -1
- data/spec/unit/plugins/linux/mdadm_spec.rb +2 -2
- data/spec/unit/plugins/linux/memory_spec.rb +26 -1
- data/spec/unit/plugins/linux/network_spec.rb +37 -37
- data/spec/unit/plugins/linux/platform_spec.rb +580 -837
- data/spec/unit/plugins/linux/sessions_spec.rb +2 -2
- data/spec/unit/plugins/linux/systemd_paths_spec.rb +1 -1
- data/spec/unit/plugins/linux/uptime_spec.rb +1 -1
- data/spec/unit/plugins/linux/virtualization_spec.rb +28 -227
- data/spec/unit/plugins/lua_spec.rb +1 -1
- data/spec/unit/plugins/mono_spec.rb +2 -2
- data/spec/unit/plugins/netbsd/hostname_spec.rb +1 -1
- data/spec/unit/plugins/netbsd/kernel_spec.rb +1 -1
- data/spec/unit/plugins/netbsd/platform_spec.rb +1 -1
- data/spec/unit/plugins/network_spec.rb +11 -11
- data/spec/unit/plugins/nodejs_spec.rb +1 -1
- data/spec/unit/plugins/ohai_spec.rb +1 -1
- data/spec/unit/plugins/ohai_time_spec.rb +1 -1
- data/spec/unit/plugins/openbsd/hostname_spec.rb +1 -1
- data/spec/unit/plugins/openbsd/kernel_spec.rb +1 -1
- data/spec/unit/plugins/openbsd/platform_spec.rb +1 -1
- data/spec/unit/plugins/openstack_spec.rb +8 -4
- data/spec/unit/plugins/os_spec.rb +1 -1
- data/spec/unit/plugins/packages_spec.rb +1 -21
- data/spec/unit/plugins/passwd_spec.rb +1 -1
- data/spec/unit/plugins/perl_spec.rb +1 -1
- data/spec/unit/plugins/php_spec.rb +6 -6
- data/spec/unit/plugins/platform_spec.rb +1 -1
- data/spec/unit/plugins/powershell_spec.rb +3 -3
- data/spec/unit/plugins/python_spec.rb +1 -1
- data/spec/unit/plugins/rackspace_spec.rb +2 -2
- data/spec/unit/plugins/root_group_spec.rb +1 -11
- data/spec/unit/plugins/ruby_spec.rb +1 -1
- data/spec/unit/plugins/rust_spec.rb +1 -1
- data/spec/unit/plugins/scala_spec.rb +1 -1
- data/spec/unit/plugins/scsi_spec.rb +2 -2
- data/spec/unit/plugins/shard_spec.rb +1 -1
- data/spec/unit/plugins/shells_spec.rb +1 -1
- data/spec/unit/plugins/softlayer_spec.rb +1 -1
- data/spec/unit/plugins/solaris2/cpu_spec.rb +3 -3
- data/spec/unit/plugins/solaris2/dmi_spec.rb +1 -1
- data/spec/unit/plugins/solaris2/filesystem.rb +4 -4
- data/spec/unit/plugins/solaris2/hostname_spec.rb +1 -1
- data/spec/unit/plugins/solaris2/kernel_spec.rb +1 -1
- data/spec/unit/plugins/solaris2/memory_spec.rb +1 -1
- data/spec/unit/plugins/solaris2/network_spec.rb +6 -6
- data/spec/unit/plugins/solaris2/platform_spec.rb +3 -3
- data/spec/unit/plugins/solaris2/virtualization_spec.rb +41 -69
- data/spec/unit/plugins/ssh_host_keys_spec.rb +3 -3
- data/spec/unit/plugins/sysconf_spec.rb +2 -2
- data/spec/unit/plugins/timezone_spec.rb +1 -1
- data/spec/unit/plugins/virtualbox_spec.rb +1 -1
- data/spec/unit/plugins/vmware_spec.rb +1 -1
- data/spec/unit/plugins/windows/cpu_spec.rb +1 -2
- data/spec/unit/plugins/windows/filesystem_spec.rb +2 -2
- data/spec/unit/plugins/windows/fips_spec.rb +17 -77
- data/spec/unit/plugins/windows/kernel_spec.rb +1 -1
- data/spec/unit/plugins/windows/memory_spec.rb +2 -2
- data/spec/unit/plugins/windows/network_spec.rb +1 -1
- data/spec/unit/plugins/windows/system_enclosure_spec.rb +1 -1
- data/spec/unit/plugins/windows/uptime_spec.rb +1 -1
- data/spec/unit/plugins/windows/virtualization_spec.rb +20 -238
- data/spec/unit/plugins/zpools_spec.rb +7 -7
- data/spec/unit/provides_map_spec.rb +1 -1
- data/spec/unit/runner_spec.rb +1 -1
- data/spec/unit/system_spec.rb +10 -77
- data/spec/unit/util/file_helper_spec.rb +1 -1
- data/spec/unit/util/ip_helper_spec.rb +1 -1
- metadata +6 -9
- data/lib/ohai/plugins/darwin/system_profiler.rb +0 -72
- data/lib/ohai/util/win32/group_helper.rb +0 -76
- data/spec/unit/plugins/darwin/system_profiler_output.rb +0 -79524
- data/spec/unit/plugins/darwin/system_profiler_spec.rb +0 -40
@@ -16,7 +16,7 @@
|
|
16
16
|
# See the License for the specific language governing permissions and
|
17
17
|
# limitations under the License.
|
18
18
|
|
19
|
-
|
19
|
+
require "spec_helper"
|
20
20
|
|
21
21
|
describe Ohai::System, "AIX virtualization plugin" do
|
22
22
|
|
@@ -244,7 +244,7 @@ describe Ohai::System, "AIX virtualization plugin" do
|
|
244
244
|
/dev/nvram pseudo EXPORTED
|
245
245
|
|
246
246
|
|
247
|
-
LSWPAR_L
|
247
|
+
LSWPAR_L
|
248
248
|
|
249
249
|
end
|
250
250
|
|
@@ -17,7 +17,7 @@
|
|
17
17
|
# limitations under the License.
|
18
18
|
#
|
19
19
|
|
20
|
-
|
20
|
+
require "spec_helper"
|
21
21
|
|
22
22
|
describe Ohai::System, "BSD filesystem plugin" do
|
23
23
|
let(:plugin) { get_plugin("filesystem") }
|
@@ -35,14 +35,14 @@ describe Ohai::System, "BSD filesystem plugin" do
|
|
35
35
|
Filesystem 1K-blocks Used Avail Capacity Mounted on
|
36
36
|
/dev/ada0p2 9637788 3313504 5553264 37% /
|
37
37
|
devfs 1 1 0 100% /dev
|
38
|
-
DF
|
38
|
+
DF
|
39
39
|
allow(plugin).to receive(:shell_out).with("df").and_return(mock_shell_out(0, @stdout, ""))
|
40
40
|
|
41
41
|
@inode_stdout = <<~DFI
|
42
42
|
Filesystem 512-blocks Used Avail Capacity iused ifree %iused Mounted on
|
43
43
|
/dev/ada0p2 15411832 5109256 9069632 36% 252576 790750 24% /
|
44
44
|
devfs 2 2 0 100% 0 0 100% /dev
|
45
|
-
DFI
|
45
|
+
DFI
|
46
46
|
allow(plugin).to receive(:shell_out).with("df -iP").and_return(mock_shell_out(0, @inode_stdout, ""))
|
47
47
|
end
|
48
48
|
|
@@ -106,7 +106,7 @@ DFI
|
|
106
106
|
@stdout = <<~MOUNT
|
107
107
|
/dev/ada0p2 on / (ufs, local, journaled soft-updates)
|
108
108
|
devfs on /dev (devfs, local, multilabel)
|
109
|
-
MOUNT
|
109
|
+
MOUNT
|
110
110
|
allow(plugin).to receive(:shell_out).with("mount -l").and_return(mock_shell_out(0, @stdout, ""))
|
111
111
|
end
|
112
112
|
|
@@ -16,7 +16,7 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
|
19
|
+
require "spec_helper"
|
20
20
|
|
21
21
|
describe Ohai::System, "BSD virtualization plugin" do
|
22
22
|
let(:plugin) { get_plugin("bsd/virtualization") }
|
@@ -78,7 +78,7 @@ describe Ohai::System, "BSD virtualization plugin" do
|
|
78
78
|
Id Refs Address Size Name
|
79
79
|
1 40 0xffffffff80100000 d20428 kernel
|
80
80
|
7 3 0xffffffff81055000 41e88 vboxguest.ko
|
81
|
-
OUT
|
81
|
+
OUT
|
82
82
|
allow(plugin).to receive(:shell_out).with((Ohai.abs_path("/sbin/kldstat")).to_s).and_return(mock_shell_out(0, @vbox_guest, ""))
|
83
83
|
end
|
84
84
|
|
@@ -96,7 +96,7 @@ OUT
|
|
96
96
|
Id Refs Address Size Name
|
97
97
|
1 40 0xffffffff80100000 d20428 kernel
|
98
98
|
7 3 0xffffffff81055000 41e88 vboxdrv.ko
|
99
|
-
OUT
|
99
|
+
OUT
|
100
100
|
allow(plugin).to receive(:shell_out).with("/sbin/kldstat").and_return(mock_shell_out(0, @stdout, ""))
|
101
101
|
end
|
102
102
|
|
data/spec/unit/plugins/c_spec.rb
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
|
19
|
+
require "spec_helper"
|
20
20
|
|
21
21
|
C_GCC = <<~EOF.freeze
|
22
22
|
Using built-in specs.
|
@@ -70,14 +70,6 @@ C_SUN = <<~EOF.freeze
|
|
70
70
|
cc: Sun C 5.8 Patch 121016-06 2007/08/01
|
71
71
|
EOF
|
72
72
|
|
73
|
-
C_HPUX = <<~EOF.freeze
|
74
|
-
/opt/ansic/bin/cc:
|
75
|
-
$Revision: 92453-07 linker linker crt0.o B.11.47 051104 $
|
76
|
-
LINT B.11.11.16 CXREF B.11.11.16
|
77
|
-
HP92453-01 B.11.11.16 HP C Compiler
|
78
|
-
$ PATCH/11.00:PHCO_27774 Oct 3 2002 09:45:59 $
|
79
|
-
EOF
|
80
|
-
|
81
73
|
describe Ohai::System, "plugin c" do
|
82
74
|
|
83
75
|
let(:plugin) { get_plugin("c") }
|
@@ -131,43 +123,6 @@ describe Ohai::System, "plugin c" do
|
|
131
123
|
end
|
132
124
|
|
133
125
|
end
|
134
|
-
|
135
|
-
context "on HPUX" do
|
136
|
-
before(:each) do
|
137
|
-
allow(plugin).to receive(:collect_os).and_return(:hpux)
|
138
|
-
allow(plugin).to receive(:shell_out).with("what /opt/ansic/bin/cc").and_return(mock_shell_out(0, C_HPUX, ""))
|
139
|
-
end
|
140
|
-
|
141
|
-
# hpux cc
|
142
|
-
it "gets the cc version from running what cc" do
|
143
|
-
expect(plugin).to receive(:shell_out).with("what /opt/ansic/bin/cc").and_return(mock_shell_out(0, C_HPUX, ""))
|
144
|
-
plugin.run
|
145
|
-
end
|
146
|
-
|
147
|
-
it "sets languages[:c][:hpcc][:version]" do
|
148
|
-
plugin.run
|
149
|
-
expect(plugin.languages[:c][:hpcc][:version]).to eql("B.11.11.16")
|
150
|
-
end
|
151
|
-
|
152
|
-
it "sets languages[:c][:hpcc][:description]" do
|
153
|
-
plugin.run
|
154
|
-
expect(plugin.languages[:c][:hpcc][:description]).to eql("HP92453-01 B.11.11.16 HP C Compiler")
|
155
|
-
end
|
156
|
-
|
157
|
-
it "does not set the languages[:c][:hpcc] tree up if cc command exits nonzero" do
|
158
|
-
allow(plugin).to receive(:shell_out).with("what /opt/ansic/bin/cc").and_return(mock_shell_out(1, "", ""))
|
159
|
-
plugin.run
|
160
|
-
expect(plugin[:languages][:c]).not_to have_key(:hpcc)
|
161
|
-
end
|
162
|
-
|
163
|
-
it "does not set the languages[:c][:hpcc] tree up if cc command fails" do
|
164
|
-
allow(plugin).to receive(:shell_out).with("what /opt/ansic/bin/cc").and_raise(Ohai::Exceptions::Exec)
|
165
|
-
plugin.run
|
166
|
-
expect(plugin[:languages][:c]).not_to have_key(:hpcc)
|
167
|
-
expect(plugin[:languages][:c]).not_to be_empty # expect other attributes
|
168
|
-
end
|
169
|
-
end
|
170
|
-
|
171
126
|
context "on Darwin" do
|
172
127
|
before(:each) do
|
173
128
|
allow(plugin).to receive(:shell_out).with("/usr/bin/xcode-select -p").and_return(mock_shell_out(0, "", ""))
|
@@ -381,12 +336,5 @@ describe Ohai::System, "plugin c" do
|
|
381
336
|
plugin.run
|
382
337
|
expect(plugin[:languages][:c]).not_to have_key(:sunpro)
|
383
338
|
end
|
384
|
-
|
385
|
-
it "does not set the languages[:c][:sunpro] tree if the corresponding cc command fails on hpux" do
|
386
|
-
hpux_error_message = "cc: warning 901: unknown option: `-flags': use +help for online documentation.\ncc: HP C/aC++ B3910B A.06.25 [Nov 30 2009]"
|
387
|
-
allow(plugin).to receive(:shell_out).with("cc -V -flags").and_return(mock_shell_out(0, "", hpux_error_message))
|
388
|
-
plugin.run
|
389
|
-
expect(plugin[:languages][:c]).not_to have_key(:sunpro)
|
390
|
-
end
|
391
339
|
end
|
392
340
|
end
|
@@ -16,7 +16,7 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
|
19
|
+
require "spec_helper"
|
20
20
|
|
21
21
|
describe Ohai::System, "Darwin cpu plugin" do
|
22
22
|
before(:each) do
|
@@ -75,7 +75,7 @@ describe Ohai::System, "Darwin cpu plugin" do
|
|
75
75
|
machdep.cpu.vendor: GenuineIntel
|
76
76
|
machdep.cpu.max_ext: 2147483656
|
77
77
|
machdep.cpu.max_basic: 13
|
78
|
-
CTL
|
78
|
+
CTL
|
79
79
|
|
80
80
|
allow(@plugin).to receive(:collect_os).and_return(:darwin)
|
81
81
|
allow(@plugin).to receive(:shell_out).with("sysctl hw machdep").and_return(mock_shell_out(0, @stdout, ""))
|
@@ -16,7 +16,7 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
|
19
|
+
require "spec_helper"
|
20
20
|
|
21
21
|
describe Ohai::System, "darwin filesystem plugin" do
|
22
22
|
let(:plugin) { get_plugin("filesystem") }
|
@@ -37,7 +37,7 @@ describe Ohai::System, "darwin filesystem plugin" do
|
|
37
37
|
map -hosts 0 0 0 100% 0 0 100% /net
|
38
38
|
map -static 0 0 0 100% 0 0 100% /mobile_symbol
|
39
39
|
deweyfs@osxfuse0 0 0 0 100% 0 0 100% /mnt/dewey
|
40
|
-
DF
|
40
|
+
DF
|
41
41
|
allow(plugin).to receive(:shell_out).with("df -i").and_return(mock_shell_out(0, @stdout, ""))
|
42
42
|
end
|
43
43
|
|
@@ -77,7 +77,7 @@ DF
|
|
77
77
|
map -hosts on /net (autofs, nosuid, automounted, nobrowse)
|
78
78
|
map -static on /mobile_symbol (autofs, automounted, nobrowse)
|
79
79
|
deweyfs@osxfuse0 on /mnt/dewey (osxfusefs, synchronous, nobrowse)
|
80
|
-
MOUNT
|
80
|
+
MOUNT
|
81
81
|
allow(plugin).to receive(:shell_out).with("mount").and_return(mock_shell_out(0, @stdout, ""))
|
82
82
|
end
|
83
83
|
|
@@ -105,7 +105,7 @@ MOUNT
|
|
105
105
|
map -static 0 0 0 100% 0 0 100% /mobile_symbol
|
106
106
|
deweyfs@osxfuse0 0 0 0 100% 0 0 100% /mnt/dewey
|
107
107
|
/dev/disk0s2 488555536 313696448 174347088 65% 39276054 21793386 64% /another/mountpoint
|
108
|
-
DF
|
108
|
+
DF
|
109
109
|
allow(plugin).to receive(:shell_out).with("df -i").and_return(mock_shell_out(0, @dfstdout, ""))
|
110
110
|
end
|
111
111
|
|
@@ -127,7 +127,7 @@ DF
|
|
127
127
|
deweyfs@osxfuse0 0 0 0 100% 0 0 100% /mnt/dewey
|
128
128
|
/dev/disk0s3 488555536 313696448 174347088 65% 39276054 21793386 64% /mnt
|
129
129
|
/dev/disk0s4 488555536 313696448 174347088 65% 39276054 21793386 64% /mnt
|
130
|
-
DF
|
130
|
+
DF
|
131
131
|
allow(plugin).to receive(:shell_out).with("df -i").and_return(mock_shell_out(0, @dfstdout, ""))
|
132
132
|
end
|
133
133
|
|
@@ -16,8 +16,8 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
|
20
|
-
require_relative "hardware_system_profiler_output
|
19
|
+
require "spec_helper"
|
20
|
+
require_relative "hardware_system_profiler_output"
|
21
21
|
|
22
22
|
describe Ohai::System, "Darwin hardware plugin", :unix_only do
|
23
23
|
let(:plugin) { get_plugin("darwin/hardware") }
|
@@ -287,7 +287,7 @@ module HardwareSystemProfilerOutput
|
|
287
287
|
</dict>
|
288
288
|
</array>
|
289
289
|
</plist>
|
290
|
-
HARDWARE_OUTPUT
|
290
|
+
HARDWARE_OUTPUT
|
291
291
|
|
292
292
|
STORAGE = <<~STORAGE_OUTPUT.freeze
|
293
293
|
<?xml version="1.0" encoding="UTF-8"?>
|
@@ -598,7 +598,7 @@ HARDWARE_OUTPUT
|
|
598
598
|
</dict>
|
599
599
|
</array>
|
600
600
|
</plist>
|
601
|
-
STORAGE_OUTPUT
|
601
|
+
STORAGE_OUTPUT
|
602
602
|
|
603
603
|
POWER = <<~POWER_OUTPUT.freeze
|
604
604
|
<?xml version="1.0" encoding="UTF-8"?>
|
@@ -1105,6 +1105,6 @@ STORAGE_OUTPUT
|
|
1105
1105
|
</dict>
|
1106
1106
|
</array>
|
1107
1107
|
</plist>
|
1108
|
-
POWER_OUTPUT
|
1108
|
+
POWER_OUTPUT
|
1109
1109
|
|
1110
1110
|
end
|
@@ -14,7 +14,7 @@
|
|
14
14
|
# See the License for the specific language governing permissions and
|
15
15
|
# limitations under the License.
|
16
16
|
|
17
|
-
|
17
|
+
require "spec_helper"
|
18
18
|
|
19
19
|
docker_output = <<~EOF
|
20
20
|
{"ID":"KZET:VDFN:2V2G:JS5Z:HAKO:SOGI:AFSZ:HDMT:GVEM:V2NT:DUSW:J3Z6","Containers":11,"ContainersRunning":0,"ContainersPaused":0,"ContainersStopped":11,"Images":30,"Driver":"overlay2","DriverStatus":[["Backing Filesystem","extfs"],["Supports d_type","true"],["Native Overlay Diff","true"]],"SystemStatus":null,"Plugins":{"Volume":["local"],"Network":["bridge","host","ipvlan","macvlan","null","overlay"],"Authorization":null,"Log":["awslogs","fluentd","gcplogs","gelf","journald","json-file","logentries","splunk","syslog"]},"MemoryLimit":true,"SwapLimit":true,"KernelMemory":true,"CpuCfsPeriod":true,"CpuCfsQuota":true,"CPUShares":true,"CPUSet":true,"IPv4Forwarding":true,"BridgeNfIptables":true,"BridgeNfIp6tables":true,"Debug":true,"NFd":21,"OomKillDisable":true,"NGoroutines":39,"SystemTime":"2018-02-15T19:12:40.214106068Z","LoggingDriver":"json-file","CgroupDriver":"cgroupfs","NEventsListener":2,"KernelVersion":"4.9.60-linuxkit-aufs","OperatingSystem":"Docker for Mac","OSType":"linux","Architecture":"x86_64","IndexServerAddress":"https://index.docker.io/v1/","RegistryConfig":{"AllowNondistributableArtifactsCIDRs":[],"AllowNondistributableArtifactsHostnames":[],"InsecureRegistryCIDRs":["127.0.0.0/8"],"IndexConfigs":{"docker.io":{"Name":"docker.io","Mirrors":[],"Secure":true,"Official":true}},"Mirrors":[]},"NCPU":4,"MemTotal":2095816704,"GenericResources":null,"DockerRootDir":"/var/lib/docker","HttpProxy":"docker.for.mac.http.internal:3128","HttpsProxy":"docker.for.mac.http.internal:3129","NoProxy":"","Name":"linuxkit-025000000001","Labels":[],"ExperimentalBuild":true,"ServerVersion":"17.12.0-ce","ClusterStore":"","ClusterAdvertise":"","Runtimes":{"runc":{"path":"docker-runc"}},"DefaultRuntime":"runc","Swarm":{"NodeID":"","NodeAddr":"","LocalNodeState":"inactive","ControlAvailable":false,"Error":"","RemoteManagers":null},"LiveRestoreEnabled":false,"Isolation":"","InitBinary":"docker-init","ContainerdCommit":{"ID":"89623f28b87a6004d4b785663257362d1658a729","Expected":"89623f28b87a6004d4b785663257362d1658a729"},"RuncCommit":{"ID":"b2567b37d7b75eb4cf325b77297b140ea686ce8f","Expected":"b2567b37d7b75eb4cf325b77297b140ea686ce8f"},"InitCommit":{"ID":"949e6fa","Expected":"949e6fa"},"SecurityOptions":["name=seccomp,profile=default"]}
|
@@ -17,17 +17,17 @@
|
|
17
17
|
# limitations under the License.
|
18
18
|
#
|
19
19
|
|
20
|
-
|
20
|
+
require "spec_helper"
|
21
21
|
|
22
22
|
tmp = ENV["TMPDIR"] || ENV["TMP"] || ENV["TEMP"] || "/tmp"
|
23
23
|
|
24
24
|
shared_examples "a v7 loading failure" do
|
25
25
|
before(:all) do
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
|
27
|
+
Dir.mkdir("#{tmp}/plugins")
|
28
|
+
rescue Errno::EEXIST
|
29
29
|
# ignore
|
30
|
-
|
30
|
+
|
31
31
|
end
|
32
32
|
|
33
33
|
before(:each) do
|
@@ -41,11 +41,11 @@ shared_examples "a v7 loading failure" do
|
|
41
41
|
end
|
42
42
|
|
43
43
|
after(:all) do
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
|
45
|
+
Dir.delete("#{tmp}/plugins")
|
46
|
+
rescue
|
47
47
|
# ignore
|
48
|
-
|
48
|
+
|
49
49
|
end
|
50
50
|
|
51
51
|
before(:each) do
|
@@ -67,11 +67,11 @@ end
|
|
67
67
|
|
68
68
|
shared_examples "a v7 loading success" do
|
69
69
|
before(:all) do
|
70
|
-
|
71
|
-
|
72
|
-
|
70
|
+
|
71
|
+
Dir.mkdir("#{tmp}/plugins")
|
72
|
+
rescue Errno::EEXIST
|
73
73
|
# ignore
|
74
|
-
|
74
|
+
|
75
75
|
end
|
76
76
|
|
77
77
|
before(:each) do
|
@@ -85,11 +85,11 @@ shared_examples "a v7 loading success" do
|
|
85
85
|
end
|
86
86
|
|
87
87
|
after(:all) do
|
88
|
-
|
89
|
-
|
90
|
-
|
88
|
+
|
89
|
+
Dir.delete("#{tmp}/plugins")
|
90
|
+
rescue
|
91
91
|
# ignore
|
92
|
-
|
92
|
+
|
93
93
|
end
|
94
94
|
|
95
95
|
before(:each) do
|
@@ -110,11 +110,11 @@ end
|
|
110
110
|
|
111
111
|
shared_examples "a v7 run failure" do
|
112
112
|
before(:all) do
|
113
|
-
|
114
|
-
|
115
|
-
|
113
|
+
|
114
|
+
Dir.mkdir("#{tmp}/plugins")
|
115
|
+
rescue Errno::EEXIST
|
116
116
|
# ignore
|
117
|
-
|
117
|
+
|
118
118
|
end
|
119
119
|
|
120
120
|
before(:each) do
|
@@ -128,11 +128,11 @@ shared_examples "a v7 run failure" do
|
|
128
128
|
end
|
129
129
|
|
130
130
|
after(:all) do
|
131
|
-
|
132
|
-
|
133
|
-
|
131
|
+
|
132
|
+
Dir.delete("#{tmp}/plugins")
|
133
|
+
rescue
|
134
134
|
# ignore
|
135
|
-
|
135
|
+
|
136
136
|
end
|
137
137
|
|
138
138
|
before(:each) do
|
@@ -156,20 +156,20 @@ describe "when using DSL commands outside Ohai.plugin block" do
|
|
156
156
|
provides "fail"
|
157
157
|
Ohai.plugin do
|
158
158
|
end
|
159
|
-
EOF
|
159
|
+
EOF
|
160
160
|
|
161
161
|
failstr2 = <<~EOF
|
162
162
|
depends "fail"
|
163
163
|
Ohai.plugin do
|
164
164
|
end
|
165
|
-
EOF
|
165
|
+
EOF
|
166
166
|
|
167
167
|
failstr3 = <<~EOF
|
168
168
|
collect_data do
|
169
169
|
end
|
170
170
|
Ohai.plugin do
|
171
171
|
end
|
172
|
-
EOF
|
172
|
+
EOF
|
173
173
|
|
174
174
|
it_behaves_like "a v7 loading failure" do
|
175
175
|
let(:failstr) { failstr1 }
|