ohai 8.26.1 → 13.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (188) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile +3 -4
  3. data/Rakefile +14 -0
  4. data/lib/ohai/application.rb +1 -0
  5. data/lib/ohai/config.rb +2 -88
  6. data/lib/ohai/dsl/plugin.rb +0 -4
  7. data/lib/ohai/exception.rb +0 -1
  8. data/lib/ohai/loader.rb +11 -2
  9. data/lib/ohai/log.rb +3 -1
  10. data/lib/ohai/mixin/command.rb +1 -318
  11. data/lib/ohai/mixin/do_metadata.rb +47 -0
  12. data/lib/ohai/mixin/ec2_metadata.rb +2 -29
  13. data/lib/ohai/mixin/gce_metadata.rb +0 -37
  14. data/lib/ohai/mixin/http_helper.rb +56 -0
  15. data/lib/ohai/mixin/network_constants.rb +0 -5
  16. data/lib/ohai/plugins/cloud.rb +144 -157
  17. data/lib/ohai/plugins/darwin/filesystem.rb +68 -22
  18. data/lib/ohai/plugins/digital_ocean.rb +24 -42
  19. data/lib/ohai/plugins/dmi.rb +81 -77
  20. data/lib/ohai/plugins/ec2.rb +33 -60
  21. data/lib/ohai/plugins/gce.rb +3 -1
  22. data/lib/ohai/plugins/hostname.rb +1 -16
  23. data/lib/ohai/plugins/linux/filesystem.rb +130 -81
  24. data/lib/ohai/plugins/linux/mdadm.rb +3 -45
  25. data/lib/ohai/plugins/linux/network.rb +1 -26
  26. data/lib/ohai/plugins/linux/platform.rb +4 -2
  27. data/lib/ohai/plugins/linux/virtualization.rb +1 -5
  28. data/lib/ohai/plugins/scala.rb +1 -13
  29. data/lib/ohai/plugins/solaris2/network.rb +1 -2
  30. data/lib/ohai/plugins/uptime.rb +0 -9
  31. data/lib/ohai/plugins/windows/cpu.rb +2 -1
  32. data/lib/ohai/plugins/windows/network.rb +1 -1
  33. data/lib/ohai/runner.rb +0 -5
  34. data/lib/ohai/system.rb +38 -8
  35. data/lib/ohai/version.rb +2 -2
  36. data/ohai.gemspec +1 -1
  37. data/spec/functional/application_spec.rb +0 -40
  38. data/spec/functional/plugins/powershell_spec.rb +1 -1
  39. data/spec/functional/plugins/root_group_spec.rb +1 -1
  40. data/spec/functional/plugins/windows/uptime_spec.rb +1 -1
  41. data/spec/ohai_spec.rb +1 -1
  42. data/spec/support/integration_helper.rb +17 -0
  43. data/spec/support/platform_helpers.rb +17 -0
  44. data/spec/unit/application_spec.rb +0 -1
  45. data/spec/unit/config_spec.rb +0 -111
  46. data/spec/unit/dsl/plugin_spec.rb +1 -1
  47. data/spec/unit/hints_spec.rb +1 -1
  48. data/spec/unit/loader_spec.rb +26 -1
  49. data/spec/unit/mixin/command_spec.rb +1 -69
  50. data/spec/unit/mixin/ec2_metadata_spec.rb +1 -1
  51. data/spec/unit/mixin/softlayer_metadata_spec.rb +1 -1
  52. data/spec/unit/plugin_config_spec.rb +0 -1
  53. data/spec/unit/plugins/abort_spec.rb +1 -1
  54. data/spec/unit/plugins/aix/cpu_spec.rb +1 -1
  55. data/spec/unit/plugins/aix/filesystem_spec.rb +2 -1
  56. data/spec/unit/plugins/aix/hostname_spec.rb +1 -1
  57. data/spec/unit/plugins/aix/kernel_spec.rb +1 -1
  58. data/spec/unit/plugins/aix/memory_spec.rb +1 -1
  59. data/spec/unit/plugins/aix/network_spec.rb +1 -1
  60. data/spec/unit/plugins/aix/os_spec.rb +1 -1
  61. data/spec/unit/plugins/aix/platform_spec.rb +1 -1
  62. data/spec/unit/plugins/aix/uptime_spec.rb +1 -1
  63. data/spec/unit/plugins/aix/virtualization_spec.rb +1 -1
  64. data/spec/unit/plugins/azure_spec.rb +1 -1
  65. data/spec/unit/plugins/bsd/filesystem_spec.rb +1 -1
  66. data/spec/unit/plugins/bsd/virtualization_spec.rb +1 -1
  67. data/spec/unit/plugins/c_spec.rb +1 -1
  68. data/spec/unit/plugins/chef_spec.rb +1 -2
  69. data/spec/unit/plugins/cloud_spec.rb +210 -50
  70. data/spec/unit/plugins/darwin/cpu_spec.rb +1 -1
  71. data/spec/unit/plugins/darwin/filesystem_spec.rb +62 -13
  72. data/spec/unit/plugins/darwin/hardware_spec.rb +2 -2
  73. data/spec/unit/plugins/darwin/hostname_spec.rb +1 -1
  74. data/spec/unit/plugins/darwin/kernel_spec.rb +1 -1
  75. data/spec/unit/plugins/darwin/memory_spec.rb +1 -1
  76. data/spec/unit/plugins/darwin/network_spec.rb +1 -1
  77. data/spec/unit/plugins/darwin/platform_spec.rb +1 -1
  78. data/spec/unit/plugins/darwin/system_profiler_spec.rb +2 -9
  79. data/spec/unit/plugins/darwin/virtualization_spec.rb +1 -1
  80. data/spec/unit/plugins/digital_ocean_spec.rb +39 -110
  81. data/spec/unit/plugins/dmi_spec.rb +1 -1
  82. data/spec/unit/plugins/ec2_spec.rb +10 -62
  83. data/spec/unit/plugins/elixir_spec.rb +1 -1
  84. data/spec/unit/plugins/erlang_spec.rb +1 -1
  85. data/spec/unit/plugins/eucalyptus_spec.rb +1 -1
  86. data/spec/unit/plugins/fail_spec.rb +1 -1
  87. data/spec/unit/plugins/freebsd/cpu_spec.rb +1 -1
  88. data/spec/unit/plugins/freebsd/hostname_spec.rb +1 -1
  89. data/spec/unit/plugins/freebsd/kernel_spec.rb +1 -1
  90. data/spec/unit/plugins/freebsd/os_spec.rb +1 -1
  91. data/spec/unit/plugins/freebsd/platform_spec.rb +1 -1
  92. data/spec/unit/plugins/gce_spec.rb +1 -1
  93. data/spec/unit/plugins/go_spec.rb +1 -1
  94. data/spec/unit/plugins/groovy_spec.rb +1 -1
  95. data/spec/unit/plugins/haskell_spec.rb +1 -1
  96. data/spec/unit/plugins/hostname_spec.rb +16 -41
  97. data/spec/unit/plugins/init_package_spec.rb +1 -1
  98. data/spec/unit/plugins/ip_scopes_spec.rb +18 -6
  99. data/spec/unit/plugins/java_spec.rb +1 -1
  100. data/spec/unit/plugins/joyent_spec.rb +17 -1
  101. data/spec/unit/plugins/kernel_spec.rb +1 -1
  102. data/spec/unit/plugins/linode_spec.rb +1 -1
  103. data/spec/unit/plugins/linux/block_device_spec.rb +1 -1
  104. data/spec/unit/plugins/linux/cpu_spec.rb +1 -2
  105. data/spec/unit/plugins/linux/filesystem_spec.rb +207 -201
  106. data/spec/unit/plugins/linux/fips_spec.rb +1 -1
  107. data/spec/unit/plugins/linux/hostname_spec.rb +1 -1
  108. data/spec/unit/plugins/linux/hostnamectl_spec.rb +1 -1
  109. data/spec/unit/plugins/linux/kernel_spec.rb +1 -1
  110. data/spec/unit/plugins/linux/lsb_spec.rb +1 -1
  111. data/spec/unit/plugins/linux/machineid_spec.rb +1 -1
  112. data/spec/unit/plugins/linux/mdadm_spec.rb +2 -68
  113. data/spec/unit/plugins/linux/memory_spec.rb +1 -1
  114. data/spec/unit/plugins/linux/network_spec.rb +3 -44
  115. data/spec/unit/plugins/linux/platform_spec.rb +4 -4
  116. data/spec/unit/plugins/linux/sessions_spec.rb +1 -1
  117. data/spec/unit/plugins/linux/uptime_spec.rb +1 -1
  118. data/spec/unit/plugins/linux/virtualization_spec.rb +1 -28
  119. data/spec/unit/plugins/lua_spec.rb +1 -1
  120. data/spec/unit/plugins/mono_spec.rb +1 -1
  121. data/spec/unit/plugins/netbsd/hostname_spec.rb +1 -1
  122. data/spec/unit/plugins/netbsd/kernel_spec.rb +1 -1
  123. data/spec/unit/plugins/netbsd/platform_spec.rb +1 -1
  124. data/spec/unit/plugins/network_spec.rb +1 -1
  125. data/spec/unit/plugins/nodejs_spec.rb +1 -1
  126. data/spec/unit/plugins/ohai_spec.rb +1 -1
  127. data/spec/unit/plugins/ohai_time_spec.rb +1 -1
  128. data/spec/unit/plugins/openbsd/hostname_spec.rb +1 -1
  129. data/spec/unit/plugins/openbsd/kernel_spec.rb +1 -1
  130. data/spec/unit/plugins/openbsd/platform_spec.rb +1 -1
  131. data/spec/unit/plugins/openstack_spec.rb +2 -3
  132. data/spec/unit/plugins/os_spec.rb +1 -1
  133. data/spec/unit/plugins/packages_spec.rb +1 -1
  134. data/spec/unit/plugins/passwd_spec.rb +17 -1
  135. data/spec/unit/plugins/perl_spec.rb +1 -1
  136. data/spec/unit/plugins/php_spec.rb +1 -1
  137. data/spec/unit/plugins/platform_spec.rb +1 -1
  138. data/spec/unit/plugins/powershell_spec.rb +1 -1
  139. data/spec/unit/plugins/python_spec.rb +1 -1
  140. data/spec/unit/plugins/rackspace_spec.rb +1 -2
  141. data/spec/unit/plugins/root_group_spec.rb +2 -2
  142. data/spec/unit/plugins/ruby_spec.rb +1 -1
  143. data/spec/unit/plugins/rust_spec.rb +1 -1
  144. data/spec/unit/plugins/scala_spec.rb +3 -37
  145. data/spec/unit/plugins/shard_spec.rb +1 -1
  146. data/spec/unit/plugins/shells_spec.rb +1 -1
  147. data/spec/unit/plugins/softlayer_spec.rb +1 -1
  148. data/spec/unit/plugins/solaris2/cpu_spec.rb +1 -1
  149. data/spec/unit/plugins/solaris2/dmi_spec.rb +1 -1
  150. data/spec/unit/plugins/solaris2/hostname_spec.rb +1 -1
  151. data/spec/unit/plugins/solaris2/kernel_spec.rb +1 -1
  152. data/spec/unit/plugins/solaris2/memory_spec.rb +1 -1
  153. data/spec/unit/plugins/solaris2/network_spec.rb +7 -4
  154. data/spec/unit/plugins/solaris2/platform_spec.rb +1 -1
  155. data/spec/unit/plugins/solaris2/virtualization_spec.rb +1 -1
  156. data/spec/unit/plugins/solaris2/zpools_spec.rb +1 -1
  157. data/spec/unit/plugins/ssh_host_keys_spec.rb +1 -1
  158. data/spec/unit/plugins/sysconf_spec.rb +1 -1
  159. data/spec/unit/plugins/timezone_spec.rb +1 -1
  160. data/spec/unit/plugins/virtualbox_spec.rb +1 -1
  161. data/spec/unit/plugins/vmware_spec.rb +2 -1
  162. data/spec/unit/plugins/windows/cpu_spec.rb +9 -2
  163. data/spec/unit/plugins/windows/fips_spec.rb +1 -1
  164. data/spec/unit/plugins/windows/memory_spec.rb +1 -1
  165. data/spec/unit/plugins/windows/uptime_spec.rb +1 -1
  166. data/spec/unit/plugins/windows/virtualization_spec.rb +1 -1
  167. data/spec/unit/provides_map_spec.rb +1 -1
  168. data/spec/unit/runner_spec.rb +1 -1
  169. data/spec/unit/system_spec.rb +68 -76
  170. data/spec/unit/util/file_helper_spec.rb +1 -1
  171. data/spec/unit/util/ip_helper_spec.rb +1 -1
  172. metadata +6 -20
  173. data/lib/ohai/plugins/cloud_v2.rb +0 -315
  174. data/lib/ohai/plugins/darwin/filesystem2.rb +0 -107
  175. data/lib/ohai/plugins/linux/filesystem2.rb +0 -223
  176. data/lib/ohai/plugins/linux/lspci.rb +0 -76
  177. data/lib/ohai/plugins/network_listeners.rb +0 -60
  178. data/lib/ohai/plugins/sigar/cpu.rb +0 -44
  179. data/lib/ohai/plugins/sigar/filesystem.rb +0 -50
  180. data/lib/ohai/plugins/sigar/memory.rb +0 -39
  181. data/lib/ohai/plugins/sigar/network.rb +0 -168
  182. data/lib/ohai/plugins/sigar/network_route.rb +0 -64
  183. data/lib/ohai/plugins/sigar/platform.rb +0 -30
  184. data/spec/unit/plugins/cloud_v2_spec.rb +0 -389
  185. data/spec/unit/plugins/darwin/filesystem2_spec.rb +0 -139
  186. data/spec/unit/plugins/linux/filesystem2_spec.rb +0 -437
  187. data/spec/unit/plugins/linux/lspci_spec.rb +0 -133
  188. data/spec/unit/plugins/sigar/network_route_spec.rb +0 -148
@@ -16,7 +16,7 @@
16
16
  # limitations under the License.
17
17
  #
18
18
 
19
- require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
19
+ require_relative "../../../spec_helper.rb"
20
20
 
21
21
  describe Ohai::System, "OpenBSD kernel plugin" do
22
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__) + "/../../../spec_helper.rb")
19
+ require_relative "../../../spec_helper.rb"
20
20
 
21
21
  describe Ohai::System, "OpenBSD plugin platform" do
22
22
  before(:each) do
@@ -16,10 +16,9 @@
16
16
  # limitations under the License.
17
17
  #
18
18
 
19
- require "spec_helper"
20
- require "ohai/plugins/openstack"
19
+ require_relative "../../spec_helper.rb"
21
20
 
22
- describe "OpenStack Plugin" do
21
+ describe Ohai::System, "plugin openstack" do
23
22
 
24
23
  let(:plugin) { get_plugin("openstack") }
25
24
 
@@ -16,7 +16,7 @@
16
16
  # limitations under the License.
17
17
  #
18
18
 
19
- require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
19
+ require_relative "../../spec_helper.rb"
20
20
 
21
21
  ORIGINAL_CONFIG_HOST_OS = ::RbConfig::CONFIG["host_os"]
22
22
 
@@ -17,7 +17,7 @@
17
17
  # limitations under the License.
18
18
  #
19
19
 
20
- require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
20
+ require_relative "../../spec_helper.rb"
21
21
 
22
22
  describe Ohai::System, "plugin packages" do
23
23
  context "on debian" do
@@ -1,4 +1,20 @@
1
- require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
1
+ #
2
+ # License:: Apache License, Version 2.0
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ require_relative "../../spec_helper.rb"
2
18
 
3
19
  describe Ohai::System, "plugin etc", :unix_only do
4
20
  before(:each) do
@@ -17,7 +17,7 @@
17
17
  # limitations under the License.
18
18
  #
19
19
 
20
- require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
20
+ require_relative "../../spec_helper.rb"
21
21
 
22
22
  describe Ohai::System, "plugin perl" do
23
23
  let(:plugin) { get_plugin("perl") }
@@ -18,7 +18,7 @@
18
18
  # limitations under the License.
19
19
  #
20
20
 
21
- require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
21
+ require_relative "../../spec_helper.rb"
22
22
 
23
23
  describe Ohai::System, "plugin php" do
24
24
  let(:plugin) { get_plugin("php") }
@@ -16,7 +16,7 @@
16
16
  # limitations under the License.
17
17
  #
18
18
 
19
- require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
19
+ require_relative "../../spec_helper.rb"
20
20
 
21
21
  describe Ohai::System, "plugin platform" do
22
22
  before(:each) do
@@ -15,7 +15,7 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
18
+ require_relative "../../spec_helper.rb"
19
19
 
20
20
  describe Ohai::System, "plugin powershell" do
21
21
  let(:plugin) { get_plugin("powershell") }
@@ -17,7 +17,7 @@
17
17
  # limitations under the License.
18
18
  #
19
19
 
20
- require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
20
+ require_relative "../../spec_helper.rb"
21
21
 
22
22
  describe Ohai::System, "plugin python" do
23
23
  let(:stdout) { "2.5.2 (r252:60911, Jan 4 2009, 17:40:26)\n[GCC 4.3.2]\n" }
@@ -16,8 +16,7 @@
16
16
  #
17
17
 
18
18
  require "resolv"
19
-
20
- require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
19
+ require_relative "../../spec_helper.rb"
21
20
 
22
21
  describe Ohai::System, "plugin rackspace" do
23
22
  let(:plugin) { get_plugin("rackspace") }
@@ -16,8 +16,8 @@
16
16
  # limitations under the License.
17
17
  #
18
18
 
19
- require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
20
- require File.expand_path(File.dirname(__FILE__) + "/../../../lib/ohai/util/win32/group_helper.rb")
19
+ require_relative "../../spec_helper.rb"
20
+ require "ohai/util/win32/group_helper"
21
21
 
22
22
  describe Ohai::System, "root_group" do
23
23
  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__) + "/../../spec_helper.rb")
19
+ require_relative "../../spec_helper.rb"
20
20
 
21
21
  ruby_bin = File.join(::RbConfig::CONFIG["bindir"], ::RbConfig::CONFIG["ruby_install_name"])
22
22
 
@@ -14,7 +14,7 @@
14
14
  # limitations under the License.
15
15
  #
16
16
 
17
- require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
17
+ require_relative "../../spec_helper.rb"
18
18
 
19
19
  describe Ohai::System, "plugin rust" do
20
20
  let(:stdout) { "rustc 1.0.0-nightly (29bd9a06e 2015-01-20 23:03:09 +0000)" }
@@ -15,7 +15,7 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
18
+ require_relative "../../spec_helper.rb"
19
19
 
20
20
  describe Ohai::System, "plugin scala" do
21
21
 
@@ -26,15 +26,11 @@ describe Ohai::System, "plugin scala" do
26
26
  end
27
27
 
28
28
  let(:scala_out) { "Scala code runner version 2.11.6 -- Copyright 2002-2013, LAMP/EPFL" }
29
- let(:sbt_out) { "sbt launcher version 0.13.8" }
30
29
 
31
30
  def setup_plugin
32
31
  allow(plugin).to receive(:shell_out)
33
32
  .with("scala -version")
34
33
  .and_return(mock_shell_out(0, "", scala_out))
35
- allow(plugin).to receive(:shell_out)
36
- .with("sbt --version", { :timeout => 5 })
37
- .and_return(mock_shell_out(0, sbt_out, ""))
38
34
  end
39
35
 
40
36
  context "if scala is installed" do
@@ -48,45 +44,15 @@ describe Ohai::System, "plugin scala" do
48
44
  end
49
45
  end
50
46
 
51
- context "if sbt is installed" do
52
-
53
- before(:each) do
54
- setup_plugin
55
- plugin.run
56
- end
57
-
58
- it "sets languages[:scala][:sbt][:version]" do
59
- expect(plugin[:languages][:scala][:sbt][:version]).to eql("0.13.8")
60
- end
61
- end
62
-
63
- context "if scala/sbt are not installed" do
64
-
47
+ context "if scala is not installed" do
65
48
  before(:each) do
66
49
  allow(plugin).to receive(:shell_out)
67
50
  .and_raise( Ohai::Exceptions::Exec )
68
51
  plugin.run
69
52
  end
70
53
 
71
- it "does NOT set the languages[:scala] if scala/sbts commands fails" do
54
+ it "does NOT set the languages[:scala] if scala commands fails" do
72
55
  expect(plugin[:languages]).not_to have_key(:scala)
73
56
  end
74
57
  end
75
-
76
- context "if sbt is not installed" do
77
- before(:each) do
78
- allow(plugin).to receive(:shell_out)
79
- .with("scala -version")
80
- .and_return(mock_shell_out(0, "", scala_out))
81
-
82
- allow(plugin).to receive(:shell_out)
83
- .with("sbt --version", { :timeout => 5 })
84
- .and_raise( Ohai::Exceptions::Exec )
85
- plugin.run
86
- end
87
-
88
- it "does NOT set the languages[:scala][:sbt] if sbt command fails" do
89
- expect(plugin[:languages][:scala]).not_to have_key(:sbt)
90
- end
91
- end
92
58
  end
@@ -17,7 +17,7 @@
17
17
  #
18
18
 
19
19
  require "digest/md5"
20
- require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
20
+ require_relative "../../spec_helper.rb"
21
21
 
22
22
  describe Ohai::System, "shard plugin" do
23
23
  let(:plugin) { get_plugin("shard") }
@@ -15,7 +15,7 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
18
+ require_relative "../../spec_helper.rb"
19
19
 
20
20
  describe Ohai::System, "plugin shells" do
21
21
  let(:plugin) { get_plugin("shells") }
@@ -17,7 +17,7 @@
17
17
  # See the License for the specific language governing permissions and
18
18
  # limitations under the License.
19
19
 
20
- require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
20
+ require_relative "../../spec_helper.rb"
21
21
 
22
22
  describe Ohai::System, "plugin softlayer" do
23
23
  let(:plugin) { get_plugin("softlayer") }
@@ -14,7 +14,7 @@
14
14
  # limitations under the License.
15
15
  #
16
16
 
17
- require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
17
+ require_relative "../../../spec_helper.rb"
18
18
 
19
19
  describe Ohai::System, "Solaris2.X cpu plugin" do
20
20
  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__) + "/../../../spec_helper.rb")
19
+ require_relative "../../../spec_helper.rb"
20
20
 
21
21
  SOLARIS_DMI_OUT = <<-EOS
22
22
  ID SIZE TYPE
@@ -16,7 +16,7 @@
16
16
  # limitations under the License.
17
17
  #
18
18
 
19
- require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
19
+ require_relative "../../../spec_helper.rb"
20
20
 
21
21
  describe Ohai::System, "Solaris2.X hostname plugin" do
22
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__) + "/../../../spec_helper.rb")
19
+ require_relative "../../../spec_helper.rb"
20
20
 
21
21
  describe Ohai::System, "Solaris2.X kernel plugin" do
22
22
  # NOTE: Solaris will report the same module loaded multiple times
@@ -14,7 +14,7 @@
14
14
  # limitations under the License.
15
15
  #
16
16
 
17
- require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
17
+ require_relative "../../../spec_helper.rb"
18
18
 
19
19
  describe Ohai::System, "Solaris2.X memory plugin" do
20
20
  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__) + "/../../../spec_helper.rb")
19
+ require_relative "../../../spec_helper.rb"
20
20
 
21
21
  describe Ohai::System, "Solaris2.X network plugin" do
22
22
 
@@ -69,7 +69,9 @@ lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
69
69
  eri0: flags=1004843<UP,BROADCAST,RUNNING,MULTICAST,DHCP,IPv4> mtu 1500 \
70
70
  index 2
71
71
  inet 172.17.128.208 netmask ffffff00 broadcast 172.17.128.255
72
- ip6.tun0: flags=10008d1<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST,IPv4> mtu 1460 index 3
72
+ ip6.tun0: flags=10008d1<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST,IPv4> \
73
+ mtu 1460
74
+ index 3
73
75
  inet6 tunnel src fe80::1 tunnel dst fe80::2
74
76
  tunnel security settings --> use 'ipsecconf -ln -i ip.tun1'
75
77
  tunnel hop limit 60 tunnel encapsulation limit 4
@@ -78,7 +80,8 @@ qfe1: flags=2000841<UP,RUNNING,MULTICAST,IPv6> mtu 1500 index 3
78
80
  usesrc vni0
79
81
  inet6 fe80::203:baff:fe17:4be0/10
80
82
  ether 0:3:ba:17:4b:e0
81
- vni0: flags=2002210041<UP,RUNNING,NOXMIT,NONUD,IPv6,VIRTUAL> mtu 1460 index 5
83
+ vni0: flags=2002210041<UP,RUNNING,NOXMIT,NONUD,IPv6,VIRTUAL> mtu 0
84
+ index 5
82
85
  srcof qfe1
83
86
  inet6 fe80::203:baff:fe17:4444/128
84
87
  ENDIFCONFIG
@@ -173,7 +176,7 @@ ROUTE_GET
173
176
  end
174
177
 
175
178
  it "finds the default interface for a solaris 11 zone" do
176
- expect(@plugin[:network][:default_interface]).to eq("net1:1")
179
+ expect(@plugin[:network][:default_interface]).to eq("net1")
177
180
  end
178
181
  end
179
182
 
@@ -16,7 +16,7 @@
16
16
  # limitations under the License.
17
17
  #
18
18
 
19
- require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
19
+ require_relative "../../../spec_helper.rb"
20
20
 
21
21
  describe Ohai::System, "Solaris plugin platform" do
22
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__) + "/../../../spec_helper.rb")
19
+ require_relative "../../../spec_helper.rb"
20
20
 
21
21
  describe Ohai::System, "Solaris virtualization platform" do
22
22
  before(:each) do
@@ -13,7 +13,7 @@
13
13
  # limitations under the License.
14
14
  #
15
15
 
16
- require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
16
+ require_relative "../../../spec_helper.rb"
17
17
 
18
18
  describe Ohai::System, "Solaris 2.x zpool plugin" do
19
19
  before(:each) do
@@ -16,7 +16,7 @@
16
16
  # limitations under the License.
17
17
  #
18
18
 
19
- require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
19
+ require_relative "../../spec_helper.rb"
20
20
 
21
21
  describe Ohai::System, "ssh_host_key plugin" do
22
22
 
@@ -16,7 +16,7 @@
16
16
  # limitations under the License.
17
17
  #
18
18
 
19
- require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
19
+ require_relative "../../spec_helper.rb"
20
20
 
21
21
  describe Ohai::System, "sysconf plugin", :unix_only do
22
22
  let(:plugin) { get_plugin("sysconf") }
@@ -15,7 +15,7 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
18
+ require_relative "../../spec_helper.rb"
19
19
 
20
20
  describe Ohai::System, "timezone plugin" do
21
21
  before(:each) do
@@ -15,7 +15,7 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
18
+ require_relative "../../spec_helper.rb"
19
19
 
20
20
  vbox_output = <<EOF
21
21
  Oracle VM VirtualBox Guest Additions Command Line Management Interface Version 5.0.2
@@ -14,7 +14,8 @@
14
14
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
- require "spec_helper"
17
+
18
+ require_relative "../../spec_helper.rb"
18
19
 
19
20
  describe Ohai::System, "plugin vmware" do
20
21
  let(:plugin) { get_plugin("vmware") }