ohai 14.2.0 → 14.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/Rakefile +1 -1
  4. data/lib/ohai/application.rb +29 -29
  5. data/lib/ohai/common/dmi.rb +5 -5
  6. data/lib/ohai/dsl/plugin.rb +3 -3
  7. data/lib/ohai/dsl/plugin/versionvii.rb +3 -3
  8. data/lib/ohai/mixin/azure_metadata.rb +2 -2
  9. data/lib/ohai/mixin/do_metadata.rb +3 -3
  10. data/lib/ohai/mixin/ec2_metadata.rb +8 -8
  11. data/lib/ohai/mixin/gce_metadata.rb +2 -2
  12. data/lib/ohai/mixin/network_constants.rb +1 -1
  13. data/lib/ohai/mixin/scaleway_metadata.rb +3 -3
  14. data/lib/ohai/mixin/softlayer_metadata.rb +1 -1
  15. data/lib/ohai/mixin/string.rb +2 -2
  16. data/lib/ohai/plugins/aix/cpu.rb +3 -3
  17. data/lib/ohai/plugins/aix/filesystem.rb +1 -1
  18. data/lib/ohai/plugins/aix/kernel.rb +1 -1
  19. data/lib/ohai/plugins/aix/memory.rb +1 -1
  20. data/lib/ohai/plugins/aix/network.rb +3 -3
  21. data/lib/ohai/plugins/bsd/virtualization.rb +1 -1
  22. data/lib/ohai/plugins/cloud.rb +1 -1
  23. data/lib/ohai/plugins/darwin/hardware.rb +1 -1
  24. data/lib/ohai/plugins/darwin/network.rb +5 -5
  25. data/lib/ohai/plugins/darwin/platform.rb +1 -1
  26. data/lib/ohai/plugins/dmi.rb +6 -6
  27. data/lib/ohai/plugins/filesystem.rb +5 -5
  28. data/lib/ohai/plugins/hostname.rb +5 -5
  29. data/lib/ohai/plugins/kernel.rb +8 -8
  30. data/lib/ohai/plugins/linux/lspci.rb +4 -4
  31. data/lib/ohai/plugins/linux/memory.rb +4 -4
  32. data/lib/ohai/plugins/linux/network.rb +16 -16
  33. data/lib/ohai/plugins/linux/platform.rb +7 -1
  34. data/lib/ohai/plugins/netbsd/network.rb +1 -1
  35. data/lib/ohai/plugins/network.rb +5 -5
  36. data/lib/ohai/plugins/openbsd/network.rb +1 -1
  37. data/lib/ohai/plugins/packages.rb +1 -1
  38. data/lib/ohai/plugins/passwd.rb +4 -4
  39. data/lib/ohai/plugins/ruby.rb +13 -13
  40. data/lib/ohai/plugins/solaris2/dmi.rb +3 -3
  41. data/lib/ohai/plugins/solaris2/filesystem.rb +6 -6
  42. data/lib/ohai/plugins/solaris2/memory.rb +2 -2
  43. data/lib/ohai/plugins/solaris2/network.rb +36 -36
  44. data/lib/ohai/plugins/windows/network.rb +2 -2
  45. data/lib/ohai/util/win32/group_helper.rb +1 -1
  46. data/lib/ohai/version.rb +1 -1
  47. data/spec/functional/application_spec.rb +6 -6
  48. data/spec/functional/loader_spec.rb +4 -4
  49. data/spec/functional/plugins/windows/uptime_spec.rb +1 -2
  50. data/spec/spec_helper.rb +5 -5
  51. data/spec/unit/application_spec.rb +11 -11
  52. data/spec/unit/config_spec.rb +5 -5
  53. data/spec/unit/dsl/plugin_spec.rb +5 -5
  54. data/spec/unit/hints_spec.rb +2 -2
  55. data/spec/unit/loader_spec.rb +41 -41
  56. data/spec/unit/mixin/azure_metadata_spec.rb +3 -3
  57. data/spec/unit/mixin/command_spec.rb +64 -64
  58. data/spec/unit/mixin/ec2_metadata_spec.rb +6 -6
  59. data/spec/unit/mixin/softlayer_metadata_spec.rb +1 -1
  60. data/spec/unit/plugin_config_spec.rb +9 -9
  61. data/spec/unit/plugins/abort_spec.rb +6 -6
  62. data/spec/unit/plugins/aix/cpu_spec.rb +16 -16
  63. data/spec/unit/plugins/aix/filesystem_spec.rb +57 -57
  64. data/spec/unit/plugins/aix/network_spec.rb +35 -35
  65. data/spec/unit/plugins/aix/virtualization_spec.rb +210 -210
  66. data/spec/unit/plugins/azure_spec.rb +49 -49
  67. data/spec/unit/plugins/bsd/filesystem_spec.rb +13 -13
  68. data/spec/unit/plugins/bsd/virtualization_spec.rb +10 -10
  69. data/spec/unit/plugins/c_spec.rb +54 -54
  70. data/spec/unit/plugins/chef_spec.rb +3 -3
  71. data/spec/unit/plugins/darwin/cpu_spec.rb +54 -54
  72. data/spec/unit/plugins/darwin/filesystem_spec.rb +34 -34
  73. data/spec/unit/plugins/darwin/hardware_system_profiler_output.rb +1070 -1070
  74. data/spec/unit/plugins/darwin/memory_spec.rb +16 -16
  75. data/spec/unit/plugins/darwin/network_spec.rb +382 -382
  76. data/spec/unit/plugins/digital_ocean_spec.rb +7 -7
  77. data/spec/unit/plugins/dmi_spec.rb +83 -83
  78. data/spec/unit/plugins/docker_spec.rb +2 -2
  79. data/spec/unit/plugins/ec2_spec.rb +156 -156
  80. data/spec/unit/plugins/eucalyptus_spec.rb +19 -19
  81. data/spec/unit/plugins/fail_spec.rb +14 -14
  82. data/spec/unit/plugins/freebsd/cpu_spec.rb +18 -18
  83. data/spec/unit/plugins/freebsd/kernel_spec.rb +1 -1
  84. data/spec/unit/plugins/gce_spec.rb +1 -1
  85. data/spec/unit/plugins/init_package_spec.rb +1 -1
  86. data/spec/unit/plugins/java_spec.rb +4 -4
  87. data/spec/unit/plugins/joyent_spec.rb +9 -9
  88. data/spec/unit/plugins/linux/block_device_spec.rb +1 -1
  89. data/spec/unit/plugins/linux/cpu_spec.rb +155 -155
  90. data/spec/unit/plugins/linux/filesystem_spec.rb +229 -229
  91. data/spec/unit/plugins/linux/kernel_spec.rb +9 -9
  92. data/spec/unit/plugins/linux/lsb_spec.rb +18 -18
  93. data/spec/unit/plugins/linux/lspci_spec.rb +58 -58
  94. data/spec/unit/plugins/linux/mdadm_spec.rb +54 -54
  95. data/spec/unit/plugins/linux/memory_spec.rb +35 -35
  96. data/spec/unit/plugins/linux/network_spec.rb +464 -464
  97. data/spec/unit/plugins/linux/platform_spec.rb +84 -68
  98. data/spec/unit/plugins/linux/systemd_paths_spec.rb +40 -40
  99. data/spec/unit/plugins/linux/uptime_spec.rb +1 -1
  100. data/spec/unit/plugins/linux/virtualization_spec.rb +197 -197
  101. data/spec/unit/plugins/mono_spec.rb +11 -11
  102. data/spec/unit/plugins/netbsd/kernel_spec.rb +1 -1
  103. data/spec/unit/plugins/network_spec.rb +2 -2
  104. data/spec/unit/plugins/openstack_spec.rb +43 -43
  105. data/spec/unit/plugins/os_spec.rb +1 -1
  106. data/spec/unit/plugins/passwd_spec.rb +9 -9
  107. data/spec/unit/plugins/php_spec.rb +22 -22
  108. data/spec/unit/plugins/powershell_spec.rb +13 -13
  109. data/spec/unit/plugins/rackspace_spec.rb +38 -38
  110. data/spec/unit/plugins/ruby_spec.rb +14 -14
  111. data/spec/unit/plugins/scaleway_spec.rb +6 -6
  112. data/spec/unit/plugins/scsi_spec.rb +7 -7
  113. data/spec/unit/plugins/solaris2/cpu_spec.rb +2594 -2594
  114. data/spec/unit/plugins/solaris2/dmi_spec.rb +91 -91
  115. data/spec/unit/plugins/solaris2/filesystem.rb +8 -8
  116. data/spec/unit/plugins/solaris2/kernel_spec.rb +1 -1
  117. data/spec/unit/plugins/solaris2/network_spec.rb +92 -93
  118. data/spec/unit/plugins/solaris2/platform_spec.rb +24 -24
  119. data/spec/unit/plugins/solaris2/virtualization_spec.rb +22 -22
  120. data/spec/unit/plugins/ssh_host_keys_spec.rb +12 -12
  121. data/spec/unit/plugins/sysconf_spec.rb +321 -321
  122. data/spec/unit/plugins/virtualbox_spec.rb +27 -27
  123. data/spec/unit/plugins/windows/cpu_spec.rb +9 -9
  124. data/spec/unit/plugins/windows/kernel_spec.rb +12 -12
  125. data/spec/unit/plugins/windows/uptime_spec.rb +1 -1
  126. data/spec/unit/plugins/zpools_spec.rb +41 -41
  127. data/spec/unit/runner_spec.rb +2 -2
  128. data/spec/unit/system_spec.rb +55 -55
  129. metadata +3 -4
  130. data/docs/man/man1/ohai.1 +0 -97
@@ -44,20 +44,20 @@ describe Ohai::Mixin::Command, "shell_out" do
44
44
 
45
45
  describe "when the command runs" do
46
46
  it "logs the command and exitstatus" do
47
- expect(Mixlib::ShellOut).
48
- to receive(:new).
49
- with(cmd, options).
50
- and_return(shell_out)
47
+ expect(Mixlib::ShellOut)
48
+ .to receive(:new)
49
+ .with(cmd, options)
50
+ .and_return(shell_out)
51
51
 
52
- expect(shell_out).
53
- to receive(:run_command)
52
+ expect(shell_out)
53
+ .to receive(:run_command)
54
54
 
55
- expect(shell_out).
56
- to receive(:exitstatus).
57
- and_return(256)
55
+ expect(shell_out)
56
+ .to receive(:exitstatus)
57
+ .and_return(256)
58
58
 
59
- expect(logger).to receive(:trace).
60
- with("Plugin OSSparkleDream: ran 'sparkle-dream --version' and returned 256")
59
+ expect(logger).to receive(:trace)
60
+ .with("Plugin OSSparkleDream: ran 'sparkle-dream --version' and returned 256")
61
61
 
62
62
  Ohai::Mixin::Command.shell_out(cmd)
63
63
  end
@@ -65,43 +65,43 @@ describe Ohai::Mixin::Command, "shell_out" do
65
65
 
66
66
  describe "when the command does not exist" do
67
67
  it "logs the command and error message" do
68
- expect(Mixlib::ShellOut).
69
- to receive(:new).
70
- with(cmd, options).
71
- and_return(shell_out)
72
-
73
- expect(shell_out).
74
- to receive(:run_command).
75
- and_raise(Errno::ENOENT, "sparkle-dream")
76
-
77
- expect(logger).
78
- to receive(:trace).
79
- with("Plugin OSSparkleDream: ran 'sparkle-dream --version' and failed " \
68
+ expect(Mixlib::ShellOut)
69
+ .to receive(:new)
70
+ .with(cmd, options)
71
+ .and_return(shell_out)
72
+
73
+ expect(shell_out)
74
+ .to receive(:run_command)
75
+ .and_raise(Errno::ENOENT, "sparkle-dream")
76
+
77
+ expect(logger)
78
+ .to receive(:trace)
79
+ .with("Plugin OSSparkleDream: ran 'sparkle-dream --version' and failed " \
80
80
  "#<Errno::ENOENT: No such file or directory - sparkle-dream>")
81
81
 
82
- expect { Ohai::Mixin::Command.shell_out(cmd) }.
83
- to raise_error(Ohai::Exceptions::Exec)
82
+ expect { Ohai::Mixin::Command.shell_out(cmd) }
83
+ .to raise_error(Ohai::Exceptions::Exec)
84
84
  end
85
85
  end
86
86
 
87
87
  describe "when the command times out" do
88
88
  it "logs the command an timeout error message" do
89
- expect(Mixlib::ShellOut).
90
- to receive(:new).
91
- with(cmd, options).
92
- and_return(shell_out)
93
-
94
- expect(shell_out).
95
- to receive(:run_command).
96
- and_raise(Mixlib::ShellOut::CommandTimeout)
97
-
98
- expect(logger).
99
- to receive(:trace).
100
- with("Plugin OSSparkleDream: ran 'sparkle-dream --version' and timed " \
89
+ expect(Mixlib::ShellOut)
90
+ .to receive(:new)
91
+ .with(cmd, options)
92
+ .and_return(shell_out)
93
+
94
+ expect(shell_out)
95
+ .to receive(:run_command)
96
+ .and_raise(Mixlib::ShellOut::CommandTimeout)
97
+
98
+ expect(logger)
99
+ .to receive(:trace)
100
+ .with("Plugin OSSparkleDream: ran 'sparkle-dream --version' and timed " \
101
101
  "out after 30 seconds")
102
102
 
103
- expect { Ohai::Mixin::Command.shell_out(cmd) }.
104
- to raise_error(Ohai::Exceptions::Exec)
103
+ expect { Ohai::Mixin::Command.shell_out(cmd) }
104
+ .to raise_error(Ohai::Exceptions::Exec)
105
105
  end
106
106
  end
107
107
 
@@ -109,42 +109,42 @@ describe Ohai::Mixin::Command, "shell_out" do
109
109
  let(:options) { windows? ? { timeout: 10 } : { timeout: 10, env: { "PATH" => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" } } }
110
110
 
111
111
  it "runs the command with the provided timeout" do
112
- expect(Mixlib::ShellOut).
113
- to receive(:new).
114
- with(cmd, options).
115
- and_return(shell_out)
112
+ expect(Mixlib::ShellOut)
113
+ .to receive(:new)
114
+ .with(cmd, options)
115
+ .and_return(shell_out)
116
116
 
117
- expect(shell_out).
118
- to receive(:run_command)
117
+ expect(shell_out)
118
+ .to receive(:run_command)
119
119
 
120
- expect(shell_out).
121
- to receive(:exitstatus).
122
- and_return(256)
120
+ expect(shell_out)
121
+ .to receive(:exitstatus)
122
+ .and_return(256)
123
123
 
124
- expect(logger).to receive(:trace).
125
- with("Plugin OSSparkleDream: ran 'sparkle-dream --version' and returned 256")
124
+ expect(logger).to receive(:trace)
125
+ .with("Plugin OSSparkleDream: ran 'sparkle-dream --version' and returned 256")
126
126
 
127
127
  Ohai::Mixin::Command.shell_out(cmd, options)
128
128
  end
129
129
 
130
130
  describe "when the command times out" do
131
131
  it "logs the command an timeout error message" do
132
- expect(Mixlib::ShellOut).
133
- to receive(:new).
134
- with(cmd, options).
135
- and_return(shell_out)
136
-
137
- expect(shell_out).
138
- to receive(:run_command).
139
- and_raise(Mixlib::ShellOut::CommandTimeout)
140
-
141
- expect(logger).
142
- to receive(:trace).
143
- with("Plugin OSSparkleDream: ran 'sparkle-dream --version' and timed " \
132
+ expect(Mixlib::ShellOut)
133
+ .to receive(:new)
134
+ .with(cmd, options)
135
+ .and_return(shell_out)
136
+
137
+ expect(shell_out)
138
+ .to receive(:run_command)
139
+ .and_raise(Mixlib::ShellOut::CommandTimeout)
140
+
141
+ expect(logger)
142
+ .to receive(:trace)
143
+ .with("Plugin OSSparkleDream: ran 'sparkle-dream --version' and timed " \
144
144
  "out after 10 seconds")
145
145
 
146
- expect { Ohai::Mixin::Command.shell_out(cmd, options) }.
147
- to raise_error(Ohai::Exceptions::Exec)
146
+ expect { Ohai::Mixin::Command.shell_out(cmd, options) }
147
+ .to raise_error(Ohai::Exceptions::Exec)
148
148
  end
149
149
  end
150
150
  end
@@ -35,7 +35,7 @@ describe Ohai::Mixin::Ec2Metadata do
35
35
 
36
36
  context "#best_api_version" do
37
37
  context "with a sorted list of metadata versions" do
38
- let(:response) { double("Net::HTTP Response", :body => "1.0\n2011-05-01\n2012-01-12\nUnsupported", :code => "200") }
38
+ let(:response) { double("Net::HTTP Response", body: "1.0\n2011-05-01\n2012-01-12\nUnsupported", code: "200") }
39
39
 
40
40
  it "returns the most recent version" do
41
41
  expect(mixin.best_api_version).to eq("2012-01-12")
@@ -43,7 +43,7 @@ describe Ohai::Mixin::Ec2Metadata do
43
43
  end
44
44
 
45
45
  context "with an unsorted list of metadata versions" do
46
- let(:response) { double("Net::HTTP Response", :body => "1.0\n2009-04-04\n2007-03-01\n2011-05-01\n2008-09-01\nUnsupported", :code => "200") }
46
+ let(:response) { double("Net::HTTP Response", body: "1.0\n2009-04-04\n2007-03-01\n2011-05-01\n2008-09-01\nUnsupported", code: "200") }
47
47
 
48
48
  it "returns the most recent version (using string sort)" do
49
49
  expect(mixin.best_api_version).to eq("2011-05-01")
@@ -51,7 +51,7 @@ describe Ohai::Mixin::Ec2Metadata do
51
51
  end
52
52
 
53
53
  context "when no supported versions are found" do
54
- let(:response) { double("Net::HTTP Response", :body => "2020-01-01\nUnsupported", :code => "200") }
54
+ let(:response) { double("Net::HTTP Response", body: "2020-01-01\nUnsupported", code: "200") }
55
55
 
56
56
  it "raises an error" do
57
57
  expect { mixin.best_api_version }.to raise_error(RuntimeError)
@@ -60,7 +60,7 @@ describe Ohai::Mixin::Ec2Metadata do
60
60
 
61
61
  # Presume 'latest' when we get a 404 for Eucalyptus back-compat
62
62
  context "when the response code is 404" do
63
- let(:response) { double("Net::HTTP Response", :code => "404") }
63
+ let(:response) { double("Net::HTTP Response", code: "404") }
64
64
 
65
65
  it "returns 'latest' as the version" do
66
66
  expect(mixin.best_api_version).to eq("latest")
@@ -68,7 +68,7 @@ describe Ohai::Mixin::Ec2Metadata do
68
68
  end
69
69
 
70
70
  context "when the response code is unexpected" do
71
- let(:response) { double("Net::HTTP Response", :body => "1.0\n2011-05-01\n2012-01-12\nUnsupported", :code => "418") }
71
+ let(:response) { double("Net::HTTP Response", body: "1.0\n2011-05-01\n2012-01-12\nUnsupported", code: "418") }
72
72
 
73
73
  it "raises an error" do
74
74
  expect { mixin.best_api_version }.to raise_error(RuntimeError)
@@ -78,7 +78,7 @@ describe Ohai::Mixin::Ec2Metadata do
78
78
 
79
79
  context "#metadata_get" do
80
80
  context "when the response code is unexpected" do
81
- let(:response) { double("Net::HTTP Response", :body => "", :code => "418") }
81
+ let(:response) { double("Net::HTTP Response", body: "", code: "418") }
82
82
 
83
83
  it "raises an error" do
84
84
  expect { mixin.metadata_get("", "2012-01-12") }.to raise_error(RuntimeError)
@@ -37,7 +37,7 @@ describe ::Ohai::Mixin::SoftlayerMetadata do
37
37
  end
38
38
 
39
39
  def make_res(body)
40
- double("response", { :body => body, :code => "200" })
40
+ double("response", { body: body, code: "200" })
41
41
  end
42
42
 
43
43
  context "fetch_metadata" do
@@ -37,8 +37,8 @@ describe "Ohai::PluginConfig" do
37
37
  shared_examples_for "failure" do
38
38
 
39
39
  it "raises an error" do
40
- expect { plugin_config[key] = value }.
41
- to raise_error(Ohai::Exceptions::PluginConfigError, /Expected Symbol/)
40
+ expect { plugin_config[key] = value }
41
+ .to raise_error(Ohai::Exceptions::PluginConfigError, /Expected Symbol/)
42
42
  end
43
43
 
44
44
  end
@@ -53,9 +53,9 @@ describe "Ohai::PluginConfig" do
53
53
 
54
54
  let(:value) do
55
55
  {
56
- :bar0 => true,
57
- :bar1 => [ :baz0, :baz1, :baz2 ],
58
- :bar2 => { :qux0 => true, :qux1 => false },
56
+ bar0: true,
57
+ bar1: [ :baz0, :baz1, :baz2 ],
58
+ bar2: { qux0: true, qux1: false },
59
59
  }
60
60
  end
61
61
 
@@ -69,7 +69,7 @@ describe "Ohai::PluginConfig" do
69
69
  {
70
70
  :bar0 => true,
71
71
  "bar1" => [ :baz0, :baz1, :baz2 ],
72
- :bar2 => { :qux0 => true, :qux1 => false },
72
+ :bar2 => { qux0: true, qux1: false },
73
73
  }
74
74
  end
75
75
 
@@ -81,9 +81,9 @@ describe "Ohai::PluginConfig" do
81
81
 
82
82
  let(:value) do
83
83
  {
84
- :bar0 => true,
85
- :bar1 => [ :baz0, :baz1, :baz2 ],
86
- :bar2 => { :qux0 => true, "qux1" => false },
84
+ bar0: true,
85
+ bar1: [ :baz0, :baz1, :baz2 ],
86
+ bar2: { :qux0 => true, "qux1" => false },
87
87
  }
88
88
  end
89
89
 
@@ -20,13 +20,13 @@ require_relative "../../spec_helper.rb"
20
20
 
21
21
  tmp = ENV["TMPDIR"] || ENV["TMP"] || ENV["TEMP"] || "/tmp"
22
22
 
23
- abortstr = <<EOF
24
- Ohai.plugin(:Abort) do
25
- provides "abort_test"
26
- collect_data do
27
- abort
23
+ abortstr = <<~EOF
24
+ Ohai.plugin(:Abort) do
25
+ provides "abort_test"
26
+ collect_data do
27
+ abort
28
+ end
28
29
  end
29
- end
30
30
  EOF
31
31
 
32
32
  describe "a plug-in that aborts execution" do
@@ -20,24 +20,24 @@ require_relative "../../../spec_helper.rb"
20
20
 
21
21
  describe Ohai::System, "AIX cpu plugin" do
22
22
  before(:each) do
23
- @lsdev_cc_processor = <<-LSDEV_CC_PROCESSOR
24
- proc0 Available 00-00 Processor
25
- proc4 Defined 00-04 Processor
23
+ @lsdev_cc_processor = <<~LSDEV_CC_PROCESSOR
24
+ proc0 Available 00-00 Processor
25
+ proc4 Defined 00-04 Processor
26
26
  LSDEV_CC_PROCESSOR
27
27
 
28
- @lsattr_el_proc0 = <<-LSATTR_EL
29
- frequency 1654344000 Processor Speed False
30
- smt_enabled true Processor SMT enabled False
31
- smt_threads 2 Processor SMT threads False
32
- state enable Processor state False
33
- type PowerPC_POWER5 Processor type False
28
+ @lsattr_el_proc0 = <<~LSATTR_EL
29
+ frequency 1654344000 Processor Speed False
30
+ smt_enabled true Processor SMT enabled False
31
+ smt_threads 2 Processor SMT threads False
32
+ state enable Processor state False
33
+ type PowerPC_POWER5 Processor type False
34
34
  LSATTR_EL
35
35
 
36
- @pmcycles_m = <<-PMCYCLES_M
37
- CPU 0 runs at 1654 MHz
38
- CPU 1 runs at 1654 MHz
39
- CPU 2 runs at 1654 MHz
40
- CPU 3 runs at 1654 MHz
36
+ @pmcycles_m = <<~PMCYCLES_M
37
+ CPU 0 runs at 1654 MHz
38
+ CPU 1 runs at 1654 MHz
39
+ CPU 2 runs at 1654 MHz
40
+ CPU 3 runs at 1654 MHz
41
41
  PMCYCLES_M
42
42
 
43
43
  @plugin = get_plugin("aix/cpu")
@@ -71,8 +71,8 @@ PMCYCLES_M
71
71
  end
72
72
 
73
73
  it "sets the number of cores" do
74
- #from http://www-01.ibm.com/software/passportadvantage/pvu_terminology_for_customers.html
75
- #on AIX number of cores and processors are considered same
74
+ # from http://www-01.ibm.com/software/passportadvantage/pvu_terminology_for_customers.html
75
+ # on AIX number of cores and processors are considered same
76
76
  expect(@plugin[:cpu][:cores]).to eq(@plugin[:cpu][:real])
77
77
  end
78
78
 
@@ -20,69 +20,69 @@ require_relative "../../../spec_helper.rb"
20
20
 
21
21
  describe Ohai::System, "AIX filesystem plugin" do
22
22
  before(:each) do
23
- @df_pk_lpar = <<-DF_PK
24
- Filesystem 1024-blocks Used Available Capacity Mounted on
25
- /dev/hd4 2097152 219796 1877356 11% /
26
- /dev/hd2 5242880 2416828 2826052 47% /usr
27
- /dev/hd9var 5242880 395540 4847340 8% /var
28
- /dev/hd3 5242880 1539508 3703372 30% /tmp
29
- /dev/hd1 10485760 1972 10483788 1% /home
30
- /dev/hd11admin 131072 380 130692 1% /admin
31
- /proc - - - - /proc
32
- /dev/hd10opt 5242880 1286720 3956160 25% /opt
33
- /dev/livedump 262144 368 261776 1% /var/adm/ras/livedump
34
- /dev/fslv00 524288 45076 479212 9% /wpars/sink-thinker-541ba3
35
- /dev/fslv01 2097152 8956 2088196 1% /wpars/sink-thinker-541ba3/home
36
- /dev/fslv02 5242880 1307352 3935528 25% /wpars/sink-thinker-541ba3/opt
37
- /proc - - - - /wpars/sink-thinker-541ba3/proc
38
- /dev/fslv03 1048576 168840 879736 17% /wpars/sink-thinker-541ba3/tmp
39
- /dev/fslv04 5242880 2725040 2517840 52% /wpars/sink-thinker-541ba3/usr
40
- /dev/fslv05 524288 76000 448288 15% /wpars/sink-thinker-541ba3/var
41
- /dev/fslv07 10485760 130872 10354888 2% /wpars/toolchain-tester-5c969f
42
- /dev/fslv08 5242880 39572 5203308 1% /wpars/toolchain-tester-5c969f/home
43
- /dev/fslv09 5242880 1477164 3765716 29% /wpars/toolchain-tester-5c969f/opt
44
- /proc - - - - /wpars/toolchain-tester-5c969f/proc
45
- /dev/fslv10 5242880 42884 5199996 1% /wpars/toolchain-tester-5c969f/tmp
46
- /dev/fslv11 5242880 2725048 2517832 52% /wpars/toolchain-tester-5c969f/usr
47
- /dev/fslv12 10485760 272376 10213384 3% /wpars/toolchain-tester-5c969f/var
23
+ @df_pk_lpar = <<~DF_PK
24
+ Filesystem 1024-blocks Used Available Capacity Mounted on
25
+ /dev/hd4 2097152 219796 1877356 11% /
26
+ /dev/hd2 5242880 2416828 2826052 47% /usr
27
+ /dev/hd9var 5242880 395540 4847340 8% /var
28
+ /dev/hd3 5242880 1539508 3703372 30% /tmp
29
+ /dev/hd1 10485760 1972 10483788 1% /home
30
+ /dev/hd11admin 131072 380 130692 1% /admin
31
+ /proc - - - - /proc
32
+ /dev/hd10opt 5242880 1286720 3956160 25% /opt
33
+ /dev/livedump 262144 368 261776 1% /var/adm/ras/livedump
34
+ /dev/fslv00 524288 45076 479212 9% /wpars/sink-thinker-541ba3
35
+ /dev/fslv01 2097152 8956 2088196 1% /wpars/sink-thinker-541ba3/home
36
+ /dev/fslv02 5242880 1307352 3935528 25% /wpars/sink-thinker-541ba3/opt
37
+ /proc - - - - /wpars/sink-thinker-541ba3/proc
38
+ /dev/fslv03 1048576 168840 879736 17% /wpars/sink-thinker-541ba3/tmp
39
+ /dev/fslv04 5242880 2725040 2517840 52% /wpars/sink-thinker-541ba3/usr
40
+ /dev/fslv05 524288 76000 448288 15% /wpars/sink-thinker-541ba3/var
41
+ /dev/fslv07 10485760 130872 10354888 2% /wpars/toolchain-tester-5c969f
42
+ /dev/fslv08 5242880 39572 5203308 1% /wpars/toolchain-tester-5c969f/home
43
+ /dev/fslv09 5242880 1477164 3765716 29% /wpars/toolchain-tester-5c969f/opt
44
+ /proc - - - - /wpars/toolchain-tester-5c969f/proc
45
+ /dev/fslv10 5242880 42884 5199996 1% /wpars/toolchain-tester-5c969f/tmp
46
+ /dev/fslv11 5242880 2725048 2517832 52% /wpars/toolchain-tester-5c969f/usr
47
+ /dev/fslv12 10485760 272376 10213384 3% /wpars/toolchain-tester-5c969f/var
48
48
  DF_PK
49
49
 
50
- @df_pk_wpar = <<-DF_PK
51
- Filesystem 1024-blocks Used Available Capacity Mounted on
52
- Global 10485760 130872 10354888 2% /
53
- Global 5242880 39572 5203308 1% /home
54
- Global 5242880 1477164 3765716 29% /opt
55
- Global - - - - /proc
56
- Global 5242880 42884 5199996 1% /tmp
57
- Global 5242880 2725048 2517832 52% /usr
58
- Global 10485760 272376 10213384 3% /var
50
+ @df_pk_wpar = <<~DF_PK
51
+ Filesystem 1024-blocks Used Available Capacity Mounted on
52
+ Global 10485760 130872 10354888 2% /
53
+ Global 5242880 39572 5203308 1% /home
54
+ Global 5242880 1477164 3765716 29% /opt
55
+ Global - - - - /proc
56
+ Global 5242880 42884 5199996 1% /tmp
57
+ Global 5242880 2725048 2517832 52% /usr
58
+ Global 10485760 272376 10213384 3% /var
59
59
  DF_PK
60
60
 
61
- @mount_lpar = <<-MOUNT
62
- node mounted mounted over vfs date options
63
- -------- --------------- --------------- ------ ------------ ---------------
64
- /dev/hd4 / jfs2 Jul 17 13:22 rw,log=/dev/hd8
65
- /dev/hd2 /usr jfs2 Jul 17 13:22 rw,log=/dev/hd8
66
- /dev/hd9var /var jfs2 Jul 17 13:22 rw,log=/dev/hd8
67
- /dev/hd3 /tmp jfs2 Jul 17 13:22 rw,log=/dev/hd8
68
- /dev/hd1 /home jfs2 Jul 17 13:22 rw,log=/dev/hd8
69
- /dev/hd11admin /admin jfs2 Jul 17 13:22 rw,log=/dev/hd8
70
- /proc /proc procfs Jul 17 13:22 rw
71
- /dev/hd10opt /opt jfs2 Jul 17 13:22 rw,log=/dev/hd8
72
- 192.168.1.11 /stage/middleware1 /stage/middleware2 nfs3 Jul 17 13:24 ro,bg,hard,intr,sec=sys
61
+ @mount_lpar = <<~MOUNT
62
+ node mounted mounted over vfs date options
63
+ -------- --------------- --------------- ------ ------------ ---------------
64
+ /dev/hd4 / jfs2 Jul 17 13:22 rw,log=/dev/hd8
65
+ /dev/hd2 /usr jfs2 Jul 17 13:22 rw,log=/dev/hd8
66
+ /dev/hd9var /var jfs2 Jul 17 13:22 rw,log=/dev/hd8
67
+ /dev/hd3 /tmp jfs2 Jul 17 13:22 rw,log=/dev/hd8
68
+ /dev/hd1 /home jfs2 Jul 17 13:22 rw,log=/dev/hd8
69
+ /dev/hd11admin /admin jfs2 Jul 17 13:22 rw,log=/dev/hd8
70
+ /proc /proc procfs Jul 17 13:22 rw
71
+ /dev/hd10opt /opt jfs2 Jul 17 13:22 rw,log=/dev/hd8
72
+ 192.168.1.11 /stage/middleware1 /stage/middleware2 nfs3 Jul 17 13:24 ro,bg,hard,intr,sec=sys
73
73
  MOUNT
74
74
 
75
- @mount_wpar = <<-MOUNT
76
- node mounted mounted over vfs date options
77
- -------- --------------- --------------- ------ ------------ ---------------
78
- Global / jfs2 Nov 23 21:03 rw,log=NULL
79
- Global /home jfs2 Nov 23 21:03 rw,log=NULL
80
- Global /opt jfs2 Nov 23 21:03 rw,log=NULL
81
- Global /proc namefs Nov 23 21:03 rw
82
- Global /tmp jfs2 Nov 23 21:03 rw,log=NULL
83
- Global /usr jfs2 Nov 23 21:03 rw,log=NULL
84
- Global /var jfs2 Nov 23 21:03 rw,log=NULL
85
- 192.168.1.11 /stage/middleware3 /stage/middleware4 nfs3 Jul 17 13:24 ro,bg,hard,intr,sec=sys
75
+ @mount_wpar = <<~MOUNT
76
+ node mounted mounted over vfs date options
77
+ -------- --------------- --------------- ------ ------------ ---------------
78
+ Global / jfs2 Nov 23 21:03 rw,log=NULL
79
+ Global /home jfs2 Nov 23 21:03 rw,log=NULL
80
+ Global /opt jfs2 Nov 23 21:03 rw,log=NULL
81
+ Global /proc namefs Nov 23 21:03 rw
82
+ Global /tmp jfs2 Nov 23 21:03 rw,log=NULL
83
+ Global /usr jfs2 Nov 23 21:03 rw,log=NULL
84
+ Global /var jfs2 Nov 23 21:03 rw,log=NULL
85
+ 192.168.1.11 /stage/middleware3 /stage/middleware4 nfs3 Jul 17 13:24 ro,bg,hard,intr,sec=sys
86
86
  MOUNT
87
87
 
88
88
  @plugin = get_plugin("aix/filesystem")