summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSalim Alam <salam@chef.io>2016-04-13 14:59:34 -0700
committerSalim Alam <salam@chef.io>2016-04-13 14:59:34 -0700
commitcd7fcf377710e4da4e32c8488d0ecf772573fb25 (patch)
tree7af118e9eb8b0519aa888f49337c60044ac7f4da
parent654b24f436fde12eb05e8d3725cd27c7c78e5d48 (diff)
downloadohai-cd7fcf377710e4da4e32c8488d0ecf772573fb25.tar.gz
Don't execute .so libs for Windows
-rw-r--r--lib/ohai/plugins/c.rb2
-rw-r--r--spec/unit/plugins/c_spec.rb8
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/ohai/plugins/c.rb b/lib/ohai/plugins/c.rb
index 7817fc86..81271f80 100644
--- a/lib/ohai/plugins/c.rb
+++ b/lib/ohai/plugins/c.rb
@@ -53,7 +53,7 @@ Ohai.plugin(:C) do
c[:glibc][:version] = $1
c[:glibc][:description] = description
end
- end unless c[:glibc]
+ end unless c[:glibc] || ::RbConfig::CONFIG["host_os"] =~ /mswin|mingw32|windows/
end
#ms cl
diff --git a/spec/unit/plugins/c_spec.rb b/spec/unit/plugins/c_spec.rb
index 5b542f4e..322d396f 100644
--- a/spec/unit/plugins/c_spec.rb
+++ b/spec/unit/plugins/c_spec.rb
@@ -153,17 +153,17 @@ describe Ohai::System, "plugin c" do
end
#glibc
- it "gets the glibc x.x.x version from running /lib/libc.so.6" do
+ it "gets the glibc x.x.x version from running /lib/libc.so.6", :unix_only do
expect(plugin).to receive(:shell_out).with("/lib/libc.so.6").and_return(mock_shell_out(0, C_GLIBC_2_3_4, ""))
plugin.run
end
- it "sets languages[:c][:glibc][:version]" do
+ it "sets languages[:c][:glibc][:version]", :unix_only do
plugin.run
expect(plugin.languages[:c][:glibc][:version]).to eql("2.3.4")
end
- it "sets languages[:c][:glibc][:description]" do
+ it "sets languages[:c][:glibc][:description]", :unix_only do
plugin.run
expect(plugin.languages[:c][:glibc][:description]).to eql(C_GLIBC_2_3_4.split($/).first)
end
@@ -183,7 +183,7 @@ describe Ohai::System, "plugin c" do
expect(plugin[:languages][:c]).not_to be_empty # expect other attributes
end
- it "gets the glibc x.x version from running /lib/libc.so.6" do
+ it "gets the glibc x.x version from running /lib/libc.so.6", :unix_only do
allow(plugin).to receive(:shell_out).with("/lib/libc.so.6").and_return(mock_shell_out(0, C_GLIBC_2_5, ""))
expect(plugin).to receive(:shell_out).with("/lib/libc.so.6").and_return(mock_shell_out(0, C_GLIBC_2_5, ""))
plugin.run