ohai 8.10.0 → 8.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -2
- data/Rakefile +13 -4
- data/bin/ohai +3 -4
- data/lib/ohai.rb +4 -4
- data/lib/ohai/application.rb +7 -6
- data/lib/ohai/common/dmi.rb +56 -56
- data/lib/ohai/config.rb +12 -8
- data/lib/ohai/dsl.rb +3 -3
- data/lib/ohai/dsl/plugin.rb +5 -5
- data/lib/ohai/dsl/plugin/versionvi.rb +0 -1
- data/lib/ohai/dsl/plugin/versionvii.rb +1 -0
- data/lib/ohai/hints.rb +1 -1
- data/lib/ohai/loader.rb +7 -7
- data/lib/ohai/log.rb +1 -1
- data/lib/ohai/mash.rb +3 -2
- data/lib/ohai/mixin/command.rb +25 -23
- data/lib/ohai/mixin/dmi_decode.rb +10 -10
- data/lib/ohai/mixin/ec2_metadata.rb +40 -39
- data/lib/ohai/mixin/gce_metadata.rb +9 -9
- data/lib/ohai/mixin/network_constants.rb +1 -1
- data/lib/ohai/mixin/os.rb +3 -3
- data/lib/ohai/mixin/seconds_to_human.rb +0 -2
- data/lib/ohai/mixin/softlayer_metadata.rb +10 -10
- data/lib/ohai/mixin/string.rb +2 -2
- data/lib/ohai/plugin_config.rb +1 -1
- data/lib/ohai/plugins/aix/cpu.rb +2 -2
- data/lib/ohai/plugins/aix/filesystem.rb +2 -2
- data/lib/ohai/plugins/aix/memory.rb +2 -2
- data/lib/ohai/plugins/aix/network.rb +9 -10
- data/lib/ohai/plugins/aix/os.rb +2 -2
- data/lib/ohai/plugins/aix/uptime.rb +3 -3
- data/lib/ohai/plugins/aix/virtualization.rb +23 -23
- data/lib/ohai/plugins/azure.rb +32 -5
- data/lib/ohai/plugins/bsd/virtualization.rb +22 -22
- data/lib/ohai/plugins/c.rb +3 -3
- data/lib/ohai/plugins/chef.rb +1 -1
- data/lib/ohai/plugins/cloud.rb +59 -60
- data/lib/ohai/plugins/cloud_v2.rb +37 -39
- data/lib/ohai/plugins/darwin/cpu.rb +1 -1
- data/lib/ohai/plugins/darwin/filesystem2.rb +5 -5
- data/lib/ohai/plugins/darwin/memory.rb +5 -6
- data/lib/ohai/plugins/darwin/network.rb +7 -7
- data/lib/ohai/plugins/darwin/system_profiler.rb +32 -33
- data/lib/ohai/plugins/darwin/virtualization.rb +9 -9
- data/lib/ohai/plugins/digital_ocean.rb +16 -16
- data/lib/ohai/plugins/dmi.rb +6 -6
- data/lib/ohai/plugins/dragonflybsd/cpu.rb +2 -2
- data/lib/ohai/plugins/dragonflybsd/memory.rb +0 -1
- data/lib/ohai/plugins/dragonflybsd/network.rb +4 -4
- data/lib/ohai/plugins/dragonflybsd/os.rb +1 -1
- data/lib/ohai/plugins/ec2.rb +39 -15
- data/lib/ohai/plugins/elixir.rb +1 -1
- data/lib/ohai/plugins/erlang.rb +3 -3
- data/lib/ohai/plugins/eucalyptus.rb +16 -12
- data/lib/ohai/plugins/freebsd/cpu.rb +2 -2
- data/lib/ohai/plugins/freebsd/memory.rb +0 -1
- data/lib/ohai/plugins/freebsd/network.rb +4 -4
- data/lib/ohai/plugins/freebsd/os.rb +1 -1
- data/lib/ohai/plugins/gce.rb +6 -6
- data/lib/ohai/plugins/hostname.rb +7 -7
- data/lib/ohai/plugins/init_package.rb +1 -1
- data/lib/ohai/plugins/ip_scopes.rb +9 -9
- data/lib/ohai/plugins/java.rb +1 -1
- data/lib/ohai/plugins/joyent.rb +7 -7
- data/lib/ohai/plugins/kernel.rb +8 -8
- data/lib/ohai/plugins/linode.rb +7 -4
- data/lib/ohai/plugins/linux/cpu.rb +5 -5
- data/lib/ohai/plugins/linux/filesystem.rb +16 -16
- data/lib/ohai/plugins/linux/filesystem2.rb +15 -15
- data/lib/ohai/plugins/linux/mdadm.rb +3 -3
- data/lib/ohai/plugins/linux/network.rb +85 -51
- data/lib/ohai/plugins/linux/platform.rb +24 -24
- data/lib/ohai/plugins/linux/virtualization.rb +8 -8
- data/lib/ohai/plugins/mono.rb +1 -1
- data/lib/ohai/plugins/netbsd/cpu.rb +1 -1
- data/lib/ohai/plugins/netbsd/network.rb +2 -2
- data/lib/ohai/plugins/network.rb +11 -11
- data/lib/ohai/plugins/network_listeners.rb +30 -26
- data/lib/ohai/plugins/ohai.rb +3 -3
- data/lib/ohai/plugins/openbsd/cpu.rb +4 -4
- data/lib/ohai/plugins/openbsd/memory.rb +4 -4
- data/lib/ohai/plugins/openbsd/network.rb +3 -3
- data/lib/ohai/plugins/openstack.rb +12 -12
- data/lib/ohai/plugins/os.rb +2 -2
- data/lib/ohai/plugins/packages.rb +22 -22
- data/lib/ohai/plugins/passwd.rb +4 -4
- data/lib/ohai/plugins/powershell.rb +9 -9
- data/lib/ohai/plugins/ps.rb +2 -2
- data/lib/ohai/plugins/python.rb +1 -1
- data/lib/ohai/plugins/rackspace.rb +13 -13
- data/lib/ohai/plugins/root_group.rb +4 -4
- data/lib/ohai/plugins/ruby.rb +6 -6
- data/lib/ohai/plugins/rust.rb +1 -1
- data/lib/ohai/plugins/sigar/cpu.rb +1 -1
- data/lib/ohai/plugins/sigar/filesystem.rb +1 -1
- data/lib/ohai/plugins/sigar/network.rb +13 -13
- data/lib/ohai/plugins/sigar/network_route.rb +34 -29
- data/lib/ohai/plugins/softlayer.rb +8 -7
- data/lib/ohai/plugins/solaris2/cpu.rb +19 -19
- data/lib/ohai/plugins/solaris2/dmi.rb +63 -63
- data/lib/ohai/plugins/solaris2/filesystem.rb +13 -13
- data/lib/ohai/plugins/solaris2/memory.rb +2 -2
- data/lib/ohai/plugins/solaris2/network.rb +5 -5
- data/lib/ohai/plugins/solaris2/virtualization.rb +18 -18
- data/lib/ohai/plugins/solaris2/zpools.rb +1 -1
- data/lib/ohai/plugins/ssh_host_key.rb +2 -2
- data/lib/ohai/plugins/uptime.rb +4 -5
- data/lib/ohai/plugins/virtualbox.rb +2 -2
- data/lib/ohai/plugins/virtualization.rb +17 -17
- data/lib/ohai/plugins/vmware.rb +2 -2
- data/lib/ohai/plugins/windows/cpu.rb +14 -14
- data/lib/ohai/plugins/windows/drivers.rb +8 -8
- data/lib/ohai/plugins/windows/filesystem.rb +4 -4
- data/lib/ohai/plugins/windows/memory.rb +1 -1
- data/lib/ohai/plugins/windows/network.rb +10 -10
- data/lib/ohai/plugins/windows/platform.rb +1 -2
- data/lib/ohai/plugins/windows/virtualization.rb +17 -17
- data/lib/ohai/provides_map.rb +7 -7
- data/lib/ohai/runner.rb +3 -3
- data/lib/ohai/system.rb +21 -20
- data/lib/ohai/util/file_helper.rb +1 -2
- data/lib/ohai/util/ip_helper.rb +4 -4
- data/lib/ohai/util/win32.rb +5 -5
- data/lib/ohai/util/win32/group_helper.rb +4 -5
- data/lib/ohai/version.rb +1 -1
- data/ohai.gemspec +7 -5
- data/spec/functional/application_spec.rb +23 -23
- data/spec/functional/loader_spec.rb +1 -1
- data/spec/functional/plugins/powershell_spec.rb +13 -13
- data/spec/functional/plugins/root_group_spec.rb +5 -5
- data/spec/ohai_spec.rb +1 -1
- data/spec/spec_helper.rb +9 -9
- data/spec/support/integration_helper.rb +7 -7
- data/spec/support/platform_helpers.rb +1 -1
- data/spec/unit/application_spec.rb +17 -17
- data/spec/unit/config_spec.rb +2 -2
- data/spec/unit/dsl/plugin_spec.rb +28 -28
- data/spec/unit/hints_spec.rb +3 -3
- data/spec/unit/loader_spec.rb +9 -9
- data/spec/unit/mixin/command_spec.rb +5 -5
- data/spec/unit/mixin/ec2_metadata_spec.rb +6 -6
- data/spec/unit/mixin/softlayer_metadata_spec.rb +19 -23
- data/spec/unit/plugin_config_spec.rb +5 -5
- data/spec/unit/plugins/abort_spec.rb +3 -3
- data/spec/unit/plugins/aix/cpu_spec.rb +1 -1
- data/spec/unit/plugins/aix/filesystem_spec.rb +25 -25
- data/spec/unit/plugins/aix/hostname_spec.rb +1 -2
- data/spec/unit/plugins/aix/kernel_spec.rb +3 -3
- data/spec/unit/plugins/aix/memory_spec.rb +8 -8
- data/spec/unit/plugins/aix/network_spec.rb +38 -38
- data/spec/unit/plugins/aix/os_spec.rb +1 -2
- 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 +11 -11
- data/spec/unit/plugins/azure_spec.rb +118 -20
- data/spec/unit/plugins/bsd/filesystem_spec.rb +1 -1
- data/spec/unit/plugins/bsd/virtualization_spec.rb +4 -4
- data/spec/unit/plugins/c_spec.rb +12 -12
- data/spec/unit/plugins/chef_spec.rb +2 -2
- data/spec/unit/plugins/cloud_spec.rb +37 -37
- data/spec/unit/plugins/cloud_v2_spec.rb +64 -65
- data/spec/unit/plugins/darwin/cpu_spec.rb +1 -2
- data/spec/unit/plugins/darwin/filesystem2_spec.rb +7 -7
- data/spec/unit/plugins/darwin/filesystem_spec.rb +5 -5
- data/spec/unit/plugins/darwin/hostname_spec.rb +1 -4
- data/spec/unit/plugins/darwin/kernel_spec.rb +6 -10
- data/spec/unit/plugins/darwin/memory_spec.rb +5 -5
- data/spec/unit/plugins/darwin/network_spec.rb +352 -353
- data/spec/unit/plugins/darwin/platform_spec.rb +1 -2
- data/spec/unit/plugins/darwin/system_profiler_spec.rb +3 -3
- data/spec/unit/plugins/darwin/virtualization_spec.rb +6 -6
- data/spec/unit/plugins/digital_ocean_spec.rb +38 -37
- data/spec/unit/plugins/dmi_spec.rb +3 -3
- data/spec/unit/plugins/ec2_spec.rb +97 -88
- data/spec/unit/plugins/elixir_spec.rb +1 -2
- data/spec/unit/plugins/erlang_spec.rb +2 -2
- data/spec/unit/plugins/eucalyptus_spec.rb +19 -19
- data/spec/unit/plugins/fail_spec.rb +2 -2
- data/spec/unit/plugins/freebsd/cpu_spec.rb +14 -14
- data/spec/unit/plugins/freebsd/hostname_spec.rb +1 -2
- data/spec/unit/plugins/freebsd/kernel_spec.rb +2 -3
- data/spec/unit/plugins/freebsd/os_spec.rb +4 -5
- data/spec/unit/plugins/freebsd/platform_spec.rb +1 -2
- data/spec/unit/plugins/gce_spec.rb +9 -9
- data/spec/unit/plugins/go_spec.rb +1 -1
- data/spec/unit/plugins/groovy_spec.rb +1 -2
- data/spec/unit/plugins/hostname_spec.rb +1 -2
- data/spec/unit/plugins/init_package_spec.rb +1 -1
- data/spec/unit/plugins/ip_scopes_spec.rb +38 -38
- data/spec/unit/plugins/java_spec.rb +52 -1
- data/spec/unit/plugins/joyent_spec.rb +9 -11
- data/spec/unit/plugins/kernel_spec.rb +11 -12
- data/spec/unit/plugins/linode_spec.rb +29 -29
- data/spec/unit/plugins/linux/block_device_spec.rb +21 -21
- data/spec/unit/plugins/linux/cpu_spec.rb +3 -3
- data/spec/unit/plugins/linux/filesystem2_spec.rb +7 -7
- data/spec/unit/plugins/linux/filesystem_spec.rb +85 -86
- data/spec/unit/plugins/linux/hostname_spec.rb +1 -3
- data/spec/unit/plugins/linux/kernel_spec.rb +1 -1
- data/spec/unit/plugins/linux/lsb_spec.rb +1 -2
- data/spec/unit/plugins/linux/mdadm_spec.rb +4 -4
- data/spec/unit/plugins/linux/memory_spec.rb +29 -33
- data/spec/unit/plugins/linux/network_spec.rb +463 -245
- data/spec/unit/plugins/linux/platform_spec.rb +64 -65
- data/spec/unit/plugins/linux/uptime_spec.rb +1 -2
- data/spec/unit/plugins/linux/virtualization_spec.rb +42 -42
- data/spec/unit/plugins/lua_spec.rb +1 -2
- data/spec/unit/plugins/mono_spec.rb +1 -2
- data/spec/unit/plugins/netbsd/hostname_spec.rb +1 -2
- data/spec/unit/plugins/netbsd/kernel_spec.rb +1 -2
- data/spec/unit/plugins/netbsd/platform_spec.rb +1 -1
- data/spec/unit/plugins/network_spec.rb +118 -118
- 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 -2
- data/spec/unit/plugins/openbsd/hostname_spec.rb +1 -2
- data/spec/unit/plugins/openbsd/kernel_spec.rb +1 -2
- data/spec/unit/plugins/openbsd/platform_spec.rb +1 -2
- data/spec/unit/plugins/openstack_spec.rb +35 -37
- data/spec/unit/plugins/os_spec.rb +7 -8
- data/spec/unit/plugins/packages_spec.rb +118 -118
- data/spec/unit/plugins/passwd_spec.rb +18 -18
- data/spec/unit/plugins/perl_spec.rb +1 -1
- data/spec/unit/plugins/php_spec.rb +4 -4
- data/spec/unit/plugins/platform_spec.rb +8 -9
- 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 +66 -68
- data/spec/unit/plugins/root_group_spec.rb +26 -26
- data/spec/unit/plugins/ruby_spec.rb +14 -15
- data/spec/unit/plugins/rust_spec.rb +2 -2
- data/spec/unit/plugins/sigar/network_route_spec.rb +36 -36
- data/spec/unit/plugins/softlayer_spec.rb +10 -10
- data/spec/unit/plugins/solaris2/cpu_spec.rb +20 -21
- data/spec/unit/plugins/solaris2/dmi_spec.rb +5 -6
- data/spec/unit/plugins/solaris2/filesystem.rb +5 -5
- data/spec/unit/plugins/solaris2/hostname_spec.rb +1 -1
- data/spec/unit/plugins/solaris2/kernel_spec.rb +3 -3
- data/spec/unit/plugins/solaris2/memory_spec.rb +5 -5
- data/spec/unit/plugins/solaris2/network_spec.rb +7 -8
- data/spec/unit/plugins/solaris2/platform_spec.rb +1 -1
- data/spec/unit/plugins/solaris2/virtualization_spec.rb +3 -5
- data/spec/unit/plugins/solaris2/zpools_spec.rb +6 -6
- data/spec/unit/plugins/ssh_host_keys_spec.rb +1 -1
- data/spec/unit/plugins/virtualbox_spec.rb +19 -19
- data/spec/unit/plugins/vmware_spec.rb +28 -28
- data/spec/unit/plugins/windows/cpu_spec.rb +46 -48
- data/spec/unit/plugins/windows/memory_spec.rb +5 -5
- data/spec/unit/plugins/windows/virtualization_spec.rb +163 -163
- data/spec/unit/provides_map_spec.rb +10 -10
- data/spec/unit/runner_spec.rb +10 -10
- data/spec/unit/system_spec.rb +19 -19
- data/spec/unit/util/file_helper_spec.rb +5 -6
- data/spec/unit/util/ip_helper_spec.rb +39 -39
- metadata +31 -4
@@ -16,9 +16,8 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
|
20
|
-
require File.expand_path(File.dirname(__FILE__) +
|
21
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper.rb')
|
19
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
|
20
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
|
22
21
|
|
23
22
|
describe Ohai::System, "Linux plugin platform" do
|
24
23
|
|
@@ -203,9 +202,9 @@ describe Ohai::System, "Linux plugin platform" do
|
|
203
202
|
end
|
204
203
|
|
205
204
|
it "should set platform_version to kernel release" do
|
206
|
-
expect(@plugin).to receive(:`).with(
|
205
|
+
expect(@plugin).to receive(:`).with("uname -r").and_return("3.18.2-2-ARCH")
|
207
206
|
@plugin.run
|
208
|
-
expect(@plugin[:platform_version]).to eq(
|
207
|
+
expect(@plugin[:platform_version]).to eq("3.18.2-2-ARCH")
|
209
208
|
end
|
210
209
|
end
|
211
210
|
|
@@ -238,7 +237,7 @@ describe Ohai::System, "Linux plugin platform" do
|
|
238
237
|
@plugin.run
|
239
238
|
expect(@plugin[:platform]).to eq("alpine")
|
240
239
|
expect(@plugin[:platform_family]).to eq("alpine")
|
241
|
-
expect(@plugin[:platform_version]).to eq(
|
240
|
+
expect(@plugin[:platform_version]).to eq("3.2.3")
|
242
241
|
end
|
243
242
|
end
|
244
243
|
|
@@ -257,9 +256,9 @@ describe Ohai::System, "Linux plugin platform" do
|
|
257
256
|
end
|
258
257
|
|
259
258
|
it "should set platform_version to kernel release" do
|
260
|
-
expect(@plugin).to receive(:`).with(
|
259
|
+
expect(@plugin).to receive(:`).with("uname -r").and_return("3.18.2-2-ARCH")
|
261
260
|
@plugin.run
|
262
|
-
expect(@plugin[:platform_version]).to eq(
|
261
|
+
expect(@plugin[:platform_version]).to eq("3.18.2-2-ARCH")
|
263
262
|
end
|
264
263
|
|
265
264
|
end
|
@@ -671,114 +670,114 @@ CISCO_RELEASE
|
|
671
670
|
|
672
671
|
describe '#read_os_release_info' do
|
673
672
|
let(:file_contents) { "COW=MOO\nDOG=\"BARK\"" }
|
674
|
-
it
|
675
|
-
allow(File).to receive(:exist?).with(
|
676
|
-
expect(@plugin.read_os_release_info(
|
673
|
+
it "returns nil if the file does not exist" do
|
674
|
+
allow(File).to receive(:exist?).with("/etc/test-release").and_return(false)
|
675
|
+
expect(@plugin.read_os_release_info("/etc/test-release")).to be nil
|
677
676
|
end
|
678
677
|
|
679
|
-
it
|
680
|
-
allow(File).to receive(:exist?).with(
|
681
|
-
allow(File).to receive(:read).with(
|
682
|
-
release_info = @plugin.read_os_release_info(
|
678
|
+
it "returns a hash of expected contents" do
|
679
|
+
allow(File).to receive(:exist?).with("/etc/test-release").and_return(true)
|
680
|
+
allow(File).to receive(:read).with("/etc/test-release").and_return(file_contents)
|
681
|
+
release_info = @plugin.read_os_release_info("/etc/test-release")
|
683
682
|
|
684
|
-
expect(release_info[
|
685
|
-
expect(release_info[
|
683
|
+
expect(release_info["COW"]).to eq("MOO")
|
684
|
+
expect(release_info["DOG"]).to eq("BARK")
|
686
685
|
end
|
687
686
|
end
|
688
687
|
|
689
688
|
describe '#os_release_info' do
|
690
|
-
context
|
691
|
-
let(:release_info) { {
|
689
|
+
context "when CISCO_RELEASE_INFO is not populated" do
|
690
|
+
let(:release_info) { { "ID" => "os_id" } }
|
692
691
|
|
693
692
|
before do
|
694
|
-
allow(File).to receive(:exist?).with(
|
695
|
-
allow(@plugin).to receive(:read_os_release_info).with(
|
693
|
+
allow(File).to receive(:exist?).with("/etc/os-release").and_return(true)
|
694
|
+
allow(@plugin).to receive(:read_os_release_info).with("/etc/os-release").and_return(release_info)
|
696
695
|
end
|
697
696
|
|
698
|
-
it
|
699
|
-
expect(@plugin).to receive(:read_os_release_info).with(
|
697
|
+
it "reads the os-release file" do
|
698
|
+
expect(@plugin).to receive(:read_os_release_info).with("/etc/os-release").and_return(release_info)
|
700
699
|
@plugin.os_release_info
|
701
700
|
end
|
702
701
|
|
703
|
-
it
|
704
|
-
expect(@plugin.os_release_info[
|
702
|
+
it "returns a hash of expected contents" do
|
703
|
+
expect(@plugin.os_release_info["ID"]).to eq("os_id")
|
705
704
|
end
|
706
705
|
end
|
707
706
|
|
708
|
-
context
|
709
|
-
let(:release_info) { {
|
710
|
-
let(:cisco_release_info) { {
|
707
|
+
context "when CISCO_RELEASE_INFO is populated" do
|
708
|
+
let(:release_info) { { "ID" => "os_id", "CISCO_RELEASE_INFO" => "/etc/cisco-release" } }
|
709
|
+
let(:cisco_release_info) { { "ID" => "cisco_id" } }
|
711
710
|
|
712
711
|
before do
|
713
|
-
allow(File).to receive(:exist?).with(
|
714
|
-
allow(File).to receive(:exist?).with(
|
715
|
-
allow(@plugin).to receive(:read_os_release_info).with(
|
716
|
-
allow(@plugin).to receive(:read_os_release_info).with(
|
712
|
+
allow(File).to receive(:exist?).with("/etc/os-release").and_return(true)
|
713
|
+
allow(File).to receive(:exist?).with("/etc/cisco-release").and_return(true)
|
714
|
+
allow(@plugin).to receive(:read_os_release_info).with("/etc/os-release").and_return(release_info)
|
715
|
+
allow(@plugin).to receive(:read_os_release_info).with("/etc/cisco-release").and_return(cisco_release_info)
|
717
716
|
end
|
718
717
|
|
719
|
-
it
|
720
|
-
expect(@plugin).to receive(:read_os_release_info).with(
|
721
|
-
expect(@plugin).to receive(:read_os_release_info).with(
|
718
|
+
it "reads the os-release AND the cisco-release file" do
|
719
|
+
expect(@plugin).to receive(:read_os_release_info).with("/etc/os-release").and_return(release_info)
|
720
|
+
expect(@plugin).to receive(:read_os_release_info).with("/etc/cisco-release").and_return(release_info)
|
722
721
|
@plugin.os_release_info
|
723
722
|
end
|
724
723
|
|
725
|
-
it
|
726
|
-
expect(@plugin.os_release_info[
|
724
|
+
it "returns the ID from the cisco-release file instead of the os-release file" do
|
725
|
+
expect(@plugin.os_release_info["ID"]).to eq("cisco_id")
|
727
726
|
end
|
728
727
|
end
|
729
728
|
end
|
730
729
|
|
731
|
-
describe
|
730
|
+
describe "on Wind River Linux 5 for Cisco Nexus" do
|
732
731
|
let(:have_os_release) { true }
|
733
732
|
let(:os_release_info) do
|
734
733
|
{
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
734
|
+
"ID" => "nexus",
|
735
|
+
"ID_LIKE" => "wrlinux",
|
736
|
+
"NAME" => "Nexus",
|
737
|
+
"VERSION" => "7.0(3)I2(0.475E.6)",
|
738
|
+
"VERSION_ID" => "7.0(3)I2",
|
739
|
+
"PRETTY_NAME" => "Nexus 7.0(3)I2",
|
740
|
+
"HOME_URL" => "http://www.cisco.com",
|
741
|
+
"BUILD_ID" => "6",
|
742
|
+
"CISCO_RELEASE_INFO" => "/etc/os-release",
|
744
743
|
}
|
745
744
|
end
|
746
745
|
|
747
|
-
it
|
746
|
+
it "should set platform to nexus and platform_family to wrlinux" do
|
748
747
|
allow(@plugin).to receive(:os_release_info).and_return(os_release_info)
|
749
748
|
@plugin.lsb = nil
|
750
749
|
@plugin.run
|
751
750
|
|
752
|
-
expect(@plugin[:platform]).to eq(
|
753
|
-
expect(@plugin[:platform_family]).to eq(
|
754
|
-
expect(@plugin[:platform_version]).to eq(
|
751
|
+
expect(@plugin[:platform]).to eq("nexus")
|
752
|
+
expect(@plugin[:platform_family]).to eq("wrlinux")
|
753
|
+
expect(@plugin[:platform_version]).to eq("7.0(3)I2(0.475E.6)")
|
755
754
|
end
|
756
755
|
end
|
757
756
|
|
758
|
-
describe
|
757
|
+
describe "on Wind River Linux 7 for Cisco IOS-XR" do
|
759
758
|
let(:have_os_release) { true }
|
760
759
|
let(:os_release_info) do
|
761
760
|
{
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
761
|
+
"ID" => "ios_xr",
|
762
|
+
"ID_LIKE" => "cisco-wrlinux wrlinux",
|
763
|
+
"NAME" => "IOS XR",
|
764
|
+
"VERSION" => "6.0.0.14I",
|
765
|
+
"VERSION_ID" => "6.0.0.14I",
|
766
|
+
"PRETTY_NAME" => "Cisco IOS XR Software, Version 6.0.0.14I",
|
767
|
+
"BUILD_ID" => "2015-09-10-15-50-17",
|
768
|
+
"HOME_URL" => "http://www.cisco.com",
|
769
|
+
"CISCO_RELEASE_INFO" => "/etc/os-release",
|
771
770
|
}
|
772
771
|
end
|
773
772
|
|
774
|
-
it
|
773
|
+
it "should set platform to ios_xr and platform_family to wrlinux" do
|
775
774
|
allow(@plugin).to receive(:os_release_info).and_return(os_release_info)
|
776
775
|
@plugin.lsb = nil
|
777
776
|
@plugin.run
|
778
777
|
|
779
|
-
expect(@plugin[:platform]).to eq(
|
780
|
-
expect(@plugin[:platform_family]).to eq(
|
781
|
-
expect(@plugin[:platform_version]).to eq(
|
778
|
+
expect(@plugin[:platform]).to eq("ios_xr")
|
779
|
+
expect(@plugin[:platform_family]).to eq("wrlinux")
|
780
|
+
expect(@plugin[:platform_version]).to eq("6.0.0.14I")
|
782
781
|
end
|
783
782
|
end
|
784
783
|
end
|
@@ -16,8 +16,7 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
|
20
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper.rb')
|
19
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
|
21
20
|
|
22
21
|
describe Ohai::System, "Linux plugin uptime" do
|
23
22
|
before(:each) do
|
@@ -16,7 +16,7 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
require File.expand_path(File.dirname(__FILE__) +
|
19
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
|
20
20
|
|
21
21
|
describe Ohai::System, "Linux virtualization platform" do
|
22
22
|
let(:plugin) { get_plugin("linux/virtualization") }
|
@@ -72,7 +72,7 @@ describe Ohai::System, "Linux virtualization platform" do
|
|
72
72
|
it "does not set virtualization if xen isn't there" do
|
73
73
|
expect(File).to receive(:exist?).at_least(:once).and_return(false)
|
74
74
|
plugin.run
|
75
|
-
expect(plugin[:virtualization]).to eq({
|
75
|
+
expect(plugin[:virtualization]).to eq({ "systems" => {} })
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
@@ -116,7 +116,7 @@ describe Ohai::System, "Linux virtualization platform" do
|
|
116
116
|
it "does not set virtualization if kvm isn't there" do
|
117
117
|
expect(File).to receive(:exist?).at_least(:once).and_return(false)
|
118
118
|
plugin.run
|
119
|
-
expect(plugin[:virtualization]).to eq({
|
119
|
+
expect(plugin[:virtualization]).to eq({ "systems" => {} })
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
@@ -142,7 +142,7 @@ describe Ohai::System, "Linux virtualization platform" do
|
|
142
142
|
it "does not set virtualization if vbox isn't there" do
|
143
143
|
expect(File).to receive(:exist?).at_least(:once).and_return(false)
|
144
144
|
plugin.run
|
145
|
-
expect(plugin[:virtualization]).to eq({
|
145
|
+
expect(plugin[:virtualization]).to eq({ "systems" => {} })
|
146
146
|
end
|
147
147
|
end
|
148
148
|
|
@@ -152,7 +152,7 @@ describe Ohai::System, "Linux virtualization platform" do
|
|
152
152
|
end
|
153
153
|
|
154
154
|
it "sets virtualpc guest if dmidecode detects Microsoft Virtual Machine" do
|
155
|
-
ms_vpc_dmidecode
|
155
|
+
ms_vpc_dmidecode = <<-MSVPC
|
156
156
|
System Information
|
157
157
|
Manufacturer: Microsoft Corporation
|
158
158
|
Product Name: Virtual Machine
|
@@ -169,7 +169,7 @@ MSVPC
|
|
169
169
|
end
|
170
170
|
|
171
171
|
it "sets hyperv guest if dmidecode detects Hyper-V or version 7.0" do
|
172
|
-
ms_hv_dmidecode
|
172
|
+
ms_hv_dmidecode = <<-MSHV
|
173
173
|
System Information
|
174
174
|
Manufacturer: Microsoft Corporation
|
175
175
|
Product Name: Virtual Machine
|
@@ -186,7 +186,7 @@ MSHV
|
|
186
186
|
end
|
187
187
|
|
188
188
|
it "sets virtualserver guest if dmidecode detects version 5.0" do
|
189
|
-
ms_vs_dmidecode
|
189
|
+
ms_vs_dmidecode = <<-MSVS
|
190
190
|
System Information
|
191
191
|
Manufacturer: Microsoft Corporation
|
192
192
|
Product Name: Virtual Machine
|
@@ -203,7 +203,7 @@ MSVS
|
|
203
203
|
end
|
204
204
|
|
205
205
|
it "sets vmware guest if dmidecode detects VMware" do
|
206
|
-
vmware_dmidecode
|
206
|
+
vmware_dmidecode = <<-VMWARE
|
207
207
|
System Information
|
208
208
|
Manufacturer: VMware, Inc.
|
209
209
|
Product Name: VMware Virtual Platform
|
@@ -222,7 +222,7 @@ VMWARE
|
|
222
222
|
end
|
223
223
|
|
224
224
|
it "sets vbox guest if dmidecode detects VirtualBox" do
|
225
|
-
vbox_dmidecode
|
225
|
+
vbox_dmidecode = <<-VBOX
|
226
226
|
Base Board Information
|
227
227
|
Manufacturer: Oracle Corporation
|
228
228
|
Product Name: VirtualBox
|
@@ -243,7 +243,7 @@ VBOX
|
|
243
243
|
end
|
244
244
|
|
245
245
|
it "sets openstack guest if dmidecode detects OpenStack" do
|
246
|
-
openstack_dmidecode
|
246
|
+
openstack_dmidecode = <<-OPENSTACK
|
247
247
|
System Information
|
248
248
|
Manufacturer: Red Hat Inc.
|
249
249
|
Product Name: OpenStack Nova
|
@@ -262,7 +262,7 @@ OPENSTACK
|
|
262
262
|
end
|
263
263
|
|
264
264
|
it "sets kvm guest if dmidecode contains KVM" do
|
265
|
-
kvm_dmidecode
|
265
|
+
kvm_dmidecode = <<-RKVM
|
266
266
|
System Information
|
267
267
|
Manufacturer: Red Hat
|
268
268
|
Product Name: KVM
|
@@ -281,7 +281,7 @@ RKVM
|
|
281
281
|
end
|
282
282
|
|
283
283
|
it "sets kvm guest if dmidecode detects RHEV" do
|
284
|
-
kvm_dmidecode
|
284
|
+
kvm_dmidecode = <<-RHEV
|
285
285
|
System Information
|
286
286
|
Manufacturer: Red Hat
|
287
287
|
Product Name: RHEV Hypervisor
|
@@ -302,7 +302,7 @@ RHEV
|
|
302
302
|
it "should run dmidecode and not set virtualization if nothing is detected" do
|
303
303
|
allow(plugin).to receive(:shell_out).with("dmidecode").and_return(mock_shell_out(0, "", ""))
|
304
304
|
plugin.run
|
305
|
-
expect(plugin[:virtualization]).to eq({
|
305
|
+
expect(plugin[:virtualization]).to eq({ "systems" => {} })
|
306
306
|
end
|
307
307
|
end
|
308
308
|
|
@@ -313,7 +313,7 @@ RHEV
|
|
313
313
|
plugin.run
|
314
314
|
expect(plugin[:virtualization][:system]).to eq("linux-vserver")
|
315
315
|
expect(plugin[:virtualization][:role]).to eq("host")
|
316
|
-
expect(plugin[:virtualization][:systems][
|
316
|
+
expect(plugin[:virtualization][:systems]["linux-vserver"]).to eq("host")
|
317
317
|
end
|
318
318
|
|
319
319
|
it "sets Linux-VServer host if /proc/self/status contains VxID: 0" do
|
@@ -322,7 +322,7 @@ RHEV
|
|
322
322
|
plugin.run
|
323
323
|
expect(plugin[:virtualization][:system]).to eq("linux-vserver")
|
324
324
|
expect(plugin[:virtualization][:role]).to eq("host")
|
325
|
-
expect(plugin[:virtualization][:systems][
|
325
|
+
expect(plugin[:virtualization][:systems]["linux-vserver"]).to eq("host")
|
326
326
|
end
|
327
327
|
|
328
328
|
it "sets Linux-VServer host if /proc/self/status contains multiple space VxID: 0" do
|
@@ -331,7 +331,7 @@ RHEV
|
|
331
331
|
plugin.run
|
332
332
|
expect(plugin[:virtualization][:system]).to eq("linux-vserver")
|
333
333
|
expect(plugin[:virtualization][:role]).to eq("host")
|
334
|
-
expect(plugin[:virtualization][:systems][
|
334
|
+
expect(plugin[:virtualization][:systems]["linux-vserver"]).to eq("host")
|
335
335
|
end
|
336
336
|
|
337
337
|
it "sets Linux-VServer host if /proc/self/status contains tabbed VxID:\t0" do
|
@@ -340,7 +340,7 @@ RHEV
|
|
340
340
|
plugin.run
|
341
341
|
expect(plugin[:virtualization][:system]).to eq("linux-vserver")
|
342
342
|
expect(plugin[:virtualization][:role]).to eq("host")
|
343
|
-
expect(plugin[:virtualization][:systems][
|
343
|
+
expect(plugin[:virtualization][:systems]["linux-vserver"]).to eq("host")
|
344
344
|
end
|
345
345
|
|
346
346
|
it "sets Linux-VServer guest if /proc/self/status contains s_context > 0" do
|
@@ -349,7 +349,7 @@ RHEV
|
|
349
349
|
plugin.run
|
350
350
|
expect(plugin[:virtualization][:system]).to eq("linux-vserver")
|
351
351
|
expect(plugin[:virtualization][:role]).to eq("guest")
|
352
|
-
expect(plugin[:virtualization][:systems][
|
352
|
+
expect(plugin[:virtualization][:systems]["linux-vserver"]).to eq("guest")
|
353
353
|
end
|
354
354
|
|
355
355
|
it "sets Linux-VServer guest if /proc/self/status contains VxID > 0" do
|
@@ -358,13 +358,13 @@ RHEV
|
|
358
358
|
plugin.run
|
359
359
|
expect(plugin[:virtualization][:system]).to eq("linux-vserver")
|
360
360
|
expect(plugin[:virtualization][:role]).to eq("guest")
|
361
|
-
expect(plugin[:virtualization][:systems][
|
361
|
+
expect(plugin[:virtualization][:systems]["linux-vserver"]).to eq("guest")
|
362
362
|
end
|
363
363
|
|
364
364
|
it "does not set virtualization if Linux-VServer isn't there" do
|
365
365
|
expect(File).to receive(:exist?).at_least(:once).and_return(false)
|
366
366
|
plugin.run
|
367
|
-
expect(plugin[:virtualization]).to eq({
|
367
|
+
expect(plugin[:virtualization]).to eq({ "systems" => {} })
|
368
368
|
end
|
369
369
|
end
|
370
370
|
|
@@ -390,13 +390,13 @@ RHEV
|
|
390
390
|
expect(File).to receive(:exist?).with("/proc/bc/0").and_return(false)
|
391
391
|
expect(File).to receive(:exist?).with("/proc/vz").and_return(false)
|
392
392
|
plugin.run
|
393
|
-
expect(plugin[:virtualization]).to eq({
|
393
|
+
expect(plugin[:virtualization]).to eq({ "systems" => {} })
|
394
394
|
end
|
395
395
|
end
|
396
396
|
|
397
397
|
describe "when we are checking for parallels" do
|
398
398
|
it "sets parallels guest if /proc/bus/pci/devices contains 1ab84000" do
|
399
|
-
devices
|
399
|
+
devices = <<-DEVICES
|
400
400
|
0018 1ab84000 1f 8001 0 0 0 0 0 0 20 0 0 0 0 0 0 prl_tg
|
401
401
|
0028 1af41000 17 8201 ee000000 0 0 0 0 0 40 1000 0 0 0 0 0 virtio-pci
|
402
402
|
DEVICES
|
@@ -409,20 +409,20 @@ RHEV
|
|
409
409
|
end
|
410
410
|
|
411
411
|
it "does not set virtualization if /proc/bus/pci/devices not contains 1ab84000" do
|
412
|
-
devices
|
412
|
+
devices = <<-DEVICES
|
413
413
|
0030 1af41000 a 8401 ee040000 0 0 0 0 0 40 1000 0 0 0 0 0 virtio-pci
|
414
414
|
0050 10110022 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
415
415
|
DEVICES
|
416
416
|
expect(File).to receive(:exist?).with("/proc/bus/pci/devices").and_return(true)
|
417
417
|
allow(File).to receive(:read).with("/proc/bus/pci/devices").and_return(devices)
|
418
418
|
plugin.run
|
419
|
-
expect(plugin[:virtualization]).to eq({
|
419
|
+
expect(plugin[:virtualization]).to eq({ "systems" => {} })
|
420
420
|
end
|
421
421
|
end
|
422
422
|
|
423
423
|
describe "when we are checking for lxc" do
|
424
424
|
it "sets lxc guest if /proc/self/cgroup exist and there are /lxc/<hexadecimal> mounts" do
|
425
|
-
self_cgroup
|
425
|
+
self_cgroup = <<-CGROUP
|
426
426
|
8:blkio:/lxc/baa660ed81bc81d262ac6e19486142aeec5fce2043e2a173eb2505c6fbed89bc
|
427
427
|
7:net_cls:/lxc/baa660ed81bc81d262ac6e19486142aeec5fce2043e2a173eb2505c6fbed89bc
|
428
428
|
6:freezer:/lxc/baa660ed81bc81d262ac6e19486142aeec5fce2043e2a173eb2505c6fbed89bc
|
@@ -441,7 +441,7 @@ CGROUP
|
|
441
441
|
end
|
442
442
|
|
443
443
|
it "sets lxc guest if /proc/self/cgroup exist and there are /lxc/<name> mounts" do
|
444
|
-
self_cgroup
|
444
|
+
self_cgroup = <<-CGROUP
|
445
445
|
8:blkio:/lxc/vanilla
|
446
446
|
7:net_cls:/lxc/vanilla
|
447
447
|
6:freezer:/lxc/vanilla
|
@@ -460,7 +460,7 @@ CGROUP
|
|
460
460
|
end
|
461
461
|
|
462
462
|
it "sets not set anything if /proc/self/cgroup exist and the cgroup is named arbitrarily, it isn't necessarily lxc." do
|
463
|
-
self_cgroup
|
463
|
+
self_cgroup = <<-CGROUP
|
464
464
|
8:blkio:/Charlie
|
465
465
|
7:net_cls:/Charlie
|
466
466
|
6:freezer:/Charlie
|
@@ -473,12 +473,12 @@ CGROUP
|
|
473
473
|
expect(File).to receive(:exist?).with("/proc/self/cgroup").and_return(true)
|
474
474
|
allow(File).to receive(:read).with("/proc/self/cgroup").and_return(self_cgroup)
|
475
475
|
plugin.run
|
476
|
-
expect(plugin[:virtualization]).to eq({
|
476
|
+
expect(plugin[:virtualization]).to eq({ "systems" => {} })
|
477
477
|
end
|
478
478
|
|
479
479
|
context "/proc/self/cgroup only has / mounts" do
|
480
480
|
before(:each) do
|
481
|
-
self_cgroup
|
481
|
+
self_cgroup = <<-CGROUP
|
482
482
|
8:blkio:/
|
483
483
|
7:net_cls:/
|
484
484
|
6:freezer:/
|
@@ -515,7 +515,7 @@ CGROUP
|
|
515
515
|
plugin.run
|
516
516
|
expect(plugin[:virtualization][:system]).to be_nil
|
517
517
|
expect(plugin[:virtualization][:role]).to be_nil
|
518
|
-
expect(plugin[:virtualization]).to eq({
|
518
|
+
expect(plugin[:virtualization]).to eq({ "systems" => {} })
|
519
519
|
end
|
520
520
|
|
521
521
|
end
|
@@ -523,13 +523,13 @@ CGROUP
|
|
523
523
|
it "does not set virtualization if /proc/self/cgroup isn't there" do
|
524
524
|
expect(File).to receive(:exist?).with("/proc/self/cgroup").and_return(false)
|
525
525
|
plugin.run
|
526
|
-
expect(plugin[:virtualization]).to eq({
|
526
|
+
expect(plugin[:virtualization]).to eq({ "systems" => {} })
|
527
527
|
end
|
528
528
|
end
|
529
529
|
|
530
530
|
describe "when we are checking for docker" do
|
531
531
|
it "sets docker guest if /proc/self/cgroup exist and there are /docker/<hexadecimal> mounts" do
|
532
|
-
self_cgroup
|
532
|
+
self_cgroup = <<-CGROUP
|
533
533
|
8:blkio:/docker/baa660ed81bc81d262ac6e19486142aeec5fce2043e2a173eb2505c6fbed89bc
|
534
534
|
7:net_cls:/docker/baa660ed81bc81d262ac6e19486142aeec5fce2043e2a173eb2505c6fbed89bc
|
535
535
|
6:freezer:/docker/baa660ed81bc81d262ac6e19486142aeec5fce2043e2a173eb2505c6fbed89bc
|
@@ -548,7 +548,7 @@ CGROUP
|
|
548
548
|
end
|
549
549
|
|
550
550
|
it "sets docker guest if /proc/self/cgroup exist and there are /docker/<name> mounts" do
|
551
|
-
self_cgroup
|
551
|
+
self_cgroup = <<-CGROUP
|
552
552
|
8:blkio:/docker/vanilla
|
553
553
|
7:net_cls:/docker/vanilla
|
554
554
|
6:freezer:/docker/vanilla
|
@@ -569,7 +569,7 @@ CGROUP
|
|
569
569
|
# Relevant at least starting docker 1.6.2, kernel 4.0.5 & systemd 224-1.
|
570
570
|
# Doi not exactly know which software/version really matters here.
|
571
571
|
it "should set docker guest if /proc/self/cgroup exists and there are /system.slice/docker-<hexadecimal> mounts (systemd managed cgroup)" do
|
572
|
-
self_cgroup
|
572
|
+
self_cgroup = <<-CGROUP
|
573
573
|
8:devices:/system.slice/docker-47341c91be8d491cb3b8a475ad5b4aef6e79bf728cbb351c384e4a6c410f172f.scope
|
574
574
|
7:cpuset:/system.slice/docker-47341c91be8d491cb3b8a475ad5b4aef6e79bf728cbb351c384e4a6c410f172f.scope
|
575
575
|
6:blkio:/system.slice/docker-47341c91be8d491cb3b8a475ad5b4aef6e79bf728cbb351c384e4a6c410f172f.scope
|
@@ -588,7 +588,7 @@ CGROUP
|
|
588
588
|
end
|
589
589
|
|
590
590
|
it "sets not set anything if /proc/self/cgroup exist and the cgroup is named arbitrarily, it isn't necessarily lxc." do
|
591
|
-
self_cgroup
|
591
|
+
self_cgroup = <<-CGROUP
|
592
592
|
8:blkio:/Charlie
|
593
593
|
7:net_cls:/Charlie
|
594
594
|
6:freezer:/Charlie
|
@@ -601,12 +601,12 @@ CGROUP
|
|
601
601
|
allow(File).to receive(:exist?).with("/proc/self/cgroup").and_return(true)
|
602
602
|
allow(File).to receive(:read).with("/proc/self/cgroup").and_return(self_cgroup)
|
603
603
|
plugin.run
|
604
|
-
expect(plugin[:virtualization]).to eq({
|
604
|
+
expect(plugin[:virtualization]).to eq({ "systems" => {} })
|
605
605
|
end
|
606
606
|
|
607
607
|
context "/proc/self/cgroup only has / mounts" do
|
608
608
|
before(:each) do
|
609
|
-
self_cgroup
|
609
|
+
self_cgroup = <<-CGROUP
|
610
610
|
8:blkio:/
|
611
611
|
7:net_cls:/
|
612
612
|
6:freezer:/
|
@@ -619,7 +619,7 @@ CGROUP
|
|
619
619
|
allow(File).to receive(:exist?).with("/proc/self/cgroup").and_return(true)
|
620
620
|
allow(File).to receive(:read).with("/proc/self/cgroup").and_return(self_cgroup)
|
621
621
|
plugin.run
|
622
|
-
expect(plugin[:virtualization]).to eq({
|
622
|
+
expect(plugin[:virtualization]).to eq({ "systems" => {} })
|
623
623
|
end
|
624
624
|
|
625
625
|
end
|
@@ -639,13 +639,13 @@ CGROUP
|
|
639
639
|
plugin.run
|
640
640
|
expect(plugin[:virtualization][:system]).to be_nil
|
641
641
|
expect(plugin[:virtualization][:role]).to be_nil
|
642
|
-
expect(plugin[:virtualization]).to eq({
|
642
|
+
expect(plugin[:virtualization]).to eq({ "systems" => {} })
|
643
643
|
end
|
644
644
|
|
645
645
|
it "does not set virtualization if /proc/self/cgroup isn't there" do
|
646
646
|
allow(File).to receive(:exist?).with("/proc/self/cgroup").and_return(false)
|
647
647
|
plugin.run
|
648
|
-
expect(plugin[:virtualization]).to eq({
|
648
|
+
expect(plugin[:virtualization]).to eq({ "systems" => {} })
|
649
649
|
end
|
650
650
|
|
651
651
|
it "sets virtualization if /.dockerenv exists" do
|
@@ -668,13 +668,13 @@ CGROUP
|
|
668
668
|
allow(File).to receive(:exist?).with("/.dockerenv").and_return(false)
|
669
669
|
allow(File).to receive(:exist?).with("/.dockerinit").and_return(false)
|
670
670
|
plugin.run
|
671
|
-
expect(plugin[:virtualization]).to eq({
|
671
|
+
expect(plugin[:virtualization]).to eq({ "systems" => {} })
|
672
672
|
end
|
673
673
|
|
674
674
|
end
|
675
675
|
|
676
676
|
it "does not set virtualization if no tests match" do
|
677
677
|
plugin.run
|
678
|
-
expect(plugin[:virtualization]).to eq({
|
678
|
+
expect(plugin[:virtualization]).to eq({ "systems" => {} })
|
679
679
|
end
|
680
680
|
end
|