ohai 13.3.0 → 13.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ohai/mixin/azure_metadata.rb +53 -0
  3. data/lib/ohai/plugins/aix/uptime.rb +25 -10
  4. data/lib/ohai/plugins/azure.rb +68 -8
  5. data/lib/ohai/plugins/cloud.rb +4 -2
  6. data/lib/ohai/plugins/digital_ocean.rb +3 -3
  7. data/lib/ohai/plugins/dragonflybsd/os.rb +1 -2
  8. data/lib/ohai/plugins/ec2.rb +24 -16
  9. data/lib/ohai/plugins/eucalyptus.rb +4 -4
  10. data/lib/ohai/plugins/freebsd/os.rb +1 -2
  11. data/lib/ohai/plugins/gce.rb +3 -3
  12. data/lib/ohai/plugins/hostname.rb +3 -3
  13. data/lib/ohai/plugins/linux/cpu.rb +33 -2
  14. data/lib/ohai/plugins/linux/filesystem.rb +47 -39
  15. data/lib/ohai/plugins/linux/systemd_paths.rb +3 -4
  16. data/lib/ohai/plugins/linux/virtualization.rb +6 -2
  17. data/lib/ohai/plugins/network.rb +2 -3
  18. data/lib/ohai/plugins/openstack.rb +2 -3
  19. data/lib/ohai/plugins/os.rb +1 -2
  20. data/lib/ohai/plugins/packages.rb +28 -2
  21. data/lib/ohai/plugins/passwd.rb +1 -2
  22. data/lib/ohai/plugins/rackspace.rb +1 -2
  23. data/lib/ohai/plugins/shard.rb +1 -2
  24. data/lib/ohai/plugins/softlayer.rb +1 -2
  25. data/lib/ohai/plugins/solaris2/virtualization.rb +1 -2
  26. data/lib/ohai/plugins/uptime.rb +1 -2
  27. data/lib/ohai/version.rb +1 -1
  28. data/spec/data/plugins/pacman.output +51 -0
  29. data/spec/unit/mixin/azure_metadata_spec.rb +67 -0
  30. data/spec/unit/mixin/softlayer_metadata_spec.rb +1 -1
  31. data/spec/unit/plugins/aix/uptime_spec.rb +7 -9
  32. data/spec/unit/plugins/azure_spec.rb +81 -0
  33. data/spec/unit/plugins/cloud_spec.rb +37 -5
  34. data/spec/unit/plugins/ec2_spec.rb +34 -12
  35. data/spec/unit/plugins/linux/cpu_spec.rb +123 -87
  36. data/spec/unit/plugins/linux/filesystem_spec.rb +12 -0
  37. data/spec/unit/plugins/linux/virtualization_spec.rb +11 -0
  38. data/spec/unit/plugins/packages_spec.rb +37 -0
  39. metadata +6 -3
@@ -102,6 +102,43 @@ describe Ohai::System, "plugin packages" do
102
102
  end
103
103
  end
104
104
 
105
+ context "on arch" do
106
+ let(:plugin) do
107
+ get_plugin("packages").tap do |plugin|
108
+ plugin[:platform_family] = "arch"
109
+ end
110
+ end
111
+
112
+ let(:stdout) do
113
+ File.read(File.join(SPEC_PLUGIN_PATH, "pacman.output"))
114
+ end
115
+
116
+ before(:each) do
117
+ allow(plugin).to receive(:collect_os).and_return(:linux)
118
+ allow(plugin).to receive(:shell_out).with("LANG=C pacman -Qi").and_return(mock_shell_out(0, stdout, ""))
119
+ plugin.run
120
+ end
121
+
122
+ it "calls LANG=C pacman -Qi" do
123
+ expect(plugin).to receive(:shell_out)
124
+ .with("LANG=C pacman -Qi")
125
+ .and_return(mock_shell_out(0, stdout, ""))
126
+ plugin.run
127
+ end
128
+
129
+ it "gets packages and versions/release - normal case" do
130
+ expect(plugin[:packages]["acl"][:version]).to eq("2.2.52-3")
131
+ expect(plugin[:packages]["acl"][:installdate]).to eq("1500780345")
132
+ expect(plugin[:packages]["acl"][:arch]).to eq("x86_64")
133
+ end
134
+
135
+ it "gets packages and versions/release - multiline optdeps" do
136
+ expect(plugin[:packages]["abcde"][:version]).to eq("2.8.1-2")
137
+ expect(plugin[:packages]["abcde"][:installdate]).to eq("1493998583")
138
+ expect(plugin[:packages]["abcde"][:arch]).to eq("any")
139
+ end
140
+ end
141
+
105
142
  context "on windows", :windows_only do
106
143
 
107
144
  let(:plugin) do
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: 13.3.0
4
+ version: 13.4.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: 2017-08-10 00:00:00.000000000 Z
11
+ date: 2017-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: systemu
@@ -202,6 +202,7 @@ files:
202
202
  - lib/ohai/loader.rb
203
203
  - lib/ohai/log.rb
204
204
  - lib/ohai/mash.rb
205
+ - lib/ohai/mixin/azure_metadata.rb
205
206
  - lib/ohai/mixin/command.rb
206
207
  - lib/ohai/mixin/constant_helper.rb
207
208
  - lib/ohai/mixin/dmi_decode.rb
@@ -361,6 +362,7 @@ files:
361
362
  - spec/data/plugins/lua.output
362
363
  - spec/data/plugins/messages.rb
363
364
  - spec/data/plugins/node.output
365
+ - spec/data/plugins/pacman.output
364
366
  - spec/data/plugins/perl.output
365
367
  - spec/data/plugins/php.output
366
368
  - spec/data/plugins/pkg-query.output
@@ -389,6 +391,7 @@ files:
389
391
  - spec/unit/dsl/plugin_spec.rb
390
392
  - spec/unit/hints_spec.rb
391
393
  - spec/unit/loader_spec.rb
394
+ - spec/unit/mixin/azure_metadata_spec.rb
392
395
  - spec/unit/mixin/command_spec.rb
393
396
  - spec/unit/mixin/ec2_metadata_spec.rb
394
397
  - spec/unit/mixin/softlayer_metadata_spec.rb
@@ -536,7 +539,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
536
539
  version: '0'
537
540
  requirements: []
538
541
  rubyforge_project:
539
- rubygems_version: 2.6.12
542
+ rubygems_version: 2.6.13
540
543
  signing_key:
541
544
  specification_version: 4
542
545
  summary: Ohai profiles your system and emits JSON