ohai 15.3.1 → 15.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (171) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +0 -6
  3. data/lib/ohai/mixin/{network_constants.rb → network_helper.rb} +8 -1
  4. data/lib/ohai/plugins/aix/network.rb +3 -8
  5. data/lib/ohai/plugins/darwin/network.rb +6 -4
  6. data/lib/ohai/plugins/filesystem.rb +166 -0
  7. data/lib/ohai/plugins/network.rb +5 -5
  8. data/lib/ohai/plugins/openstack.rb +2 -1
  9. data/lib/ohai/plugins/solaris2/network.rb +6 -4
  10. data/lib/ohai/version.rb +1 -1
  11. data/ohai.gemspec +1 -1
  12. metadata +3 -162
  13. data/Rakefile +0 -42
  14. data/lib/ohai/plugins/windows/filesystem.rb +0 -147
  15. data/spec/data/plugins/dpkg-query.output +0 -4
  16. data/spec/data/plugins/lslpp.output +0 -50
  17. data/spec/data/plugins/pacman.output +0 -51
  18. data/spec/data/plugins/pkg-query.output +0 -58
  19. data/spec/data/plugins/pkginfo.output +0 -50
  20. data/spec/data/plugins/pkglist.output +0 -24
  21. data/spec/data/plugins/rpmquery.output +0 -7
  22. data/spec/functional/application_spec.rb +0 -107
  23. data/spec/functional/loader_spec.rb +0 -53
  24. data/spec/functional/plugins/powershell_spec.rb +0 -88
  25. data/spec/functional/plugins/root_group_spec.rb +0 -41
  26. data/spec/functional/plugins/windows/uptime_spec.rb +0 -51
  27. data/spec/ohai_spec.rb +0 -27
  28. data/spec/rcov.opts +0 -2
  29. data/spec/spec.opts +0 -2
  30. data/spec/spec_helper.rb +0 -124
  31. data/spec/support/integration_helper.rb +0 -61
  32. data/spec/support/platform_helpers.rb +0 -38
  33. data/spec/unit/application_spec.rb +0 -96
  34. data/spec/unit/config_spec.rb +0 -57
  35. data/spec/unit/dsl/plugin_spec.rb +0 -634
  36. data/spec/unit/hints_spec.rb +0 -65
  37. data/spec/unit/loader_spec.rb +0 -195
  38. data/spec/unit/mixin/azure_metadata_spec.rb +0 -72
  39. data/spec/unit/mixin/command_spec.rb +0 -151
  40. data/spec/unit/mixin/dmi_decode.rb +0 -75
  41. data/spec/unit/mixin/ec2_metadata_spec.rb +0 -88
  42. data/spec/unit/mixin/softlayer_metadata_spec.rb +0 -72
  43. data/spec/unit/plugin_config_spec.rb +0 -117
  44. data/spec/unit/plugins/abort_spec.rb +0 -69
  45. data/spec/unit/plugins/aix/cpu_spec.rb +0 -127
  46. data/spec/unit/plugins/aix/filesystem_spec.rb +0 -238
  47. data/spec/unit/plugins/aix/hostname_spec.rb +0 -33
  48. data/spec/unit/plugins/aix/kernel_spec.rb +0 -61
  49. data/spec/unit/plugins/aix/memory_spec.rb +0 -49
  50. data/spec/unit/plugins/aix/network_spec.rb +0 -313
  51. data/spec/unit/plugins/aix/platform_spec.rb +0 -44
  52. data/spec/unit/plugins/aix/uptime_spec.rb +0 -42
  53. data/spec/unit/plugins/aix/virtualization_spec.rb +0 -319
  54. data/spec/unit/plugins/azure_spec.rb +0 -243
  55. data/spec/unit/plugins/bsd/filesystem_spec.rb +0 -138
  56. data/spec/unit/plugins/bsd/virtualization_spec.rb +0 -145
  57. data/spec/unit/plugins/c_spec.rb +0 -341
  58. data/spec/unit/plugins/chef_spec.rb +0 -44
  59. data/spec/unit/plugins/cloud_spec.rb +0 -484
  60. data/spec/unit/plugins/darwin/cpu_spec.rb +0 -124
  61. data/spec/unit/plugins/darwin/filesystem_spec.rb +0 -140
  62. data/spec/unit/plugins/darwin/hardware_spec.rb +0 -105
  63. data/spec/unit/plugins/darwin/hardware_system_profiler_output.rb +0 -1110
  64. data/spec/unit/plugins/darwin/hostname_spec.rb +0 -43
  65. data/spec/unit/plugins/darwin/kernel_spec.rb +0 -65
  66. data/spec/unit/plugins/darwin/memory_spec.rb +0 -64
  67. data/spec/unit/plugins/darwin/network_spec.rb +0 -849
  68. data/spec/unit/plugins/darwin/platform_spec.rb +0 -71
  69. data/spec/unit/plugins/darwin/virtualization_spec.rb +0 -156
  70. data/spec/unit/plugins/digital_ocean_spec.rb +0 -106
  71. data/spec/unit/plugins/dmi_spec.rb +0 -156
  72. data/spec/unit/plugins/docker_spec.rb +0 -100
  73. data/spec/unit/plugins/ec2_spec.rb +0 -452
  74. data/spec/unit/plugins/elixir_spec.rb +0 -55
  75. data/spec/unit/plugins/erlang_spec.rb +0 -71
  76. data/spec/unit/plugins/eucalyptus_spec.rb +0 -109
  77. data/spec/unit/plugins/fail_spec.rb +0 -260
  78. data/spec/unit/plugins/freebsd/cpu_spec.rb +0 -129
  79. data/spec/unit/plugins/freebsd/hostname_spec.rb +0 -35
  80. data/spec/unit/plugins/freebsd/kernel_spec.rb +0 -36
  81. data/spec/unit/plugins/freebsd/platform_spec.rb +0 -38
  82. data/spec/unit/plugins/gce_spec.rb +0 -81
  83. data/spec/unit/plugins/go_spec.rb +0 -48
  84. data/spec/unit/plugins/groovy_spec.rb +0 -66
  85. data/spec/unit/plugins/haskell_spec.rb +0 -231
  86. data/spec/unit/plugins/hostname_spec.rb +0 -162
  87. data/spec/unit/plugins/init_package_spec.rb +0 -60
  88. data/spec/unit/plugins/java_spec.rb +0 -230
  89. data/spec/unit/plugins/joyent_spec.rb +0 -100
  90. data/spec/unit/plugins/kernel_spec.rb +0 -38
  91. data/spec/unit/plugins/linode_spec.rb +0 -135
  92. data/spec/unit/plugins/linux/block_device_spec.rb +0 -75
  93. data/spec/unit/plugins/linux/cpu_spec.rb +0 -441
  94. data/spec/unit/plugins/linux/filesystem_spec.rb +0 -550
  95. data/spec/unit/plugins/linux/fips_spec.rb +0 -60
  96. data/spec/unit/plugins/linux/hostname_spec.rb +0 -52
  97. data/spec/unit/plugins/linux/hostnamectl_spec.rb +0 -59
  98. data/spec/unit/plugins/linux/kernel_spec.rb +0 -71
  99. data/spec/unit/plugins/linux/lsb_spec.rb +0 -147
  100. data/spec/unit/plugins/linux/lspci_spec.rb +0 -133
  101. data/spec/unit/plugins/linux/machineid_spec.rb +0 -46
  102. data/spec/unit/plugins/linux/mdadm_spec.rb +0 -170
  103. data/spec/unit/plugins/linux/memory_spec.rb +0 -256
  104. data/spec/unit/plugins/linux/network_spec.rb +0 -1392
  105. data/spec/unit/plugins/linux/platform_spec.rb +0 -812
  106. data/spec/unit/plugins/linux/sessions_spec.rb +0 -98
  107. data/spec/unit/plugins/linux/sysctl_spec.rb +0 -53
  108. data/spec/unit/plugins/linux/systemd_paths_spec.rb +0 -122
  109. data/spec/unit/plugins/linux/uptime_spec.rb +0 -48
  110. data/spec/unit/plugins/linux/virtualization_spec.rb +0 -650
  111. data/spec/unit/plugins/lua_spec.rb +0 -60
  112. data/spec/unit/plugins/mono_spec.rb +0 -67
  113. data/spec/unit/plugins/netbsd/hostname_spec.rb +0 -43
  114. data/spec/unit/plugins/netbsd/kernel_spec.rb +0 -35
  115. data/spec/unit/plugins/netbsd/platform_spec.rb +0 -38
  116. data/spec/unit/plugins/network_spec.rb +0 -1078
  117. data/spec/unit/plugins/nodejs_spec.rb +0 -55
  118. data/spec/unit/plugins/ohai_spec.rb +0 -32
  119. data/spec/unit/plugins/ohai_time_spec.rb +0 -44
  120. data/spec/unit/plugins/openbsd/hostname_spec.rb +0 -43
  121. data/spec/unit/plugins/openbsd/kernel_spec.rb +0 -36
  122. data/spec/unit/plugins/openbsd/platform_spec.rb +0 -33
  123. data/spec/unit/plugins/openstack_spec.rb +0 -311
  124. data/spec/unit/plugins/os_spec.rb +0 -115
  125. data/spec/unit/plugins/packages_spec.rb +0 -353
  126. data/spec/unit/plugins/passwd_spec.rb +0 -65
  127. data/spec/unit/plugins/perl_spec.rb +0 -62
  128. data/spec/unit/plugins/php_spec.rb +0 -97
  129. data/spec/unit/plugins/platform_spec.rb +0 -65
  130. data/spec/unit/plugins/powershell_spec.rb +0 -71
  131. data/spec/unit/plugins/python_spec.rb +0 -51
  132. data/spec/unit/plugins/rackspace_spec.rb +0 -350
  133. data/spec/unit/plugins/root_group_spec.rb +0 -90
  134. data/spec/unit/plugins/ruby_spec.rb +0 -60
  135. data/spec/unit/plugins/rust_spec.rb +0 -43
  136. data/spec/unit/plugins/scala_spec.rb +0 -58
  137. data/spec/unit/plugins/scaleway_spec.rb +0 -93
  138. data/spec/unit/plugins/scsi_spec.rb +0 -69
  139. data/spec/unit/plugins/shard_spec.rb +0 -121
  140. data/spec/unit/plugins/shells_spec.rb +0 -56
  141. data/spec/unit/plugins/softlayer_spec.rb +0 -60
  142. data/spec/unit/plugins/solaris2/cpu_spec.rb +0 -2926
  143. data/spec/unit/plugins/solaris2/dmi_spec.rb +0 -153
  144. data/spec/unit/plugins/solaris2/filesystem.rb +0 -407
  145. data/spec/unit/plugins/solaris2/hostname_spec.rb +0 -37
  146. data/spec/unit/plugins/solaris2/kernel_spec.rb +0 -183
  147. data/spec/unit/plugins/solaris2/memory_spec.rb +0 -43
  148. data/spec/unit/plugins/solaris2/network_spec.rb +0 -201
  149. data/spec/unit/plugins/solaris2/platform_spec.rb +0 -108
  150. data/spec/unit/plugins/solaris2/virtualization_spec.rb +0 -97
  151. data/spec/unit/plugins/ssh_host_keys_spec.rb +0 -116
  152. data/spec/unit/plugins/sysconf_spec.rb +0 -680
  153. data/spec/unit/plugins/timezone_spec.rb +0 -30
  154. data/spec/unit/plugins/vbox_host_spec.rb +0 -14
  155. data/spec/unit/plugins/virtualbox_spec.rb +0 -375
  156. data/spec/unit/plugins/vmware_spec.rb +0 -81
  157. data/spec/unit/plugins/windows/cpu_spec.rb +0 -118
  158. data/spec/unit/plugins/windows/filesystem_spec.rb +0 -226
  159. data/spec/unit/plugins/windows/fips_spec.rb +0 -60
  160. data/spec/unit/plugins/windows/kernel_spec.rb +0 -79
  161. data/spec/unit/plugins/windows/memory_spec.rb +0 -52
  162. data/spec/unit/plugins/windows/network_spec.rb +0 -137
  163. data/spec/unit/plugins/windows/system_enclosure_spec.rb +0 -45
  164. data/spec/unit/plugins/windows/uptime_spec.rb +0 -38
  165. data/spec/unit/plugins/windows/virtualization_spec.rb +0 -63
  166. data/spec/unit/plugins/zpools_spec.rb +0 -244
  167. data/spec/unit/provides_map_spec.rb +0 -208
  168. data/spec/unit/runner_spec.rb +0 -422
  169. data/spec/unit/system_spec.rb +0 -416
  170. data/spec/unit/util/file_helper_spec.rb +0 -47
  171. data/spec/unit/util/ip_helper_spec.rb +0 -128
@@ -1,124 +0,0 @@
1
- #
2
- # Author:: Nathan L Smith (<nlloyds@gmail.com>)
3
- # Copyright:: Copyright (c) 2013-2018 Chef Software, Inc.
4
- # License:: Apache License, Version 2.0
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
-
19
- require "spec_helper"
20
-
21
- describe Ohai::System, "Darwin cpu plugin" do
22
- before do
23
- @plugin = get_plugin("cpu")
24
- @stdout = <<~CTL
25
- hw.ncpu: 8
26
- hw.byteorder: 1234
27
- hw.memsize: 17179869184
28
- hw.activecpu: 8
29
- hw.packages: 1
30
- hw.tbfrequency: 1000000000
31
- hw.l3cachesize: 6291456
32
- hw.l2cachesize: 262144
33
- hw.l1dcachesize: 32768
34
- hw.l1icachesize: 32768
35
- hw.cachelinesize: 64
36
- hw.cpufrequency: 2800000000
37
- hw.busfrequency: 100000000
38
- hw.pagesize32: 4096
39
- hw.pagesize: 4096
40
- hw.cpufamily: 280134364
41
- hw.cpu64bit_capable: 1
42
- hw.cpusubtype: 8
43
- hw.cputype: 7
44
- hw.logicalcpu_max: 8
45
- hw.logicalcpu: 8
46
- hw.physicalcpu_max: 4
47
- hw.physicalcpu: 4
48
- hw.targettype: Mac
49
- hw.cputhreadtype: 1
50
- machdep.cpu.thread_count: 8
51
- machdep.cpu.core_count: 4
52
- machdep.cpu.address_bits.virtual: 48
53
- machdep.cpu.address_bits.physical: 39
54
- machdep.cpu.cache.size: 256
55
- machdep.cpu.cache.L2_associativity: 8
56
- machdep.cpu.cache.linesize: 64
57
- machdep.cpu.processor_flag: 5
58
- machdep.cpu.microcode_version: 15
59
- machdep.cpu.cores_per_package: 8
60
- machdep.cpu.logical_per_package: 16
61
- machdep.cpu.extfeatures: SYSCALL XD 1GBPAGE EM64T LAHF LZCNT RDTSCP TSCI
62
- machdep.cpu.leaf7_features: SMEP ERMS RDWRFSGS TSC_THREAD_OFFSET BMI1 HLE AVX2 BMI2 INVPCID RTM FPU_CSDS
63
- machdep.cpu.features: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFSH DS ACPI MMX FXSR SSE SSE2 SS HTT TM PBE SSE3 PCLMULQDQ DTES64 MON DSCPL VMX SMX EST TM2 SSSE3 FMA CX16 TPR PDCM SSE4.1 SSE4.2 x2APIC MOVBE POPCNT AES PCID XSAVE OSXSAVE SEGLIM64 TSCTMR AVX1.0 RDRAND F16C
64
- machdep.cpu.brand: 0
65
- machdep.cpu.signature: 263777
66
- machdep.cpu.extfeature_bits: 142473169152
67
- machdep.cpu.leaf7_feature_bits: 12219
68
- machdep.cpu.feature_bits: 9221960262849657855
69
- machdep.cpu.stepping: 1
70
- machdep.cpu.extfamily: 0
71
- machdep.cpu.extmodel: 4
72
- machdep.cpu.model: 70
73
- machdep.cpu.family: 6
74
- machdep.cpu.brand_string: Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
75
- machdep.cpu.vendor: GenuineIntel
76
- machdep.cpu.max_ext: 2147483656
77
- machdep.cpu.max_basic: 13
78
- CTL
79
-
80
- allow(@plugin).to receive(:collect_os).and_return(:darwin)
81
- allow(@plugin).to receive(:shell_out).with("sysctl hw machdep").and_return(mock_shell_out(0, @stdout, ""))
82
- @plugin.run
83
- end
84
-
85
- it "sets cpu[:cores] to 4" do
86
- expect(@plugin[:cpu][:cores]).to eq(4)
87
- end
88
-
89
- it "sets cpu[:total] to 8" do
90
- expect(@plugin[:cpu][:total]).to eq(8)
91
- end
92
-
93
- it "sets cpu[:real] to 1" do
94
- expect(@plugin[:cpu][:real]).to eq(1)
95
- end
96
-
97
- it "sets cpu[:mhz] to 2800" do
98
- expect(@plugin[:cpu][:mhz]).to eq(2800)
99
- end
100
-
101
- it "sets cpu[:vendor_id] to GenuineIntel" do
102
- expect(@plugin[:cpu][:vendor_id]).to eq("GenuineIntel")
103
- end
104
-
105
- it "sets cpu[:model_name] to Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz" do
106
- expect(@plugin[:cpu][:model_name]).to eq("Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz")
107
- end
108
-
109
- it "sets cpu[:model] to 70" do
110
- expect(@plugin[:cpu][:model]).to eq(70)
111
- end
112
-
113
- it "sets cpu[:family] to 6" do
114
- expect(@plugin[:cpu][:family]).to eq(6)
115
- end
116
-
117
- it "sets cpu[:stepping] to 1" do
118
- expect(@plugin[:cpu][:stepping]).to eq(1)
119
- end
120
-
121
- it "sets cpu[:flags] to array of flags" do
122
- expect(@plugin[:cpu][:flags]).to eq(["fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce", "cx8", "apic", "sep", "mtrr", "pge", "mca", "cmov", "pat", "pse36", "clfsh", "ds", "acpi", "mmx", "fxsr", "sse", "sse2", "ss", "htt", "tm", "pbe", "sse3", "pclmulqdq", "dtes64", "mon", "dscpl", "vmx", "smx", "est", "tm2", "ssse3", "fma", "cx16", "tpr", "pdcm", "sse4.1", "sse4.2", "x2apic", "movbe", "popcnt", "aes", "pcid", "xsave", "osxsave", "seglim64", "tsctmr", "avx1.0", "rdrand", "f16c"])
123
- end
124
- end
@@ -1,140 +0,0 @@
1
- #
2
- # Author:: Phil Dibowitz (<phil@ipom.com>)
3
- # Copyright:: Copyright (c) 2015 Facebook, Inc.
4
- # License:: Apache License, Version 2.0
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
-
19
- require "spec_helper"
20
-
21
- describe Ohai::System, "darwin filesystem plugin" do
22
- let(:plugin) { get_plugin("filesystem") }
23
-
24
- before do
25
- allow(plugin).to receive(:collect_os).and_return(:darwin)
26
-
27
- allow(plugin).to receive(:shell_out).with("df -i").and_return(mock_shell_out(0, "", ""))
28
- allow(plugin).to receive(:shell_out).with("mount").and_return(mock_shell_out(0, "", ""))
29
- end
30
-
31
- describe "when gathering filesystem usage data from df" do
32
- before do
33
- @stdout = <<~DF
34
- Filesystem 512-blocks Used Available Capacity iused ifree %iused Mounted on
35
- /dev/disk0s2 488555536 313696448 174347088 65% 39276054 21793386 64% /
36
- devfs 385 385 0 100% 666 0 100% /dev
37
- map /etc/auto.direct 0 0 0 100% 0 0 100% /mnt/vol
38
- map -hosts 0 0 0 100% 0 0 100% /net
39
- map -static 0 0 0 100% 0 0 100% /mobile_symbol
40
- deweyfs@osxfuse0 0 0 0 100% 0 0 100% /mnt/dewey
41
- DF
42
- allow(plugin).to receive(:shell_out).with("df -i").and_return(mock_shell_out(0, @stdout, ""))
43
- end
44
-
45
- it "runs df -i" do
46
- expect(plugin).to receive(:shell_out).ordered.with("df -i").and_return(mock_shell_out(0, @stdout, ""))
47
- plugin.run
48
- end
49
-
50
- it "sets size to value from df -i" do
51
- plugin.run
52
- expect(plugin[:filesystem]["by_pair"]["/dev/disk0s2,/"][:kb_size]).to eq("244277768")
53
- expect(plugin[:filesystem]["by_pair"]["/dev/disk0s2,/"][:kb_used]).to eq("156848224")
54
- expect(plugin[:filesystem]["by_pair"]["/dev/disk0s2,/"][:kb_available]).to eq("87173544")
55
- expect(plugin[:filesystem]["by_pair"]["/dev/disk0s2,/"][:percent_used]).to eq("65%")
56
- end
57
-
58
- it "sets device and mount to value from df -i" do
59
- plugin.run
60
- expect(plugin[:filesystem]["by_pair"]["/dev/disk0s2,/"][:mount]).to eq("/")
61
- expect(plugin[:filesystem]["by_pair"]["/dev/disk0s2,/"][:device]).to eq("/dev/disk0s2")
62
- end
63
-
64
- it "sets inode info to value from df -i" do
65
- plugin.run
66
- expect(plugin[:filesystem]["by_pair"]["/dev/disk0s2,/"][:total_inodes]).to eq("61069440")
67
- expect(plugin[:filesystem]["by_pair"]["/dev/disk0s2,/"][:inodes_used]).to eq("39276054")
68
- expect(plugin[:filesystem]["by_pair"]["/dev/disk0s2,/"][:inodes_available]).to eq("21793386")
69
- end
70
- end
71
-
72
- describe "when gathering mounted filesystem data from mount" do
73
- before do
74
- @stdout = <<~MOUNT
75
- /dev/disk0s2 on / (hfs, local, journaled)
76
- devfs on /dev (devfs, local, nobrowse)
77
- map /etc/auto.direct on /mnt/vol (autofs, automounted, nobrowse)
78
- map -hosts on /net (autofs, nosuid, automounted, nobrowse)
79
- map -static on /mobile_symbol (autofs, automounted, nobrowse)
80
- deweyfs@osxfuse0 on /mnt/dewey (osxfusefs, synchronous, nobrowse)
81
- MOUNT
82
- allow(plugin).to receive(:shell_out).with("mount").and_return(mock_shell_out(0, @stdout, ""))
83
- end
84
-
85
- it "runs mount" do
86
- expect(plugin).to receive(:shell_out).with("mount").and_return(mock_shell_out(0, @stdout, ""))
87
- plugin.run
88
- end
89
-
90
- it "sets values from mount" do
91
- plugin.run
92
- expect(plugin[:filesystem]["by_pair"]["/dev/disk0s2,/"][:mount]).to eq("/")
93
- expect(plugin[:filesystem]["by_pair"]["/dev/disk0s2,/"][:fs_type]).to eq("hfs")
94
- expect(plugin[:filesystem]["by_pair"]["/dev/disk0s2,/"][:mount_options]).to eq(%w{local journaled})
95
- end
96
- end
97
-
98
- describe "when gathering filesystem data with devices mounted more than once" do
99
- before do
100
- @dfstdout = <<~DF
101
- Filesystem 512-blocks Used Available Capacity iused ifree %iused Mounted on
102
- /dev/disk0s2 488555536 313696448 174347088 65% 39276054 21793386 64% /
103
- devfs 385 385 0 100% 666 0 100% /dev
104
- map /etc/auto.direct 0 0 0 100% 0 0 100% /mnt/vol
105
- map -hosts 0 0 0 100% 0 0 100% /net
106
- map -static 0 0 0 100% 0 0 100% /mobile_symbol
107
- deweyfs@osxfuse0 0 0 0 100% 0 0 100% /mnt/dewey
108
- /dev/disk0s2 488555536 313696448 174347088 65% 39276054 21793386 64% /another/mountpoint
109
- DF
110
- allow(plugin).to receive(:shell_out).with("df -i").and_return(mock_shell_out(0, @dfstdout, ""))
111
- end
112
-
113
- it "provides a devices view with all mountpoints" do
114
- plugin.run
115
- expect(plugin[:filesystem]["by_device"]["/dev/disk0s2"][:mounts]).to eq(["/", "/another/mountpoint"])
116
- end
117
- end
118
-
119
- describe "when gathering filesystem data with double-mounts" do
120
- before do
121
- @dfstdout = <<~DF
122
- Filesystem 512-blocks Used Available Capacity iused ifree %iused Mounted on
123
- /dev/disk0s2 488555536 313696448 174347088 65% 39276054 21793386 64% /
124
- devfs 385 385 0 100% 666 0 100% /dev
125
- map /etc/auto.direct 0 0 0 100% 0 0 100% /mnt/vol
126
- map -hosts 0 0 0 100% 0 0 100% /net
127
- map -static 0 0 0 100% 0 0 100% /mobile_symbol
128
- deweyfs@osxfuse0 0 0 0 100% 0 0 100% /mnt/dewey
129
- /dev/disk0s3 488555536 313696448 174347088 65% 39276054 21793386 64% /mnt
130
- /dev/disk0s4 488555536 313696448 174347088 65% 39276054 21793386 64% /mnt
131
- DF
132
- allow(plugin).to receive(:shell_out).with("df -i").and_return(mock_shell_out(0, @dfstdout, ""))
133
- end
134
-
135
- it "provides a mounts view with all devices" do
136
- plugin.run
137
- expect(plugin[:filesystem]["by_mountpoint"]["/mnt"][:devices]).to eq(["/dev/disk0s3", "/dev/disk0s4"])
138
- end
139
- end
140
- end
@@ -1,105 +0,0 @@
1
- #
2
- # Author:: Nate Walck (<nate.walck@gmail.com>)
3
- # Copyright:: Copyright (c) 2016-present Facebook, Inc.
4
- # License:: Apache License, Version 2.0
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
-
19
- require "spec_helper"
20
- require_relative "hardware_system_profiler_output"
21
-
22
- describe Ohai::System, "Darwin hardware plugin", :unix_only do
23
- let(:plugin) { get_plugin("darwin/hardware") }
24
-
25
- before do
26
- allow(plugin).to receive(:collect_os).and_return(:darwin)
27
- # Make sure it always runs correct commands and mock the data as it calls them
28
- allow(plugin).to receive(:shell_out).with(
29
- "system_profiler SPHardwareDataType -xml"
30
- ).and_return(
31
- mock_shell_out(0, HardwareSystemProfilerOutput::HARDWARE, "")
32
- )
33
-
34
- allow(plugin).to receive(:shell_out).with(
35
- "sw_vers"
36
- ).and_return(
37
- mock_shell_out(0, "ProductName: Mac OS X\nProductVersion: 10.12\nBuildVersion: 16A239j", "")
38
- )
39
-
40
- allow(plugin).to receive(:shell_out).with(
41
- "uname -m"
42
- ).and_return(
43
- mock_shell_out(0, "x86_64", "")
44
- )
45
-
46
- allow(plugin).to receive(:shell_out).with(
47
- "system_profiler SPStorageDataType -xml"
48
- ).and_return(
49
- mock_shell_out(0, HardwareSystemProfilerOutput::STORAGE, "")
50
- )
51
-
52
- allow(plugin).to receive(:shell_out).with(
53
- "system_profiler SPPowerDataType -xml"
54
- ).and_return(
55
- mock_shell_out(0, HardwareSystemProfilerOutput::POWER, "")
56
- )
57
- end
58
-
59
- it "parses hardware data correctly" do
60
- plugin.run
61
- expect(plugin["hardware"]["SMC_version_system"]).to eq("2.16f68")
62
- expect(plugin["hardware"]["boot_rom_version"]).to eq("MBP111.0138.B17")
63
- expect(plugin["hardware"]["cpu_type"]).to eq("Intel Core i7")
64
- expect(plugin["hardware"]["current_processor_speed"]).to eq("3 GHz")
65
- expect(plugin["hardware"]["l2_cache_core"]).to eq("256 KB")
66
- expect(plugin["hardware"]["l3_cache"]).to eq("4 MB")
67
- expect(plugin["hardware"]["machine_model"]).to eq("MacBookPro11,1")
68
- expect(plugin["hardware"]["machine_name"]).to eq("MacBook Pro")
69
- expect(plugin["hardware"]["number_processors"]).to eq(2)
70
- expect(plugin["hardware"]["packages"]).to eq(1)
71
- expect(plugin["hardware"]["physical_memory"]).to eq("16 GB")
72
- expect(plugin["hardware"]["platform_UUID"]).to eq("F1A4AE0F-84A8-45D8-83C7-F3F904464FC5")
73
- expect(plugin["hardware"]["serial_number"]).to eq("ABCDEFG12345")
74
- end
75
-
76
- it "parses sw_vers and uname data correctly" do
77
- plugin.run
78
- expect(plugin["hardware"]["operating_system"]).to eq("Mac OS X")
79
- expect(plugin["hardware"]["operating_system_version"]).to eq("10.12")
80
- expect(plugin["hardware"]["build_version"]).to eq("16A239j")
81
- expect(plugin["hardware"]["architecture"]).to eq("x86_64")
82
- end
83
-
84
- it "parses storage data correctly" do
85
- plugin.run
86
- expect(plugin["hardware"]["storage"][0]["name"]).to eq("Macintosh HD")
87
- expect(plugin["hardware"]["storage"][0]["bsd_name"]).to eq("disk1")
88
- expect(plugin["hardware"]["storage"][0]["capacity"]).to eq(249661751296)
89
- expect(plugin["hardware"]["storage"][0]["drive_type"]).to eq("ssd")
90
- expect(plugin["hardware"]["storage"][0]["smart_status"]).to eq("Verified")
91
- expect(plugin["hardware"]["storage"][0]["partitions"]).to eq(1)
92
- end
93
-
94
- it "parses storage data correctly" do
95
- plugin.run
96
- expect(plugin["hardware"]["battery"]["current_capacity"]).to eq(5841)
97
- expect(plugin["hardware"]["battery"]["max_capacity"]).to eq(5841)
98
- expect(plugin["hardware"]["battery"]["fully_charged"]).to eq(true)
99
- expect(plugin["hardware"]["battery"]["is_charging"]).to eq(false)
100
- expect(plugin["hardware"]["battery"]["charge_cycle_count"]).to eq(201)
101
- expect(plugin["hardware"]["battery"]["health"]).to eq("Good")
102
- expect(plugin["hardware"]["battery"]["serial"]).to eq("D123456789ABCDEFG")
103
- expect(plugin["hardware"]["battery"]["remaining"]).to eq(100)
104
- end
105
- end
@@ -1,1110 +0,0 @@
1
- module HardwareSystemProfilerOutput
2
- HARDWARE = <<~HARDWARE_OUTPUT.freeze
3
- <?xml version="1.0" encoding="UTF-8"?>
4
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
5
- <plist version="1.0">
6
- <array>
7
- <dict>
8
- <key>_SPCommandLineArguments</key>
9
- <array>
10
- <string>/usr/sbin/system_profiler</string>
11
- <string>-nospawn</string>
12
- <string>-xml</string>
13
- <string>SPHardwareDataType</string>
14
- <string>-detailLevel</string>
15
- <string>full</string>
16
- </array>
17
- <key>_SPCompletionInterval</key>
18
- <real>0.095997989177703857</real>
19
- <key>_SPResponseTime</key>
20
- <real>0.21922904253005981</real>
21
- <key>_dataType</key>
22
- <string>SPHardwareDataType</string>
23
- <key>_detailLevel</key>
24
- <string>-2</string>
25
- <key>_items</key>
26
- <array>
27
- <dict>
28
- <key>SMC_version_system</key>
29
- <string>2.16f68</string>
30
- <key>_name</key>
31
- <string>hardware_overview</string>
32
- <key>boot_rom_version</key>
33
- <string>MBP111.0138.B17</string>
34
- <key>cpu_type</key>
35
- <string>Intel Core i7</string>
36
- <key>current_processor_speed</key>
37
- <string>3 GHz</string>
38
- <key>l2_cache_core</key>
39
- <string>256 KB</string>
40
- <key>l3_cache</key>
41
- <string>4 MB</string>
42
- <key>machine_model</key>
43
- <string>MacBookPro11,1</string>
44
- <key>machine_name</key>
45
- <string>MacBook Pro</string>
46
- <key>number_processors</key>
47
- <integer>2</integer>
48
- <key>packages</key>
49
- <integer>1</integer>
50
- <key>physical_memory</key>
51
- <string>16 GB</string>
52
- <key>platform_UUID</key>
53
- <string>F1A4AE0F-84A8-45D8-83C7-F3F904464FC5</string>
54
- <key>serial_number</key>
55
- <string>ABCDEFG12345</string>
56
- </dict>
57
- </array>
58
- <key>_parentDataType</key>
59
- <string>SPRootDataType</string>
60
- <key>_properties</key>
61
- <dict>
62
- <key>LOM_revision</key>
63
- <dict>
64
- <key>_order</key>
65
- <string>85</string>
66
- </dict>
67
- <key>Lightshow_version</key>
68
- <dict>
69
- <key>_order</key>
70
- <string>83</string>
71
- <key>_suppressLocalization</key>
72
- <string>YES</string>
73
- </dict>
74
- <key>MMM_state</key>
75
- <dict>
76
- <key>_order</key>
77
- <string>70</string>
78
- </dict>
79
- <key>SMC_version_other</key>
80
- <dict>
81
- <key>_order</key>
82
- <string>82</string>
83
- </dict>
84
- <key>SMC_version_riser</key>
85
- <dict>
86
- <key>_order</key>
87
- <string>81</string>
88
- </dict>
89
- <key>SMC_version_system</key>
90
- <dict>
91
- <key>_order</key>
92
- <string>80</string>
93
- <key>_suppressLocalization</key>
94
- <string>YES</string>
95
- </dict>
96
- <key>apple_rom_info</key>
97
- <dict>
98
- <key>_order</key>
99
- <string>53</string>
100
- </dict>
101
- <key>boot_rom_release_date</key>
102
- <dict>
103
- <key>_order</key>
104
- <string>52</string>
105
- </dict>
106
- <key>boot_rom_vendor</key>
107
- <dict>
108
- <key>_order</key>
109
- <string>50</string>
110
- </dict>
111
- <key>boot_rom_version</key>
112
- <dict>
113
- <key>_order</key>
114
- <string>51</string>
115
- </dict>
116
- <key>bus_speed</key>
117
- <dict>
118
- <key>_order</key>
119
- <string>45</string>
120
- </dict>
121
- <key>cores_per_package</key>
122
- <dict>
123
- <key>_order</key>
124
- <string>24</string>
125
- </dict>
126
- <key>cpu_interconnect_speed</key>
127
- <dict>
128
- <key>_order</key>
129
- <string>46</string>
130
- </dict>
131
- <key>cpu_type</key>
132
- <dict>
133
- <key>_order</key>
134
- <string>15</string>
135
- </dict>
136
- <key>current_processor_speed</key>
137
- <dict>
138
- <key>_order</key>
139
- <string>17</string>
140
- </dict>
141
- <key>l2_cache</key>
142
- <dict>
143
- <key>_order</key>
144
- <string>26</string>
145
- </dict>
146
- <key>l2_cache_core</key>
147
- <dict>
148
- <key>_order</key>
149
- <string>26</string>
150
- </dict>
151
- <key>l2_cache_share</key>
152
- <dict>
153
- <key>_order</key>
154
- <string>26</string>
155
- </dict>
156
- <key>l2_cache_size</key>
157
- <dict>
158
- <key>_order</key>
159
- <string>26</string>
160
- </dict>
161
- <key>l3_cache</key>
162
- <dict>
163
- <key>_order</key>
164
- <string>27</string>
165
- </dict>
166
- <key>l3_cache_processor</key>
167
- <dict>
168
- <key>_order</key>
169
- <string>27</string>
170
- </dict>
171
- <key>l3_cache_size</key>
172
- <dict>
173
- <key>_order</key>
174
- <string>27</string>
175
- </dict>
176
- <key>machine_model</key>
177
- <dict>
178
- <key>_order</key>
179
- <string>11</string>
180
- </dict>
181
- <key>machine_name</key>
182
- <dict>
183
- <key>_order</key>
184
- <string>10</string>
185
- </dict>
186
- <key>maximum_processor_speed</key>
187
- <dict>
188
- <key>_order</key>
189
- <string>19</string>
190
- </dict>
191
- <key>minimum_processor_speed</key>
192
- <dict>
193
- <key>_order</key>
194
- <string>18</string>
195
- </dict>
196
- <key>number_cpus</key>
197
- <dict>
198
- <key>_order</key>
199
- <string>20</string>
200
- </dict>
201
- <key>number_processors</key>
202
- <dict>
203
- <key>_order</key>
204
- <string>22</string>
205
- </dict>
206
- <key>packages</key>
207
- <dict>
208
- <key>_order</key>
209
- <string>20</string>
210
- </dict>
211
- <key>physical_memory</key>
212
- <dict>
213
- <key>_order</key>
214
- <string>40</string>
215
- </dict>
216
- <key>platform_UUID</key>
217
- <dict>
218
- <key>_detailLevel</key>
219
- <string>0</string>
220
- <key>_order</key>
221
- <string>98</string>
222
- </dict>
223
- <key>platform_cpu_features</key>
224
- <dict>
225
- <key>_order</key>
226
- <string>30</string>
227
- </dict>
228
- <key>platform_cpu_htt</key>
229
- <dict>
230
- <key>_order</key>
231
- <string>28</string>
232
- </dict>
233
- <key>platform_cpu_vendor</key>
234
- <dict>
235
- <key>_order</key>
236
- <string>12</string>
237
- </dict>
238
- <key>platform_manufacturer</key>
239
- <dict>
240
- <key>_order</key>
241
- <string>4</string>
242
- </dict>
243
- <key>platform_product_name</key>
244
- <dict>
245
- <key>_order</key>
246
- <string>2</string>
247
- </dict>
248
- <key>platform_version</key>
249
- <dict>
250
- <key>_order</key>
251
- <string>6</string>
252
- </dict>
253
- <key>riser_serial_number</key>
254
- <dict>
255
- <key>_detailLevel</key>
256
- <string>0</string>
257
- <key>_order</key>
258
- <string>92</string>
259
- </dict>
260
- <key>sales_order_number</key>
261
- <dict>
262
- <key>_detailLevel</key>
263
- <string>0</string>
264
- <key>_order</key>
265
- <string>95</string>
266
- </dict>
267
- <key>serial_number</key>
268
- <dict>
269
- <key>_detailLevel</key>
270
- <string>0</string>
271
- <key>_order</key>
272
- <string>90</string>
273
- </dict>
274
- <key>volumes</key>
275
- <dict>
276
- <key>_detailLevel</key>
277
- <string>0</string>
278
- </dict>
279
- </dict>
280
- <key>_timeStamp</key>
281
- <date>2016-07-08T19:44:04Z</date>
282
- <key>_versionInfo</key>
283
- <dict>
284
- <key>com.apple.SystemProfiler.SPPlatformReporter</key>
285
- <string>1445</string>
286
- </dict>
287
- </dict>
288
- </array>
289
- </plist>
290
- HARDWARE_OUTPUT
291
-
292
- STORAGE = <<~STORAGE_OUTPUT.freeze
293
- <?xml version="1.0" encoding="UTF-8"?>
294
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
295
- <plist version="1.0">
296
- <array>
297
- <dict>
298
- <key>_SPCommandLineArguments</key>
299
- <array>
300
- <string>/usr/sbin/system_profiler</string>
301
- <string>-nospawn</string>
302
- <string>-xml</string>
303
- <string>SPStorageDataType</string>
304
- <string>-detailLevel</string>
305
- <string>full</string>
306
- </array>
307
- <key>_SPCompletionInterval</key>
308
- <real>0.35913503170013428</real>
309
- <key>_SPResponseTime</key>
310
- <real>0.46972799301147461</real>
311
- <key>_dataType</key>
312
- <string>SPStorageDataType</string>
313
- <key>_items</key>
314
- <array>
315
- <dict>
316
- <key>_name</key>
317
- <string>Macintosh HD</string>
318
- <key>bsd_name</key>
319
- <string>disk1</string>
320
- <key>com.apple.corestorage.lv</key>
321
- <dict>
322
- <key>com.apple.corestorage.lv.encrypted</key>
323
- <string>yes</string>
324
- <key>com.apple.corestorage.lv.encryptionType</key>
325
- <string>AES-XTS</string>
326
- <key>com.apple.corestorage.lv.locked</key>
327
- <string>no</string>
328
- <key>com.apple.corestorage.lv.revertible</key>
329
- <string>kCoreStorageDecryptRevert</string>
330
- <key>com.apple.corestorage.lv.uuid</key>
331
- <string>1CD892E5-60BC-4339-AEF9-8C2818735617</string>
332
- </dict>
333
- <key>com.apple.corestorage.lvg</key>
334
- <dict>
335
- <key>com.apple.corestorage.lvg.freeSpace</key>
336
- <integer>0</integer>
337
- <key>com.apple.corestorage.lvg.name</key>
338
- <string>Macintosh HD</string>
339
- <key>com.apple.corestorage.lvg.size</key>
340
- <integer>250006216704</integer>
341
- <key>com.apple.corestorage.lvg.uuid</key>
342
- <string>949A3F85-1B19-4930-8EE0-B1565D66F2C5</string>
343
- </dict>
344
- <key>com.apple.corestorage.pv</key>
345
- <array>
346
- <dict>
347
- <key>_name</key>
348
- <string>disk0s2</string>
349
- <key>com.apple.corestorage.pv.size</key>
350
- <integer>250006216704</integer>
351
- <key>com.apple.corestorage.pv.status</key>
352
- <string>Online</string>
353
- <key>com.apple.corestorage.pv.uuid</key>
354
- <string>D26DACEB-E661-4621-9BE3-355FAE611398</string>
355
- <key>device_name</key>
356
- <string>APPLE SSD SM0256F</string>
357
- <key>is_internal_disk</key>
358
- <string>yes</string>
359
- <key>media_name</key>
360
- <string>APPLE SSD SM0256F Media</string>
361
- <key>medium_type</key>
362
- <string>ssd</string>
363
- <key>partition_map_type</key>
364
- <string>guid_partition_map_type</string>
365
- <key>protocol</key>
366
- <string>PCI</string>
367
- <key>smart_status</key>
368
- <string>Verified</string>
369
- </dict>
370
- </array>
371
- <key>file_system</key>
372
- <string>Journaled HFS+</string>
373
- <key>free_space_in_bytes</key>
374
- <integer>23864803328</integer>
375
- <key>ignore_ownership</key>
376
- <string>no</string>
377
- <key>mount_point</key>
378
- <string>/</string>
379
- <key>size_in_bytes</key>
380
- <integer>249661751296</integer>
381
- <key>volume_uuid</key>
382
- <string>06A53A23-1675-31BF-93BF-E78C149C61E9</string>
383
- <key>writable</key>
384
- <string>yes</string>
385
- </dict>
386
- </array>
387
- <key>_parentDataType</key>
388
- <string>SPHardwareDataType</string>
389
- <key>_properties</key>
390
- <dict>
391
- <key>_name</key>
392
- <dict>
393
- <key>_isColumn</key>
394
- <string>YES</string>
395
- <key>_order</key>
396
- <string>100</string>
397
- </dict>
398
- <key>bsd_name</key>
399
- <dict>
400
- <key>_isColumn</key>
401
- <true/>
402
- <key>_order</key>
403
- <string>180</string>
404
- </dict>
405
- <key>com.apple.corestorage.lv</key>
406
- <dict>
407
- <key>_order</key>
408
- <string>200</string>
409
- </dict>
410
- <key>com.apple.corestorage.lv.bytesConverted</key>
411
- <dict>
412
- <key>_isByteSize</key>
413
- <true/>
414
- <key>_order</key>
415
- <string>250</string>
416
- </dict>
417
- <key>com.apple.corestorage.lv.conversionState</key>
418
- <dict>
419
- <key>_order</key>
420
- <string>240</string>
421
- </dict>
422
- <key>com.apple.corestorage.lv.encrypted</key>
423
- <dict>
424
- <key>_order</key>
425
- <string>220</string>
426
- </dict>
427
- <key>com.apple.corestorage.lv.encryptionType</key>
428
- <dict>
429
- <key>_order</key>
430
- <string>225</string>
431
- </dict>
432
- <key>com.apple.corestorage.lv.locked</key>
433
- <dict>
434
- <key>_order</key>
435
- <string>230</string>
436
- </dict>
437
- <key>com.apple.corestorage.lv.revertible</key>
438
- <dict>
439
- <key>_order</key>
440
- <string>210</string>
441
- </dict>
442
- <key>com.apple.corestorage.lv.uuid</key>
443
- <dict>
444
- <key>_order</key>
445
- <string>290</string>
446
- </dict>
447
- <key>com.apple.corestorage.lvg</key>
448
- <dict>
449
- <key>_order</key>
450
- <string>400</string>
451
- </dict>
452
- <key>com.apple.corestorage.lvg.freeSpace</key>
453
- <dict>
454
- <key>_isByteSize</key>
455
- <true/>
456
- <key>_order</key>
457
- <string>430</string>
458
- </dict>
459
- <key>com.apple.corestorage.lvg.name</key>
460
- <dict>
461
- <key>_order</key>
462
- <string>410</string>
463
- </dict>
464
- <key>com.apple.corestorage.lvg.size</key>
465
- <dict>
466
- <key>_isByteSize</key>
467
- <true/>
468
- <key>_order</key>
469
- <string>420</string>
470
- </dict>
471
- <key>com.apple.corestorage.lvg.uuid</key>
472
- <dict>
473
- <key>_order</key>
474
- <string>440</string>
475
- </dict>
476
- <key>com.apple.corestorage.pv</key>
477
- <dict>
478
- <key>_order</key>
479
- <string>500</string>
480
- </dict>
481
- <key>com.apple.corestorage.pv.size</key>
482
- <dict>
483
- <key>_isByteSize</key>
484
- <true/>
485
- <key>_order</key>
486
- <string>520</string>
487
- </dict>
488
- <key>com.apple.corestorage.pv.status</key>
489
- <dict>
490
- <key>_order</key>
491
- <string>565</string>
492
- </dict>
493
- <key>com.apple.corestorage.pv.uuid</key>
494
- <dict>
495
- <key>_order</key>
496
- <string>590</string>
497
- </dict>
498
- <key>device_name</key>
499
- <dict>
500
- <key>_order</key>
501
- <string>505</string>
502
- </dict>
503
- <key>file_system</key>
504
- <dict>
505
- <key>_isColumn</key>
506
- <true/>
507
- <key>_order</key>
508
- <string>140</string>
509
- </dict>
510
- <key>free_space_in_bytes</key>
511
- <dict>
512
- <key>_isByteSize</key>
513
- <true/>
514
- <key>_isColumn</key>
515
- <true/>
516
- <key>_order</key>
517
- <string>110</string>
518
- </dict>
519
- <key>ignore_ownership</key>
520
- <dict>
521
- <key>_order</key>
522
- <string>160</string>
523
- </dict>
524
- <key>is_internal_disk</key>
525
- <dict>
526
- <key>_order</key>
527
- <string>550</string>
528
- </dict>
529
- <key>media_name</key>
530
- <dict>
531
- <key>_order</key>
532
- <string>510</string>
533
- </dict>
534
- <key>medium_type</key>
535
- <dict>
536
- <key>_order</key>
537
- <string>530</string>
538
- </dict>
539
- <key>mount_point</key>
540
- <dict>
541
- <key>_isColumn</key>
542
- <true/>
543
- <key>_order</key>
544
- <string>130</string>
545
- </dict>
546
- <key>optical_media_type</key>
547
- <dict>
548
- <key>_order</key>
549
- <string>535</string>
550
- </dict>
551
- <key>partition_map_type</key>
552
- <dict>
553
- <key>_order</key>
554
- <string>560</string>
555
- </dict>
556
- <key>protocol</key>
557
- <dict>
558
- <key>_order</key>
559
- <string>540</string>
560
- </dict>
561
- <key>size_in_bytes</key>
562
- <dict>
563
- <key>_isByteSize</key>
564
- <string>YES</string>
565
- <key>_isColumn</key>
566
- <true/>
567
- <key>_order</key>
568
- <string>120</string>
569
- </dict>
570
- <key>smart_status</key>
571
- <dict>
572
- <key>_order</key>
573
- <string>570</string>
574
- </dict>
575
- <key>volume_uuid</key>
576
- <dict>
577
- <key>_order</key>
578
- <string>190</string>
579
- </dict>
580
- <key>volumes</key>
581
- <dict>
582
- <key>_detailLevel</key>
583
- <string>0</string>
584
- </dict>
585
- <key>writable</key>
586
- <dict>
587
- <key>_order</key>
588
- <string>150</string>
589
- </dict>
590
- </dict>
591
- <key>_timeStamp</key>
592
- <date>2016-07-08T19:45:57Z</date>
593
- <key>_versionInfo</key>
594
- <dict>
595
- <key>com.apple.SystemProfiler.SPStorageReporter</key>
596
- <string>900</string>
597
- </dict>
598
- </dict>
599
- </array>
600
- </plist>
601
- STORAGE_OUTPUT
602
-
603
- POWER = <<~POWER_OUTPUT.freeze
604
- <?xml version="1.0" encoding="UTF-8"?>
605
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
606
- <plist version="1.0">
607
- <array>
608
- <dict>
609
- <key>_SPCommandLineArguments</key>
610
- <array>
611
- <string>/usr/sbin/system_profiler</string>
612
- <string>-nospawn</string>
613
- <string>-xml</string>
614
- <string>SPPowerDataType</string>
615
- <string>-detailLevel</string>
616
- <string>full</string>
617
- </array>
618
- <key>_SPCompletionInterval</key>
619
- <real>0.061106979846954346</real>
620
- <key>_SPResponseTime</key>
621
- <real>0.16731500625610352</real>
622
- <key>_dataType</key>
623
- <string>SPPowerDataType</string>
624
- <key>_detailLevel</key>
625
- <string>0</string>
626
- <key>_items</key>
627
- <array>
628
- <dict>
629
- <key>_name</key>
630
- <string>spbattery_information</string>
631
- <key>sppower_battery_charge_info</key>
632
- <dict>
633
- <key>sppower_battery_current_capacity</key>
634
- <integer>5841</integer>
635
- <key>sppower_battery_fully_charged</key>
636
- <string>TRUE</string>
637
- <key>sppower_battery_is_charging</key>
638
- <string>FALSE</string>
639
- <key>sppower_battery_max_capacity</key>
640
- <integer>5841</integer>
641
- </dict>
642
- <key>sppower_battery_health_info</key>
643
- <dict>
644
- <key>sppower_battery_cycle_count</key>
645
- <integer>201</integer>
646
- <key>sppower_battery_health</key>
647
- <string>Good</string>
648
- </dict>
649
- <key>sppower_battery_installed</key>
650
- <string>TRUE</string>
651
- <key>sppower_battery_model_info</key>
652
- <dict>
653
- <key>PCB Lot Code</key>
654
- <string>0000</string>
655
- <key>Pack Lot Code</key>
656
- <string>0000</string>
657
- <key>sppower_battery_cell_revision</key>
658
- <string>0389</string>
659
- <key>sppower_battery_device_name</key>
660
- <string>bq20z451</string>
661
- <key>sppower_battery_firmware_version</key>
662
- <string>0702</string>
663
- <key>sppower_battery_hardware_revision</key>
664
- <string>000a</string>
665
- <key>sppower_battery_manufacturer</key>
666
- <string>SMP</string>
667
- <key>sppower_battery_serial_number</key>
668
- <string>D123456789ABCDEFG</string>
669
- </dict>
670
- <key>sppower_current_amperage</key>
671
- <integer>0</integer>
672
- <key>sppower_current_voltage</key>
673
- <integer>12788</integer>
674
- </dict>
675
- <dict>
676
- <key>AC Power</key>
677
- <dict>
678
- <key>AutoPowerOff Delay</key>
679
- <integer>14400</integer>
680
- <key>AutoPowerOff Enabled</key>
681
- <integer>1</integer>
682
- <key>Current Power Source</key>
683
- <string>TRUE</string>
684
- <key>DarkWakeBackgroundTasks</key>
685
- <true/>
686
- <key>Disk Sleep Timer</key>
687
- <integer>10</integer>
688
- <key>Display Sleep Timer</key>
689
- <integer>10</integer>
690
- <key>Display Sleep Uses Dim</key>
691
- <string>Yes</string>
692
- <key>Hibernate Mode</key>
693
- <integer>3</integer>
694
- <key>PrioritizeNetworkReachabilityOverSleep</key>
695
- <integer>0</integer>
696
- <key>Standby Delay</key>
697
- <integer>10800</integer>
698
- <key>Standby Enabled</key>
699
- <integer>1</integer>
700
- <key>System Sleep Timer</key>
701
- <integer>1</integer>
702
- <key>Wake On AC Change</key>
703
- <string>No</string>
704
- <key>Wake On Clamshell Open</key>
705
- <string>Yes</string>
706
- <key>Wake On LAN</key>
707
- <string>Yes</string>
708
- </dict>
709
- <key>Battery Power</key>
710
- <dict>
711
- <key>AutoPowerOff Delay</key>
712
- <integer>14400</integer>
713
- <key>AutoPowerOff Enabled</key>
714
- <integer>1</integer>
715
- <key>DarkWakeBackgroundTasks</key>
716
- <false/>
717
- <key>Disk Sleep Timer</key>
718
- <integer>10</integer>
719
- <key>Display Sleep Timer</key>
720
- <integer>2</integer>
721
- <key>Display Sleep Uses Dim</key>
722
- <string>Yes</string>
723
- <key>Hibernate Mode</key>
724
- <integer>3</integer>
725
- <key>ReduceBrightness</key>
726
- <string>Yes</string>
727
- <key>Standby Delay</key>
728
- <integer>10800</integer>
729
- <key>Standby Enabled</key>
730
- <integer>1</integer>
731
- <key>System Sleep Timer</key>
732
- <integer>1</integer>
733
- <key>Wake On AC Change</key>
734
- <string>No</string>
735
- <key>Wake On Clamshell Open</key>
736
- <string>Yes</string>
737
- </dict>
738
- <key>_name</key>
739
- <string>sppower_information</string>
740
- </dict>
741
- <dict>
742
- <key>_name</key>
743
- <string>sppower_hwconfig_information</string>
744
- <key>sppower_ups_installed</key>
745
- <string>FALSE</string>
746
- </dict>
747
- <dict>
748
- <key>_name</key>
749
- <string>sppower_ac_charger_information</string>
750
- <key>sppower_ac_charger_ID</key>
751
- <string>0x0100</string>
752
- <key>sppower_ac_charger_family</key>
753
- <string>0x0085</string>
754
- <key>sppower_ac_charger_revision</key>
755
- <string>0x0000</string>
756
- <key>sppower_ac_charger_serial_number</key>
757
- <string>0x00a1dab7</string>
758
- <key>sppower_ac_charger_watts</key>
759
- <string>85</string>
760
- <key>sppower_battery_charger_connected</key>
761
- <string>TRUE</string>
762
- <key>sppower_battery_is_charging</key>
763
- <string>FALSE</string>
764
- </dict>
765
- </array>
766
- <key>_parentDataType</key>
767
- <string>SPHardwareDataType</string>
768
- <key>_properties</key>
769
- <dict>
770
- <key>Automatic Restart On Power Loss</key>
771
- <dict>
772
- <key>_isColumn</key>
773
- <string>NO</string>
774
- <key>_order</key>
775
- <string>107</string>
776
- </dict>
777
- <key>Disk Sleep Timer</key>
778
- <dict>
779
- <key>_isColumn</key>
780
- <string>NO</string>
781
- <key>_order</key>
782
- <string>102</string>
783
- </dict>
784
- <key>Display Sleep Timer</key>
785
- <dict>
786
- <key>_isColumn</key>
787
- <string>NO</string>
788
- <key>_order</key>
789
- <string>103</string>
790
- </dict>
791
- <key>Dynamic Power Step</key>
792
- <dict>
793
- <key>_isColumn</key>
794
- <string>NO</string>
795
- <key>_order</key>
796
- <string>104</string>
797
- </dict>
798
- <key>PCB Lot Code</key>
799
- <dict>
800
- <key>_isColumn</key>
801
- <string>NO</string>
802
- <key>_order</key>
803
- <string>404</string>
804
- </dict>
805
- <key>Pack Lot Code</key>
806
- <dict>
807
- <key>_isColumn</key>
808
- <string>NO</string>
809
- <key>_order</key>
810
- <string>403</string>
811
- </dict>
812
- <key>Reduce Processor Speed</key>
813
- <dict>
814
- <key>_isColumn</key>
815
- <string>NO</string>
816
- <key>_order</key>
817
- <string>105</string>
818
- </dict>
819
- <key>Sleep On Power Button</key>
820
- <dict>
821
- <key>_isColumn</key>
822
- <string>NO</string>
823
- <key>_order</key>
824
- <string>106</string>
825
- </dict>
826
- <key>System Sleep Timer</key>
827
- <dict>
828
- <key>_isColumn</key>
829
- <string>NO</string>
830
- <key>_order</key>
831
- <string>101</string>
832
- </dict>
833
- <key>Wake On AC Change</key>
834
- <dict>
835
- <key>_isColumn</key>
836
- <string>NO</string>
837
- <key>_order</key>
838
- <string>108</string>
839
- </dict>
840
- <key>Wake On Clamshell Open</key>
841
- <dict>
842
- <key>_isColumn</key>
843
- <string>NO</string>
844
- <key>_order</key>
845
- <string>109</string>
846
- </dict>
847
- <key>Wake On LAN</key>
848
- <dict>
849
- <key>_isColumn</key>
850
- <string>NO</string>
851
- <key>_order</key>
852
- <string>110</string>
853
- </dict>
854
- <key>Wake On Modem Ring</key>
855
- <dict>
856
- <key>_isColumn</key>
857
- <string>NO</string>
858
- <key>_order</key>
859
- <string>111</string>
860
- </dict>
861
- <key>spbattery_information</key>
862
- <dict>
863
- <key>_isColumn</key>
864
- <string>NO</string>
865
- <key>_order</key>
866
- <string>200</string>
867
- </dict>
868
- <key>sppower_ac_charger_ID</key>
869
- <dict>
870
- <key>_isColumn</key>
871
- <string>NO</string>
872
- <key>_order</key>
873
- <string>310</string>
874
- </dict>
875
- <key>sppower_ac_charger_family</key>
876
- <dict>
877
- <key>_isColumn</key>
878
- <string>NO</string>
879
- <key>_order</key>
880
- <string>313</string>
881
- </dict>
882
- <key>sppower_ac_charger_firmware_version</key>
883
- <dict>
884
- <key>_isColumn</key>
885
- <string>NO</string>
886
- <key>_order</key>
887
- <string>318</string>
888
- </dict>
889
- <key>sppower_ac_charger_hardware_version</key>
890
- <dict>
891
- <key>_isColumn</key>
892
- <string>NO</string>
893
- <key>_order</key>
894
- <string>317</string>
895
- </dict>
896
- <key>sppower_ac_charger_information</key>
897
- <dict>
898
- <key>_isColumn</key>
899
- <string>NO</string>
900
- <key>_order</key>
901
- <string>300</string>
902
- </dict>
903
- <key>sppower_ac_charger_manufacturer</key>
904
- <dict>
905
- <key>_isColumn</key>
906
- <string>NO</string>
907
- <key>_order</key>
908
- <string>316</string>
909
- </dict>
910
- <key>sppower_ac_charger_name</key>
911
- <dict>
912
- <key>_isColumn</key>
913
- <string>NO</string>
914
- <key>_order</key>
915
- <string>315</string>
916
- </dict>
917
- <key>sppower_ac_charger_revision</key>
918
- <dict>
919
- <key>_isColumn</key>
920
- <string>NO</string>
921
- <key>_order</key>
922
- <string>312</string>
923
- </dict>
924
- <key>sppower_ac_charger_serial_number</key>
925
- <dict>
926
- <key>_isColumn</key>
927
- <string>NO</string>
928
- <key>_order</key>
929
- <string>314</string>
930
- </dict>
931
- <key>sppower_ac_charger_watts</key>
932
- <dict>
933
- <key>_isColumn</key>
934
- <string>NO</string>
935
- <key>_order</key>
936
- <string>311</string>
937
- </dict>
938
- <key>sppower_battery_cannot_charge</key>
939
- <dict>
940
- <key>_isColumn</key>
941
- <string>NO</string>
942
- <key>_order</key>
943
- <string>401</string>
944
- </dict>
945
- <key>sppower_battery_cell_revision</key>
946
- <dict>
947
- <key>_isColumn</key>
948
- <string>NO</string>
949
- <key>_order</key>
950
- <string>407</string>
951
- </dict>
952
- <key>sppower_battery_charge_info</key>
953
- <dict>
954
- <key>_isColumn</key>
955
- <string>NO</string>
956
- <key>_order</key>
957
- <string>2</string>
958
- </dict>
959
- <key>sppower_battery_charger_connected</key>
960
- <dict>
961
- <key>_isColumn</key>
962
- <string>NO</string>
963
- <key>_order</key>
964
- <string>302</string>
965
- </dict>
966
- <key>sppower_battery_depleted</key>
967
- <dict>
968
- <key>_isColumn</key>
969
- <string>NO</string>
970
- <key>_order</key>
971
- <string>203</string>
972
- </dict>
973
- <key>sppower_battery_device_name</key>
974
- <dict>
975
- <key>_isColumn</key>
976
- <string>NO</string>
977
- <key>_order</key>
978
- <string>402</string>
979
- </dict>
980
- <key>sppower_battery_firmware_version</key>
981
- <dict>
982
- <key>_isColumn</key>
983
- <string>NO</string>
984
- <key>_order</key>
985
- <string>405</string>
986
- </dict>
987
- <key>sppower_battery_hardware_revision</key>
988
- <dict>
989
- <key>_isColumn</key>
990
- <string>NO</string>
991
- <key>_order</key>
992
- <string>406</string>
993
- </dict>
994
- <key>sppower_battery_health_info</key>
995
- <dict>
996
- <key>_isColumn</key>
997
- <string>NO</string>
998
- <key>_order</key>
999
- <string>3</string>
1000
- </dict>
1001
- <key>sppower_battery_installed</key>
1002
- <dict>
1003
- <key>_isColumn</key>
1004
- <string>NO</string>
1005
- <key>_order</key>
1006
- <string>201</string>
1007
- </dict>
1008
- <key>sppower_battery_manufacturer</key>
1009
- <dict>
1010
- <key>_isColumn</key>
1011
- <string>NO</string>
1012
- <key>_order</key>
1013
- <string>401</string>
1014
- </dict>
1015
- <key>sppower_battery_model_info</key>
1016
- <dict>
1017
- <key>_isColumn</key>
1018
- <string>NO</string>
1019
- <key>_order</key>
1020
- <string>1</string>
1021
- </dict>
1022
- <key>sppower_battery_serial_number</key>
1023
- <dict>
1024
- <key>_isColumn</key>
1025
- <string>NO</string>
1026
- <key>_order</key>
1027
- <string>400</string>
1028
- </dict>
1029
- <key>sppower_clamshell_closed</key>
1030
- <dict>
1031
- <key>_isColumn</key>
1032
- <string>NO</string>
1033
- <key>_order</key>
1034
- <string>401</string>
1035
- </dict>
1036
- <key>sppower_current_amperage</key>
1037
- <dict>
1038
- <key>_isColumn</key>
1039
- <string>NO</string>
1040
- <key>_order</key>
1041
- <string>206</string>
1042
- </dict>
1043
- <key>sppower_current_voltage</key>
1044
- <dict>
1045
- <key>_isColumn</key>
1046
- <string>NO</string>
1047
- <key>_order</key>
1048
- <string>207</string>
1049
- </dict>
1050
- <key>sppower_events_info</key>
1051
- <dict>
1052
- <key>_isColumn</key>
1053
- <string>NO</string>
1054
- <key>_order</key>
1055
- <string>500</string>
1056
- </dict>
1057
- <key>sppower_hwconfig_information</key>
1058
- <dict>
1059
- <key>_isColumn</key>
1060
- <string>NO</string>
1061
- <key>_order</key>
1062
- <string>400</string>
1063
- </dict>
1064
- <key>sppower_information</key>
1065
- <dict>
1066
- <key>_isColumn</key>
1067
- <string>NO</string>
1068
- <key>_order</key>
1069
- <string>100</string>
1070
- </dict>
1071
- <key>sppower_repeating_events_info</key>
1072
- <dict>
1073
- <key>_isColumn</key>
1074
- <string>NO</string>
1075
- <key>_order</key>
1076
- <string>520</string>
1077
- </dict>
1078
- <key>sppower_scheduled_events_info</key>
1079
- <dict>
1080
- <key>_isColumn</key>
1081
- <string>NO</string>
1082
- <key>_order</key>
1083
- <string>510</string>
1084
- </dict>
1085
- <key>sppower_watts</key>
1086
- <dict>
1087
- <key>_isColumn</key>
1088
- <string>NO</string>
1089
- <key>_order</key>
1090
- <string>301</string>
1091
- </dict>
1092
- <key>volumes</key>
1093
- <dict>
1094
- <key>_detailLevel</key>
1095
- <string>0</string>
1096
- </dict>
1097
- </dict>
1098
- <key>_timeStamp</key>
1099
- <date>2016-07-08T19:46:23Z</date>
1100
- <key>_versionInfo</key>
1101
- <dict>
1102
- <key>com.apple.SystemProfiler.SPPowerReporter</key>
1103
- <string>150</string>
1104
- </dict>
1105
- </dict>
1106
- </array>
1107
- </plist>
1108
- POWER_OUTPUT
1109
-
1110
- end