ohai 14.15.0 → 15.0.35

Sign up to get free protection for your applications and to get access to all the features.
Files changed (192) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/lib/ohai/application.rb +0 -4
  4. data/lib/ohai/common/dmi.rb +43 -43
  5. data/lib/ohai/config.rb +1 -1
  6. data/lib/ohai/loader.rb +32 -47
  7. data/lib/ohai/mixin/dmi_decode.rb +29 -32
  8. data/lib/ohai/mixin/os.rb +0 -2
  9. data/lib/ohai/mixin/softlayer_metadata.rb +5 -5
  10. data/lib/ohai/plugins/aix/virtualization.rb +4 -4
  11. data/lib/ohai/plugins/bsd/virtualization.rb +10 -12
  12. data/lib/ohai/plugins/c.rb +0 -20
  13. data/lib/ohai/plugins/elixir.rb +13 -13
  14. data/lib/ohai/plugins/filesystem.rb +10 -10
  15. data/lib/ohai/plugins/gce.rb +42 -8
  16. data/lib/ohai/plugins/go.rb +11 -11
  17. data/lib/ohai/plugins/groovy.rb +12 -12
  18. data/lib/ohai/plugins/hostname.rb +9 -2
  19. data/lib/ohai/plugins/linux/fips.rb +2 -9
  20. data/lib/ohai/plugins/linux/memory.rb +5 -0
  21. data/lib/ohai/plugins/linux/network.rb +1 -1
  22. data/lib/ohai/plugins/linux/platform.rb +84 -83
  23. data/lib/ohai/plugins/linux/systemd_paths.rb +0 -3
  24. data/lib/ohai/plugins/linux/virtualization.rb +10 -20
  25. data/lib/ohai/plugins/lua.rb +13 -13
  26. data/lib/ohai/plugins/mono.rb +23 -23
  27. data/lib/ohai/plugins/nodejs.rb +13 -13
  28. data/lib/ohai/plugins/openstack.rb +1 -1
  29. data/lib/ohai/plugins/packages.rb +1 -28
  30. data/lib/ohai/plugins/perl.rb +17 -17
  31. data/lib/ohai/plugins/php.rb +22 -22
  32. data/lib/ohai/plugins/powershell.rb +30 -30
  33. data/lib/ohai/plugins/ps.rb +1 -1
  34. data/lib/ohai/plugins/python.rb +15 -15
  35. data/lib/ohai/plugins/rust.rb +11 -11
  36. data/lib/ohai/plugins/solaris2/dmi.rb +48 -48
  37. data/lib/ohai/plugins/solaris2/virtualization.rb +8 -10
  38. data/lib/ohai/plugins/virtualbox.rb +21 -21
  39. data/lib/ohai/plugins/windows/filesystem.rb +2 -2
  40. data/lib/ohai/plugins/windows/fips.rb +2 -21
  41. data/lib/ohai/plugins/windows/virtualization.rb +9 -35
  42. data/lib/ohai/runner.rb +2 -2
  43. data/lib/ohai/system.rb +0 -17
  44. data/lib/ohai/version.rb +1 -1
  45. data/ohai.gemspec +2 -2
  46. data/spec/data/plugins/rpmquery.output +0 -2
  47. data/spec/functional/application_spec.rb +1 -1
  48. data/spec/functional/loader_spec.rb +2 -2
  49. data/spec/functional/plugins/powershell_spec.rb +2 -2
  50. data/spec/functional/plugins/root_group_spec.rb +1 -1
  51. data/spec/functional/plugins/windows/uptime_spec.rb +2 -2
  52. data/spec/ohai_spec.rb +1 -1
  53. data/spec/unit/application_spec.rb +1 -1
  54. data/spec/unit/config_spec.rb +1 -1
  55. data/spec/unit/dsl/plugin_spec.rb +1 -1
  56. data/spec/unit/hints_spec.rb +2 -2
  57. data/spec/unit/loader_spec.rb +12 -12
  58. data/spec/unit/mixin/azure_metadata_spec.rb +1 -1
  59. data/spec/unit/mixin/command_spec.rb +1 -1
  60. data/spec/unit/mixin/dmi_decode.rb +68 -0
  61. data/spec/unit/mixin/ec2_metadata_spec.rb +1 -1
  62. data/spec/unit/mixin/softlayer_metadata_spec.rb +1 -1
  63. data/spec/unit/plugin_config_spec.rb +1 -1
  64. data/spec/unit/plugins/abort_spec.rb +9 -9
  65. data/spec/unit/plugins/aix/cpu_spec.rb +4 -4
  66. data/spec/unit/plugins/aix/filesystem_spec.rb +5 -5
  67. data/spec/unit/plugins/aix/hostname_spec.rb +1 -1
  68. data/spec/unit/plugins/aix/kernel_spec.rb +1 -1
  69. data/spec/unit/plugins/aix/memory_spec.rb +1 -1
  70. data/spec/unit/plugins/aix/network_spec.rb +6 -6
  71. data/spec/unit/plugins/aix/platform_spec.rb +1 -1
  72. data/spec/unit/plugins/aix/uptime_spec.rb +1 -1
  73. data/spec/unit/plugins/aix/virtualization_spec.rb +2 -2
  74. data/spec/unit/plugins/azure_spec.rb +1 -1
  75. data/spec/unit/plugins/bsd/filesystem_spec.rb +4 -4
  76. data/spec/unit/plugins/bsd/virtualization_spec.rb +3 -3
  77. data/spec/unit/plugins/c_spec.rb +1 -53
  78. data/spec/unit/plugins/chef_spec.rb +1 -1
  79. data/spec/unit/plugins/cloud_spec.rb +1 -1
  80. data/spec/unit/plugins/darwin/cpu_spec.rb +2 -2
  81. data/spec/unit/plugins/darwin/filesystem_spec.rb +5 -5
  82. data/spec/unit/plugins/darwin/hardware_spec.rb +2 -2
  83. data/spec/unit/plugins/darwin/hardware_system_profiler_output.rb +3 -3
  84. data/spec/unit/plugins/darwin/hostname_spec.rb +1 -1
  85. data/spec/unit/plugins/darwin/kernel_spec.rb +1 -1
  86. data/spec/unit/plugins/darwin/memory_spec.rb +1 -1
  87. data/spec/unit/plugins/darwin/network_spec.rb +1 -1
  88. data/spec/unit/plugins/darwin/platform_spec.rb +1 -1
  89. data/spec/unit/plugins/darwin/virtualization_spec.rb +1 -1
  90. data/spec/unit/plugins/dmi_spec.rb +1 -1
  91. data/spec/unit/plugins/docker_spec.rb +1 -1
  92. data/spec/unit/plugins/ec2_spec.rb +1 -1
  93. data/spec/unit/plugins/elixir_spec.rb +1 -1
  94. data/spec/unit/plugins/erlang_spec.rb +1 -1
  95. data/spec/unit/plugins/eucalyptus_spec.rb +1 -1
  96. data/spec/unit/plugins/fail_spec.rb +28 -28
  97. data/spec/unit/plugins/freebsd/cpu_spec.rb +1 -1
  98. data/spec/unit/plugins/freebsd/hostname_spec.rb +1 -1
  99. data/spec/unit/plugins/freebsd/kernel_spec.rb +1 -1
  100. data/spec/unit/plugins/freebsd/platform_spec.rb +1 -1
  101. data/spec/unit/plugins/gce_spec.rb +1 -1
  102. data/spec/unit/plugins/go_spec.rb +1 -1
  103. data/spec/unit/plugins/groovy_spec.rb +1 -1
  104. data/spec/unit/plugins/haskell_spec.rb +1 -1
  105. data/spec/unit/plugins/hostname_spec.rb +68 -1
  106. data/spec/unit/plugins/init_package_spec.rb +1 -1
  107. data/spec/unit/plugins/java_spec.rb +1 -1
  108. data/spec/unit/plugins/joyent_spec.rb +3 -3
  109. data/spec/unit/plugins/kernel_spec.rb +1 -1
  110. data/spec/unit/plugins/linode_spec.rb +1 -1
  111. data/spec/unit/plugins/linux/block_device_spec.rb +1 -1
  112. data/spec/unit/plugins/linux/cpu_spec.rb +6 -6
  113. data/spec/unit/plugins/linux/filesystem_spec.rb +21 -21
  114. data/spec/unit/plugins/linux/fips_spec.rb +13 -45
  115. data/spec/unit/plugins/linux/hostname_spec.rb +1 -1
  116. data/spec/unit/plugins/linux/hostnamectl_spec.rb +2 -2
  117. data/spec/unit/plugins/linux/kernel_spec.rb +8 -8
  118. data/spec/unit/plugins/linux/lsb_spec.rb +3 -3
  119. data/spec/unit/plugins/linux/lspci_spec.rb +2 -2
  120. data/spec/unit/plugins/linux/machineid_spec.rb +1 -1
  121. data/spec/unit/plugins/linux/mdadm_spec.rb +2 -2
  122. data/spec/unit/plugins/linux/memory_spec.rb +26 -1
  123. data/spec/unit/plugins/linux/network_spec.rb +37 -37
  124. data/spec/unit/plugins/linux/platform_spec.rb +580 -837
  125. data/spec/unit/plugins/linux/sessions_spec.rb +2 -2
  126. data/spec/unit/plugins/linux/systemd_paths_spec.rb +1 -1
  127. data/spec/unit/plugins/linux/uptime_spec.rb +1 -1
  128. data/spec/unit/plugins/linux/virtualization_spec.rb +28 -227
  129. data/spec/unit/plugins/lua_spec.rb +1 -1
  130. data/spec/unit/plugins/mono_spec.rb +2 -2
  131. data/spec/unit/plugins/netbsd/hostname_spec.rb +1 -1
  132. data/spec/unit/plugins/netbsd/kernel_spec.rb +1 -1
  133. data/spec/unit/plugins/netbsd/platform_spec.rb +1 -1
  134. data/spec/unit/plugins/network_spec.rb +11 -11
  135. data/spec/unit/plugins/nodejs_spec.rb +1 -1
  136. data/spec/unit/plugins/ohai_spec.rb +1 -1
  137. data/spec/unit/plugins/ohai_time_spec.rb +1 -1
  138. data/spec/unit/plugins/openbsd/hostname_spec.rb +1 -1
  139. data/spec/unit/plugins/openbsd/kernel_spec.rb +1 -1
  140. data/spec/unit/plugins/openbsd/platform_spec.rb +1 -1
  141. data/spec/unit/plugins/openstack_spec.rb +8 -4
  142. data/spec/unit/plugins/os_spec.rb +1 -1
  143. data/spec/unit/plugins/packages_spec.rb +1 -21
  144. data/spec/unit/plugins/passwd_spec.rb +1 -1
  145. data/spec/unit/plugins/perl_spec.rb +1 -1
  146. data/spec/unit/plugins/php_spec.rb +6 -6
  147. data/spec/unit/plugins/platform_spec.rb +1 -1
  148. data/spec/unit/plugins/powershell_spec.rb +3 -3
  149. data/spec/unit/plugins/python_spec.rb +1 -1
  150. data/spec/unit/plugins/rackspace_spec.rb +2 -2
  151. data/spec/unit/plugins/root_group_spec.rb +1 -11
  152. data/spec/unit/plugins/ruby_spec.rb +1 -1
  153. data/spec/unit/plugins/rust_spec.rb +1 -1
  154. data/spec/unit/plugins/scala_spec.rb +1 -1
  155. data/spec/unit/plugins/scsi_spec.rb +2 -2
  156. data/spec/unit/plugins/shard_spec.rb +1 -1
  157. data/spec/unit/plugins/shells_spec.rb +1 -1
  158. data/spec/unit/plugins/softlayer_spec.rb +1 -1
  159. data/spec/unit/plugins/solaris2/cpu_spec.rb +3 -3
  160. data/spec/unit/plugins/solaris2/dmi_spec.rb +1 -1
  161. data/spec/unit/plugins/solaris2/filesystem.rb +4 -4
  162. data/spec/unit/plugins/solaris2/hostname_spec.rb +1 -1
  163. data/spec/unit/plugins/solaris2/kernel_spec.rb +1 -1
  164. data/spec/unit/plugins/solaris2/memory_spec.rb +1 -1
  165. data/spec/unit/plugins/solaris2/network_spec.rb +6 -6
  166. data/spec/unit/plugins/solaris2/platform_spec.rb +3 -3
  167. data/spec/unit/plugins/solaris2/virtualization_spec.rb +41 -69
  168. data/spec/unit/plugins/ssh_host_keys_spec.rb +3 -3
  169. data/spec/unit/plugins/sysconf_spec.rb +2 -2
  170. data/spec/unit/plugins/timezone_spec.rb +1 -1
  171. data/spec/unit/plugins/virtualbox_spec.rb +1 -1
  172. data/spec/unit/plugins/vmware_spec.rb +1 -1
  173. data/spec/unit/plugins/windows/cpu_spec.rb +1 -2
  174. data/spec/unit/plugins/windows/filesystem_spec.rb +2 -2
  175. data/spec/unit/plugins/windows/fips_spec.rb +17 -77
  176. data/spec/unit/plugins/windows/kernel_spec.rb +1 -1
  177. data/spec/unit/plugins/windows/memory_spec.rb +2 -2
  178. data/spec/unit/plugins/windows/network_spec.rb +1 -1
  179. data/spec/unit/plugins/windows/system_enclosure_spec.rb +1 -1
  180. data/spec/unit/plugins/windows/uptime_spec.rb +1 -1
  181. data/spec/unit/plugins/windows/virtualization_spec.rb +20 -238
  182. data/spec/unit/plugins/zpools_spec.rb +7 -7
  183. data/spec/unit/provides_map_spec.rb +1 -1
  184. data/spec/unit/runner_spec.rb +1 -1
  185. data/spec/unit/system_spec.rb +10 -77
  186. data/spec/unit/util/file_helper_spec.rb +1 -1
  187. data/spec/unit/util/ip_helper_spec.rb +1 -1
  188. metadata +6 -9
  189. data/lib/ohai/plugins/darwin/system_profiler.rb +0 -72
  190. data/lib/ohai/util/win32/group_helper.rb +0 -76
  191. data/spec/unit/plugins/darwin/system_profiler_output.rb +0 -79524
  192. data/spec/unit/plugins/darwin/system_profiler_spec.rb +0 -40
@@ -16,7 +16,7 @@
16
16
  # limitations under the License.
17
17
  #
18
18
 
19
- require_relative "../spec_helper"
19
+ require "spec_helper"
20
20
  require "ohai/application"
21
21
 
22
22
  RSpec.describe "Ohai::Application" do
@@ -16,7 +16,7 @@
16
16
  # limitations under the License.
17
17
  #
18
18
 
19
- require_relative "../spec_helper"
19
+ require "spec_helper"
20
20
  require "ohai/config"
21
21
 
22
22
  RSpec.describe Ohai::Config do
@@ -17,7 +17,7 @@
17
17
  # limitations under the License
18
18
  #
19
19
 
20
- require_relative "../../spec_helper.rb"
20
+ require "spec_helper"
21
21
 
22
22
  shared_examples "Ohai::DSL::Plugin" do
23
23
  context "#initialize" do
@@ -17,7 +17,7 @@
17
17
  # limitations under the License.
18
18
  #
19
19
 
20
- require_relative "../spec_helper.rb"
20
+ require "spec_helper"
21
21
 
22
22
  describe "Ohai::Hints" do
23
23
  # We are using the plugins directory infrastructure to test hints
@@ -44,7 +44,7 @@ describe "Ohai::Hints" do
44
44
  when_plugins_directory "contains empty and full hints" do
45
45
  with_plugin("cloud.json", <<~EOF)
46
46
  {"name":"circus"}
47
- EOF
47
+ EOF
48
48
 
49
49
  with_plugin("cloud_empty.json", <<EOF)
50
50
  EOF
@@ -17,7 +17,7 @@
17
17
  # limitations under the License.
18
18
  #
19
19
 
20
- require_relative "../spec_helper.rb"
20
+ require "spec_helper"
21
21
 
22
22
  describe Ohai::Loader do
23
23
  extend IntegrationSupport
@@ -38,13 +38,13 @@ describe Ohai::Loader do
38
38
  Ohai.plugin(:Alpha) do
39
39
  provides "alpha"
40
40
  end
41
- EOF
41
+ EOF
42
42
 
43
43
  with_plugin("cookbook_b/beta.rb", <<~EOF)
44
44
  Ohai.plugin(:Beta) do
45
45
  provides "beta"
46
46
  end
47
- EOF
47
+ EOF
48
48
 
49
49
  describe "#load_additional" do
50
50
  it "adds the plugins to the map" do
@@ -63,13 +63,13 @@ EOF
63
63
  Ohai.plugins(:ExtraS) do
64
64
  provides "the_letter_s"
65
65
  end
66
- EOF
66
+ EOF
67
67
 
68
68
  with_plugin("no_method.rb", <<~EOF)
69
69
  Ohai.plugin(:NoMethod) do
70
70
  really_wants "this_attribute"
71
71
  end
72
- EOF
72
+ EOF
73
73
 
74
74
  with_plugin("illegal_def.rb", <<~EOF)
75
75
  Ohai.plugin(:Zoo) do
@@ -78,32 +78,32 @@ EOF
78
78
  collect_data(:darwin) do
79
79
  end
80
80
  end
81
- EOF
81
+ EOF
82
82
 
83
83
  with_plugin("unexpected_error.rb", <<~EOF)
84
84
  Ohai.plugin(:Zoo) do
85
85
  raise "You aren't expecting this."
86
86
  end
87
- EOF
87
+ EOF
88
88
 
89
89
  with_plugin("bad_symbol.rb", <<~EOF)
90
90
  Ohai.plugin(:1nval!d) do
91
91
  provides "not_a_symbol"
92
92
  end
93
- EOF
93
+ EOF
94
94
 
95
95
  with_plugin("no_end.rb", <<~EOF)
96
96
  Ohai.plugin(:NoEnd) do
97
97
  provides "fish_oil"
98
98
  collect_data do
99
99
  end
100
- EOF
100
+ EOF
101
101
 
102
102
  with_plugin("bad_name.rb", <<~EOF)
103
103
  Ohai.plugin(:you_give_plugins_a_bad_name) do
104
104
  provides "that/one/song"
105
105
  end
106
- EOF
106
+ EOF
107
107
 
108
108
  describe "load_plugin() method" do
109
109
  describe "when the plugin uses Ohai.plugin instead of Ohai.plugins" do
@@ -185,9 +185,9 @@ EOF
185
185
 
186
186
  describe "when plugin directory does not exist" do
187
187
  it "logs an invalid plugin path warning" do
188
- expect(Ohai::Log).to receive(:info).with(/The plugin path.*does not exist/)
188
+ expect(Ohai::Log).to receive(:debug).with(/The plugin path.*does not exist/)
189
189
  allow(Dir).to receive(:exist?).with("/bogus/dir").and_return(false)
190
- Ohai::Loader::PluginFile.find_all_in("/bogus/dir")
190
+ loader.plugin_files_by_dir("/bogus/dir")
191
191
  end
192
192
  end
193
193
  end
@@ -16,7 +16,7 @@
16
16
  # limitations under the License.
17
17
  #
18
18
 
19
- require_relative "../../spec_helper.rb"
19
+ require "spec_helper"
20
20
  require "ohai/mixin/azure_metadata"
21
21
 
22
22
  describe Ohai::Mixin::AzureMetadata do
@@ -17,7 +17,7 @@
17
17
  # limitations under the License.
18
18
  #
19
19
 
20
- require_relative "../../spec_helper.rb"
20
+ require "spec_helper"
21
21
 
22
22
  describe Ohai::Mixin::Command, "shell_out" do
23
23
  let(:cmd) { "sparkle-dream --version" }
@@ -0,0 +1,68 @@
1
+ #
2
+ # Author:: Tim Smith (tsmith@chef.io)
3
+ # Copyright:: Copyright (c) 2018 Chef Software, Inc.
4
+ # License:: Apache License, Version 2.0
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ require "spec_helper"
20
+ require "ohai/mixin/dmi_decode"
21
+
22
+ describe Ohai::Mixin::DmiDecode, "guest_from_dmi_data" do
23
+ let(:mixin) { Object.new.extend(Ohai::Mixin::DmiDecode) }
24
+
25
+ # for the full DMI data used in these tests see https://github.com/chef/dmidecode_collection
26
+ {
27
+ xen: ["Xen", "HVM domU", "4.2.amazon"],
28
+ vmware: ["VMware, Inc.", "VMware Virtual Platform", "None"],
29
+ hyperv: ["Microsoft", "Virtual Machine", "7.0"],
30
+ amazonec2: ["Amazon EC2", "c5n.large", "Not Specified"],
31
+ veertu: ["Veertu", "Veertu", "Not Specified"],
32
+ parallels: ["Parallels Software International Inc.", "Parallels Virtual Platform", "None"],
33
+ vbox: ["Oracle Corporation", "VirtualBox", "1.2"],
34
+ openstack: ["Red Hat Inc.", "OpenStack Nova", "2014.1.2-1.el6"],
35
+ kvm: ["Red Hat", "KVM", "RHEL 7.0.0 PC (i440FX + PIIX, 1996"],
36
+ bhyve: ["", "BHYVE", "1.0"],
37
+ }.each_pair do |hypervisor, values|
38
+ describe "when passed #{hypervisor} dmi data" do
39
+ it "returns '#{hypervisor}'" do
40
+ expect(mixin.guest_from_dmi_data(values[0], values[1], values[2])).to eq("#{hypervisor}")
41
+ end
42
+ end
43
+ end
44
+
45
+ describe "When running on RHEV Hypervisor" do
46
+ it "returns 'kvm'" do
47
+ expect(mixin.guest_from_dmi_data("Red Hat", "RHEV Hypervisor", "6.7-20150911.0.el6ev")).to eq("kvm")
48
+ end
49
+ end
50
+
51
+ describe "When the manufactuer is 'QEMU'" do
52
+ it "return kvm" do
53
+ expect(mixin.guest_from_dmi_data("QEMU", "", "")).to eq("kvm")
54
+ end
55
+ end
56
+
57
+ describe "returns nil if manufactuer is 'Microsoft', but product is not 'Virtual Machine'" do
58
+ it "returns nil" do
59
+ expect(mixin.guest_from_dmi_data("Microsot", "Zune", "2018")).to be_nil
60
+ end
61
+ end
62
+
63
+ describe "When running on an unkown system" do
64
+ it "returns nil" do
65
+ expect(mixin.guest_from_dmi_data("TimCorp", "SuperServer", "2018")).to be_nil
66
+ end
67
+ end
68
+ end
@@ -16,7 +16,7 @@
16
16
  # limitations under the License.
17
17
  #
18
18
 
19
- require_relative "../../spec_helper.rb"
19
+ require "spec_helper"
20
20
  require "ohai/mixin/ec2_metadata"
21
21
 
22
22
  describe Ohai::Mixin::Ec2Metadata do
@@ -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_relative "../../spec_helper.rb"
20
+ require "spec_helper"
21
21
  require "ohai/mixin/softlayer_metadata"
22
22
 
23
23
  describe ::Ohai::Mixin::SoftlayerMetadata do
@@ -15,7 +15,7 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require_relative "../spec_helper"
18
+ require "spec_helper"
19
19
  require "ohai/plugin_config"
20
20
 
21
21
  describe "Ohai::PluginConfig" do
@@ -16,7 +16,7 @@
16
16
  # limitations under the License.
17
17
  #
18
18
 
19
- require_relative "../../spec_helper.rb"
19
+ require "spec_helper"
20
20
 
21
21
  tmp = ENV["TMPDIR"] || ENV["TMP"] || ENV["TEMP"] || "/tmp"
22
22
 
@@ -31,11 +31,11 @@ EOF
31
31
 
32
32
  describe "a plug-in that aborts execution" do
33
33
  before(:all) do
34
- begin
35
- Dir.mkdir("#{tmp}/plugins")
36
- rescue Errno::EEXIST
34
+
35
+ Dir.mkdir("#{tmp}/plugins")
36
+ rescue Errno::EEXIST
37
37
  # ignore
38
- end
38
+
39
39
  end
40
40
 
41
41
  before(:each) do
@@ -49,11 +49,11 @@ describe "a plug-in that aborts execution" do
49
49
  end
50
50
 
51
51
  after(:all) do
52
- begin
53
- Dir.delete("#{tmp}/plugins")
54
- rescue
52
+
53
+ Dir.delete("#{tmp}/plugins")
54
+ rescue
55
55
  # ignore
56
- end
56
+
57
57
  end
58
58
 
59
59
  before(:each) do
@@ -16,14 +16,14 @@
16
16
  # See the License for the specific language governing permissions and
17
17
  # limitations under the License.
18
18
 
19
- require_relative "../../../spec_helper.rb"
19
+ require "spec_helper"
20
20
 
21
21
  describe Ohai::System, "AIX cpu plugin" do
22
22
  before(:each) do
23
23
  @lsdev_cc_processor = <<~LSDEV_CC_PROCESSOR
24
24
  proc0 Available 00-00 Processor
25
25
  proc4 Defined 00-04 Processor
26
- LSDEV_CC_PROCESSOR
26
+ LSDEV_CC_PROCESSOR
27
27
 
28
28
  @lsattr_el_proc0 = <<~LSATTR_EL
29
29
  frequency 1654344000 Processor Speed False
@@ -31,14 +31,14 @@ LSDEV_CC_PROCESSOR
31
31
  smt_threads 2 Processor SMT threads False
32
32
  state enable Processor state False
33
33
  type PowerPC_POWER5 Processor type False
34
- LSATTR_EL
34
+ LSATTR_EL
35
35
 
36
36
  @pmcycles_m = <<~PMCYCLES_M
37
37
  CPU 0 runs at 1654 MHz
38
38
  CPU 1 runs at 1654 MHz
39
39
  CPU 2 runs at 1654 MHz
40
40
  CPU 3 runs at 1654 MHz
41
- PMCYCLES_M
41
+ PMCYCLES_M
42
42
 
43
43
  @plugin = get_plugin("cpu")
44
44
  allow(@plugin).to receive(:collect_os).and_return(:aix)
@@ -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
- require_relative "../../../spec_helper.rb"
19
+ require "spec_helper"
20
20
 
21
21
  describe Ohai::System, "AIX filesystem plugin" do
22
22
  before(:each) do
@@ -45,7 +45,7 @@ describe Ohai::System, "AIX filesystem plugin" do
45
45
  /dev/fslv10 5242880 42884 5199996 1% /wpars/toolchain-tester-5c969f/tmp
46
46
  /dev/fslv11 5242880 2725048 2517832 52% /wpars/toolchain-tester-5c969f/usr
47
47
  /dev/fslv12 10485760 272376 10213384 3% /wpars/toolchain-tester-5c969f/var
48
- DF_PK
48
+ DF_PK
49
49
 
50
50
  @df_pk_wpar = <<~DF_PK
51
51
  Filesystem 1024-blocks Used Available Capacity Mounted on
@@ -56,7 +56,7 @@ DF_PK
56
56
  Global 5242880 42884 5199996 1% /tmp
57
57
  Global 5242880 2725048 2517832 52% /usr
58
58
  Global 10485760 272376 10213384 3% /var
59
- DF_PK
59
+ DF_PK
60
60
 
61
61
  @mount_lpar = <<~MOUNT
62
62
  node mounted mounted over vfs date options
@@ -70,7 +70,7 @@ DF_PK
70
70
  /proc /proc procfs Jul 17 13:22 rw
71
71
  /dev/hd10opt /opt jfs2 Jul 17 13:22 rw,log=/dev/hd8
72
72
  192.168.1.11 /stage/middleware1 /stage/middleware2 nfs3 Jul 17 13:24 ro,bg,hard,intr,sec=sys
73
- MOUNT
73
+ MOUNT
74
74
 
75
75
  @mount_wpar = <<~MOUNT
76
76
  node mounted mounted over vfs date options
@@ -83,7 +83,7 @@ MOUNT
83
83
  Global /usr jfs2 Nov 23 21:03 rw,log=NULL
84
84
  Global /var jfs2 Nov 23 21:03 rw,log=NULL
85
85
  192.168.1.11 /stage/middleware3 /stage/middleware4 nfs3 Jul 17 13:24 ro,bg,hard,intr,sec=sys
86
- MOUNT
86
+ MOUNT
87
87
 
88
88
  @plugin = get_plugin("filesystem")
89
89
  allow(@plugin).to receive(:collect_os).and_return(:aix)
@@ -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
- require_relative "../../../spec_helper.rb"
19
+ require "spec_helper"
20
20
 
21
21
  describe Ohai::System, "AIX hostname plugin" do
22
22
  before(:each) do
@@ -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
- require_relative "../../../spec_helper.rb"
19
+ require "spec_helper"
20
20
 
21
21
  describe Ohai::System, "AIX kernel plugin" do
22
22
  before(:each) do
@@ -16,7 +16,7 @@
16
16
  # limitations under the License.
17
17
  #
18
18
 
19
- require_relative "../../../spec_helper.rb"
19
+ require "spec_helper"
20
20
 
21
21
  describe Ohai::System, "AIX memory plugin" do
22
22
  before(:each) do
@@ -16,14 +16,14 @@
16
16
  # See the License for the specific language governing permissions and
17
17
  # limitations under the License.
18
18
 
19
- require_relative "../../../spec_helper.rb"
19
+ require "spec_helper"
20
20
 
21
21
  describe Ohai::System, "AIX network plugin" do
22
22
 
23
23
  before(:each) do
24
24
  @netstat_rn_grep_default = <<~NETSTAT_RN_GREP_DEFAULT
25
25
  default 172.31.8.1 UG 2 121789 en0 - -
26
- NETSTAT_RN_GREP_DEFAULT
26
+ NETSTAT_RN_GREP_DEFAULT
27
27
 
28
28
  @ifconfig = <<~IFCONFIG
29
29
  en0: flags=1e080863,480<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),CHAIN> metric 1
@@ -39,7 +39,7 @@ NETSTAT_RN_GREP_DEFAULT
39
39
  inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
40
40
  inet6 ::1%1/0
41
41
  tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1
42
- IFCONFIG
42
+ IFCONFIG
43
43
 
44
44
  @netstat_nrf_inet = <<~NETSTAT_NRF_INET
45
45
  Destination Gateway Flags Refs Use If Exp Groups
@@ -48,14 +48,14 @@ IFCONFIG
48
48
  172.29.128.0 172.29.174.58 UHSb 0 0 en0 - - =>
49
49
  172.29.128/18 172.29.174.58 U 7 1035485 en0 - -
50
50
  172.29.191.255 172.29.174.58 UHSb 0 1 en0 - -
51
- NETSTAT_NRF_INET
51
+ NETSTAT_NRF_INET
52
52
 
53
53
  @entstat_err = <<~ENSTAT_ERR
54
54
 
55
55
 
56
56
  entstat: 0909-002 Unable to open device en0, errno = 13
57
57
  grep: 0652-033 Cannot open Address".
58
- ENSTAT_ERR
58
+ ENSTAT_ERR
59
59
 
60
60
  @aix_arp_an = <<~ARP_AN
61
61
  ? (172.29.131.16) at 6e:87:70:0:40:3 [ethernet] stored in bucket 16
@@ -72,7 +72,7 @@ ENSTAT_ERR
72
72
 
73
73
  bucket: 0 contains: 0 entries
74
74
  There are 6 entries in the arp table.
75
- ARP_AN
75
+ ARP_AN
76
76
 
77
77
  @plugin = get_plugin("aix/network")
78
78
  allow(@plugin).to receive(:collect_os).and_return(:aix)