ohai 15.3.1 → 15.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -6
- data/lib/ohai/mixin/{network_constants.rb → network_helper.rb} +8 -1
- data/lib/ohai/plugins/aix/network.rb +3 -8
- data/lib/ohai/plugins/darwin/network.rb +6 -4
- data/lib/ohai/plugins/filesystem.rb +166 -0
- data/lib/ohai/plugins/network.rb +5 -5
- data/lib/ohai/plugins/openstack.rb +2 -1
- data/lib/ohai/plugins/solaris2/network.rb +6 -4
- data/lib/ohai/version.rb +1 -1
- data/ohai.gemspec +1 -1
- metadata +3 -162
- data/Rakefile +0 -42
- data/lib/ohai/plugins/windows/filesystem.rb +0 -147
- data/spec/data/plugins/dpkg-query.output +0 -4
- data/spec/data/plugins/lslpp.output +0 -50
- data/spec/data/plugins/pacman.output +0 -51
- data/spec/data/plugins/pkg-query.output +0 -58
- data/spec/data/plugins/pkginfo.output +0 -50
- data/spec/data/plugins/pkglist.output +0 -24
- data/spec/data/plugins/rpmquery.output +0 -7
- data/spec/functional/application_spec.rb +0 -107
- data/spec/functional/loader_spec.rb +0 -53
- data/spec/functional/plugins/powershell_spec.rb +0 -88
- data/spec/functional/plugins/root_group_spec.rb +0 -41
- data/spec/functional/plugins/windows/uptime_spec.rb +0 -51
- data/spec/ohai_spec.rb +0 -27
- data/spec/rcov.opts +0 -2
- data/spec/spec.opts +0 -2
- data/spec/spec_helper.rb +0 -124
- data/spec/support/integration_helper.rb +0 -61
- data/spec/support/platform_helpers.rb +0 -38
- data/spec/unit/application_spec.rb +0 -96
- data/spec/unit/config_spec.rb +0 -57
- data/spec/unit/dsl/plugin_spec.rb +0 -634
- data/spec/unit/hints_spec.rb +0 -65
- data/spec/unit/loader_spec.rb +0 -195
- data/spec/unit/mixin/azure_metadata_spec.rb +0 -72
- data/spec/unit/mixin/command_spec.rb +0 -151
- data/spec/unit/mixin/dmi_decode.rb +0 -75
- data/spec/unit/mixin/ec2_metadata_spec.rb +0 -88
- data/spec/unit/mixin/softlayer_metadata_spec.rb +0 -72
- data/spec/unit/plugin_config_spec.rb +0 -117
- data/spec/unit/plugins/abort_spec.rb +0 -69
- data/spec/unit/plugins/aix/cpu_spec.rb +0 -127
- data/spec/unit/plugins/aix/filesystem_spec.rb +0 -238
- data/spec/unit/plugins/aix/hostname_spec.rb +0 -33
- data/spec/unit/plugins/aix/kernel_spec.rb +0 -61
- data/spec/unit/plugins/aix/memory_spec.rb +0 -49
- data/spec/unit/plugins/aix/network_spec.rb +0 -313
- data/spec/unit/plugins/aix/platform_spec.rb +0 -44
- data/spec/unit/plugins/aix/uptime_spec.rb +0 -42
- data/spec/unit/plugins/aix/virtualization_spec.rb +0 -319
- data/spec/unit/plugins/azure_spec.rb +0 -243
- data/spec/unit/plugins/bsd/filesystem_spec.rb +0 -138
- data/spec/unit/plugins/bsd/virtualization_spec.rb +0 -145
- data/spec/unit/plugins/c_spec.rb +0 -341
- data/spec/unit/plugins/chef_spec.rb +0 -44
- data/spec/unit/plugins/cloud_spec.rb +0 -484
- data/spec/unit/plugins/darwin/cpu_spec.rb +0 -124
- data/spec/unit/plugins/darwin/filesystem_spec.rb +0 -140
- data/spec/unit/plugins/darwin/hardware_spec.rb +0 -105
- data/spec/unit/plugins/darwin/hardware_system_profiler_output.rb +0 -1110
- data/spec/unit/plugins/darwin/hostname_spec.rb +0 -43
- data/spec/unit/plugins/darwin/kernel_spec.rb +0 -65
- data/spec/unit/plugins/darwin/memory_spec.rb +0 -64
- data/spec/unit/plugins/darwin/network_spec.rb +0 -849
- data/spec/unit/plugins/darwin/platform_spec.rb +0 -71
- data/spec/unit/plugins/darwin/virtualization_spec.rb +0 -156
- data/spec/unit/plugins/digital_ocean_spec.rb +0 -106
- data/spec/unit/plugins/dmi_spec.rb +0 -156
- data/spec/unit/plugins/docker_spec.rb +0 -100
- data/spec/unit/plugins/ec2_spec.rb +0 -452
- data/spec/unit/plugins/elixir_spec.rb +0 -55
- data/spec/unit/plugins/erlang_spec.rb +0 -71
- data/spec/unit/plugins/eucalyptus_spec.rb +0 -109
- data/spec/unit/plugins/fail_spec.rb +0 -260
- data/spec/unit/plugins/freebsd/cpu_spec.rb +0 -129
- data/spec/unit/plugins/freebsd/hostname_spec.rb +0 -35
- data/spec/unit/plugins/freebsd/kernel_spec.rb +0 -36
- data/spec/unit/plugins/freebsd/platform_spec.rb +0 -38
- data/spec/unit/plugins/gce_spec.rb +0 -81
- data/spec/unit/plugins/go_spec.rb +0 -48
- data/spec/unit/plugins/groovy_spec.rb +0 -66
- data/spec/unit/plugins/haskell_spec.rb +0 -231
- data/spec/unit/plugins/hostname_spec.rb +0 -162
- data/spec/unit/plugins/init_package_spec.rb +0 -60
- data/spec/unit/plugins/java_spec.rb +0 -230
- data/spec/unit/plugins/joyent_spec.rb +0 -100
- data/spec/unit/plugins/kernel_spec.rb +0 -38
- data/spec/unit/plugins/linode_spec.rb +0 -135
- data/spec/unit/plugins/linux/block_device_spec.rb +0 -75
- data/spec/unit/plugins/linux/cpu_spec.rb +0 -441
- data/spec/unit/plugins/linux/filesystem_spec.rb +0 -550
- data/spec/unit/plugins/linux/fips_spec.rb +0 -60
- data/spec/unit/plugins/linux/hostname_spec.rb +0 -52
- data/spec/unit/plugins/linux/hostnamectl_spec.rb +0 -59
- data/spec/unit/plugins/linux/kernel_spec.rb +0 -71
- data/spec/unit/plugins/linux/lsb_spec.rb +0 -147
- data/spec/unit/plugins/linux/lspci_spec.rb +0 -133
- data/spec/unit/plugins/linux/machineid_spec.rb +0 -46
- data/spec/unit/plugins/linux/mdadm_spec.rb +0 -170
- data/spec/unit/plugins/linux/memory_spec.rb +0 -256
- data/spec/unit/plugins/linux/network_spec.rb +0 -1392
- data/spec/unit/plugins/linux/platform_spec.rb +0 -812
- data/spec/unit/plugins/linux/sessions_spec.rb +0 -98
- data/spec/unit/plugins/linux/sysctl_spec.rb +0 -53
- data/spec/unit/plugins/linux/systemd_paths_spec.rb +0 -122
- data/spec/unit/plugins/linux/uptime_spec.rb +0 -48
- data/spec/unit/plugins/linux/virtualization_spec.rb +0 -650
- data/spec/unit/plugins/lua_spec.rb +0 -60
- data/spec/unit/plugins/mono_spec.rb +0 -67
- data/spec/unit/plugins/netbsd/hostname_spec.rb +0 -43
- data/spec/unit/plugins/netbsd/kernel_spec.rb +0 -35
- data/spec/unit/plugins/netbsd/platform_spec.rb +0 -38
- data/spec/unit/plugins/network_spec.rb +0 -1078
- data/spec/unit/plugins/nodejs_spec.rb +0 -55
- data/spec/unit/plugins/ohai_spec.rb +0 -32
- data/spec/unit/plugins/ohai_time_spec.rb +0 -44
- data/spec/unit/plugins/openbsd/hostname_spec.rb +0 -43
- data/spec/unit/plugins/openbsd/kernel_spec.rb +0 -36
- data/spec/unit/plugins/openbsd/platform_spec.rb +0 -33
- data/spec/unit/plugins/openstack_spec.rb +0 -311
- data/spec/unit/plugins/os_spec.rb +0 -115
- data/spec/unit/plugins/packages_spec.rb +0 -353
- data/spec/unit/plugins/passwd_spec.rb +0 -65
- data/spec/unit/plugins/perl_spec.rb +0 -62
- data/spec/unit/plugins/php_spec.rb +0 -97
- data/spec/unit/plugins/platform_spec.rb +0 -65
- data/spec/unit/plugins/powershell_spec.rb +0 -71
- data/spec/unit/plugins/python_spec.rb +0 -51
- data/spec/unit/plugins/rackspace_spec.rb +0 -350
- data/spec/unit/plugins/root_group_spec.rb +0 -90
- data/spec/unit/plugins/ruby_spec.rb +0 -60
- data/spec/unit/plugins/rust_spec.rb +0 -43
- data/spec/unit/plugins/scala_spec.rb +0 -58
- data/spec/unit/plugins/scaleway_spec.rb +0 -93
- data/spec/unit/plugins/scsi_spec.rb +0 -69
- data/spec/unit/plugins/shard_spec.rb +0 -121
- data/spec/unit/plugins/shells_spec.rb +0 -56
- data/spec/unit/plugins/softlayer_spec.rb +0 -60
- data/spec/unit/plugins/solaris2/cpu_spec.rb +0 -2926
- data/spec/unit/plugins/solaris2/dmi_spec.rb +0 -153
- data/spec/unit/plugins/solaris2/filesystem.rb +0 -407
- data/spec/unit/plugins/solaris2/hostname_spec.rb +0 -37
- data/spec/unit/plugins/solaris2/kernel_spec.rb +0 -183
- data/spec/unit/plugins/solaris2/memory_spec.rb +0 -43
- data/spec/unit/plugins/solaris2/network_spec.rb +0 -201
- data/spec/unit/plugins/solaris2/platform_spec.rb +0 -108
- data/spec/unit/plugins/solaris2/virtualization_spec.rb +0 -97
- data/spec/unit/plugins/ssh_host_keys_spec.rb +0 -116
- data/spec/unit/plugins/sysconf_spec.rb +0 -680
- data/spec/unit/plugins/timezone_spec.rb +0 -30
- data/spec/unit/plugins/vbox_host_spec.rb +0 -14
- data/spec/unit/plugins/virtualbox_spec.rb +0 -375
- data/spec/unit/plugins/vmware_spec.rb +0 -81
- data/spec/unit/plugins/windows/cpu_spec.rb +0 -118
- data/spec/unit/plugins/windows/filesystem_spec.rb +0 -226
- data/spec/unit/plugins/windows/fips_spec.rb +0 -60
- data/spec/unit/plugins/windows/kernel_spec.rb +0 -79
- data/spec/unit/plugins/windows/memory_spec.rb +0 -52
- data/spec/unit/plugins/windows/network_spec.rb +0 -137
- data/spec/unit/plugins/windows/system_enclosure_spec.rb +0 -45
- data/spec/unit/plugins/windows/uptime_spec.rb +0 -38
- data/spec/unit/plugins/windows/virtualization_spec.rb +0 -63
- data/spec/unit/plugins/zpools_spec.rb +0 -244
- data/spec/unit/provides_map_spec.rb +0 -208
- data/spec/unit/runner_spec.rb +0 -422
- data/spec/unit/system_spec.rb +0 -416
- data/spec/unit/util/file_helper_spec.rb +0 -47
- data/spec/unit/util/ip_helper_spec.rb +0 -128
@@ -1,37 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Author:: Daniel DeLeo <dan@kallistec.com>
|
3
|
-
# Copyright:: Copyright (c) 2009 Daniel DeLeo
|
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, "Solaris2.X hostname plugin" do
|
22
|
-
before do
|
23
|
-
@plugin = get_plugin("hostname")
|
24
|
-
allow(@plugin).to receive(:collect_os).and_return(:solaris2)
|
25
|
-
allow(@plugin).to receive(:resolve_fqdn).and_return("kitteh.inurfridge.eatinurfoodz")
|
26
|
-
allow(@plugin).to receive(:shell_out).with("hostname").and_return(mock_shell_out(0, "kitteh\n", ""))
|
27
|
-
# Socket.stub(:getaddrinfo).and_return( [["AF_INET", 0, "kitteh.inurfridge.eatinurfoodz", "10.1.2.3", 2, 0, 0]] );
|
28
|
-
end
|
29
|
-
|
30
|
-
it_should_check_from("solaris2::hostname", "hostname", "hostname", "kitteh")
|
31
|
-
|
32
|
-
it "gets the fqdn value from #resolve_fqdn" do
|
33
|
-
@plugin.run
|
34
|
-
expect(@plugin["fqdn"]).to eq("kitteh.inurfridge.eatinurfoodz")
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
@@ -1,183 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Author:: Daniel DeLeo <dan@kallistec.com>
|
3
|
-
# Copyright:: Copyright (c) 2009 Daniel DeLeo
|
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, "Solaris2.X kernel plugin" do
|
22
|
-
# NOTE: Solaris will report the same module loaded multiple times
|
23
|
-
# with the same ID, Loadaddr, etc. and only the info column different
|
24
|
-
# ignoring it, and removing the data from this fixture.
|
25
|
-
MODINFO = <<-TOOMUCH.freeze
|
26
|
-
Id Loadaddr Size Info Rev Module Name
|
27
|
-
6 1180000 4623 1 1 specfs (filesystem for specfs)
|
28
|
-
8 1185df0 38c4 1 1 TS (time sharing sched class)
|
29
|
-
9 1188f50 8dc - 1 TS_DPTBL (Time sharing dispatch table)
|
30
|
-
10 1188fe0 3623e 2 1 ufs (filesystem for ufs)
|
31
|
-
11 11bc7ae 1ef - 1 fssnap_if (File System Snapshot Interface)
|
32
|
-
12 11bc8f6 1b3a 1 1 rootnex (sun4u root nexus 1.95)
|
33
|
-
13 11be023 210 57 1 options (options driver)
|
34
|
-
15 11be6ff 181a 12 1 sad (STREAMS Administrative Driver ')
|
35
|
-
16 11bfc79 64b 2 1 pseudo (nexus driver for 'pseudo')
|
36
|
-
17 11c0152 23563 32 1 sd (SCSI Disk Driver 1.447)
|
37
|
-
18 11e160d 8c49 - 1 scsi (SCSI Bus Utility Routines)
|
38
|
-
23 12171db 1072b 50 1 glm (GLM SCSI HBA Driver 1.191.)
|
39
|
-
24 1225816 edcb 111 1 pcipsy (PCI Bus nexus driver 1.214)
|
40
|
-
26 123e0eb 15b7 - 1 dada ( ATA Bus Utility Routines)
|
41
|
-
27 123f30a 722 - 1 todmostek (tod module for Mostek M48T59 1.)
|
42
|
-
28 11e7342 1a902 5 1 procfs (filesystem for proc)
|
43
|
-
29 12335a1 da0 134 1 power (power button driver v1.10)
|
44
|
-
30 1234199 15cb 126 1 ebus (ebus nexus driver 1.44)
|
45
|
-
32 123f9a4 12215 6 1 sockfs (filesystem for sockfs)
|
46
|
-
34 12365ba 6ae 11 1 clone (Clone Pseudodriver 'clone')
|
47
|
-
35 1251709 7b1a6 0 1 ip (IP Streams module)
|
48
|
-
36 1236a10 34f 1 1 ip6 (IP Streams module)
|
49
|
-
37 12c56af 282d1 2 1 tcp (TCP Streams module)
|
50
|
-
38 1236ba4 107d - 1 md5 (MD5 Message-Digest Algorithm)
|
51
|
-
39 1237b6c 365 3 1 tcp6 (TCP Streams module)
|
52
|
-
40 1201148 a22f 4 1 udp (UDP Streams module)
|
53
|
-
41 1237d11 365 5 1 udp6 (UDP Streams module)
|
54
|
-
42 12096ef 86eb 6 1 icmp (ICMP Streams module)
|
55
|
-
43 1237eb6 351 7 1 icmp6 (ICMP Streams module)
|
56
|
-
44 123804c 6d5b 8 1 arp (ARP Streams module)
|
57
|
-
45 1210282 46ba 9 1 timod (transport interface str mod)
|
58
|
-
47 12152d1 c53 16 1 conskbd (Console kbd Multiplexer driver )
|
59
|
-
48 1215b88 1ec2 15 1 wc (Workstation multiplexer Driver )
|
60
|
-
49 12e66d4 516c 37 1 su (su driver 1.80)
|
61
|
-
51 12ed065 4026 10 1 kb (streams module for keyboard)
|
62
|
-
52 12efe3b 18c0 11 1 ms (streams module for mouse)
|
63
|
-
53 12f14f7 a87 17 1 consms (Mouse Driver for Sun 'consms' 5)
|
64
|
-
54 12f1bf6 b9d6 166 1 gfxp (TSI tspci driver %I%)
|
65
|
-
55 12fb934 d77 14 1 iwscn (Workstation Redirection driver )
|
66
|
-
58 1321301 4a4e 1 1 elfexec (exec module for elf)
|
67
|
-
62 1328758 10bca - 1 usba (USBA: USB Architecture 1.36)
|
68
|
-
64 1337002 4884 - 1 mpxio (Multipath Interface Library v1.)
|
69
|
-
68 131ded0 36d9 3 1 fifofs (filesystem for fifo)
|
70
|
-
69 131248e 6888 - 1 fctl (Sun FC Transport Library v1.14)
|
71
|
-
71 1345ddc 18cff - 1 usba10 (USBA10: USB 1.0 Architecture 1.)
|
72
|
-
75 135b92b f0e2 12 1 ldterm (terminal line discipline)
|
73
|
-
76 1326309 246d 13 1 ttcompat (alt ioctl calls)
|
74
|
-
77 133b574 8cbb 29 1 zs (Z8530 serial driver V4.128)
|
75
|
-
78 1343d27 15d0 26 1 ptsl (tty pseudo driver slave 'ptsl' )
|
76
|
-
79 12fc4f3 1e77 25 1 ptc (tty pseudo driver control 'ptc')
|
77
|
-
81 13748db 1d2c 14 1 rts (Routing Socket Streams module)
|
78
|
-
88 136a112 ac5a 20 1 se (Siemens SAB 82532 ESCC2 1.128)
|
79
|
-
89 13cf520 4be3 105 1 tl (TPI Local Transport Driver - tl)
|
80
|
-
90 13d3d1b 48d3 17 1 keysock (PF_KEY Socket Streams module)
|
81
|
-
91 13d7766 323f 234 1 spdsock (PF_POLICY Socket Streams device)
|
82
|
-
92 137c3fb 1672 97 1 sysmsg (System message redirection (fan)
|
83
|
-
93 12fe1ba 82c 0 1 cn (Console redirection driver 5.57)
|
84
|
-
94 7814fba6 4b5 2 1 intpexec (exec mod for interp)
|
85
|
-
95 12fe826 2cb 42 1 pipe (pipe(2) syscall)
|
86
|
-
96 137d2dd 112d 13 1 mm (memory driver 1.68)
|
87
|
-
97 13da515 ea79 7 1 hme (10/100Mb Ethernet Driver v1.167)
|
88
|
-
98 78058000 2e313 85 1 md (Solaris Volume Manager base mod)
|
89
|
-
99 13e6c82 127bc 226 1 rpcmod (RPC syscall)
|
90
|
-
100 13f6ab6 1f99 - 1 tlimod (KTLI misc module)
|
91
|
-
101 13f89a9 54e8 - 1 md_stripe (Solaris Volume Manager stripes )
|
92
|
-
102 78086000 13316 - 1 md_mirror (Solaris Volume Manager mirrors )
|
93
|
-
103 78084c17 1669 15 1 mntfs (mount information file system)
|
94
|
-
105 78098156 fe0 12 1 fdfs (filesystem for fd)
|
95
|
-
106 7809a000 46d7 201 1 doorfs (doors)
|
96
|
-
107 7809e3c4 16e2 4 1 namefs (filesystem for namefs)
|
97
|
-
108 780a0000 15ef2 11 1 tmpfs (filesystem for tmpfs)
|
98
|
-
109 78098ca6 1054 90 1 kstat (kernel statistics driver 1.18)
|
99
|
-
110 1375e9f 3aa9 88 1 devinfo (DEVINFO Driver 1.48)
|
100
|
-
111 13fda05 25b9 38 1 openeepr (OPENPROM/NVRAM Driver v1.14)
|
101
|
-
112 780a5886 9c7 21 1 log (streams log driver)
|
102
|
-
113 780bc000 2c080 106 1 nfs (NFS syscall, client, and common)
|
103
|
-
114 780ea000 4e43 - 1 rpcsec (kernel RPC security module.)
|
104
|
-
115 780f4000 8667 - 1 klmmod (lock mgr common module)
|
105
|
-
116 780f0000 354c 2 1 FX (Fixed priority sched class)
|
106
|
-
117 137e232 2ae - 1 FX_DPTBL (Fixed priority dispatch table)
|
107
|
-
118 780fc000 668b 17 1 autofs (filesystem for autofs)
|
108
|
-
119 780eeaab 1bba 104 1 random (random number device v1.8)
|
109
|
-
120 12eb400 1b66 - 1 sha1 (SHA1 Message-Digest Algorithm)
|
110
|
-
122 780f2788 13b8 - 1 bootdev (bootdev misc module 1.18)
|
111
|
-
124 78124000 579e 127 1 pm (power management driver v1.104)
|
112
|
-
125 781106aa 10b7 207 1 pset (processor sets)
|
113
|
-
126 7812a000 289d 52 1 shmsys (System V shared memory)
|
114
|
-
127 1216e2a 3dc - 1 ipc (common ipc code)
|
115
|
-
128 7812e000 ee14 - 1 md_raid (Solaris Volume Manager raid mod)
|
116
|
-
129 7813e000 d0cd - 1 md_trans (Solaris Volume Manager trans mo)
|
117
|
-
130 7814c000 2a03 - 1 md_hotspares (Solaris Volume Manager hot spar)
|
118
|
-
131 7814ab55 1004 - 1 md_notify (Solaris Volume Manager notifica)
|
119
|
-
132 7809f7f6 903 22 1 sy (Indirect driver for tty 'sy' 1.)
|
120
|
-
133 780e541c d34 23 1 ptm (Master streams driver 'ptm' 1.4)
|
121
|
-
134 7812c76d d36 24 1 pts (Slave Stream Pseudo Terminal dr)
|
122
|
-
135 7814e728 1617 19 1 ptem (pty hardware emulator)
|
123
|
-
136 780e5eb8 2a5 20 1 redirmod (redirection module)
|
124
|
-
137 78150000 6b71 91 1 vol (Volume Management Driver, 1.93)
|
125
|
-
138 13285ad 2cf 21 1 connld (Streams-based pipes)
|
126
|
-
139 137e27a 109 3 1 IA (interactive scheduling class)
|
127
|
-
140 7813c544 1b10 22 1 hwc (streams module for hardware cur)
|
128
|
-
141 78156871 170f 23 1 bufmod (streams buffer mod)
|
129
|
-
142 1325c4c 838 72 1 ksyms (kernel symbols driver 1.25)
|
130
|
-
143 12fea22 14864 33 1 st (SCSI tape Driver 1.238)
|
131
|
-
144 1379790 2a12 53 1 semsys (System V semaphore facility)
|
132
|
-
145 12138e4 15e4 4 1 RT (realtime scheduling class)
|
133
|
-
146 121719e 28c - 1 RT_DPTBL (realtime dispatch table)
|
134
|
-
TOOMUCH
|
135
|
-
|
136
|
-
before do
|
137
|
-
@plugin = get_plugin("kernel")
|
138
|
-
allow(@plugin).to receive(:collect_os).and_return(:solaris2)
|
139
|
-
allow(@plugin).to receive(:init_kernel).and_return({})
|
140
|
-
allow(@plugin).to receive(:shell_out).with("uname -s").and_return(mock_shell_out(0, "SunOS\n", ""))
|
141
|
-
allow(@plugin).to receive(:shell_out).with("modinfo").and_return(mock_shell_out(0, MODINFO, ""))
|
142
|
-
@release = StringIO.new(" Oracle Solaris 10 1/13 s10s_u11wos_24a SPARC\n Assembled 17 January 2013")
|
143
|
-
allow(File).to receive(:open).with("/etc/release").and_yield(@release)
|
144
|
-
end
|
145
|
-
|
146
|
-
it "gives the Solaris update version information" do
|
147
|
-
@release = StringIO.new(" Solaris 10 10/08 s10s_u6wos_07b SPARC\n Use is subject to license terms.\n Assembled 27 October 2008")
|
148
|
-
allow(File).to receive(:open).with("/etc/release").and_yield(@release)
|
149
|
-
@plugin.run
|
150
|
-
expect(@plugin[:kernel][:update]).to eq("10 10/08 s10s_u6wos_07")
|
151
|
-
end
|
152
|
-
|
153
|
-
it "gives the Oracle Solaris update version information" do
|
154
|
-
@release = StringIO.new(" Oracle Solaris 10 1/13 s10s_u11wos_24a SPARC\n Assembled 17 January 2013")
|
155
|
-
allow(File).to receive(:open).with("/etc/release").and_yield(@release)
|
156
|
-
@plugin.run
|
157
|
-
expect(@plugin[:kernel][:update]).to eq("10 1/13 s10s_u11wos_24")
|
158
|
-
end
|
159
|
-
|
160
|
-
it "gives the Solaris 11 update version information" do
|
161
|
-
@release = StringIO.new(" Oracle Solaris 11.3 SPARC\n Assembled 25 July 2016")
|
162
|
-
allow(File).to receive(:open).with("/etc/release").and_yield(@release)
|
163
|
-
@plugin.run
|
164
|
-
expect(@plugin[:kernel][:update]).to eq("11.3")
|
165
|
-
end
|
166
|
-
|
167
|
-
it_should_check_from_deep_mash("solaris2::kernel", "kernel", "os", "uname -s", [0, "SunOS\n", ""])
|
168
|
-
|
169
|
-
it "gives excruciating detail about kernel modules" do
|
170
|
-
@plugin.run
|
171
|
-
|
172
|
-
expect(@plugin[:kernel][:modules]).to have(107).modules
|
173
|
-
|
174
|
-
# Teh daterz
|
175
|
-
# Id Loadaddr Size Info Rev Module Name
|
176
|
-
# 6 1180000 4623 1 1 specfs (filesystem for specfs)
|
177
|
-
teh_daterz = { "id" => 6, "loadaddr" => "1180000", "size" => 17955, "description" => "filesystem for specfs" }
|
178
|
-
expect(@plugin[:kernel][:modules].keys).to include("specfs")
|
179
|
-
expect(@plugin[:kernel][:modules].keys).not_to include("Module")
|
180
|
-
expect(@plugin[:kernel][:modules]["specfs"]).to eq(teh_daterz)
|
181
|
-
end
|
182
|
-
|
183
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# License:: Apache License, Version 2.0
|
3
|
-
#
|
4
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
# you may not use this file except in compliance with the License.
|
6
|
-
# You may obtain a copy of the License at
|
7
|
-
#
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
#
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
# See the License for the specific language governing permissions and
|
14
|
-
# limitations under the License.
|
15
|
-
#
|
16
|
-
|
17
|
-
require "spec_helper"
|
18
|
-
|
19
|
-
describe Ohai::System, "Solaris2.X memory plugin" do
|
20
|
-
before do
|
21
|
-
@plugin = get_plugin("solaris2/memory")
|
22
|
-
allow(@plugin).to receive(:collect_os).and_return("solaris2")
|
23
|
-
allow(@plugin).to receive(:shell_out).with("prtconf | grep Memory").and_return(mock_shell_out(0, "Memory size: 8194 Megabytes\n", ""))
|
24
|
-
@swap_s = "total: 112230656k bytes allocated + 357865576k reserved = 470096232k used, 47057688k available\n"
|
25
|
-
allow(@plugin).to receive(:shell_out).with("swap -s").and_return(mock_shell_out(0, @swap_s, ""))
|
26
|
-
end
|
27
|
-
|
28
|
-
it "gets the total memory" do
|
29
|
-
@plugin.run
|
30
|
-
expect(@plugin[:memory][:total]).to eql("#{8194 * 1024}kB")
|
31
|
-
end
|
32
|
-
|
33
|
-
it "gets total swap" do
|
34
|
-
@plugin.run
|
35
|
-
expect(@plugin[:memory][:swap][:total]).to eql("#{(470096232 + 47057688)}kB" )
|
36
|
-
end
|
37
|
-
|
38
|
-
it "gets free swap" do
|
39
|
-
@plugin.run
|
40
|
-
expect(@plugin[:memory][:swap][:free]).to eql("47057688kB")
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|
@@ -1,201 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Author:: Daniel DeLeo <dan@chef.io>
|
3
|
-
# Copyright:: Copyright (c) 2010-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, "Solaris2.X network plugin" do
|
22
|
-
|
23
|
-
before do
|
24
|
-
@solaris_arp_rn = <<~ARP_RN
|
25
|
-
Net to Media Table: IPv4
|
26
|
-
Device IP Address Mask Flags Phys Addr
|
27
|
-
------ -------------------- --------------- ----- ---------------
|
28
|
-
rtls0 172.31.4.1 255.255.255.255 00:14:69:81:0b:c0
|
29
|
-
rtls0 172.31.4.44 255.255.255.255 00:0c:29:c4:9a:11
|
30
|
-
rtls0 172.31.5.16 255.255.255.255 de:ad:be:ef:3b:ba
|
31
|
-
rtls0 172.31.4.16 255.255.255.255 d8:d3:85:65:39:40
|
32
|
-
rtls0 172.31.4.12 255.255.255.255 d8:d3:85:bb:43:b0
|
33
|
-
rtls0 172.31.4.115 255.255.255.255 52:54:00:0d:b7:5b
|
34
|
-
rtls0 172.31.4.126 255.255.255.255 52:54:00:2d:93:0c
|
35
|
-
rtls0 172.31.4.125 255.255.255.255 02:08:20:2e:29:8d
|
36
|
-
rtls0 172.31.4.121 255.255.255.255 52:54:00:25:8a:3f
|
37
|
-
rtls0 172.31.4.103 255.255.255.255 SP 52:54:00:7f:22:e7
|
38
|
-
rtls0 172.31.4.102 255.255.255.255 02:08:20:88:38:18
|
39
|
-
rtls0 172.31.4.106 255.255.255.255 02:08:20:6d:cc:aa
|
40
|
-
rtls0 172.31.4.83 255.255.255.255 02:08:20:05:8e:75
|
41
|
-
rtls0 172.31.4.82 255.255.255.255 52:54:00:2d:93:0c
|
42
|
-
rtls0 172.31.4.81 255.255.255.255 02:08:20:37:80:87
|
43
|
-
rtls0 224.0.0.0 240.0.0.0 SM 01:00:5e:00:00:00
|
44
|
-
ARP_RN
|
45
|
-
|
46
|
-
@solaris_ifconfig = <<~ENDIFCONFIG
|
47
|
-
ipmp0: flags=108000000843<UP,BROADCAST,RUNNING,MULTICAST,IPMP,PHYSRUNNING> mtu 1500
|
48
|
-
inet 10.10.130.103 netmask fffffe00 broadcast 10.10.131.255
|
49
|
-
groupname ipmp0
|
50
|
-
lo0:3: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
|
51
|
-
inet 127.0.0.1 netmask ff000000
|
52
|
-
e1000g0:3: flags=201000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS> mtu 1500 index 3
|
53
|
-
inet 72.2.115.28 netmask ffffff80 broadcast 72.2.115.127
|
54
|
-
e1000g2:1: flags=201000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS> mtu 1500 index 4
|
55
|
-
inet 10.2.115.28 netmask ffffff80 broadcast 10.2.115.127
|
56
|
-
inet6 2001:0db8:3c4d:55:a00:20ff:fe8e:f3ad/64
|
57
|
-
net0: flags=40201000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS,L3PROTECT> mtu 1500 index 2
|
58
|
-
inet 37.153.96.148 netmask fffffe00 broadcast 37.153.97.255
|
59
|
-
ether 90:b8:d0:16:9b:97
|
60
|
-
net1:1: flags=100001000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,PHYSRUNNING> mtu 1500 index 2
|
61
|
-
inet 10.16.125.36 netmask fffffe00 broadcast 10.16.125.255
|
62
|
-
ether 90:b8:d0:16:9b:97
|
63
|
-
ip.tun0: flags=2200851<UP,POINTOPOINT,RUNNING,MULTICAST,NONUD,IPv6> mtu 1480 index 3
|
64
|
-
inet tunnel src 109.146.85.57 tunnel dst 109.146.85.212
|
65
|
-
tunnel security settings --> use 'ipsecconf -ln -i ip.tun1'
|
66
|
-
tunnel hop limit 60
|
67
|
-
inet6 fe80::6d92:5539/10 --> fe80::6d92:55d4
|
68
|
-
ip.tun0:1: flags=2200851<UP,POINTOPOINT,RUNNING,MULTICAST,NONUD,IPv6> mtu 1480 index 3
|
69
|
-
inet6 2::45/128 --> 2::46
|
70
|
-
lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
|
71
|
-
inet 127.0.0.1 netmask ff000000
|
72
|
-
eri0: flags=1004843<UP,BROADCAST,RUNNING,MULTICAST,DHCP,IPv4> mtu 1500 index 2
|
73
|
-
inet 172.17.128.208 netmask ffffff00 broadcast 172.17.128.255
|
74
|
-
ip6.tun0: flags=10008d1<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST,IPv4> mtu 1460 index 3
|
75
|
-
inet6 tunnel src fe80::1 tunnel dst fe80::2
|
76
|
-
tunnel security settings --> use 'ipsecconf -ln -i ip.tun1'
|
77
|
-
tunnel hop limit 60 tunnel encapsulation limit 4
|
78
|
-
inet 10.0.0.208 --> 10.0.0.210 netmask ff000000
|
79
|
-
qfe1: flags=2000841<UP,RUNNING,MULTICAST,IPv6> mtu 1500 index 3
|
80
|
-
usesrc vni0
|
81
|
-
inet6 fe80::203:baff:fe17:4be0/10
|
82
|
-
ether 0:3:ba:17:4b:e0
|
83
|
-
vni0: flags=2002210041<UP,RUNNING,NOXMIT,NONUD,IPv6,VIRTUAL> mtu 1460 index 5
|
84
|
-
srcof qfe1
|
85
|
-
inet6 fe80::203:baff:fe17:4444/128
|
86
|
-
ENDIFCONFIG
|
87
|
-
|
88
|
-
@solaris_netstat_rn = <<~NETSTAT_RN
|
89
|
-
Routing Table: IPv4
|
90
|
-
Destination Gateway Flags Ref Use Interface
|
91
|
-
-------------------- -------------------- ----- ----- ---------- ---------
|
92
|
-
default 10.13.37.1 UG 1 0 e1000g0
|
93
|
-
10.13.37.0 10.13.37.157 U 1 2 e1000g0
|
94
|
-
127.0.0.1 127.0.0.1 UH 1 35 lo0
|
95
|
-
|
96
|
-
Routing Table: IPv6
|
97
|
-
Destination/Mask Gateway Flags Ref Use If
|
98
|
-
--------------------------- --------------------------- ----- --- ------- -----
|
99
|
-
fe80::/10 fe80::250:56ff:fe13:3757 U 1 0 e1000g0
|
100
|
-
::1 ::1 UH 1 0 lo0
|
101
|
-
NETSTAT_RN
|
102
|
-
|
103
|
-
@solaris_route_get = <<~ROUTE_GET
|
104
|
-
route to: default
|
105
|
-
destination: default
|
106
|
-
mask: default
|
107
|
-
gateway: 10.13.37.1
|
108
|
-
interface: e1000g0 index 3
|
109
|
-
flags: <UP,GATEWAY,DONE,STATIC>
|
110
|
-
recvpipe sendpipe ssthresh rtt,ms rttvar,ms hopcount mtu expire
|
111
|
-
0 0 0 0 0 0 1500 0
|
112
|
-
ROUTE_GET
|
113
|
-
|
114
|
-
@solaris11_route_get = <<~ROUTE_GET
|
115
|
-
route to: default
|
116
|
-
destination: default
|
117
|
-
mask: default
|
118
|
-
gateway: 10.13.37.1
|
119
|
-
interface: net1 index 2
|
120
|
-
flags: <UP,GATEWAY,DONE,STATIC>
|
121
|
-
recvpipe sendpipe ssthresh rtt,ms rttvar,ms hopcount mtu expire
|
122
|
-
0 0 0 0 0 0 1500 0
|
123
|
-
ROUTE_GET
|
124
|
-
|
125
|
-
@ifconfig_lines = @solaris_ifconfig.split("\n")
|
126
|
-
|
127
|
-
@plugin = get_plugin("solaris2/network")
|
128
|
-
allow(@plugin).to receive(:collect_os).and_return(:solaris2)
|
129
|
-
@plugin[:network] = Mash.new
|
130
|
-
|
131
|
-
allow(@plugin).to receive(:shell_out).with("ifconfig -a").and_return(mock_shell_out(0, @solaris_route_get, ""))
|
132
|
-
allow(@plugin).to receive(:shell_out).with("arp -an").and_return(mock_shell_out(0, @solaris_arp_rn, ""))
|
133
|
-
allow(@plugin).to receive(:shell_out).with("route -v -n get default").and_return(mock_shell_out(0, @solaris_route_get, ""))
|
134
|
-
end
|
135
|
-
|
136
|
-
describe "gathering IP layer address info" do
|
137
|
-
before do
|
138
|
-
@stdout = double("Pipe, stdout, cmd=`route get default`", read: @solaris_route_get)
|
139
|
-
allow(@plugin).to receive(:shell_out).with("route -v -n get default").and_return(mock_shell_out(0, @solaris_route_get, ""))
|
140
|
-
allow(@plugin).to receive(:shell_out).with("ifconfig -a").and_return(mock_shell_out(0, @solaris_ifconfig, ""))
|
141
|
-
@plugin.run
|
142
|
-
end
|
143
|
-
|
144
|
-
it "completes the run" do
|
145
|
-
expect(@plugin["network"]).not_to be_nil
|
146
|
-
end
|
147
|
-
|
148
|
-
it "detects the interfaces" do
|
149
|
-
expect(@plugin["network"]["interfaces"].keys.sort).to eq(["e1000g0:3", "e1000g2:1", "eri0", "ip.tun0", "ip.tun0:1", "ip6.tun0", "ipmp0", "lo0", "lo0:3", "net0", "net1:1", "qfe1", "vni0"])
|
150
|
-
end
|
151
|
-
|
152
|
-
it "detects the ip addresses of the interfaces" do
|
153
|
-
expect(@plugin["network"]["interfaces"]["e1000g0:3"]["addresses"].keys).to include("72.2.115.28")
|
154
|
-
end
|
155
|
-
|
156
|
-
it "detects the encapsulation type of the interfaces" do
|
157
|
-
expect(@plugin["network"]["interfaces"]["e1000g0:3"]["encapsulation"]).to eq("Ethernet")
|
158
|
-
end
|
159
|
-
|
160
|
-
it "detects the L3PROTECT network flag" do
|
161
|
-
expect(@plugin["network"]["interfaces"]["net0"]["flags"]).to include("L3PROTECT")
|
162
|
-
end
|
163
|
-
|
164
|
-
it "detects an interface with no index number" do
|
165
|
-
expect(@plugin["network"]["interfaces"]["ipmp0"]["index"]).to eq(nil)
|
166
|
-
expect(@plugin["network"]["interfaces"]["ipmp0"]["mtu"]).to eq("1500")
|
167
|
-
end
|
168
|
-
|
169
|
-
end
|
170
|
-
|
171
|
-
describe "gathering solaris 11 zone IP layer address info" do
|
172
|
-
before do
|
173
|
-
@stdout = double("Pipe, stdout, cmd=`route get default`", read: @solaris11_route_get)
|
174
|
-
allow(@plugin).to receive(:shell_out).with("route -v -n get default").and_return(mock_shell_out(0, @solaris11_route_get, ""))
|
175
|
-
allow(@plugin).to receive(:shell_out).with("ifconfig -a").and_return(mock_shell_out(0, @solaris_ifconfig, ""))
|
176
|
-
@plugin.run
|
177
|
-
end
|
178
|
-
|
179
|
-
it "finds the flags for a PHYSRUNNING interface" do
|
180
|
-
expect(@plugin[:network][:interfaces]["net1:1"][:flags]).to eq(%w{ UP BROADCAST RUNNING MULTICAST IPv4 PHYSRUNNING })
|
181
|
-
end
|
182
|
-
|
183
|
-
it "finds the default interface for a solaris 11 zone" do
|
184
|
-
expect(@plugin[:network][:default_interface]).to eq("net1:1")
|
185
|
-
end
|
186
|
-
end
|
187
|
-
|
188
|
-
# TODO: specs for the arp -an stuff, check that it correctly adds the MAC addr to the right iface, etc.
|
189
|
-
|
190
|
-
describe "setting the node's default IP address attribute" do
|
191
|
-
before do
|
192
|
-
@stdout = double("Pipe, stdout, cmd=`route get default`", read: @solaris_route_get)
|
193
|
-
allow(@plugin).to receive(:shell_out).with("route -v -n get default").and_return(mock_shell_out(0, @solaris_route_get, ""))
|
194
|
-
@plugin.run
|
195
|
-
end
|
196
|
-
|
197
|
-
it "finds the default interface by asking which iface has the default route" do
|
198
|
-
expect(@plugin[:network][:default_interface]).to eq("e1000g0")
|
199
|
-
end
|
200
|
-
end
|
201
|
-
end
|