ohai 8.10.0 → 8.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (256) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -2
  3. data/Rakefile +13 -4
  4. data/bin/ohai +3 -4
  5. data/lib/ohai.rb +4 -4
  6. data/lib/ohai/application.rb +7 -6
  7. data/lib/ohai/common/dmi.rb +56 -56
  8. data/lib/ohai/config.rb +12 -8
  9. data/lib/ohai/dsl.rb +3 -3
  10. data/lib/ohai/dsl/plugin.rb +5 -5
  11. data/lib/ohai/dsl/plugin/versionvi.rb +0 -1
  12. data/lib/ohai/dsl/plugin/versionvii.rb +1 -0
  13. data/lib/ohai/hints.rb +1 -1
  14. data/lib/ohai/loader.rb +7 -7
  15. data/lib/ohai/log.rb +1 -1
  16. data/lib/ohai/mash.rb +3 -2
  17. data/lib/ohai/mixin/command.rb +25 -23
  18. data/lib/ohai/mixin/dmi_decode.rb +10 -10
  19. data/lib/ohai/mixin/ec2_metadata.rb +40 -39
  20. data/lib/ohai/mixin/gce_metadata.rb +9 -9
  21. data/lib/ohai/mixin/network_constants.rb +1 -1
  22. data/lib/ohai/mixin/os.rb +3 -3
  23. data/lib/ohai/mixin/seconds_to_human.rb +0 -2
  24. data/lib/ohai/mixin/softlayer_metadata.rb +10 -10
  25. data/lib/ohai/mixin/string.rb +2 -2
  26. data/lib/ohai/plugin_config.rb +1 -1
  27. data/lib/ohai/plugins/aix/cpu.rb +2 -2
  28. data/lib/ohai/plugins/aix/filesystem.rb +2 -2
  29. data/lib/ohai/plugins/aix/memory.rb +2 -2
  30. data/lib/ohai/plugins/aix/network.rb +9 -10
  31. data/lib/ohai/plugins/aix/os.rb +2 -2
  32. data/lib/ohai/plugins/aix/uptime.rb +3 -3
  33. data/lib/ohai/plugins/aix/virtualization.rb +23 -23
  34. data/lib/ohai/plugins/azure.rb +32 -5
  35. data/lib/ohai/plugins/bsd/virtualization.rb +22 -22
  36. data/lib/ohai/plugins/c.rb +3 -3
  37. data/lib/ohai/plugins/chef.rb +1 -1
  38. data/lib/ohai/plugins/cloud.rb +59 -60
  39. data/lib/ohai/plugins/cloud_v2.rb +37 -39
  40. data/lib/ohai/plugins/darwin/cpu.rb +1 -1
  41. data/lib/ohai/plugins/darwin/filesystem2.rb +5 -5
  42. data/lib/ohai/plugins/darwin/memory.rb +5 -6
  43. data/lib/ohai/plugins/darwin/network.rb +7 -7
  44. data/lib/ohai/plugins/darwin/system_profiler.rb +32 -33
  45. data/lib/ohai/plugins/darwin/virtualization.rb +9 -9
  46. data/lib/ohai/plugins/digital_ocean.rb +16 -16
  47. data/lib/ohai/plugins/dmi.rb +6 -6
  48. data/lib/ohai/plugins/dragonflybsd/cpu.rb +2 -2
  49. data/lib/ohai/plugins/dragonflybsd/memory.rb +0 -1
  50. data/lib/ohai/plugins/dragonflybsd/network.rb +4 -4
  51. data/lib/ohai/plugins/dragonflybsd/os.rb +1 -1
  52. data/lib/ohai/plugins/ec2.rb +39 -15
  53. data/lib/ohai/plugins/elixir.rb +1 -1
  54. data/lib/ohai/plugins/erlang.rb +3 -3
  55. data/lib/ohai/plugins/eucalyptus.rb +16 -12
  56. data/lib/ohai/plugins/freebsd/cpu.rb +2 -2
  57. data/lib/ohai/plugins/freebsd/memory.rb +0 -1
  58. data/lib/ohai/plugins/freebsd/network.rb +4 -4
  59. data/lib/ohai/plugins/freebsd/os.rb +1 -1
  60. data/lib/ohai/plugins/gce.rb +6 -6
  61. data/lib/ohai/plugins/hostname.rb +7 -7
  62. data/lib/ohai/plugins/init_package.rb +1 -1
  63. data/lib/ohai/plugins/ip_scopes.rb +9 -9
  64. data/lib/ohai/plugins/java.rb +1 -1
  65. data/lib/ohai/plugins/joyent.rb +7 -7
  66. data/lib/ohai/plugins/kernel.rb +8 -8
  67. data/lib/ohai/plugins/linode.rb +7 -4
  68. data/lib/ohai/plugins/linux/cpu.rb +5 -5
  69. data/lib/ohai/plugins/linux/filesystem.rb +16 -16
  70. data/lib/ohai/plugins/linux/filesystem2.rb +15 -15
  71. data/lib/ohai/plugins/linux/mdadm.rb +3 -3
  72. data/lib/ohai/plugins/linux/network.rb +85 -51
  73. data/lib/ohai/plugins/linux/platform.rb +24 -24
  74. data/lib/ohai/plugins/linux/virtualization.rb +8 -8
  75. data/lib/ohai/plugins/mono.rb +1 -1
  76. data/lib/ohai/plugins/netbsd/cpu.rb +1 -1
  77. data/lib/ohai/plugins/netbsd/network.rb +2 -2
  78. data/lib/ohai/plugins/network.rb +11 -11
  79. data/lib/ohai/plugins/network_listeners.rb +30 -26
  80. data/lib/ohai/plugins/ohai.rb +3 -3
  81. data/lib/ohai/plugins/openbsd/cpu.rb +4 -4
  82. data/lib/ohai/plugins/openbsd/memory.rb +4 -4
  83. data/lib/ohai/plugins/openbsd/network.rb +3 -3
  84. data/lib/ohai/plugins/openstack.rb +12 -12
  85. data/lib/ohai/plugins/os.rb +2 -2
  86. data/lib/ohai/plugins/packages.rb +22 -22
  87. data/lib/ohai/plugins/passwd.rb +4 -4
  88. data/lib/ohai/plugins/powershell.rb +9 -9
  89. data/lib/ohai/plugins/ps.rb +2 -2
  90. data/lib/ohai/plugins/python.rb +1 -1
  91. data/lib/ohai/plugins/rackspace.rb +13 -13
  92. data/lib/ohai/plugins/root_group.rb +4 -4
  93. data/lib/ohai/plugins/ruby.rb +6 -6
  94. data/lib/ohai/plugins/rust.rb +1 -1
  95. data/lib/ohai/plugins/sigar/cpu.rb +1 -1
  96. data/lib/ohai/plugins/sigar/filesystem.rb +1 -1
  97. data/lib/ohai/plugins/sigar/network.rb +13 -13
  98. data/lib/ohai/plugins/sigar/network_route.rb +34 -29
  99. data/lib/ohai/plugins/softlayer.rb +8 -7
  100. data/lib/ohai/plugins/solaris2/cpu.rb +19 -19
  101. data/lib/ohai/plugins/solaris2/dmi.rb +63 -63
  102. data/lib/ohai/plugins/solaris2/filesystem.rb +13 -13
  103. data/lib/ohai/plugins/solaris2/memory.rb +2 -2
  104. data/lib/ohai/plugins/solaris2/network.rb +5 -5
  105. data/lib/ohai/plugins/solaris2/virtualization.rb +18 -18
  106. data/lib/ohai/plugins/solaris2/zpools.rb +1 -1
  107. data/lib/ohai/plugins/ssh_host_key.rb +2 -2
  108. data/lib/ohai/plugins/uptime.rb +4 -5
  109. data/lib/ohai/plugins/virtualbox.rb +2 -2
  110. data/lib/ohai/plugins/virtualization.rb +17 -17
  111. data/lib/ohai/plugins/vmware.rb +2 -2
  112. data/lib/ohai/plugins/windows/cpu.rb +14 -14
  113. data/lib/ohai/plugins/windows/drivers.rb +8 -8
  114. data/lib/ohai/plugins/windows/filesystem.rb +4 -4
  115. data/lib/ohai/plugins/windows/memory.rb +1 -1
  116. data/lib/ohai/plugins/windows/network.rb +10 -10
  117. data/lib/ohai/plugins/windows/platform.rb +1 -2
  118. data/lib/ohai/plugins/windows/virtualization.rb +17 -17
  119. data/lib/ohai/provides_map.rb +7 -7
  120. data/lib/ohai/runner.rb +3 -3
  121. data/lib/ohai/system.rb +21 -20
  122. data/lib/ohai/util/file_helper.rb +1 -2
  123. data/lib/ohai/util/ip_helper.rb +4 -4
  124. data/lib/ohai/util/win32.rb +5 -5
  125. data/lib/ohai/util/win32/group_helper.rb +4 -5
  126. data/lib/ohai/version.rb +1 -1
  127. data/ohai.gemspec +7 -5
  128. data/spec/functional/application_spec.rb +23 -23
  129. data/spec/functional/loader_spec.rb +1 -1
  130. data/spec/functional/plugins/powershell_spec.rb +13 -13
  131. data/spec/functional/plugins/root_group_spec.rb +5 -5
  132. data/spec/ohai_spec.rb +1 -1
  133. data/spec/spec_helper.rb +9 -9
  134. data/spec/support/integration_helper.rb +7 -7
  135. data/spec/support/platform_helpers.rb +1 -1
  136. data/spec/unit/application_spec.rb +17 -17
  137. data/spec/unit/config_spec.rb +2 -2
  138. data/spec/unit/dsl/plugin_spec.rb +28 -28
  139. data/spec/unit/hints_spec.rb +3 -3
  140. data/spec/unit/loader_spec.rb +9 -9
  141. data/spec/unit/mixin/command_spec.rb +5 -5
  142. data/spec/unit/mixin/ec2_metadata_spec.rb +6 -6
  143. data/spec/unit/mixin/softlayer_metadata_spec.rb +19 -23
  144. data/spec/unit/plugin_config_spec.rb +5 -5
  145. data/spec/unit/plugins/abort_spec.rb +3 -3
  146. data/spec/unit/plugins/aix/cpu_spec.rb +1 -1
  147. data/spec/unit/plugins/aix/filesystem_spec.rb +25 -25
  148. data/spec/unit/plugins/aix/hostname_spec.rb +1 -2
  149. data/spec/unit/plugins/aix/kernel_spec.rb +3 -3
  150. data/spec/unit/plugins/aix/memory_spec.rb +8 -8
  151. data/spec/unit/plugins/aix/network_spec.rb +38 -38
  152. data/spec/unit/plugins/aix/os_spec.rb +1 -2
  153. data/spec/unit/plugins/aix/platform_spec.rb +1 -1
  154. data/spec/unit/plugins/aix/uptime_spec.rb +1 -1
  155. data/spec/unit/plugins/aix/virtualization_spec.rb +11 -11
  156. data/spec/unit/plugins/azure_spec.rb +118 -20
  157. data/spec/unit/plugins/bsd/filesystem_spec.rb +1 -1
  158. data/spec/unit/plugins/bsd/virtualization_spec.rb +4 -4
  159. data/spec/unit/plugins/c_spec.rb +12 -12
  160. data/spec/unit/plugins/chef_spec.rb +2 -2
  161. data/spec/unit/plugins/cloud_spec.rb +37 -37
  162. data/spec/unit/plugins/cloud_v2_spec.rb +64 -65
  163. data/spec/unit/plugins/darwin/cpu_spec.rb +1 -2
  164. data/spec/unit/plugins/darwin/filesystem2_spec.rb +7 -7
  165. data/spec/unit/plugins/darwin/filesystem_spec.rb +5 -5
  166. data/spec/unit/plugins/darwin/hostname_spec.rb +1 -4
  167. data/spec/unit/plugins/darwin/kernel_spec.rb +6 -10
  168. data/spec/unit/plugins/darwin/memory_spec.rb +5 -5
  169. data/spec/unit/plugins/darwin/network_spec.rb +352 -353
  170. data/spec/unit/plugins/darwin/platform_spec.rb +1 -2
  171. data/spec/unit/plugins/darwin/system_profiler_spec.rb +3 -3
  172. data/spec/unit/plugins/darwin/virtualization_spec.rb +6 -6
  173. data/spec/unit/plugins/digital_ocean_spec.rb +38 -37
  174. data/spec/unit/plugins/dmi_spec.rb +3 -3
  175. data/spec/unit/plugins/ec2_spec.rb +97 -88
  176. data/spec/unit/plugins/elixir_spec.rb +1 -2
  177. data/spec/unit/plugins/erlang_spec.rb +2 -2
  178. data/spec/unit/plugins/eucalyptus_spec.rb +19 -19
  179. data/spec/unit/plugins/fail_spec.rb +2 -2
  180. data/spec/unit/plugins/freebsd/cpu_spec.rb +14 -14
  181. data/spec/unit/plugins/freebsd/hostname_spec.rb +1 -2
  182. data/spec/unit/plugins/freebsd/kernel_spec.rb +2 -3
  183. data/spec/unit/plugins/freebsd/os_spec.rb +4 -5
  184. data/spec/unit/plugins/freebsd/platform_spec.rb +1 -2
  185. data/spec/unit/plugins/gce_spec.rb +9 -9
  186. data/spec/unit/plugins/go_spec.rb +1 -1
  187. data/spec/unit/plugins/groovy_spec.rb +1 -2
  188. data/spec/unit/plugins/hostname_spec.rb +1 -2
  189. data/spec/unit/plugins/init_package_spec.rb +1 -1
  190. data/spec/unit/plugins/ip_scopes_spec.rb +38 -38
  191. data/spec/unit/plugins/java_spec.rb +52 -1
  192. data/spec/unit/plugins/joyent_spec.rb +9 -11
  193. data/spec/unit/plugins/kernel_spec.rb +11 -12
  194. data/spec/unit/plugins/linode_spec.rb +29 -29
  195. data/spec/unit/plugins/linux/block_device_spec.rb +21 -21
  196. data/spec/unit/plugins/linux/cpu_spec.rb +3 -3
  197. data/spec/unit/plugins/linux/filesystem2_spec.rb +7 -7
  198. data/spec/unit/plugins/linux/filesystem_spec.rb +85 -86
  199. data/spec/unit/plugins/linux/hostname_spec.rb +1 -3
  200. data/spec/unit/plugins/linux/kernel_spec.rb +1 -1
  201. data/spec/unit/plugins/linux/lsb_spec.rb +1 -2
  202. data/spec/unit/plugins/linux/mdadm_spec.rb +4 -4
  203. data/spec/unit/plugins/linux/memory_spec.rb +29 -33
  204. data/spec/unit/plugins/linux/network_spec.rb +463 -245
  205. data/spec/unit/plugins/linux/platform_spec.rb +64 -65
  206. data/spec/unit/plugins/linux/uptime_spec.rb +1 -2
  207. data/spec/unit/plugins/linux/virtualization_spec.rb +42 -42
  208. data/spec/unit/plugins/lua_spec.rb +1 -2
  209. data/spec/unit/plugins/mono_spec.rb +1 -2
  210. data/spec/unit/plugins/netbsd/hostname_spec.rb +1 -2
  211. data/spec/unit/plugins/netbsd/kernel_spec.rb +1 -2
  212. data/spec/unit/plugins/netbsd/platform_spec.rb +1 -1
  213. data/spec/unit/plugins/network_spec.rb +118 -118
  214. data/spec/unit/plugins/nodejs_spec.rb +1 -1
  215. data/spec/unit/plugins/ohai_spec.rb +1 -1
  216. data/spec/unit/plugins/ohai_time_spec.rb +1 -2
  217. data/spec/unit/plugins/openbsd/hostname_spec.rb +1 -2
  218. data/spec/unit/plugins/openbsd/kernel_spec.rb +1 -2
  219. data/spec/unit/plugins/openbsd/platform_spec.rb +1 -2
  220. data/spec/unit/plugins/openstack_spec.rb +35 -37
  221. data/spec/unit/plugins/os_spec.rb +7 -8
  222. data/spec/unit/plugins/packages_spec.rb +118 -118
  223. data/spec/unit/plugins/passwd_spec.rb +18 -18
  224. data/spec/unit/plugins/perl_spec.rb +1 -1
  225. data/spec/unit/plugins/php_spec.rb +4 -4
  226. data/spec/unit/plugins/platform_spec.rb +8 -9
  227. data/spec/unit/plugins/powershell_spec.rb +3 -3
  228. data/spec/unit/plugins/python_spec.rb +1 -1
  229. data/spec/unit/plugins/rackspace_spec.rb +66 -68
  230. data/spec/unit/plugins/root_group_spec.rb +26 -26
  231. data/spec/unit/plugins/ruby_spec.rb +14 -15
  232. data/spec/unit/plugins/rust_spec.rb +2 -2
  233. data/spec/unit/plugins/sigar/network_route_spec.rb +36 -36
  234. data/spec/unit/plugins/softlayer_spec.rb +10 -10
  235. data/spec/unit/plugins/solaris2/cpu_spec.rb +20 -21
  236. data/spec/unit/plugins/solaris2/dmi_spec.rb +5 -6
  237. data/spec/unit/plugins/solaris2/filesystem.rb +5 -5
  238. data/spec/unit/plugins/solaris2/hostname_spec.rb +1 -1
  239. data/spec/unit/plugins/solaris2/kernel_spec.rb +3 -3
  240. data/spec/unit/plugins/solaris2/memory_spec.rb +5 -5
  241. data/spec/unit/plugins/solaris2/network_spec.rb +7 -8
  242. data/spec/unit/plugins/solaris2/platform_spec.rb +1 -1
  243. data/spec/unit/plugins/solaris2/virtualization_spec.rb +3 -5
  244. data/spec/unit/plugins/solaris2/zpools_spec.rb +6 -6
  245. data/spec/unit/plugins/ssh_host_keys_spec.rb +1 -1
  246. data/spec/unit/plugins/virtualbox_spec.rb +19 -19
  247. data/spec/unit/plugins/vmware_spec.rb +28 -28
  248. data/spec/unit/plugins/windows/cpu_spec.rb +46 -48
  249. data/spec/unit/plugins/windows/memory_spec.rb +5 -5
  250. data/spec/unit/plugins/windows/virtualization_spec.rb +163 -163
  251. data/spec/unit/provides_map_spec.rb +10 -10
  252. data/spec/unit/runner_spec.rb +10 -10
  253. data/spec/unit/system_spec.rb +19 -19
  254. data/spec/unit/util/file_helper_spec.rb +5 -6
  255. data/spec/unit/util/ip_helper_spec.rb +39 -39
  256. metadata +31 -4
@@ -6,9 +6,9 @@
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
8
8
  # You may obtain a copy of the License at
9
- #
9
+ #
10
10
  # http://www.apache.org/licenses/LICENSE-2.0
11
- #
11
+ #
12
12
  # Unless required by applicable law or agreed to in writing, software
13
13
  # distributed under the License is distributed on an "AS IS" BASIS,
14
14
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -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 File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
20
20
 
21
21
  describe Ohai::System, "Linux filesystem plugin" do
22
22
  let(:plugin) { get_plugin("linux/filesystem") }
@@ -73,7 +73,7 @@ tmpfs 2030944 2960 2027984 1% /dev/shm
73
73
  /dev/md0 960492 36388 875312 4% /boot
74
74
  DF
75
75
  allow(plugin).to receive(:shell_out).with("df -P").and_return(mock_shell_out(0, @stdout, ""))
76
-
76
+
77
77
  @inode_stdout = <<-DFi
78
78
  Filesystem Inodes IUsed IFree IUse% Mounted on
79
79
  /dev/xvda1 1310720 107407 1203313 9% /
@@ -115,17 +115,17 @@ DFi
115
115
  plugin.run
116
116
  expect(plugin[:filesystem]["/dev/mapper/sys.vg-special.lv"][:mount]).to eq("/special")
117
117
  end
118
-
118
+
119
119
  it "should set total_inodes to value from df -iP" do
120
120
  plugin.run
121
121
  expect(plugin[:filesystem]["/dev/mapper/sys.vg-special.lv"][:total_inodes]).to eq("124865")
122
122
  end
123
-
123
+
124
124
  it "should set inodes_used to value from df -iP" do
125
125
  plugin.run
126
126
  expect(plugin[:filesystem]["/dev/mapper/sys.vg-special.lv"][:inodes_used]).to eq("380")
127
127
  end
128
-
128
+
129
129
  it "should set inodes_available to value from df -iP" do
130
130
  plugin.run
131
131
  expect(plugin[:filesystem]["/dev/mapper/sys.vg-special.lv"][:inodes_available]).to eq("124485")
@@ -171,26 +171,26 @@ MOUNT
171
171
 
172
172
  it "should set mount_options to an array of values from mount" do
173
173
  plugin.run
174
- expect(plugin[:filesystem]["/dev/mapper/sys.vg-special.lv"][:mount_options]).to eq([ "ro", "noatime" ])
174
+ expect(plugin[:filesystem]["/dev/mapper/sys.vg-special.lv"][:mount_options]).to eq(%w{ro noatime})
175
175
  end
176
176
  end
177
177
 
178
178
  describe "when gathering filesystem type data from blkid" do
179
179
  before(:each) do
180
180
  @stdout = <<-BLKID_TYPE
181
- /dev/sdb1: TYPE=\"linux_raid_member\"
182
- /dev/sdb2: TYPE=\"linux_raid_member\"
183
- /dev/sda1: TYPE=\"linux_raid_member\"
184
- /dev/sda2: TYPE=\"linux_raid_member\"
185
- /dev/md0: TYPE=\"ext3\"
186
- /dev/md1: TYPE=\"LVM2_member\"
187
- /dev/mapper/sys.vg-root.lv: TYPE=\"ext4\"
188
- /dev/mapper/sys.vg-swap.lv: TYPE=\"swap\"
189
- /dev/mapper/sys.vg-tmp.lv: TYPE=\"ext4\"
190
- /dev/mapper/sys.vg-usr.lv: TYPE=\"ext4\"
191
- /dev/mapper/sys.vg-var.lv: TYPE=\"ext4\"
192
- /dev/mapper/sys.vg-home.lv: TYPE=\"xfs\"
193
- /dev/mapper/debian--7-root: TYPE=\"ext4\"
181
+ /dev/sdb1: TYPE=\"linux_raid_member\"
182
+ /dev/sdb2: TYPE=\"linux_raid_member\"
183
+ /dev/sda1: TYPE=\"linux_raid_member\"
184
+ /dev/sda2: TYPE=\"linux_raid_member\"
185
+ /dev/md0: TYPE=\"ext3\"
186
+ /dev/md1: TYPE=\"LVM2_member\"
187
+ /dev/mapper/sys.vg-root.lv: TYPE=\"ext4\"
188
+ /dev/mapper/sys.vg-swap.lv: TYPE=\"swap\"
189
+ /dev/mapper/sys.vg-tmp.lv: TYPE=\"ext4\"
190
+ /dev/mapper/sys.vg-usr.lv: TYPE=\"ext4\"
191
+ /dev/mapper/sys.vg-var.lv: TYPE=\"ext4\"
192
+ /dev/mapper/sys.vg-home.lv: TYPE=\"xfs\"
193
+ /dev/mapper/debian--7-root: TYPE=\"ext4\"
194
194
  BLKID_TYPE
195
195
  allow(plugin).to receive(:shell_out).with("blkid -s TYPE").and_return(mock_shell_out(0, @stdout, ""))
196
196
  end
@@ -210,19 +210,19 @@ BLKID_TYPE
210
210
  before(:each) do
211
211
  allow(File).to receive(:exist?).with("/bin/lsblk").and_return(true)
212
212
  @stdout = <<-BLKID_TYPE
213
- NAME="sdb1" FSTYPE="linux_raid_member"
214
- NAME="sdb2" FSTYPE="linux_raid_member"
215
- NAME="sda1" FSTYPE="linux_raid_member"
216
- NAME="sda2" FSTYPE="linux_raid_member"
217
- NAME="md0" FSTYPE="ext3"
218
- NAME="md1" FSTYPE="LVM2_member"
219
- NAME="sys.vg-root.lv" FSTYPE="ext4"
220
- NAME="sys.vg-swap.lv" FSTYPE="swap"
221
- NAME="sys.vg-tmp.lv" FSTYPE="ext4"
222
- NAME="sys.vg-usr.lv" FSTYPE="ext4"
223
- NAME="sys.vg-var.lv" FSTYPE="ext4"
224
- NAME="sys.vg-home.lv" FSTYPE="xfs"
225
- NAME="debian--7-root (dm-0)" FSTYPE="ext4"
213
+ NAME="sdb1" FSTYPE="linux_raid_member"
214
+ NAME="sdb2" FSTYPE="linux_raid_member"
215
+ NAME="sda1" FSTYPE="linux_raid_member"
216
+ NAME="sda2" FSTYPE="linux_raid_member"
217
+ NAME="md0" FSTYPE="ext3"
218
+ NAME="md1" FSTYPE="LVM2_member"
219
+ NAME="sys.vg-root.lv" FSTYPE="ext4"
220
+ NAME="sys.vg-swap.lv" FSTYPE="swap"
221
+ NAME="sys.vg-tmp.lv" FSTYPE="ext4"
222
+ NAME="sys.vg-usr.lv" FSTYPE="ext4"
223
+ NAME="sys.vg-var.lv" FSTYPE="ext4"
224
+ NAME="sys.vg-home.lv" FSTYPE="xfs"
225
+ NAME="debian--7-root (dm-0)" FSTYPE="ext4"
226
226
  BLKID_TYPE
227
227
  allow(plugin).to receive(:shell_out).with("lsblk -P -n -o NAME,FSTYPE").
228
228
  and_return(mock_shell_out(0, @stdout, ""))
@@ -248,19 +248,19 @@ BLKID_TYPE
248
248
  describe "when gathering filesystem uuid data from blkid" do
249
249
  before(:each) do
250
250
  @stdout = <<-BLKID_UUID
251
- /dev/sdb1: UUID=\"bd1197e0-6997-1f3a-e27e-7801388308b5\"
252
- /dev/sdb2: UUID=\"e36d933e-e5b9-cfe5-6845-1f84d0f7fbfa\"
253
- /dev/sda1: UUID=\"bd1197e0-6997-1f3a-e27e-7801388308b5\"
254
- /dev/sda2: UUID=\"e36d933e-e5b9-cfe5-6845-1f84d0f7fbfa\"
255
- /dev/md0: UUID=\"37b8de8e-0fe3-4b5a-b9b4-dde33e19bb32\"
256
- /dev/md1: UUID=\"YsIe0R-fj1y-LXTd-imla-opKo-OuIe-TBoxSK\"
257
- /dev/mapper/sys.vg-root.lv: UUID=\"7742d14b-80a3-4e97-9a32-478be9ea9aea\"
258
- /dev/mapper/sys.vg-swap.lv: UUID=\"9bc2e515-8ddc-41c3-9f63-4eaebde9ce96\"
259
- /dev/mapper/sys.vg-tmp.lv: UUID=\"74cf7eb9-428f-479e-9a4a-9943401e81e5\"
260
- /dev/mapper/sys.vg-usr.lv: UUID=\"26ec33c5-d00b-4f88-a550-492def013bbc\"
261
- /dev/mapper/sys.vg-var.lv: UUID=\"6b559c35-7847-4ae2-b512-c99012d3f5b3\"
262
- /dev/mapper/sys.vg-home.lv: UUID=\"d6efda02-1b73-453c-8c74-7d8dee78fa5e\"
263
- /dev/mapper/debian--7-root: UUID=\"09187faa-3512-4505-81af-7e86d2ccb99a\"
251
+ /dev/sdb1: UUID=\"bd1197e0-6997-1f3a-e27e-7801388308b5\"
252
+ /dev/sdb2: UUID=\"e36d933e-e5b9-cfe5-6845-1f84d0f7fbfa\"
253
+ /dev/sda1: UUID=\"bd1197e0-6997-1f3a-e27e-7801388308b5\"
254
+ /dev/sda2: UUID=\"e36d933e-e5b9-cfe5-6845-1f84d0f7fbfa\"
255
+ /dev/md0: UUID=\"37b8de8e-0fe3-4b5a-b9b4-dde33e19bb32\"
256
+ /dev/md1: UUID=\"YsIe0R-fj1y-LXTd-imla-opKo-OuIe-TBoxSK\"
257
+ /dev/mapper/sys.vg-root.lv: UUID=\"7742d14b-80a3-4e97-9a32-478be9ea9aea\"
258
+ /dev/mapper/sys.vg-swap.lv: UUID=\"9bc2e515-8ddc-41c3-9f63-4eaebde9ce96\"
259
+ /dev/mapper/sys.vg-tmp.lv: UUID=\"74cf7eb9-428f-479e-9a4a-9943401e81e5\"
260
+ /dev/mapper/sys.vg-usr.lv: UUID=\"26ec33c5-d00b-4f88-a550-492def013bbc\"
261
+ /dev/mapper/sys.vg-var.lv: UUID=\"6b559c35-7847-4ae2-b512-c99012d3f5b3\"
262
+ /dev/mapper/sys.vg-home.lv: UUID=\"d6efda02-1b73-453c-8c74-7d8dee78fa5e\"
263
+ /dev/mapper/debian--7-root: UUID=\"09187faa-3512-4505-81af-7e86d2ccb99a\"
264
264
  BLKID_UUID
265
265
  allow(plugin).to receive(:shell_out).with("blkid -s UUID").and_return(mock_shell_out(0, @stdout, ""))
266
266
  end
@@ -280,19 +280,19 @@ BLKID_UUID
280
280
  before(:each) do
281
281
  allow(File).to receive(:exist?).with("/bin/lsblk").and_return(true)
282
282
  @stdout = <<-BLKID_UUID
283
- NAME="sdb1" UUID="bd1197e0-6997-1f3a-e27e-7801388308b5"
284
- NAME="sdb2" UUID="e36d933e-e5b9-cfe5-6845-1f84d0f7fbfa"
285
- NAME="sda1" UUID="bd1197e0-6997-1f3a-e27e-7801388308b5"
286
- NAME="sda2" UUID="e36d933e-e5b9-cfe5-6845-1f84d0f7fbfa"
287
- NAME="md0" UUID="37b8de8e-0fe3-4b5a-b9b4-dde33e19bb32"
288
- NAME="md1" UUID="YsIe0R-fj1y-LXTd-imla-opKo-OuIe-TBoxSK"
289
- NAME="sys.vg-root.lv" UUID="7742d14b-80a3-4e97-9a32-478be9ea9aea"
290
- NAME="sys.vg-swap.lv" UUID="9bc2e515-8ddc-41c3-9f63-4eaebde9ce96"
291
- NAME="sys.vg-tmp.lv" UUID="74cf7eb9-428f-479e-9a4a-9943401e81e5"
292
- NAME="sys.vg-usr.lv" UUID="26ec33c5-d00b-4f88-a550-492def013bbc"
293
- NAME="sys.vg-var.lv" UUID="6b559c35-7847-4ae2-b512-c99012d3f5b3"
294
- NAME="sys.vg-home.lv" UUID="d6efda02-1b73-453c-8c74-7d8dee78fa5e"
295
- NAME="debian--7-root (dm-0)" UUID="09187faa-3512-4505-81af-7e86d2ccb99a"
283
+ NAME="sdb1" UUID="bd1197e0-6997-1f3a-e27e-7801388308b5"
284
+ NAME="sdb2" UUID="e36d933e-e5b9-cfe5-6845-1f84d0f7fbfa"
285
+ NAME="sda1" UUID="bd1197e0-6997-1f3a-e27e-7801388308b5"
286
+ NAME="sda2" UUID="e36d933e-e5b9-cfe5-6845-1f84d0f7fbfa"
287
+ NAME="md0" UUID="37b8de8e-0fe3-4b5a-b9b4-dde33e19bb32"
288
+ NAME="md1" UUID="YsIe0R-fj1y-LXTd-imla-opKo-OuIe-TBoxSK"
289
+ NAME="sys.vg-root.lv" UUID="7742d14b-80a3-4e97-9a32-478be9ea9aea"
290
+ NAME="sys.vg-swap.lv" UUID="9bc2e515-8ddc-41c3-9f63-4eaebde9ce96"
291
+ NAME="sys.vg-tmp.lv" UUID="74cf7eb9-428f-479e-9a4a-9943401e81e5"
292
+ NAME="sys.vg-usr.lv" UUID="26ec33c5-d00b-4f88-a550-492def013bbc"
293
+ NAME="sys.vg-var.lv" UUID="6b559c35-7847-4ae2-b512-c99012d3f5b3"
294
+ NAME="sys.vg-home.lv" UUID="d6efda02-1b73-453c-8c74-7d8dee78fa5e"
295
+ NAME="debian--7-root (dm-0)" UUID="09187faa-3512-4505-81af-7e86d2ccb99a"
296
296
  BLKID_UUID
297
297
  allow(plugin).to receive(:shell_out).with("lsblk -P -n -o NAME,UUID").
298
298
  and_return(mock_shell_out(0, @stdout, ""))
@@ -322,17 +322,17 @@ BLKID_UUID
322
322
  describe "when gathering filesystem label data from blkid" do
323
323
  before(:each) do
324
324
  @stdout = <<-BLKID_LABEL
325
- /dev/sda1: LABEL=\"fuego:0\"
326
- /dev/sda2: LABEL=\"fuego:1\"
327
- /dev/sdb1: LABEL=\"fuego:0\"
328
- /dev/sdb2: LABEL=\"fuego:1\"
329
- /dev/md0: LABEL=\"/boot\"
330
- /dev/mapper/sys.vg-root.lv: LABEL=\"/\"
331
- /dev/mapper/sys.vg-tmp.lv: LABEL=\"/tmp\"
332
- /dev/mapper/sys.vg-usr.lv: LABEL=\"/usr\"
333
- /dev/mapper/sys.vg-var.lv: LABEL=\"/var\"
334
- /dev/mapper/sys.vg-home.lv: LABEL=\"/home\"
335
- /dev/mapper/debian--7-root: LABEL=\"root\"
325
+ /dev/sda1: LABEL=\"fuego:0\"
326
+ /dev/sda2: LABEL=\"fuego:1\"
327
+ /dev/sdb1: LABEL=\"fuego:0\"
328
+ /dev/sdb2: LABEL=\"fuego:1\"
329
+ /dev/md0: LABEL=\"/boot\"
330
+ /dev/mapper/sys.vg-root.lv: LABEL=\"/\"
331
+ /dev/mapper/sys.vg-tmp.lv: LABEL=\"/tmp\"
332
+ /dev/mapper/sys.vg-usr.lv: LABEL=\"/usr\"
333
+ /dev/mapper/sys.vg-var.lv: LABEL=\"/var\"
334
+ /dev/mapper/sys.vg-home.lv: LABEL=\"/home\"
335
+ /dev/mapper/debian--7-root: LABEL=\"root\"
336
336
  BLKID_LABEL
337
337
  allow(plugin).to receive(:shell_out).with("blkid -s LABEL").and_return(mock_shell_out(0, @stdout, ""))
338
338
  end
@@ -352,17 +352,17 @@ BLKID_LABEL
352
352
  before(:each) do
353
353
  allow(File).to receive(:exist?).with("/bin/lsblk").and_return(true)
354
354
  @stdout = <<-BLKID_LABEL
355
- NAME="sda1" LABEL="fuego:0"
356
- NAME="sda2" LABEL="fuego:1"
357
- NAME="sdb1" LABEL="fuego:0"
358
- NAME="sdb2" LABEL="fuego:1"
359
- NAME="md0" LABEL="/boot"
360
- NAME="sys.vg-root.lv" LABEL="/"
361
- NAME="sys.vg-tmp.lv" LABEL="/tmp"
362
- NAME="sys.vg-usr.lv" LABEL="/usr"
363
- NAME="sys.vg-var.lv" LABEL="/var"
364
- NAME="sys.vg-home.lv" LABEL="/home"
365
- NAME="debian--7-root (dm-0)" LABEL="root"
355
+ NAME="sda1" LABEL="fuego:0"
356
+ NAME="sda2" LABEL="fuego:1"
357
+ NAME="sdb1" LABEL="fuego:0"
358
+ NAME="sdb2" LABEL="fuego:1"
359
+ NAME="md0" LABEL="/boot"
360
+ NAME="sys.vg-root.lv" LABEL="/"
361
+ NAME="sys.vg-tmp.lv" LABEL="/tmp"
362
+ NAME="sys.vg-usr.lv" LABEL="/usr"
363
+ NAME="sys.vg-var.lv" LABEL="/var"
364
+ NAME="sys.vg-home.lv" LABEL="/home"
365
+ NAME="debian--7-root (dm-0)" LABEL="root"
366
366
  BLKID_LABEL
367
367
  allow(plugin).to receive(:shell_out).with("lsblk -P -n -o NAME,LABEL").
368
368
  and_return(mock_shell_out(0, @stdout, ""))
@@ -385,7 +385,6 @@ BLKID_LABEL
385
385
  end
386
386
  end
387
387
 
388
-
389
388
  describe "when gathering data from /proc/mounts" do
390
389
  before(:each) do
391
390
  allow(File).to receive(:exist?).with("/proc/mounts").and_return(true)
@@ -422,15 +421,15 @@ MOUNTS
422
421
  plugin.run
423
422
  expect(plugin[:filesystem]["/dev/mapper/sys.vg-special.lv"][:mount]).to eq("/special")
424
423
  end
425
-
424
+
426
425
  it "should set fs_type to value from /proc/mounts" do
427
426
  plugin.run
428
427
  expect(plugin[:filesystem]["/dev/mapper/sys.vg-special.lv"][:fs_type]).to eq("xfs")
429
428
  end
430
-
429
+
431
430
  it "should set mount_options to an array of values from /proc/mounts" do
432
431
  plugin.run
433
- expect(plugin[:filesystem]["/dev/mapper/sys.vg-special.lv"][:mount_options]).to eq([ "ro", "noatime", "attr2", "noquota" ])
432
+ expect(plugin[:filesystem]["/dev/mapper/sys.vg-special.lv"][:mount_options]).to eq(%w{ro noatime attr2 noquota})
434
433
  end
435
434
  end
436
435
 
@@ -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 hostname plugin" do
23
22
  before(:each) do
@@ -51,4 +50,3 @@ describe Ohai::System, "Linux hostname plugin" do
51
50
  end
52
51
 
53
52
  end
54
-
@@ -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 File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
21
21
 
22
22
  describe Ohai::System, "Linux kernel plugin" do
23
23
  before(:each) do
@@ -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
  # We do not alter case for lsb attributes and consume them as provided
23
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 File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
20
20
 
21
21
  describe Ohai::System, "Linux Mdadm Plugin" do
22
22
  before(:each) do
@@ -57,9 +57,9 @@ MD
57
57
  allow(@plugin).to receive(:collect_os).and_return(:linux)
58
58
  @double_file = double("/proc/mdstat")
59
59
  allow(@double_file).to receive(:each).
60
- and_yield("Personalities : [raid1] [raid6] [raid5] [raid4] [linear] [multipath] [raid0] [raid10]").
61
- and_yield("md0 : active raid10 sdh[5] sdg[4] sdf[3] sde[2] sdd[1] sdc[0]").
62
- and_yield(" 2929893888 blocks super 1.2 256K chunks 2 near-copies [6/6] [UUUUUU]")
60
+ and_yield("Personalities : [raid1] [raid6] [raid5] [raid4] [linear] [multipath] [raid0] [raid10]").
61
+ and_yield("md0 : active raid10 sdh[5] sdg[4] sdf[3] sde[2] sdd[1] sdc[0]").
62
+ and_yield(" 2929893888 blocks super 1.2 256K chunks 2 near-copies [6/6] [UUUUUU]")
63
63
  allow(File).to receive(:open).with("/proc/mdstat").and_return(@double_file)
64
64
  allow(File).to receive(:exist?).with("/proc/mdstat").and_return(true)
65
65
  allow(@plugin).to receive(:shell_out).with("mdadm --detail /dev/md0").and_return(mock_shell_out(0, @md0, ""))
@@ -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 File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
18
18
 
19
19
  describe Ohai::System, "Linux memory plugin" do
20
20
  before(:each) do
@@ -61,144 +61,140 @@ describe Ohai::System, "Linux memory plugin" do
61
61
  @plugin.run
62
62
  expect(@plugin[:memory][:total]).to eql("131932120kB")
63
63
  end
64
-
64
+
65
65
  it "should get free memory" do
66
66
  @plugin.run
67
67
  expect(@plugin[:memory][:free]).to eql("2269032kB")
68
68
  end
69
-
69
+
70
70
  it "should get memory used for file buffers" do
71
71
  @plugin.run
72
72
  expect(@plugin[:memory][:buffers]).to eql("646368kB")
73
73
  end
74
-
74
+
75
75
  it "should get cache memory" do
76
76
  @plugin.run
77
77
  expect(@plugin[:memory][:cached]).to eql("32346556kB")
78
78
  end
79
-
79
+
80
80
  it "should get active memory" do
81
81
  @plugin.run
82
82
  expect(@plugin[:memory][:active]).to eql("98595796kB")
83
83
  end
84
-
84
+
85
85
  it "should get inactive memory" do
86
86
  @plugin.run
87
87
  expect(@plugin[:memory][:inactive]).to eql("18477320kB")
88
88
  end
89
-
89
+
90
90
  it "should get high_total memory" do
91
91
  @plugin.run
92
92
  expect(@plugin[:memory][:high_total]).to eql("0kB")
93
93
  end
94
-
94
+
95
95
  it "should get high_free memory" do
96
96
  @plugin.run
97
97
  expect(@plugin[:memory][:high_free]).to eql("0kB")
98
98
  end
99
-
99
+
100
100
  it "should get low_total memory" do
101
101
  @plugin.run
102
102
  expect(@plugin[:memory][:low_total]).to eql("131932120kB")
103
103
  end
104
-
104
+
105
105
  it "should get low_free memory" do
106
106
  @plugin.run
107
107
  expect(@plugin[:memory][:low_free]).to eql("2269032kB")
108
108
  end
109
-
109
+
110
110
  it "should get dirty memory" do
111
111
  @plugin.run
112
112
  expect(@plugin[:memory][:dirty]).to eql("3212kB")
113
113
  end
114
-
114
+
115
115
  it "should get writeback memory" do
116
116
  @plugin.run
117
117
  expect(@plugin[:memory][:writeback]).to eql("0kB")
118
118
  end
119
-
119
+
120
120
  it "should get anon_pages memory" do
121
121
  @plugin.run
122
122
  expect(@plugin[:memory][:anon_pages]).to eql("84082132kB")
123
123
  end
124
-
124
+
125
125
  it "should get mapped memory" do
126
126
  @plugin.run
127
127
  expect(@plugin[:memory][:mapped]).to eql("3445224kB")
128
128
  end
129
-
130
-
129
+
131
130
  it "should get slab memory" do
132
131
  @plugin.run
133
132
  expect(@plugin[:memory][:slab]).to eql("9892096kB")
134
133
  end
135
-
134
+
136
135
  it "should get slab_reclaimable memory" do
137
136
  @plugin.run
138
137
  expect(@plugin[:memory][:slab_reclaimable]).to eql("362636kB")
139
138
  end
140
-
139
+
141
140
  it "should get slab_reclaimable memory" do
142
141
  @plugin.run
143
142
  expect(@plugin[:memory][:slab_unreclaim]).to eql("18860kB")
144
143
  end
145
-
144
+
146
145
  it "should get page_tables memory" do
147
146
  @plugin.run
148
147
  expect(@plugin[:memory][:page_tables]).to eql("1759332kB")
149
148
  end
150
-
151
-
149
+
152
150
  it "should get nfs_unstable memory" do
153
151
  @plugin.run
154
152
  expect(@plugin[:memory][:nfs_unstable]).to eql("0kB")
155
153
  end
156
-
154
+
157
155
  it "should get bounce memory" do
158
156
  @plugin.run
159
157
  expect(@plugin[:memory][:bounce]).to eql("0kB")
160
158
  end
161
-
159
+
162
160
  it "should get commit_limit memory" do
163
161
  @plugin.run
164
162
  expect(@plugin[:memory][:commit_limit]).to eql("148709328kB")
165
163
  end
166
-
164
+
167
165
  it "should get committed_as memory" do
168
166
  @plugin.run
169
167
  expect(@plugin[:memory][:committed_as]).to eql("333717060kB")
170
168
  end
171
-
169
+
172
170
  it "should get vmalloc_total memory" do
173
171
  @plugin.run
174
172
  expect(@plugin[:memory][:vmalloc_total]).to eql("34359738367kB")
175
173
  end
176
-
174
+
177
175
  it "should get vmalloc_used memory" do
178
176
  @plugin.run
179
177
  expect(@plugin[:memory][:vmalloc_used]).to eql("276796kB")
180
178
  end
181
-
179
+
182
180
  it "should get vmalloc_chunk memory" do
183
181
  @plugin.run
184
182
  expect(@plugin[:memory][:vmalloc_chunk]).to eql("34359461515kB")
185
183
  end
186
-
184
+
187
185
  it "should get total swap" do
188
186
  @plugin.run
189
187
  expect(@plugin[:memory][:swap][:total]).to eql("16777208kB")
190
188
  end
191
-
189
+
192
190
  it "should get cached swap" do
193
191
  @plugin.run
194
192
  expect(@plugin[:memory][:swap][:cached]).to eql("312kB")
195
193
  end
196
-
194
+
197
195
  it "should get free swap" do
198
196
  @plugin.run
199
197
  expect(@plugin[:memory][:swap][:free]).to eql("14127356kB")
200
198
  end
201
-
202
-
203
-
199
+
204
200
  end