ohai 8.13.0 → 8.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/lib/ohai/common/dmi.rb +1 -1
  4. data/lib/ohai/config.rb +2 -2
  5. data/lib/ohai/dsl/plugin.rb +1 -1
  6. data/lib/ohai/loader.rb +1 -1
  7. data/lib/ohai/mixin/command.rb +18 -5
  8. data/lib/ohai/mixin/ec2_metadata.rb +1 -1
  9. data/lib/ohai/plugins/aix/os.rb +1 -1
  10. data/lib/ohai/plugins/c.rb +49 -67
  11. data/lib/ohai/plugins/darwin/memory.rb +1 -1
  12. data/lib/ohai/plugins/darwin/network.rb +3 -3
  13. data/lib/ohai/plugins/darwin/platform.rb +1 -1
  14. data/lib/ohai/plugins/darwin/system_profiler.rb +1 -1
  15. data/lib/ohai/plugins/digital_ocean.rb +1 -1
  16. data/lib/ohai/plugins/ec2.rb +42 -41
  17. data/lib/ohai/plugins/erlang.rb +1 -1
  18. data/lib/ohai/plugins/ip_scopes.rb +1 -1
  19. data/lib/ohai/plugins/kernel.rb +1 -1
  20. data/lib/ohai/plugins/linux/network.rb +2 -2
  21. data/lib/ohai/plugins/linux/platform.rb +6 -1
  22. data/lib/ohai/plugins/mono.rb +1 -1
  23. data/lib/ohai/plugins/network.rb +2 -2
  24. data/lib/ohai/plugins/packages.rb +59 -46
  25. data/lib/ohai/plugins/python.rb +2 -2
  26. data/lib/ohai/plugins/rackspace.rb +4 -4
  27. data/lib/ohai/plugins/sigar/network.rb +1 -1
  28. data/lib/ohai/plugins/sigar/network_route.rb +1 -1
  29. data/lib/ohai/plugins/solaris2/dmi.rb +1 -1
  30. data/lib/ohai/plugins/solaris2/network.rb +25 -8
  31. data/lib/ohai/plugins/ssh_host_key.rb +1 -1
  32. data/lib/ohai/plugins/windows/network.rb +5 -5
  33. data/lib/ohai/provides_map.rb +2 -2
  34. data/lib/ohai/system.rb +1 -1
  35. data/lib/ohai/version.rb +1 -1
  36. data/spec/functional/loader_spec.rb +1 -1
  37. data/spec/unit/mixin/command_spec.rb +118 -0
  38. data/spec/unit/plugins/aix/os_spec.rb +6 -5
  39. data/spec/unit/plugins/c_spec.rb +169 -118
  40. data/spec/unit/plugins/digital_ocean_spec.rb +7 -7
  41. data/spec/unit/plugins/dmi_spec.rb +4 -4
  42. data/spec/unit/plugins/ec2_spec.rb +64 -69
  43. data/spec/unit/plugins/linode_spec.rb +6 -6
  44. data/spec/unit/plugins/linux/platform_spec.rb +7 -0
  45. data/spec/unit/plugins/linux/sessions_spec.rb +2 -2
  46. data/spec/unit/plugins/network_spec.rb +16 -16
  47. data/spec/unit/plugins/openstack_spec.rb +1 -1
  48. data/spec/unit/plugins/packages_spec.rb +165 -191
  49. data/spec/unit/plugins/rackspace_spec.rb +203 -130
  50. data/spec/unit/plugins/solaris2/filesystem.rb +2 -2
  51. data/spec/unit/plugins/solaris2/network_spec.rb +36 -5
  52. metadata +3 -3
@@ -53,8 +53,8 @@ describe Ohai::System, "Solaris2.X filesystem plugin" do
53
53
  let(:plugin_config) do
54
54
  {
55
55
  :filesystem => {
56
- :zfs_properties => zfs_properties
57
- }
56
+ :zfs_properties => zfs_properties,
57
+ },
58
58
  }
59
59
  end
60
60
 
@@ -54,6 +54,9 @@ e1000g2:1: flags=201000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS> mtu 1500 ind
54
54
  net0: flags=40201000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS,L3PROTECT> mtu 1500 index 2
55
55
  inet 37.153.96.148 netmask fffffe00 broadcast 37.153.97.255
56
56
  ether 90:b8:d0:16:9b:97
57
+ net1:1: flags=100001000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,PHYSRUNNING> mtu 1500 index 2
58
+ inet 10.16.125.36 netmask fffffe00 broadcast 10.16.125.255
59
+ ether 90:b8:d0:16:9b:97
57
60
  ip.tun0: flags=2200851<UP,POINTOPOINT,RUNNING,MULTICAST,NONUD,IPv6> mtu 1480 index 3
58
61
  inet tunnel src 109.146.85.57 tunnel dst 109.146.85.212
59
62
  tunnel security settings --> use 'ipsecconf -ln -i ip.tun1'
@@ -103,7 +106,18 @@ NETSTAT_RN
103
106
  destination: default
104
107
  mask: default
105
108
  gateway: 10.13.37.1
106
- interface: e1000g0
109
+ interface: e1000g0 index 3
110
+ flags: <UP,GATEWAY,DONE,STATIC>
111
+ recvpipe sendpipe ssthresh rtt,ms rttvar,ms hopcount mtu expire
112
+ 0 0 0 0 0 0 1500 0
113
+ ROUTE_GET
114
+
115
+ @solaris11_route_get = <<-ROUTE_GET
116
+ route to: default
117
+ destination: default
118
+ mask: default
119
+ gateway: 10.13.37.1
120
+ interface: net1 index 2
107
121
  flags: <UP,GATEWAY,DONE,STATIC>
108
122
  recvpipe sendpipe ssthresh rtt,ms rttvar,ms hopcount mtu expire
109
123
  0 0 0 0 0 0 1500 0
@@ -117,13 +131,13 @@ ROUTE_GET
117
131
 
118
132
  allow(@plugin).to receive(:shell_out).with("ifconfig -a").and_return(mock_shell_out(0, @solaris_route_get, ""))
119
133
  allow(@plugin).to receive(:shell_out).with("arp -an").and_return(mock_shell_out(0, @solaris_arp_rn, ""))
120
- allow(@plugin).to receive(:shell_out).with("route -n get default").and_return(mock_shell_out(0, @soalris_route_get, ""))
134
+ allow(@plugin).to receive(:shell_out).with("route -v -n get default").and_return(mock_shell_out(0, @solaris_route_get, ""))
121
135
  end
122
136
 
123
137
  describe "gathering IP layer address info" do
124
138
  before do
125
139
  @stdout = double("Pipe, stdout, cmd=`route get default`", :read => @solaris_route_get)
126
- allow(@plugin).to receive(:shell_out).with("route -n get default").and_return(mock_shell_out(0, @solaris_route_get, ""))
140
+ allow(@plugin).to receive(:shell_out).with("route -v -n get default").and_return(mock_shell_out(0, @solaris_route_get, ""))
127
141
  allow(@plugin).to receive(:shell_out).with("ifconfig -a").and_return(mock_shell_out(0, @solaris_ifconfig, ""))
128
142
  @plugin.run
129
143
  end
@@ -133,7 +147,7 @@ ROUTE_GET
133
147
  end
134
148
 
135
149
  it "detects the interfaces" do
136
- expect(@plugin["network"]["interfaces"].keys.sort).to eq(["e1000g0:3", "e1000g2:1", "eri0", "ip.tun0", "ip.tun0:1", "lo0", "lo0:3", "net0", "qfe1"])
150
+ expect(@plugin["network"]["interfaces"].keys.sort).to eq(["e1000g0:3", "e1000g2:1", "eri0", "ip.tun0", "ip.tun0:1", "lo0", "lo0:3", "net0", "net1:1", "qfe1"])
137
151
  end
138
152
 
139
153
  it "detects the ip addresses of the interfaces" do
@@ -149,12 +163,29 @@ ROUTE_GET
149
163
  end
150
164
  end
151
165
 
166
+ describe "gathering solaris 11 zone IP layer address info" do
167
+ before do
168
+ @stdout = double("Pipe, stdout, cmd=`route get default`", :read => @solaris11_route_get)
169
+ allow(@plugin).to receive(:shell_out).with("route -v -n get default").and_return(mock_shell_out(0, @solaris11_route_get, ""))
170
+ allow(@plugin).to receive(:shell_out).with("ifconfig -a").and_return(mock_shell_out(0, @solaris_ifconfig, ""))
171
+ @plugin.run
172
+ end
173
+
174
+ it "finds the flags for a PHYSRUNNING interface" do
175
+ expect(@plugin[:network][:interfaces]["net1:1"][:flags]).to eq(%w{ UP BROADCAST RUNNING MULTICAST IPv4 PHYSRUNNING })
176
+ end
177
+
178
+ it "finds the default interface for a solaris 11 zone" do
179
+ expect(@plugin[:network][:default_interface]).to eq("net1:1")
180
+ end
181
+ end
182
+
152
183
  # TODO: specs for the arp -an stuff, check that it correctly adds the MAC addr to the right iface, etc.
153
184
 
154
185
  describe "setting the node's default IP address attribute" do
155
186
  before do
156
187
  @stdout = double("Pipe, stdout, cmd=`route get default`", :read => @solaris_route_get)
157
- allow(@plugin).to receive(:shell_out).with("route -n get default").and_return(mock_shell_out(0, @solaris_route_get, ""))
188
+ allow(@plugin).to receive(:shell_out).with("route -v -n get default").and_return(mock_shell_out(0, @solaris_route_get, ""))
158
189
  @plugin.run
159
190
  end
160
191
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ohai
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.13.0
4
+ version: 8.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-24 00:00:00.000000000 Z
11
+ date: 2016-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: systemu
@@ -620,7 +620,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
620
620
  version: '0'
621
621
  requirements: []
622
622
  rubyforge_project:
623
- rubygems_version: 2.6.1
623
+ rubygems_version: 2.6.3
624
624
  signing_key:
625
625
  specification_version: 4
626
626
  summary: Ohai profiles your system and emits JSON