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
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Matthew Kent (<mkent@magoazul.com>)
3
- # Copyright:: Copyright (c) 2011-2016 Chef Software, Inc.
3
+ # Copyright:: Copyright (c) 2011-2018, Chef Software Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -32,9 +32,9 @@ describe Ohai::System, "Linux filesystem plugin" do
32
32
  allow(plugin).to receive(:which).with("blkid").and_return("/sbin/blkid")
33
33
  allow(plugin).to receive(:shell_out).with("/sbin/blkid", timeout: 60).and_return(mock_shell_out(0, "", ""))
34
34
 
35
- allow(plugin).to receive(:shell_out).
36
- with("lsblk -n -P -o NAME,UUID,LABEL,FSTYPE", timeout: 60).
37
- and_return(mock_shell_out(0, "", ""))
35
+ allow(plugin).to receive(:shell_out)
36
+ .with("lsblk -n -P -o NAME,UUID,LABEL,FSTYPE", timeout: 60)
37
+ .and_return(mock_shell_out(0, "", ""))
38
38
 
39
39
  allow(File).to receive(:exist?).with("/proc/mounts").and_return(false)
40
40
 
@@ -57,29 +57,29 @@ describe Ohai::System, "Linux filesystem plugin" do
57
57
 
58
58
  describe "when gathering filesystem usage data from df" do
59
59
  before(:each) do
60
- @stdout = <<-DF
61
- Filesystem 1024-blocks Used Available Capacity Mounted on
62
- /dev/mapper/sys.vg-root.lv 4805760 378716 4182924 9% /
63
- tmpfs 2030944 0 2030944 0% /lib/init/rw
64
- udev 2025576 228 2025348 1% /dev
65
- tmpfs 2030944 2960 2027984 1% /dev/shm
66
- /dev/mapper/sys.vg-home.lv 97605056 53563252 44041804 55% /home
67
- /dev/mapper/sys.vg-special.lv 97605057 53563253 44041805 56% /special
68
- /dev/mapper/sys.vg-tmp.lv 1919048 46588 1774976 3% /tmp
69
- /dev/mapper/sys.vg-usr.lv 19223252 5479072 12767696 31% /usr
70
- /dev/mapper/sys.vg-var.lv 19223252 3436556 14810212 19% /var
71
- /dev/md0 960492 36388 875312 4% /boot
60
+ @stdout = <<~DF
61
+ Filesystem 1024-blocks Used Available Capacity Mounted on
62
+ /dev/mapper/sys.vg-root.lv 4805760 378716 4182924 9% /
63
+ tmpfs 2030944 0 2030944 0% /lib/init/rw
64
+ udev 2025576 228 2025348 1% /dev
65
+ tmpfs 2030944 2960 2027984 1% /dev/shm
66
+ /dev/mapper/sys.vg-home.lv 97605056 53563252 44041804 55% /home
67
+ /dev/mapper/sys.vg-special.lv 97605057 53563253 44041805 56% /special
68
+ /dev/mapper/sys.vg-tmp.lv 1919048 46588 1774976 3% /tmp
69
+ /dev/mapper/sys.vg-usr.lv 19223252 5479072 12767696 31% /usr
70
+ /dev/mapper/sys.vg-var.lv 19223252 3436556 14810212 19% /var
71
+ /dev/md0 960492 36388 875312 4% /boot
72
72
  DF
73
73
  allow(plugin).to receive(:shell_out).with("df -P").and_return(mock_shell_out(0, @stdout, ""))
74
74
 
75
- @inode_stdout = <<-DFi
76
- Filesystem Inodes IUsed IFree IUse% Mounted on
77
- /dev/xvda1 1310720 107407 1203313 9% /
78
- /dev/mapper/sys.vg-special.lv 124865 380 124485 1% /special
79
- tmpfs 126922 273 126649 1% /run
80
- none 126922 1 126921 1% /run/lock
81
- none 126922 1 126921 1% /run/shm
82
- DFi
75
+ @inode_stdout = <<~DFI
76
+ Filesystem Inodes IUsed IFree IUse% Mounted on
77
+ /dev/xvda1 1310720 107407 1203313 9% /
78
+ /dev/mapper/sys.vg-special.lv 124865 380 124485 1% /special
79
+ tmpfs 126922 273 126649 1% /run
80
+ none 126922 1 126921 1% /run/lock
81
+ none 126922 1 126921 1% /run/shm
82
+ DFI
83
83
  allow(plugin).to receive(:shell_out).with("df -iP").and_return(mock_shell_out(0, @inode_stdout, ""))
84
84
  end
85
85
 
@@ -132,22 +132,22 @@ DFi
132
132
 
133
133
  describe "when gathering mounted filesystem data from mount" do
134
134
  before(:each) do
135
- @stdout = <<-MOUNT
136
- /dev/mapper/sys.vg-root.lv on / type ext4 (rw,noatime,errors=remount-ro)
137
- tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
138
- proc on /proc type proc (rw,noexec,nosuid,nodev)
139
- sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
140
- udev on /dev type tmpfs (rw,mode=0755)
141
- tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
142
- devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
143
- /dev/mapper/sys.vg-home.lv on /home type xfs (rw,noatime)
144
- /dev/mapper/sys.vg-special.lv on /special type xfs (ro,noatime)
145
- /dev/mapper/sys.vg-tmp.lv on /tmp type ext4 (rw,noatime)
146
- /dev/mapper/sys.vg-usr.lv on /usr type ext4 (rw,noatime)
147
- /dev/mapper/sys.vg-var.lv on /var type ext4 (rw,noatime)
148
- /dev/md0 on /boot type ext3 (rw,noatime,errors=remount-ro)
149
- fusectl on /sys/fs/fuse/connections type fusectl (rw)
150
- binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
135
+ @stdout = <<~MOUNT
136
+ /dev/mapper/sys.vg-root.lv on / type ext4 (rw,noatime,errors=remount-ro)
137
+ tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
138
+ proc on /proc type proc (rw,noexec,nosuid,nodev)
139
+ sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
140
+ udev on /dev type tmpfs (rw,mode=0755)
141
+ tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
142
+ devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
143
+ /dev/mapper/sys.vg-home.lv on /home type xfs (rw,noatime)
144
+ /dev/mapper/sys.vg-special.lv on /special type xfs (ro,noatime)
145
+ /dev/mapper/sys.vg-tmp.lv on /tmp type ext4 (rw,noatime)
146
+ /dev/mapper/sys.vg-usr.lv on /usr type ext4 (rw,noatime)
147
+ /dev/mapper/sys.vg-var.lv on /var type ext4 (rw,noatime)
148
+ /dev/md0 on /boot type ext3 (rw,noatime,errors=remount-ro)
149
+ fusectl on /sys/fs/fuse/connections type fusectl (rw)
150
+ binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
151
151
  MOUNT
152
152
  allow(plugin).to receive(:shell_out).with("mount").and_return(mock_shell_out(0, @stdout, ""))
153
153
  end
@@ -177,44 +177,44 @@ MOUNT
177
177
  before(:each) do
178
178
  # blkid and lsblk output are coorelated with df/mount output, so the
179
179
  # most full test of them actually requires we have both
180
- @dfstdout = <<-DF
181
- Filesystem 1024-blocks Used Available Capacity Mounted on
182
- /dev/mapper/sys.vg-root.lv 4805760 378716 4182924 9% /
183
- tmpfs 2030944 0 2030944 0% /lib/init/rw
184
- udev 2025576 228 2025348 1% /dev
185
- tmpfs 2030944 2960 2027984 1% /dev/shm
186
- /dev/mapper/sys.vg-home.lv 97605056 53563252 44041804 55% /home
187
- /dev/mapper/sys.vg-special.lv 97605057 53563253 44041805 56% /special
188
- /dev/mapper/sys.vg-tmp.lv 1919048 46588 1774976 3% /tmp
189
- /dev/mapper/sys.vg-usr.lv 19223252 5479072 12767696 31% /usr
190
- /dev/mapper/sys.vg-var.lv 19223252 3436556 14810212 19% /var
191
- /dev/md0 960492 36388 875312 4% /boot
180
+ @dfstdout = <<~DF
181
+ Filesystem 1024-blocks Used Available Capacity Mounted on
182
+ /dev/mapper/sys.vg-root.lv 4805760 378716 4182924 9% /
183
+ tmpfs 2030944 0 2030944 0% /lib/init/rw
184
+ udev 2025576 228 2025348 1% /dev
185
+ tmpfs 2030944 2960 2027984 1% /dev/shm
186
+ /dev/mapper/sys.vg-home.lv 97605056 53563252 44041804 55% /home
187
+ /dev/mapper/sys.vg-special.lv 97605057 53563253 44041805 56% /special
188
+ /dev/mapper/sys.vg-tmp.lv 1919048 46588 1774976 3% /tmp
189
+ /dev/mapper/sys.vg-usr.lv 19223252 5479072 12767696 31% /usr
190
+ /dev/mapper/sys.vg-var.lv 19223252 3436556 14810212 19% /var
191
+ /dev/md0 960492 36388 875312 4% /boot
192
192
  DF
193
193
  allow(plugin).to receive(:shell_out).with("df -P").and_return(mock_shell_out(0, @dfstdout, ""))
194
194
 
195
- @inode_stdout = <<-DFi
196
- Filesystem Inodes IUsed IFree IUse% Mounted on
197
- /dev/xvda1 1310720 107407 1203313 9% /
198
- /dev/mapper/sys.vg-special.lv 124865 380 124485 1% /special
199
- tmpfs 126922 273 126649 1% /run
200
- none 126922 1 126921 1% /run/lock
201
- none 126922 1 126921 1% /run/shm
202
- DFi
195
+ @inode_stdout = <<~DFI
196
+ Filesystem Inodes IUsed IFree IUse% Mounted on
197
+ /dev/xvda1 1310720 107407 1203313 9% /
198
+ /dev/mapper/sys.vg-special.lv 124865 380 124485 1% /special
199
+ tmpfs 126922 273 126649 1% /run
200
+ none 126922 1 126921 1% /run/lock
201
+ none 126922 1 126921 1% /run/shm
202
+ DFI
203
203
  allow(plugin).to receive(:shell_out).with("df -iP").and_return(mock_shell_out(0, @inode_stdout, ""))
204
204
 
205
- @stdout = <<-BLKID_TYPE
206
- /dev/sdb1: LABEL=\"fuego:0\" UUID=\"bd1197e0-6997-1f3a-e27e-7801388308b5\" TYPE=\"linux_raid_member\"
207
- /dev/sdb2: LABEL=\"fuego:1\" UUID=\"e36d933e-e5b9-cfe5-6845-1f84d0f7fbfa\" TYPE=\"linux_raid_member\"
208
- /dev/sda1: LABEL=\"fuego:0\" UUID=\"bd1197e0-6997-1f3a-e27e-7801388308b5\" TYPE=\"linux_raid_member\"
209
- /dev/sda2: LABEL=\"fuego:1\" UUID=\"e36d933e-e5b9-cfe5-6845-1f84d0f7fbfa\" TYPE=\"linux_raid_member\"
210
- /dev/md0: LABEL=\"/boot\" UUID=\"37b8de8e-0fe3-4b5a-b9b4-dde33e19bb32\" TYPE=\"ext3\"
211
- /dev/md1: UUID=\"YsIe0R-fj1y-LXTd-imla-opKo-OuIe-TBoxSK\" TYPE=\"LVM2_member\"
212
- /dev/mapper/sys.vg-root.lv: LABEL=\"/\" UUID=\"7742d14b-80a3-4e97-9a32-478be9ea9aea\" TYPE=\"ext4\"
213
- /dev/mapper/sys.vg-swap.lv: UUID=\"9bc2e515-8ddc-41c3-9f63-4eaebde9ce96\" TYPE=\"swap\"
214
- /dev/mapper/sys.vg-tmp.lv: LABEL=\"/tmp\" UUID=\"74cf7eb9-428f-479e-9a4a-9943401e81e5\" TYPE=\"ext4\"
215
- /dev/mapper/sys.vg-usr.lv: LABEL=\"/usr\" UUID=\"26ec33c5-d00b-4f88-a550-492def013bbc\" TYPE=\"ext4\"
216
- /dev/mapper/sys.vg-var.lv: LABEL=\"/var\" UUID=\"6b559c35-7847-4ae2-b512-c99012d3f5b3\" TYPE=\"ext4\"
217
- /dev/mapper/sys.vg-home.lv: LABEL=\"/home\" UUID=\"d6efda02-1b73-453c-8c74-7d8dee78fa5e\" TYPE=\"xfs\"
205
+ @stdout = <<~BLKID_TYPE
206
+ /dev/sdb1: LABEL=\"fuego:0\" UUID=\"bd1197e0-6997-1f3a-e27e-7801388308b5\" TYPE=\"linux_raid_member\"
207
+ /dev/sdb2: LABEL=\"fuego:1\" UUID=\"e36d933e-e5b9-cfe5-6845-1f84d0f7fbfa\" TYPE=\"linux_raid_member\"
208
+ /dev/sda1: LABEL=\"fuego:0\" UUID=\"bd1197e0-6997-1f3a-e27e-7801388308b5\" TYPE=\"linux_raid_member\"
209
+ /dev/sda2: LABEL=\"fuego:1\" UUID=\"e36d933e-e5b9-cfe5-6845-1f84d0f7fbfa\" TYPE=\"linux_raid_member\"
210
+ /dev/md0: LABEL=\"/boot\" UUID=\"37b8de8e-0fe3-4b5a-b9b4-dde33e19bb32\" TYPE=\"ext3\"
211
+ /dev/md1: UUID=\"YsIe0R-fj1y-LXTd-imla-opKo-OuIe-TBoxSK\" TYPE=\"LVM2_member\"
212
+ /dev/mapper/sys.vg-root.lv: LABEL=\"/\" UUID=\"7742d14b-80a3-4e97-9a32-478be9ea9aea\" TYPE=\"ext4\"
213
+ /dev/mapper/sys.vg-swap.lv: UUID=\"9bc2e515-8ddc-41c3-9f63-4eaebde9ce96\" TYPE=\"swap\"
214
+ /dev/mapper/sys.vg-tmp.lv: LABEL=\"/tmp\" UUID=\"74cf7eb9-428f-479e-9a4a-9943401e81e5\" TYPE=\"ext4\"
215
+ /dev/mapper/sys.vg-usr.lv: LABEL=\"/usr\" UUID=\"26ec33c5-d00b-4f88-a550-492def013bbc\" TYPE=\"ext4\"
216
+ /dev/mapper/sys.vg-var.lv: LABEL=\"/var\" UUID=\"6b559c35-7847-4ae2-b512-c99012d3f5b3\" TYPE=\"ext4\"
217
+ /dev/mapper/sys.vg-home.lv: LABEL=\"/home\" UUID=\"d6efda02-1b73-453c-8c74-7d8dee78fa5e\" TYPE=\"xfs\"
218
218
  BLKID_TYPE
219
219
  allow(plugin).to receive(:shell_out).with("/sbin/blkid", timeout: 60).and_return(mock_shell_out(0, @stdout, ""))
220
220
  end
@@ -233,51 +233,51 @@ BLKID_TYPE
233
233
 
234
234
  describe "when gathering filesystem type data from lsblk" do
235
235
  before(:each) do
236
- @dfstdout = <<-DF
237
- Filesystem 1024-blocks Used Available Capacity Mounted on
238
- /dev/mapper/sys.vg-root.lv 4805760 378716 4182924 9% /
239
- tmpfs 2030944 0 2030944 0% /lib/init/rw
240
- udev 2025576 228 2025348 1% /dev
241
- tmpfs 2030944 2960 2027984 1% /dev/shm
242
- /dev/mapper/sys.vg-home.lv 97605056 53563252 44041804 55% /home
243
- /dev/mapper/sys.vg-special.lv 97605057 53563253 44041805 56% /special
244
- /dev/mapper/sys.vg-tmp.lv 1919048 46588 1774976 3% /tmp
245
- /dev/mapper/sys.vg-usr.lv 19223252 5479072 12767696 31% /usr
246
- /dev/mapper/sys.vg-var.lv 19223252 3436556 14810212 19% /var
247
- /dev/md0 960492 36388 875312 4% /boot
236
+ @dfstdout = <<~DF
237
+ Filesystem 1024-blocks Used Available Capacity Mounted on
238
+ /dev/mapper/sys.vg-root.lv 4805760 378716 4182924 9% /
239
+ tmpfs 2030944 0 2030944 0% /lib/init/rw
240
+ udev 2025576 228 2025348 1% /dev
241
+ tmpfs 2030944 2960 2027984 1% /dev/shm
242
+ /dev/mapper/sys.vg-home.lv 97605056 53563252 44041804 55% /home
243
+ /dev/mapper/sys.vg-special.lv 97605057 53563253 44041805 56% /special
244
+ /dev/mapper/sys.vg-tmp.lv 1919048 46588 1774976 3% /tmp
245
+ /dev/mapper/sys.vg-usr.lv 19223252 5479072 12767696 31% /usr
246
+ /dev/mapper/sys.vg-var.lv 19223252 3436556 14810212 19% /var
247
+ /dev/md0 960492 36388 875312 4% /boot
248
248
  DF
249
249
  allow(plugin).to receive(:shell_out).with("df -P").and_return(mock_shell_out(0, @dfstdout, ""))
250
250
 
251
- @inode_stdout = <<-DFi
252
- Filesystem Inodes IUsed IFree IUse% Mounted on
253
- /dev/xvda1 1310720 107407 1203313 9% /
254
- /dev/mapper/sys.vg-special.lv 124865 380 124485 1% /special
255
- tmpfs 126922 273 126649 1% /run
256
- none 126922 1 126921 1% /run/lock
257
- none 126922 1 126921 1% /run/shm
258
- DFi
251
+ @inode_stdout = <<~DFI
252
+ Filesystem Inodes IUsed IFree IUse% Mounted on
253
+ /dev/xvda1 1310720 107407 1203313 9% /
254
+ /dev/mapper/sys.vg-special.lv 124865 380 124485 1% /special
255
+ tmpfs 126922 273 126649 1% /run
256
+ none 126922 1 126921 1% /run/lock
257
+ none 126922 1 126921 1% /run/shm
258
+ DFI
259
259
  allow(plugin).to receive(:shell_out).with("df -iP").and_return(mock_shell_out(0, @inode_stdout, ""))
260
260
 
261
261
  allow(plugin).to receive(:which).with("lsblk").and_return("/sbin/lsblk")
262
262
  allow(plugin).to receive(:which).with("blkid").and_return(nil)
263
- @stdout = <<-BLKID_TYPE
264
- NAME=\"sdb1\" UUID=\"bd1197e0-6997-1f3a-e27e-7801388308b5\" LABEL=\"fuego:0\" FSTYPE=\"LVM2_member\"
265
- NAME=\"sdb2\" UUID=\"e36d933e-e5b9-cfe5-6845-1f84d0f7fbfa\" LABEL=\"fuego:1\" FSTYPE=\"LVM2_member\"
266
- NAME=\"sda1\" UUID=\"bd1197e0-6997-1f3a-e27e-7801388308b5\" LABEL=\"fuego:0\" FSTYPE=\"LVM2_member\"
267
- NAME=\"sda2\" UUID=\"e36d933e-e5b9-cfe5-6845-1f84d0f7fbfa\" LABEL=\"fuego:1\" FSTYPE=\"LVM2_member\"
268
- NAME=\"md0\" UUID=\"37b8de8e-0fe3-4b5a-b9b4-dde33e19bb32\" LABEL=\"/boot\" FSTYPE=\"ext3\"
269
- NAME=\"md1\" UUID=\"YsIe0R-fj1y-LXTd-imla-opKo-OuIe-TBoxSK\" LABEL=\"\" FSTYPE=\"LVM2_member\"
270
- NAME=\"sys.vg-root.lv\" UUID=\"7742d14b-80a3-4e97-9a32-478be9ea9aea\" LABEL=\"/\" FSTYPE=\"ext4\"
271
- NAME=\"sys.vg-swap.lv\" UUID=\"9bc2e515-8ddc-41c3-9f63-4eaebde9ce96\" LABEL=\"\" FSTYPE=\"swap\"
272
- NAME=\"sys.vg-tmp.lv\" UUID=\"74cf7eb9-428f-479e-9a4a-9943401e81e5\" LABEL=\"/tmp\" FSTYPE=\"ext4\"
273
- NAME=\"sys.vg-usr.lv\" UUID=\"26ec33c5-d00b-4f88-a550-492def013bbc\" LABEL=\"/usr\" FSTYPE=\"ext4\"
274
- NAME=\"sys.vg-var.lv\" UUID=\"6b559c35-7847-4ae2-b512-c99012d3f5b3\" LABEL=\"/var\" FSTYPE=\"ext4\"
275
- NAME=\"sys.vg-home.lv\" UUID=\"d6efda02-1b73-453c-8c74-7d8dee78fa5e\" LABEL=\"/home\" FSTYPE=\"xfs\"
276
- NAME=\"debian--7-root (dm-0)\" UUID=\"09187faa-3512-4505-81af-7e86d2ccb99a\" LABEL=\"root\" FSTYPE=\"ext4\"
263
+ @stdout = <<~BLKID_TYPE
264
+ NAME=\"sdb1\" UUID=\"bd1197e0-6997-1f3a-e27e-7801388308b5\" LABEL=\"fuego:0\" FSTYPE=\"LVM2_member\"
265
+ NAME=\"sdb2\" UUID=\"e36d933e-e5b9-cfe5-6845-1f84d0f7fbfa\" LABEL=\"fuego:1\" FSTYPE=\"LVM2_member\"
266
+ NAME=\"sda1\" UUID=\"bd1197e0-6997-1f3a-e27e-7801388308b5\" LABEL=\"fuego:0\" FSTYPE=\"LVM2_member\"
267
+ NAME=\"sda2\" UUID=\"e36d933e-e5b9-cfe5-6845-1f84d0f7fbfa\" LABEL=\"fuego:1\" FSTYPE=\"LVM2_member\"
268
+ NAME=\"md0\" UUID=\"37b8de8e-0fe3-4b5a-b9b4-dde33e19bb32\" LABEL=\"/boot\" FSTYPE=\"ext3\"
269
+ NAME=\"md1\" UUID=\"YsIe0R-fj1y-LXTd-imla-opKo-OuIe-TBoxSK\" LABEL=\"\" FSTYPE=\"LVM2_member\"
270
+ NAME=\"sys.vg-root.lv\" UUID=\"7742d14b-80a3-4e97-9a32-478be9ea9aea\" LABEL=\"/\" FSTYPE=\"ext4\"
271
+ NAME=\"sys.vg-swap.lv\" UUID=\"9bc2e515-8ddc-41c3-9f63-4eaebde9ce96\" LABEL=\"\" FSTYPE=\"swap\"
272
+ NAME=\"sys.vg-tmp.lv\" UUID=\"74cf7eb9-428f-479e-9a4a-9943401e81e5\" LABEL=\"/tmp\" FSTYPE=\"ext4\"
273
+ NAME=\"sys.vg-usr.lv\" UUID=\"26ec33c5-d00b-4f88-a550-492def013bbc\" LABEL=\"/usr\" FSTYPE=\"ext4\"
274
+ NAME=\"sys.vg-var.lv\" UUID=\"6b559c35-7847-4ae2-b512-c99012d3f5b3\" LABEL=\"/var\" FSTYPE=\"ext4\"
275
+ NAME=\"sys.vg-home.lv\" UUID=\"d6efda02-1b73-453c-8c74-7d8dee78fa5e\" LABEL=\"/home\" FSTYPE=\"xfs\"
276
+ NAME=\"debian--7-root (dm-0)\" UUID=\"09187faa-3512-4505-81af-7e86d2ccb99a\" LABEL=\"root\" FSTYPE=\"ext4\"
277
277
  BLKID_TYPE
278
- allow(plugin).to receive(:shell_out).
279
- with("/sbin/lsblk -n -P -o NAME,UUID,LABEL,FSTYPE", timeout: 60).
280
- and_return(mock_shell_out(0, @stdout, ""))
278
+ allow(plugin).to receive(:shell_out)
279
+ .with("/sbin/lsblk -n -P -o NAME,UUID,LABEL,FSTYPE", timeout: 60)
280
+ .and_return(mock_shell_out(0, @stdout, ""))
281
281
  end
282
282
 
283
283
  it "should run lsblk -n -P -o NAME,UUID,LABEL,FSTYPE" do
@@ -300,64 +300,64 @@ BLKID_TYPE
300
300
 
301
301
  describe "when gathering filesystem type data from both lsblk and blkid" do
302
302
  before(:each) do
303
- @dfstdout = <<-DF
304
- Filesystem 1024-blocks Used Available Capacity Mounted on
305
- /dev/mapper/sys.vg-root.lv 4805760 378716 4182924 9% /
306
- tmpfs 2030944 0 2030944 0% /lib/init/rw
307
- udev 2025576 228 2025348 1% /dev
308
- tmpfs 2030944 2960 2027984 1% /dev/shm
309
- /dev/mapper/sys.vg-home.lv 97605056 53563252 44041804 55% /home
310
- /dev/mapper/sys.vg-special.lv 97605057 53563253 44041805 56% /special
311
- /dev/mapper/sys.vg-tmp.lv 1919048 46588 1774976 3% /tmp
312
- /dev/mapper/sys.vg-usr.lv 19223252 5479072 12767696 31% /usr
313
- /dev/mapper/sys.vg-var.lv 19223252 3436556 14810212 19% /var
314
- /dev/md0 960492 36388 875312 4% /boot
303
+ @dfstdout = <<~DF
304
+ Filesystem 1024-blocks Used Available Capacity Mounted on
305
+ /dev/mapper/sys.vg-root.lv 4805760 378716 4182924 9% /
306
+ tmpfs 2030944 0 2030944 0% /lib/init/rw
307
+ udev 2025576 228 2025348 1% /dev
308
+ tmpfs 2030944 2960 2027984 1% /dev/shm
309
+ /dev/mapper/sys.vg-home.lv 97605056 53563252 44041804 55% /home
310
+ /dev/mapper/sys.vg-special.lv 97605057 53563253 44041805 56% /special
311
+ /dev/mapper/sys.vg-tmp.lv 1919048 46588 1774976 3% /tmp
312
+ /dev/mapper/sys.vg-usr.lv 19223252 5479072 12767696 31% /usr
313
+ /dev/mapper/sys.vg-var.lv 19223252 3436556 14810212 19% /var
314
+ /dev/md0 960492 36388 875312 4% /boot
315
315
  DF
316
316
  allow(plugin).to receive(:shell_out).with("df -P").and_return(mock_shell_out(0, @dfstdout, ""))
317
317
 
318
- @inode_stdout = <<-DFi
319
- Filesystem Inodes IUsed IFree IUse% Mounted on
320
- /dev/xvda1 1310720 107407 1203313 9% /
321
- /dev/mapper/sys.vg-special.lv 124865 380 124485 1% /special
322
- tmpfs 126922 273 126649 1% /run
323
- none 126922 1 126921 1% /run/lock
324
- none 126922 1 126921 1% /run/shm
325
- DFi
318
+ @inode_stdout = <<~DFI
319
+ Filesystem Inodes IUsed IFree IUse% Mounted on
320
+ /dev/xvda1 1310720 107407 1203313 9% /
321
+ /dev/mapper/sys.vg-special.lv 124865 380 124485 1% /special
322
+ tmpfs 126922 273 126649 1% /run
323
+ none 126922 1 126921 1% /run/lock
324
+ none 126922 1 126921 1% /run/shm
325
+ DFI
326
326
  allow(plugin).to receive(:shell_out).with("df -iP").and_return(mock_shell_out(0, @inode_stdout, ""))
327
327
 
328
328
  allow(plugin).to receive(:which).with("lsblk").and_return("/sbin/lsblk")
329
329
  allow(plugin).to receive(:which).with("blkid").and_return("/sbin/blkid")
330
- @stdout = <<-BLKID_TYPE
331
- NAME=\"sdb1\" UUID=\"bd1197e0-6997-1f3a-e27e-7801388308b5\" LABEL=\"fuego:0\" FSTYPE=\"LVM2_member\"
332
- NAME=\"sdb2\" UUID=\"e36d933e-e5b9-cfe5-6845-1f84d0f7fbfa\" LABEL=\"fuego:1\" FSTYPE=\"LVM2_member\"
333
- NAME=\"sda1\" UUID=\"bd1197e0-6997-1f3a-e27e-7801388308b5\" LABEL=\"fuego:0\" FSTYPE=\"LVM2_member\"
334
- NAME=\"sda2\" UUID=\"e36d933e-e5b9-cfe5-6845-1f84d0f7fbfa\" LABEL=\"fuego:1\" FSTYPE=\"LVM2_member\"
335
- NAME=\"md0\" UUID=\"37b8de8e-0fe3-4b5a-b9b4-dde33e19bb32\" LABEL=\"/boot\" FSTYPE=\"ext3\"
336
- NAME=\"md1\" UUID=\"YsIe0R-fj1y-LXTd-imla-opKo-OuIe-TBoxSK\" LABEL=\"\" FSTYPE=\"LVM2_member\"
337
- NAME=\"sys.vg-root.lv\" UUID=\"7742d14b-80a3-4e97-9a32-478be9ea9aea\" LABEL=\"/\"
338
- NAME=\"sys.vg-swap.lv\" UUID=\"9bc2e515-8ddc-41c3-9f63-4eaebde9ce96\" LABEL=\"\" FSTYPE=\"swap\"
339
- NAME=\"sys.vg-tmp.lv\" UUID=\"74cf7eb9-428f-479e-9a4a-9943401e81e5\" LABEL=\"/tmp\" FSTYPE=\"ext4\"
340
- NAME=\"sys.vg-usr.lv\" UUID=\"26ec33c5-d00b-4f88-a550-492def013bbc\" LABEL=\"/usr\"
341
- NAME=\"sys.vg-var.lv\" UUID=\"6b559c35-7847-4ae2-b512-c99012d3f5b3\" LABEL=\"/var\" FSTYPE=\"ext4\"
342
- NAME=\"sys.vg-home.lv\" UUID=\"d6efda02-1b73-453c-8c74-7d8dee78fa5e\" LABEL=\"/BADhome\" FSTYPE=\"xfs\"
343
- NAME=\"debian--7-root (dm-0)\" UUID=\"09187faa-3512-4505-81af-7e86d2ccb99a\" LABEL=\"root\" FSTYPE=\"ext4\"
330
+ @stdout = <<~BLKID_TYPE
331
+ NAME=\"sdb1\" UUID=\"bd1197e0-6997-1f3a-e27e-7801388308b5\" LABEL=\"fuego:0\" FSTYPE=\"LVM2_member\"
332
+ NAME=\"sdb2\" UUID=\"e36d933e-e5b9-cfe5-6845-1f84d0f7fbfa\" LABEL=\"fuego:1\" FSTYPE=\"LVM2_member\"
333
+ NAME=\"sda1\" UUID=\"bd1197e0-6997-1f3a-e27e-7801388308b5\" LABEL=\"fuego:0\" FSTYPE=\"LVM2_member\"
334
+ NAME=\"sda2\" UUID=\"e36d933e-e5b9-cfe5-6845-1f84d0f7fbfa\" LABEL=\"fuego:1\" FSTYPE=\"LVM2_member\"
335
+ NAME=\"md0\" UUID=\"37b8de8e-0fe3-4b5a-b9b4-dde33e19bb32\" LABEL=\"/boot\" FSTYPE=\"ext3\"
336
+ NAME=\"md1\" UUID=\"YsIe0R-fj1y-LXTd-imla-opKo-OuIe-TBoxSK\" LABEL=\"\" FSTYPE=\"LVM2_member\"
337
+ NAME=\"sys.vg-root.lv\" UUID=\"7742d14b-80a3-4e97-9a32-478be9ea9aea\" LABEL=\"/\"
338
+ NAME=\"sys.vg-swap.lv\" UUID=\"9bc2e515-8ddc-41c3-9f63-4eaebde9ce96\" LABEL=\"\" FSTYPE=\"swap\"
339
+ NAME=\"sys.vg-tmp.lv\" UUID=\"74cf7eb9-428f-479e-9a4a-9943401e81e5\" LABEL=\"/tmp\" FSTYPE=\"ext4\"
340
+ NAME=\"sys.vg-usr.lv\" UUID=\"26ec33c5-d00b-4f88-a550-492def013bbc\" LABEL=\"/usr\"
341
+ NAME=\"sys.vg-var.lv\" UUID=\"6b559c35-7847-4ae2-b512-c99012d3f5b3\" LABEL=\"/var\" FSTYPE=\"ext4\"
342
+ NAME=\"sys.vg-home.lv\" UUID=\"d6efda02-1b73-453c-8c74-7d8dee78fa5e\" LABEL=\"/BADhome\" FSTYPE=\"xfs\"
343
+ NAME=\"debian--7-root (dm-0)\" UUID=\"09187faa-3512-4505-81af-7e86d2ccb99a\" LABEL=\"root\" FSTYPE=\"ext4\"
344
344
  BLKID_TYPE
345
- allow(plugin).to receive(:shell_out).
346
- with("/sbin/lsblk -n -P -o NAME,UUID,LABEL,FSTYPE", timeout: 60).
347
- and_return(mock_shell_out(0, @stdout, ""))
348
- @stdout = <<-BLKID_TYPE
349
- /dev/sdb1: LABEL=\"fuego:0\" TYPE=\"linux_raid_member\"
350
- /dev/sdb2: LABEL=\"fuego:1\" TYPE=\"linux_raid_member\"
351
- /dev/sda1: LABEL=\"fuego:0\" UUID=\"bd1197e0-6997-1f3a-e27e-7801388308b5\" TYPE=\"linux_raid_member\"
352
- /dev/sda2: LABEL=\"fuego:1\" UUID=\"e36d933e-e5b9-cfe5-6845-1f84d0f7fbfa\" TYPE=\"linux_raid_member\"
353
- /dev/md0: LABEL=\"/boot\" UUID=\"37b8de8e-0fe3-4b5a-b9b4-dde33e19bb32\" TYPE=\"ext3\"
354
- /dev/md1: UUID=\"YsIe0R-fj1y-LXTd-imla-opKo-OuIe-TBoxSK\" TYPE=\"LVM2_member\"
355
- /dev/mapper/sys.vg-root.lv: LABEL=\"/\" UUID=\"7742d14b-80a3-4e97-9a32-478be9ea9aea\" TYPE=\"ext4\"
356
- /dev/mapper/sys.vg-swap.lv: UUID=\"9bc2e515-8ddc-41c3-9f63-4eaebde9ce96\" TYPE=\"swap\"
357
- /dev/mapper/sys.vg-tmp.lv: LABEL=\"/tmp\" UUID=\"74cf7eb9-428f-479e-9a4a-9943401e81e5\" TYPE=\"ext4\"
358
- /dev/mapper/sys.vg-usr.lv: LABEL=\"/usr\" UUID=\"26ec33c5-d00b-4f88-a550-492def013bbc\" TYPE=\"ext4\"
359
- /dev/mapper/sys.vg-var.lv: LABEL=\"/var\" UUID=\"6b559c35-7847-4ae2-b512-c99012d3f5b3\" TYPE=\"ext4\"
360
- /dev/mapper/sys.vg-home.lv: LABEL=\"/home\" UUID=\"d6efda02-1b73-453c-8c74-7d8dee78fa5e\" TYPE=\"xfs\"
345
+ allow(plugin).to receive(:shell_out)
346
+ .with("/sbin/lsblk -n -P -o NAME,UUID,LABEL,FSTYPE", timeout: 60)
347
+ .and_return(mock_shell_out(0, @stdout, ""))
348
+ @stdout = <<~BLKID_TYPE
349
+ /dev/sdb1: LABEL=\"fuego:0\" TYPE=\"linux_raid_member\"
350
+ /dev/sdb2: LABEL=\"fuego:1\" TYPE=\"linux_raid_member\"
351
+ /dev/sda1: LABEL=\"fuego:0\" UUID=\"bd1197e0-6997-1f3a-e27e-7801388308b5\" TYPE=\"linux_raid_member\"
352
+ /dev/sda2: LABEL=\"fuego:1\" UUID=\"e36d933e-e5b9-cfe5-6845-1f84d0f7fbfa\" TYPE=\"linux_raid_member\"
353
+ /dev/md0: LABEL=\"/boot\" UUID=\"37b8de8e-0fe3-4b5a-b9b4-dde33e19bb32\" TYPE=\"ext3\"
354
+ /dev/md1: UUID=\"YsIe0R-fj1y-LXTd-imla-opKo-OuIe-TBoxSK\" TYPE=\"LVM2_member\"
355
+ /dev/mapper/sys.vg-root.lv: LABEL=\"/\" UUID=\"7742d14b-80a3-4e97-9a32-478be9ea9aea\" TYPE=\"ext4\"
356
+ /dev/mapper/sys.vg-swap.lv: UUID=\"9bc2e515-8ddc-41c3-9f63-4eaebde9ce96\" TYPE=\"swap\"
357
+ /dev/mapper/sys.vg-tmp.lv: LABEL=\"/tmp\" UUID=\"74cf7eb9-428f-479e-9a4a-9943401e81e5\" TYPE=\"ext4\"
358
+ /dev/mapper/sys.vg-usr.lv: LABEL=\"/usr\" UUID=\"26ec33c5-d00b-4f88-a550-492def013bbc\" TYPE=\"ext4\"
359
+ /dev/mapper/sys.vg-var.lv: LABEL=\"/var\" UUID=\"6b559c35-7847-4ae2-b512-c99012d3f5b3\" TYPE=\"ext4\"
360
+ /dev/mapper/sys.vg-home.lv: LABEL=\"/home\" UUID=\"d6efda02-1b73-453c-8c74-7d8dee78fa5e\" TYPE=\"xfs\"
361
361
  BLKID_TYPE
362
362
  allow(plugin).to receive(:shell_out).with("/sbin/blkid", timeout: 60).and_return(mock_shell_out(0, @stdout, ""))
363
363
  end
@@ -388,23 +388,23 @@ BLKID_TYPE
388
388
  before(:each) do
389
389
  allow(File).to receive(:exist?).with("/proc/mounts").and_return(true)
390
390
  @double_file = double("/proc/mounts")
391
- @mounts = <<-MOUNTS
392
- rootfs / rootfs rw 0 0
393
- none /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
394
- none /proc proc rw,nosuid,nodev,noexec,relatime 0 0
395
- none /dev devtmpfs rw,relatime,size=2025576k,nr_inodes=506394,mode=755 0 0
396
- none /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
397
- /dev/mapper/sys.vg-root.lv / ext4 rw,noatime,errors=remount-ro,barrier=1,data=ordered 0 0
398
- tmpfs /lib/init/rw tmpfs rw,nosuid,relatime,mode=755 0 0
399
- tmpfs /dev/shm tmpfs rw,nosuid,nodev,relatime 0 0
400
- /dev/mapper/sys.vg-home.lv /home xfs rw,noatime,attr2,noquota 0 0
401
- /dev/mapper/sys.vg-special.lv /special xfs ro,noatime,attr2,noquota 0 0
402
- /dev/mapper/sys.vg-tmp.lv /tmp ext4 rw,noatime,barrier=1,data=ordered 0 0
403
- /dev/mapper/sys.vg-usr.lv /usr ext4 rw,noatime,barrier=1,data=ordered 0 0
404
- /dev/mapper/sys.vg-var.lv /var ext4 rw,noatime,barrier=1,data=ordered 0 0
405
- /dev/md0 /boot ext3 rw,noatime,errors=remount-ro,data=ordered 0 0
406
- fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
407
- binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0
391
+ @mounts = <<~MOUNTS
392
+ rootfs / rootfs rw 0 0
393
+ none /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
394
+ none /proc proc rw,nosuid,nodev,noexec,relatime 0 0
395
+ none /dev devtmpfs rw,relatime,size=2025576k,nr_inodes=506394,mode=755 0 0
396
+ none /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
397
+ /dev/mapper/sys.vg-root.lv / ext4 rw,noatime,errors=remount-ro,barrier=1,data=ordered 0 0
398
+ tmpfs /lib/init/rw tmpfs rw,nosuid,relatime,mode=755 0 0
399
+ tmpfs /dev/shm tmpfs rw,nosuid,nodev,relatime 0 0
400
+ /dev/mapper/sys.vg-home.lv /home xfs rw,noatime,attr2,noquota 0 0
401
+ /dev/mapper/sys.vg-special.lv /special xfs ro,noatime,attr2,noquota 0 0
402
+ /dev/mapper/sys.vg-tmp.lv /tmp ext4 rw,noatime,barrier=1,data=ordered 0 0
403
+ /dev/mapper/sys.vg-usr.lv /usr ext4 rw,noatime,barrier=1,data=ordered 0 0
404
+ /dev/mapper/sys.vg-var.lv /var ext4 rw,noatime,barrier=1,data=ordered 0 0
405
+ /dev/md0 /boot ext3 rw,noatime,errors=remount-ro,data=ordered 0 0
406
+ fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
407
+ binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0
408
408
  MOUNTS
409
409
  @counter = 0
410
410
  allow(@double_file).to receive(:read_nonblock) do
@@ -439,39 +439,39 @@ MOUNTS
439
439
  # 2. A bind-mounted directory, which shows up as the same device in a
440
440
  # subdir: / and /var/chroot
441
441
  # 3. tmpfs in multiple places.
442
- @dfstdout = <<-DF
443
- Filesystem 1024-blocks Used Available Capacity Mounted on
444
- /dev/mapper/sys.vg-root.lv 4805760 378716 4182924 9% /
445
- tmpfs 2030944 0 2030944 0% /lib/init/rw
446
- udev 2025576 228 2025348 1% /dev
447
- tmpfs 2030944 2960 2027984 1% /dev/shm
448
- /dev/mapper/sys.vg-home.lv 97605056 53563252 44041804 55% /home
449
- /dev/mapper/sys.vg-home.lv 97605056 53563252 44041804 55% /home2
450
- /dev/mapper/sys.vg-root.lv 4805760 378716 4182924 9% /var/chroot
442
+ @dfstdout = <<~DF
443
+ Filesystem 1024-blocks Used Available Capacity Mounted on
444
+ /dev/mapper/sys.vg-root.lv 4805760 378716 4182924 9% /
445
+ tmpfs 2030944 0 2030944 0% /lib/init/rw
446
+ udev 2025576 228 2025348 1% /dev
447
+ tmpfs 2030944 2960 2027984 1% /dev/shm
448
+ /dev/mapper/sys.vg-home.lv 97605056 53563252 44041804 55% /home
449
+ /dev/mapper/sys.vg-home.lv 97605056 53563252 44041804 55% /home2
450
+ /dev/mapper/sys.vg-root.lv 4805760 378716 4182924 9% /var/chroot
451
451
  DF
452
452
  allow(plugin).to receive(:shell_out).with("df -P").and_return(mock_shell_out(0, @dfstdout, ""))
453
453
 
454
- @inode_stdout = <<-DFi
455
- Filesystem Inodes IUsed IFree IUse% Mounted on
456
- /dev/mapper/sys.vg-root.lv 1310720 107407 1203313 9% /
457
- tmpfs 126922 273 126649 1% /lib/init/rw
458
- none 126922 1 126921 1% /dev/shm
459
- udev 126922 1 126921 1% /dev
460
- /dev/mapper/sys.vg-home.lv 60891136 4696030 56195106 8% /home
461
- /dev/mapper/sys.vg-home.lv 60891136 4696030 56195106 8% /home2
462
- /dev/mapper/sys.vg-root.lv 1310720 107407 1203313 9% /var/chroot
463
- DFi
454
+ @inode_stdout = <<~DFI
455
+ Filesystem Inodes IUsed IFree IUse% Mounted on
456
+ /dev/mapper/sys.vg-root.lv 1310720 107407 1203313 9% /
457
+ tmpfs 126922 273 126649 1% /lib/init/rw
458
+ none 126922 1 126921 1% /dev/shm
459
+ udev 126922 1 126921 1% /dev
460
+ /dev/mapper/sys.vg-home.lv 60891136 4696030 56195106 8% /home
461
+ /dev/mapper/sys.vg-home.lv 60891136 4696030 56195106 8% /home2
462
+ /dev/mapper/sys.vg-root.lv 1310720 107407 1203313 9% /var/chroot
463
+ DFI
464
464
  allow(plugin).to receive(:shell_out).with("df -iP").and_return(mock_shell_out(0, @inode_stdout, ""))
465
465
 
466
466
  allow(plugin).to receive(:which).with("lsblk").and_return("/sbin/lsblk")
467
467
  allow(plugin).to receive(:which).with("blkid").and_return(nil)
468
- @stdout = <<-BLKID_TYPE
469
- NAME=\"/dev/mapper/sys.vg-root.lv\" UUID=\"7742d14b-80a3-4e97-9a32-478be9ea9aea\" LABEL=\"/\" FSTYPE=\"ext4\"
470
- NAME=\"/dev/mapper/sys.vg-home.lv\" UUID=\"d6efda02-1b73-453c-8c74-7d8dee78fa5e\" LABEL=\"/home\" FSTYPE=\"xfs\"
468
+ @stdout = <<~BLKID_TYPE
469
+ NAME=\"/dev/mapper/sys.vg-root.lv\" UUID=\"7742d14b-80a3-4e97-9a32-478be9ea9aea\" LABEL=\"/\" FSTYPE=\"ext4\"
470
+ NAME=\"/dev/mapper/sys.vg-home.lv\" UUID=\"d6efda02-1b73-453c-8c74-7d8dee78fa5e\" LABEL=\"/home\" FSTYPE=\"xfs\"
471
471
  BLKID_TYPE
472
- allow(plugin).to receive(:shell_out).
473
- with("/sbin/lsblk -n -P -o NAME,UUID,LABEL,FSTYPE", timeout: 60).
474
- and_return(mock_shell_out(0, @stdout, ""))
472
+ allow(plugin).to receive(:shell_out)
473
+ .with("/sbin/lsblk -n -P -o NAME,UUID,LABEL,FSTYPE", timeout: 60)
474
+ .and_return(mock_shell_out(0, @stdout, ""))
475
475
  end
476
476
 
477
477
  it "should provide a devices view with all mountpoints" do
@@ -484,41 +484,41 @@ BLKID_TYPE
484
484
 
485
485
  describe "when gathering filesystem data with double-mounts" do
486
486
  before(:each) do
487
- @dfstdout = <<-DF
488
- Filesystem 1024-blocks Used Available Capacity Mounted on
489
- /dev/mapper/sys.vg-root.lv 4805760 378716 4182924 9% /
490
- tmpfs 2030944 0 2030944 0% /lib/init/rw
491
- udev 2025576 228 2025348 1% /dev
492
- tmpfs 2030944 2960 2027984 1% /dev/shm
493
- /dev/mapper/sys.vg-home.lv 97605056 53563252 44041804 55% /home
494
- /dev/sdb1 97605056 53563252 44041804 55% /mnt
495
- /dev/sdc1 4805760 378716 4182924 9% /mnt
487
+ @dfstdout = <<~DF
488
+ Filesystem 1024-blocks Used Available Capacity Mounted on
489
+ /dev/mapper/sys.vg-root.lv 4805760 378716 4182924 9% /
490
+ tmpfs 2030944 0 2030944 0% /lib/init/rw
491
+ udev 2025576 228 2025348 1% /dev
492
+ tmpfs 2030944 2960 2027984 1% /dev/shm
493
+ /dev/mapper/sys.vg-home.lv 97605056 53563252 44041804 55% /home
494
+ /dev/sdb1 97605056 53563252 44041804 55% /mnt
495
+ /dev/sdc1 4805760 378716 4182924 9% /mnt
496
496
  DF
497
497
  allow(plugin).to receive(:shell_out).with("df -P").and_return(mock_shell_out(0, @dfstdout, ""))
498
498
 
499
- @inode_stdout = <<-DFi
500
- Filesystem Inodes IUsed IFree IUse% Mounted on
501
- /dev/mapper/sys.vg-root.lv 1310720 107407 1203313 9% /
502
- tmpfs 126922 273 126649 1% /lib/init/rw
503
- none 126922 1 126921 1% /dev/shm
504
- udev 126922 1 126921 1% /dev
505
- /dev/mapper/sys.vg-home.lv 60891136 4696030 56195106 8% /home
506
- /dev/sdb1 60891136 4696030 56195106 8% /mnt
507
- /dev/sdc1 1310720 107407 1203313 9% /mnt
508
- DFi
499
+ @inode_stdout = <<~DFI
500
+ Filesystem Inodes IUsed IFree IUse% Mounted on
501
+ /dev/mapper/sys.vg-root.lv 1310720 107407 1203313 9% /
502
+ tmpfs 126922 273 126649 1% /lib/init/rw
503
+ none 126922 1 126921 1% /dev/shm
504
+ udev 126922 1 126921 1% /dev
505
+ /dev/mapper/sys.vg-home.lv 60891136 4696030 56195106 8% /home
506
+ /dev/sdb1 60891136 4696030 56195106 8% /mnt
507
+ /dev/sdc1 1310720 107407 1203313 9% /mnt
508
+ DFI
509
509
  allow(plugin).to receive(:shell_out).with("df -iP").and_return(mock_shell_out(0, @inode_stdout, ""))
510
510
 
511
511
  allow(plugin).to receive(:which).with("lsblk").and_return("/sbin/lsblk")
512
512
  allow(plugin).to receive(:which).with("blkid").and_return(nil)
513
- @stdout = <<-BLKID_TYPE
514
- NAME=\"/dev/mapper/sys.vg-root.lv\" UUID=\"7742d14b-80a3-4e97-9a32-478be9ea9aea\" LABEL=\"/\" FSTYPE=\"ext4\"
515
- NAME=\"/dev/sdb1\" UUID=\"6b559c35-7847-4ae2-b512-c99012d3f5b3\" LABEL=\"/mnt\" FSTYPE=\"ext4\"
516
- NAME=\"/dev/sdc1\" UUID=\"7f1e51bf-3608-4351-b7cd-379e39cff36a\" LABEL=\"/mnt\" FSTYPE=\"ext4\"
517
- NAME=\"/dev/mapper/sys.vg-home.lv\" UUID=\"d6efda02-1b73-453c-8c74-7d8dee78fa5e\" LABEL=\"/home\" FSTYPE=\"xfs\"
513
+ @stdout = <<~BLKID_TYPE
514
+ NAME=\"/dev/mapper/sys.vg-root.lv\" UUID=\"7742d14b-80a3-4e97-9a32-478be9ea9aea\" LABEL=\"/\" FSTYPE=\"ext4\"
515
+ NAME=\"/dev/sdb1\" UUID=\"6b559c35-7847-4ae2-b512-c99012d3f5b3\" LABEL=\"/mnt\" FSTYPE=\"ext4\"
516
+ NAME=\"/dev/sdc1\" UUID=\"7f1e51bf-3608-4351-b7cd-379e39cff36a\" LABEL=\"/mnt\" FSTYPE=\"ext4\"
517
+ NAME=\"/dev/mapper/sys.vg-home.lv\" UUID=\"d6efda02-1b73-453c-8c74-7d8dee78fa5e\" LABEL=\"/home\" FSTYPE=\"xfs\"
518
518
  BLKID_TYPE
519
- allow(plugin).to receive(:shell_out).
520
- with("/sbin/lsblk -n -P -o NAME,UUID,LABEL,FSTYPE", timeout: 60).
521
- and_return(mock_shell_out(0, @stdout, ""))
519
+ allow(plugin).to receive(:shell_out)
520
+ .with("/sbin/lsblk -n -P -o NAME,UUID,LABEL,FSTYPE", timeout: 60)
521
+ .and_return(mock_shell_out(0, @stdout, ""))
522
522
  end
523
523
 
524
524
  it "should provide a mounts view with all devices" do