ohai 15.2.5 → 15.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ohai/application.rb +2 -2
  3. data/lib/ohai/mixin/dmi_decode.rb +4 -1
  4. data/lib/ohai/plugins/linux/sysctl.rb +38 -0
  5. data/lib/ohai/plugins/linux/virtualization.rb +11 -10
  6. data/lib/ohai/plugins/openstack.rb +8 -3
  7. data/lib/ohai/plugins/passwd.rb +4 -0
  8. data/lib/ohai/version.rb +1 -1
  9. data/spec/functional/application_spec.rb +5 -5
  10. data/spec/functional/loader_spec.rb +2 -2
  11. data/spec/functional/plugins/powershell_spec.rb +11 -5
  12. data/spec/functional/plugins/root_group_spec.rb +1 -1
  13. data/spec/functional/plugins/windows/uptime_spec.rb +3 -3
  14. data/spec/ohai_spec.rb +1 -1
  15. data/spec/spec_helper.rb +8 -8
  16. data/spec/support/integration_helper.rb +3 -3
  17. data/spec/unit/application_spec.rb +5 -5
  18. data/spec/unit/dsl/plugin_spec.rb +8 -7
  19. data/spec/unit/mixin/command_spec.rb +2 -2
  20. data/spec/unit/mixin/dmi_decode.rb +8 -1
  21. data/spec/unit/plugins/abort_spec.rb +4 -4
  22. data/spec/unit/plugins/aix/cpu_spec.rb +1 -1
  23. data/spec/unit/plugins/aix/filesystem_spec.rb +1 -1
  24. data/spec/unit/plugins/aix/hostname_spec.rb +2 -2
  25. data/spec/unit/plugins/aix/kernel_spec.rb +1 -1
  26. data/spec/unit/plugins/aix/memory_spec.rb +5 -5
  27. data/spec/unit/plugins/aix/network_spec.rb +4 -1
  28. data/spec/unit/plugins/aix/platform_spec.rb +4 -4
  29. data/spec/unit/plugins/aix/uptime_spec.rb +3 -3
  30. data/spec/unit/plugins/aix/virtualization_spec.rb +1 -1
  31. data/spec/unit/plugins/azure_spec.rb +8 -8
  32. data/spec/unit/plugins/bsd/filesystem_spec.rb +17 -16
  33. data/spec/unit/plugins/bsd/virtualization_spec.rb +1 -1
  34. data/spec/unit/plugins/c_spec.rb +6 -5
  35. data/spec/unit/plugins/chef_spec.rb +2 -2
  36. data/spec/unit/plugins/cloud_spec.rb +4 -4
  37. data/spec/unit/plugins/darwin/cpu_spec.rb +11 -11
  38. data/spec/unit/plugins/darwin/filesystem_spec.rb +14 -13
  39. data/spec/unit/plugins/darwin/hardware_spec.rb +2 -1
  40. data/spec/unit/plugins/darwin/hostname_spec.rb +3 -3
  41. data/spec/unit/plugins/darwin/kernel_spec.rb +5 -5
  42. data/spec/unit/plugins/darwin/memory_spec.rb +5 -5
  43. data/spec/unit/plugins/darwin/network_spec.rb +3 -3
  44. data/spec/unit/plugins/darwin/platform_spec.rb +9 -9
  45. data/spec/unit/plugins/darwin/virtualization_spec.rb +10 -10
  46. data/spec/unit/plugins/digital_ocean_spec.rb +14 -12
  47. data/spec/unit/plugins/dmi_spec.rb +1 -1
  48. data/spec/unit/plugins/docker_spec.rb +2 -2
  49. data/spec/unit/plugins/ec2_spec.rb +41 -30
  50. data/spec/unit/plugins/elixir_spec.rb +2 -2
  51. data/spec/unit/plugins/erlang_spec.rb +1 -1
  52. data/spec/unit/plugins/eucalyptus_spec.rb +17 -13
  53. data/spec/unit/plugins/fail_spec.rb +15 -15
  54. data/spec/unit/plugins/freebsd/cpu_spec.rb +2 -2
  55. data/spec/unit/plugins/freebsd/hostname_spec.rb +1 -1
  56. data/spec/unit/plugins/freebsd/kernel_spec.rb +2 -2
  57. data/spec/unit/plugins/freebsd/platform_spec.rb +3 -3
  58. data/spec/unit/plugins/gce_spec.rb +9 -7
  59. data/spec/unit/plugins/go_spec.rb +2 -2
  60. data/spec/unit/plugins/groovy_spec.rb +1 -1
  61. data/spec/unit/plugins/haskell_spec.rb +10 -10
  62. data/spec/unit/plugins/hostname_spec.rb +15 -14
  63. data/spec/unit/plugins/init_package_spec.rb +4 -4
  64. data/spec/unit/plugins/java_spec.rb +7 -3
  65. data/spec/unit/plugins/joyent_spec.rb +4 -4
  66. data/spec/unit/plugins/kernel_spec.rb +1 -1
  67. data/spec/unit/plugins/linux/block_device_spec.rb +2 -2
  68. data/spec/unit/plugins/linux/cpu_spec.rb +9 -8
  69. data/spec/unit/plugins/linux/filesystem_spec.rb +36 -35
  70. data/spec/unit/plugins/linux/fips_spec.rb +7 -5
  71. data/spec/unit/plugins/linux/hostname_spec.rb +4 -4
  72. data/spec/unit/plugins/linux/hostnamectl_spec.rb +3 -3
  73. data/spec/unit/plugins/linux/kernel_spec.rb +1 -1
  74. data/spec/unit/plugins/linux/lsb_spec.rb +18 -18
  75. data/spec/unit/plugins/linux/lspci_spec.rb +2 -1
  76. data/spec/unit/plugins/linux/machineid_spec.rb +3 -3
  77. data/spec/unit/plugins/linux/mdadm_spec.rb +13 -13
  78. data/spec/unit/plugins/linux/memory_spec.rb +39 -39
  79. data/spec/unit/plugins/linux/network_spec.rb +20 -19
  80. data/spec/unit/plugins/linux/platform_spec.rb +60 -57
  81. data/spec/unit/plugins/linux/sessions_spec.rb +3 -3
  82. data/spec/unit/plugins/linux/sysctl_spec.rb +53 -0
  83. data/spec/unit/plugins/linux/systemd_paths_spec.rb +3 -3
  84. data/spec/unit/plugins/linux/uptime_spec.rb +5 -5
  85. data/spec/unit/plugins/linux/virtualization_spec.rb +4 -4
  86. data/spec/unit/plugins/lua_spec.rb +1 -1
  87. data/spec/unit/plugins/mono_spec.rb +1 -1
  88. data/spec/unit/plugins/netbsd/hostname_spec.rb +3 -3
  89. data/spec/unit/plugins/netbsd/kernel_spec.rb +2 -2
  90. data/spec/unit/plugins/netbsd/platform_spec.rb +3 -3
  91. data/spec/unit/plugins/network_spec.rb +3 -3
  92. data/spec/unit/plugins/nodejs_spec.rb +1 -1
  93. data/spec/unit/plugins/ohai_spec.rb +2 -2
  94. data/spec/unit/plugins/ohai_time_spec.rb +4 -4
  95. data/spec/unit/plugins/openbsd/hostname_spec.rb +3 -3
  96. data/spec/unit/plugins/openbsd/kernel_spec.rb +2 -2
  97. data/spec/unit/plugins/openbsd/platform_spec.rb +2 -2
  98. data/spec/unit/plugins/openstack_spec.rb +13 -8
  99. data/spec/unit/plugins/os_spec.rb +12 -12
  100. data/spec/unit/plugins/packages_spec.rb +10 -7
  101. data/spec/unit/plugins/passwd_spec.rb +18 -19
  102. data/spec/unit/plugins/perl_spec.rb +1 -1
  103. data/spec/unit/plugins/php_spec.rb +1 -1
  104. data/spec/unit/plugins/platform_spec.rb +7 -7
  105. data/spec/unit/plugins/powershell_spec.rb +1 -1
  106. data/spec/unit/plugins/rackspace_spec.rb +25 -20
  107. data/spec/unit/plugins/root_group_spec.rb +14 -10
  108. data/spec/unit/plugins/ruby_spec.rb +2 -2
  109. data/spec/unit/plugins/rust_spec.rb +3 -3
  110. data/spec/unit/plugins/scala_spec.rb +2 -2
  111. data/spec/unit/plugins/scaleway_spec.rb +14 -12
  112. data/spec/unit/plugins/scsi_spec.rb +2 -1
  113. data/spec/unit/plugins/shard_spec.rb +18 -16
  114. data/spec/unit/plugins/solaris2/cpu_spec.rb +29 -29
  115. data/spec/unit/plugins/solaris2/dmi_spec.rb +4 -4
  116. data/spec/unit/plugins/solaris2/filesystem.rb +3 -3
  117. data/spec/unit/plugins/solaris2/hostname_spec.rb +2 -2
  118. data/spec/unit/plugins/solaris2/kernel_spec.rb +4 -4
  119. data/spec/unit/plugins/solaris2/memory_spec.rb +4 -4
  120. data/spec/unit/plugins/solaris2/platform_spec.rb +9 -9
  121. data/spec/unit/plugins/solaris2/virtualization_spec.rb +6 -6
  122. data/spec/unit/plugins/ssh_host_keys_spec.rb +4 -1
  123. data/spec/unit/plugins/sysconf_spec.rb +2 -2
  124. data/spec/unit/plugins/timezone_spec.rb +2 -2
  125. data/spec/unit/plugins/virtualbox_spec.rb +10 -10
  126. data/spec/unit/plugins/vmware_spec.rb +4 -4
  127. data/spec/unit/plugins/windows/cpu_spec.rb +13 -13
  128. data/spec/unit/plugins/windows/filesystem_spec.rb +1 -1
  129. data/spec/unit/plugins/windows/fips_spec.rb +7 -5
  130. data/spec/unit/plugins/windows/kernel_spec.rb +1 -1
  131. data/spec/unit/plugins/windows/memory_spec.rb +4 -4
  132. data/spec/unit/plugins/windows/network_spec.rb +1 -1
  133. data/spec/unit/plugins/windows/system_enclosure_spec.rb +2 -2
  134. data/spec/unit/plugins/windows/uptime_spec.rb +1 -1
  135. data/spec/unit/plugins/windows/virtualization_spec.rb +1 -1
  136. data/spec/unit/plugins/zpools_spec.rb +2 -0
  137. data/spec/unit/provides_map_spec.rb +18 -18
  138. data/spec/unit/runner_spec.rb +29 -29
  139. data/spec/unit/system_spec.rb +13 -13
  140. data/spec/unit/util/file_helper_spec.rb +1 -1
  141. data/spec/unit/util/ip_helper_spec.rb +6 -6
  142. metadata +4 -2
@@ -34,7 +34,7 @@ describe Ohai::System, "plugin scala" do
34
34
  end
35
35
 
36
36
  context "if scala is installed" do
37
- before(:each) do
37
+ before do
38
38
  setup_plugin
39
39
  plugin.run
40
40
  end
@@ -45,7 +45,7 @@ describe Ohai::System, "plugin scala" do
45
45
  end
46
46
 
47
47
  context "if scala is not installed" do
48
- before(:each) do
48
+ before do
49
49
  allow(plugin).to receive(:shell_out)
50
50
  .and_raise( Ohai::Exceptions::Exec )
51
51
  plugin.run
@@ -20,13 +20,13 @@ require "spec_helper"
20
20
  describe Ohai::System, "plugin scaleway" do
21
21
  let(:plugin) { get_plugin("scaleway") }
22
22
 
23
- before(:each) do
23
+ before do
24
24
  allow(plugin).to receive(:hint?).with("scaleway").and_return(false)
25
25
  allow(File).to receive(:read).with("/proc/cmdline").and_return(false)
26
26
  end
27
27
 
28
28
  shared_examples_for "!scaleway" do
29
- it "should NOT attempt to fetch the scaleway metadata" do
29
+ it "does not attempt to fetch the scaleway metadata" do
30
30
  expect(plugin).not_to receive(:http_client)
31
31
  expect(plugin[:scaleway]).to be_nil
32
32
  plugin.run
@@ -34,7 +34,7 @@ describe Ohai::System, "plugin scaleway" do
34
34
  end
35
35
 
36
36
  shared_examples_for "scaleway" do
37
- before(:each) do
37
+ before do
38
38
  @http_client = double("Net::HTTP client")
39
39
  allow(plugin).to receive(:http_client).and_return(@http_client)
40
40
  allow(IO).to receive(:select).and_return([[], [1], []])
@@ -48,7 +48,7 @@ describe Ohai::System, "plugin scaleway" do
48
48
  '{"tags": [], "state_detail": "booted", "public_ip": {"dynamic": false, "id": "7564c721-a128-444e-9c95-0754a7616482", "address": "5.1.9.3"}, "ssh_public_keys": [{"key": "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEA5qK2s41yyrNpaXXiQtb/1ADaVHVZZp9rYEtG6Dz7trOPtxkxNsaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/j2C+NAzo6TZCLTbJjBf89ieazqVqhY/dMNLDJINY2Ss2ytgyiJm9bp5bYcZz441czijBlmY/qmI0cFCVOJoDq6X9Lmn/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee+hmLFaTE3FeMr1hmeZT2ChH6ruHi8m6m18SfW0fl2fS8zG4yB+WE2IawdsoZmtgtY/Re3CpvhYP9S/JxpUedl+zzzzzzzzzzzzzzzzz5+YONBAt/PWMelXThfMukbwykto6IXmsX2qflBPsRVrWe0D7vt48loVScHDv5D05ZwqWY9rizFqCx3Y8xCLr6649ieonnnjHEsSOBREU507eXVJL6njHard+s+vuTC4bNH5LiP2INQS+9MaT37/l8WzIAL3U+hvcj95HS8KfATX+7XWa54bGJgeOnPle8ojwp1ssl7ddh2yFJozgk2CkUEyE4f1lmEX2YFJGoEoaW0QC2j0nNYiLs37yHG0h84AOgjoIAJo1rxpBAGGJOgFTkgnSdHjtDZsC9WjJYeu/QpxQ7Lf2Z+FCKoypfnZz/F10/z6nxnkZ3IKKM=", "fingerprint": "4096 4c:71:db:64:cd:24:da:4a:fa:5f:9e:70:af:ea:40:6e (no comment) (RSA)"}], "private_ip": "10.8.23.7", "timezone": "UTC", "id": "77fab916-e7ff-44c6-a025-ae08837b4c4f", "extra_networks": [], "name": "sample-hostname", "hostname": "sample-hostname", "bootscript": {"kernel": "http://169.254.42.24/kernel/x86_64-4.9.20-std-1/vmlinuz-4.9.20-std-1", "title": "x86_64 4.9.20 std #1 (longterm/latest)", "default": false, "dtb": "", "public": false, "initrd": "http://169.254.42.24/initrd/initrd-Linux-x86_64-v3.12.7.gz", "bootcmdargs": "LINUX_COMMON scaleway boot=local", "architecture": "x86_64", "organization": "11111110-1112-4112-8112-111111111116", "id": "855f21ba-e7f9-421d-91b0-976a6ad59910"}, "location": {"platform_id": "21", "hypervisor_id": "518", "node_id": "4", "cluster_id": "82", "zone_id": "par1"}, "volumes": {"0": {"name": "x86_64-debian-stretch-2017-06-29_10:17", "modification_date": "2018-01-26T10:22:28.268074+00:00", "export_uri": "device://dev/vda", "volume_type": "l_ssd", "creation_date": "2018-01-26T10:22:28.268074+00:00", "organization": "90f39224-d0a2-4771-a2f0-1036a9402b97", "server": {"id": "77fab916-e7ff-44c6-a024-ae08837b4c4f", "name": "sample-hostname"}, "id": "3be53d4d-93d7-4430-a513-61cb4410624b", "size": 50000000000}}, "ipv6": null, "organization": "89f39224-d0a2-4771-a2f0-1036a9402b97", "commercial_type": "VC1S"}'
49
49
  end
50
50
 
51
- it "should fetch and properly parse json metadata" do
51
+ it "fetches and properly parse json metadata" do
52
52
  expect(@http_client).to receive(:get)
53
53
  .with("/conf?format=json")
54
54
  .and_return(double("Net::HTTP Response", body: body, code: "200"))
@@ -59,7 +59,7 @@ describe Ohai::System, "plugin scaleway" do
59
59
  expect(plugin[:scaleway]["hostname"]).to eq("sample-hostname")
60
60
  end
61
61
 
62
- it "should complete the run despite unavailable metadata" do
62
+ it "completes the run despite unavailable metadata" do
63
63
  expect(@http_client).to receive(:get)
64
64
  .with("/conf?format=json")
65
65
  .and_return(double("Net::HTTP Response", body: "", code: "404"))
@@ -70,22 +70,24 @@ describe Ohai::System, "plugin scaleway" do
70
70
  end
71
71
 
72
72
  describe "without hint or cmdline" do
73
- it_should_behave_like "!scaleway"
73
+ it_behaves_like "!scaleway"
74
74
  end
75
75
 
76
76
  describe "with scaleway hint file" do
77
- it_should_behave_like "scaleway"
78
-
79
- before(:each) do
77
+ before do
80
78
  allow(plugin).to receive(:hint?).with("scaleway").and_return(true)
81
79
  end
80
+
81
+ it_behaves_like "scaleway"
82
+
82
83
  end
83
84
 
84
85
  describe "with scaleway cmdline" do
85
- it_should_behave_like "scaleway"
86
-
87
- before(:each) do
86
+ before do
88
87
  allow(File).to receive(:read).with("/proc/cmdline").and_return("initrd=initrd showopts console=ttyS0,115200 nousb vga=0 root=/dev/vda scaleway boot=local")
89
88
  end
89
+
90
+ it_behaves_like "scaleway"
91
+
90
92
  end
91
93
  end
@@ -20,7 +20,8 @@ require "spec_helper"
20
20
 
21
21
  describe Ohai::System, "lsscsi plugin" do
22
22
  let(:plugin) { get_plugin("scsi") }
23
- before(:each) do
23
+
24
+ before do
24
25
  allow(plugin).to receive(:collect_os).and_return(:linux)
25
26
  @stdout = <<~LSSCSI
26
27
  [5:0:0:0] disk ATA Hitachi HUA72205 A3EA /dev/sda
@@ -20,6 +20,11 @@ require "digest/md5"
20
20
  require "spec_helper"
21
21
 
22
22
  describe Ohai::System, "shard plugin" do
23
+ subject do
24
+ plugin.run
25
+ plugin[:shard_seed]
26
+ end
27
+
23
28
  let(:plugin) { get_plugin("shard") }
24
29
  let(:fqdn) { "somehost004.someregion.somecompany.com" }
25
30
  let(:uuid) { "48555CF4-5BB1-21D9-BC4C-E8B73DDE5801" }
@@ -29,12 +34,7 @@ describe Ohai::System, "shard plugin" do
29
34
  let(:fips) { false }
30
35
  let(:os) { "linux" }
31
36
 
32
- subject do
33
- plugin.run
34
- plugin[:shard_seed]
35
- end
36
-
37
- before(:each) do
37
+ before do
38
38
  plugin["machinename"] = machinename
39
39
  plugin["machine_id"] = machine_id
40
40
  plugin["fqdn"] = fqdn
@@ -45,11 +45,11 @@ describe Ohai::System, "shard plugin" do
45
45
  allow(plugin).to receive(:collect_os).and_return(os)
46
46
  end
47
47
 
48
- it "should provide a shard with a default-safe set of sources" do
48
+ it "provides a shard with a default-safe set of sources" do
49
49
  expect(subject).to eq(27767217)
50
50
  end
51
51
 
52
- it "should provide a shard with a configured source" do
52
+ it "provides a shard with a configured source" do
53
53
  Ohai.config[:plugin][:shard_seed][:sources] = [:fqdn]
54
54
  expect(subject).to eq(203669792)
55
55
  end
@@ -59,26 +59,28 @@ describe Ohai::System, "shard plugin" do
59
59
  expect { subject }.to raise_error(RuntimeError)
60
60
  end
61
61
 
62
- it "should provide a shard with a configured algorithm" do
62
+ it "provides a shard with a configured algorithm" do
63
63
  Ohai.config[:plugin][:shard_seed][:digest_algorithm] = "sha256"
64
- expect(Digest::MD5).to_not receive(:new)
64
+ expect(Digest::MD5).not_to receive(:new)
65
65
  expect(subject).to eq(117055036)
66
66
  end
67
67
 
68
68
  context "with Darwin OS" do
69
69
  let(:os) { "darwin" }
70
+
70
71
  before do
71
72
  plugin.data.delete("fips") # FIPS is undefined on Macs, make sure this still work
72
73
  plugin["hardware"] = { "serial_number" => serial, "platform_UUID" => uuid }
73
74
  end
74
75
 
75
- it "should provide a shard with a default-safe set of sources" do
76
+ it "provides a shard with a default-safe set of sources" do
76
77
  expect(subject).to eq(27767217)
77
78
  end
78
79
  end
79
80
 
80
81
  context "with Windows OS" do
81
82
  let(:os) { "windows" }
83
+
82
84
  before do
83
85
  wmi = double("WmiLite::Wmi")
84
86
  allow(WmiLite::Wmi).to receive(:new).and_return(wmi)
@@ -88,11 +90,11 @@ describe Ohai::System, "shard plugin" do
88
90
  plugin.data.delete("dmi") # To make sure we aren't using the wrong data.
89
91
  end
90
92
 
91
- it "should provide a shard with a default-safe set of sources" do
93
+ it "provides a shard with a default-safe set of sources" do
92
94
  expect(subject).to eq(27767217)
93
95
  end
94
96
 
95
- it "should allow os_serial source" do
97
+ it "allows os_serial source" do
96
98
  Ohai.config[:plugin][:shard_seed][:sources] = %i{machinename os_serial uuid}
97
99
  # Different from above.
98
100
  expect(subject).to eq(178738102)
@@ -102,7 +104,7 @@ describe Ohai::System, "shard plugin" do
102
104
  context "with a weird OS" do
103
105
  let(:os) { "aix" }
104
106
 
105
- it "should provide a shard with a default-safe set of sources" do
107
+ it "provides a shard with a default-safe set of sources" do
106
108
  # Note: this is different than the other defaults.
107
109
  expect(subject).to eq(253499154)
108
110
  end
@@ -111,8 +113,8 @@ describe Ohai::System, "shard plugin" do
111
113
  context "with FIPS mode enabled" do
112
114
  let(:fips) { true }
113
115
 
114
- it "should use SHA2" do
115
- expect(Digest::MD5).to_not receive(:hexdigest)
116
+ it "uses SHA2" do
117
+ expect(Digest::MD5).not_to receive(:hexdigest)
116
118
  expect(subject).to eq(117055036)
117
119
  end
118
120
  end
@@ -17,13 +17,13 @@
17
17
  require "spec_helper"
18
18
 
19
19
  describe Ohai::System, "Solaris2.X cpu plugin" do
20
- before(:each) do
20
+ before do
21
21
  @plugin = get_plugin("cpu")
22
22
  allow(@plugin).to receive(:collect_os).and_return("solaris2")
23
23
  end
24
24
 
25
25
  describe "on x86 processors" do
26
- before(:each) do
26
+ before do
27
27
  kstatinfo_output = <<~END
28
28
  cpu_info:0:cpu_info0:brand Crazy(r) Argon(r) CPU Y5570 @ 1.93GHz
29
29
  cpu_info:0:cpu_info0:cache_id 1
@@ -446,28 +446,28 @@ describe Ohai::System, "Solaris2.X cpu plugin" do
446
446
  @plugin.run
447
447
  end
448
448
 
449
- it "should get the total virtual processor count" do
449
+ it "gets the total virtual processor count" do
450
450
  expect(@plugin["cpu"]["total"]).to eql(16)
451
451
  end
452
452
 
453
- it "should get the total processor count" do
453
+ it "gets the total processor count" do
454
454
  expect(@plugin["cpu"]["real"]).to eql(2)
455
455
  end
456
456
 
457
- it "should get the number of threads per core" do
457
+ it "gets the number of threads per core" do
458
458
  expect(@plugin["cpu"]["corethreads"]).to eql(2)
459
459
  end
460
460
 
461
- it "should get the total number of online cores" do
461
+ it "gets the total number of online cores" do
462
462
  expect(@plugin["cpu"]["cpustates"]["on-line"]).to eql(8)
463
463
  end
464
464
 
465
- it "should get the total number of offline cores" do
465
+ it "gets the total number of offline cores" do
466
466
  expect(@plugin["cpu"]["cpustates"]["off-line"]).to eql(8)
467
467
  end
468
468
 
469
469
  describe "per-cpu information" do
470
- it "should include processor vendor_ids" do
470
+ it "includes processor vendor_ids" do
471
471
  # CPU Socket 0
472
472
  expect(@plugin["cpu"]["15"]["vendor_id"]).to eql("GenuineIntel")
473
473
  expect(@plugin["cpu"]["13"]["vendor_id"]).to eql("GenuineIntel")
@@ -488,7 +488,7 @@ describe Ohai::System, "Solaris2.X cpu plugin" do
488
488
  expect(@plugin["cpu"]["0"]["vendor_id"]).to eql("CrazyTown")
489
489
  end
490
490
 
491
- it "should include processor families" do
491
+ it "includes processor families" do
492
492
  expect(@plugin["cpu"]["15"]["family"]).to eql("6")
493
493
  expect(@plugin["cpu"]["13"]["family"]).to eql("6")
494
494
  expect(@plugin["cpu"]["11"]["family"]).to eql("6")
@@ -508,7 +508,7 @@ describe Ohai::System, "Solaris2.X cpu plugin" do
508
508
  expect(@plugin["cpu"]["0"]["family"]).to eql("12")
509
509
  end
510
510
 
511
- it "should include processor models" do
511
+ it "includes processor models" do
512
512
  expect(@plugin["cpu"]["15"]["model"]).to eql("26")
513
513
  expect(@plugin["cpu"]["13"]["model"]).to eql("26")
514
514
  expect(@plugin["cpu"]["11"]["model"]).to eql("26")
@@ -528,7 +528,7 @@ describe Ohai::System, "Solaris2.X cpu plugin" do
528
528
  expect(@plugin["cpu"]["0"]["model"]).to eql("93")
529
529
  end
530
530
 
531
- it "should includ processor architecture" do
531
+ it "includs processor architecture" do
532
532
  expect(@plugin["cpu"]["15"]["arch"]).to eql("i386")
533
533
  expect(@plugin["cpu"]["13"]["arch"]).to eql("i386")
534
534
  expect(@plugin["cpu"]["11"]["arch"]).to eql("i386")
@@ -548,7 +548,7 @@ describe Ohai::System, "Solaris2.X cpu plugin" do
548
548
  expect(@plugin["cpu"]["0"]["arch"]).to eql("i386")
549
549
  end
550
550
 
551
- it "should include processor stepping" do
551
+ it "includes processor stepping" do
552
552
  expect(@plugin["cpu"]["15"]["stepping"]).to eql("5")
553
553
  expect(@plugin["cpu"]["13"]["stepping"]).to eql("5")
554
554
  expect(@plugin["cpu"]["11"]["stepping"]).to eql("5")
@@ -569,7 +569,7 @@ describe Ohai::System, "Solaris2.X cpu plugin" do
569
569
 
570
570
  end
571
571
 
572
- it "should include processor model names" do
572
+ it "includes processor model names" do
573
573
  expect(@plugin["cpu"]["15"]["model_name"]).to eql("Intel(r) Xeon(r) CPU X5570 @ 2.93GHz")
574
574
  expect(@plugin["cpu"]["13"]["model_name"]).to eql("Intel(r) Xeon(r) CPU X5570 @ 2.93GHz")
575
575
  expect(@plugin["cpu"]["11"]["model_name"]).to eql("Intel(r) Xeon(r) CPU X5570 @ 2.93GHz")
@@ -588,7 +588,7 @@ describe Ohai::System, "Solaris2.X cpu plugin" do
588
588
  expect(@plugin["cpu"]["0"]["model_name"]).to eql("Crazy(r) Argon(r) CPU Y5570 @ 1.93GHz")
589
589
  end
590
590
 
591
- it "should include processor speed in MHz" do
591
+ it "includes processor speed in MHz" do
592
592
  expect(@plugin["cpu"]["15"]["mhz"]).to eql("2926")
593
593
  expect(@plugin["cpu"]["13"]["mhz"]).to eql("2926")
594
594
  expect(@plugin["cpu"]["11"]["mhz"]).to eql("2926")
@@ -607,7 +607,7 @@ describe Ohai::System, "Solaris2.X cpu plugin" do
607
607
  expect(@plugin["cpu"]["0"]["mhz"]).to eql("1933")
608
608
  end
609
609
 
610
- it "should include processor state" do
610
+ it "includes processor state" do
611
611
  expect(@plugin["cpu"]["15"]["state"]).to eql("on-line")
612
612
  expect(@plugin["cpu"]["13"]["state"]).to eql("on-line")
613
613
  expect(@plugin["cpu"]["11"]["state"]).to eql("on-line")
@@ -629,7 +629,7 @@ describe Ohai::System, "Solaris2.X cpu plugin" do
629
629
  end
630
630
 
631
631
  describe "on sparc processors" do
632
- before(:each) do
632
+ before do
633
633
  kstatinfo_output = <<~END
634
634
  cpu_info:0:cpu_info0:brand SPARC-T3
635
635
  cpu_info:0:cpu_info0:chip_id 0
@@ -2812,32 +2812,32 @@ describe Ohai::System, "Solaris2.X cpu plugin" do
2812
2812
  @plugin.run
2813
2813
  end
2814
2814
 
2815
- it "should get the total virtual processor count" do
2815
+ it "gets the total virtual processor count" do
2816
2816
  expect(@plugin["cpu"]["total"]).to eql(128)
2817
2817
  end
2818
2818
 
2819
- it "should get the total processor count" do
2819
+ it "gets the total processor count" do
2820
2820
  expect(@plugin["cpu"]["real"]).to eql(1)
2821
2821
  end
2822
2822
 
2823
- it "should get the total core count" do
2823
+ it "gets the total core count" do
2824
2824
  expect(@plugin["cpu"]["cores"]).to eql(16)
2825
2825
  end
2826
2826
 
2827
- it "should get the number of threads per core" do
2827
+ it "gets the number of threads per core" do
2828
2828
  expect(@plugin["cpu"]["corethreads"]).to eql(8)
2829
2829
  end
2830
2830
 
2831
- it "should get the total number of online cores" do
2831
+ it "gets the total number of online cores" do
2832
2832
  expect(@plugin["cpu"]["cpustates"]["on-line"]).to eql(124)
2833
2833
  end
2834
2834
 
2835
- it "should get the total number of offline cores" do
2835
+ it "gets the total number of offline cores" do
2836
2836
  expect(@plugin["cpu"]["cpustates"]["off-line"]).to eql(4)
2837
2837
  end
2838
2838
 
2839
2839
  describe "per-cpu information" do
2840
- it "should include processor model names" do
2840
+ it "includes processor model names" do
2841
2841
  expect(@plugin["cpu"]["0"]["model_name"]).to eql("SPARC-T3")
2842
2842
  expect(@plugin["cpu"]["1"]["model_name"]).to eql("SPARC-T3")
2843
2843
  expect(@plugin["cpu"]["2"]["model_name"]).to eql("SPARC-T3")
@@ -2848,7 +2848,7 @@ describe Ohai::System, "Solaris2.X cpu plugin" do
2848
2848
  expect(@plugin["cpu"]["127"]["model_name"]).to eql("SPARC-T4")
2849
2849
  end
2850
2850
 
2851
- it "should include processor sockets" do
2851
+ it "includes processor sockets" do
2852
2852
  expect(@plugin["cpu"]["0"]["socket"]).to eql("0")
2853
2853
  expect(@plugin["cpu"]["1"]["socket"]).to eql("0")
2854
2854
  expect(@plugin["cpu"]["2"]["socket"]).to eql("0")
@@ -2859,7 +2859,7 @@ describe Ohai::System, "Solaris2.X cpu plugin" do
2859
2859
  expect(@plugin["cpu"]["127"]["socket"]).to eql("0")
2860
2860
  end
2861
2861
 
2862
- it "should include processor MHz" do
2862
+ it "includes processor MHz" do
2863
2863
  expect(@plugin["cpu"]["0"]["mhz"]).to eql("1649")
2864
2864
  expect(@plugin["cpu"]["1"]["mhz"]).to eql("1649")
2865
2865
  expect(@plugin["cpu"]["2"]["mhz"]).to eql("1649")
@@ -2870,7 +2870,7 @@ describe Ohai::System, "Solaris2.X cpu plugin" do
2870
2870
  expect(@plugin["cpu"]["127"]["mhz"]).to eql("1649")
2871
2871
  end
2872
2872
 
2873
- it "should include processor core IDs" do
2873
+ it "includes processor core IDs" do
2874
2874
  expect(@plugin["cpu"]["0"]["core_id"]).to eql("1026")
2875
2875
  expect(@plugin["cpu"]["8"]["core_id"]).to eql("1033")
2876
2876
  expect(@plugin["cpu"]["16"]["core_id"]).to eql("1040")
@@ -2889,7 +2889,7 @@ describe Ohai::System, "Solaris2.X cpu plugin" do
2889
2889
  expect(@plugin["cpu"]["120"]["core_id"]).to eql("1131")
2890
2890
  end
2891
2891
 
2892
- it "should include processor architecture" do
2892
+ it "includes processor architecture" do
2893
2893
  expect(@plugin["cpu"]["0"]["arch"]).to eql("sparcv9")
2894
2894
  expect(@plugin["cpu"]["1"]["arch"]).to eql("sparcv9")
2895
2895
  expect(@plugin["cpu"]["2"]["arch"]).to eql("sparcv9")
@@ -2900,7 +2900,7 @@ describe Ohai::System, "Solaris2.X cpu plugin" do
2900
2900
  expect(@plugin["cpu"]["127"]["arch"]).to eql("sparcv9")
2901
2901
  end
2902
2902
 
2903
- it "should include processor FPU type" do
2903
+ it "includes processor FPU type" do
2904
2904
  expect(@plugin["cpu"]["0"]["fpu_type"]).to eql("sparcv9")
2905
2905
  expect(@plugin["cpu"]["1"]["fpu_type"]).to eql("sparcv9")
2906
2906
  expect(@plugin["cpu"]["2"]["fpu_type"]).to eql("sparcv9")
@@ -2911,7 +2911,7 @@ describe Ohai::System, "Solaris2.X cpu plugin" do
2911
2911
  expect(@plugin["cpu"]["127"]["fpu_type"]).to eql("sparcv9")
2912
2912
  end
2913
2913
 
2914
- it "should include processor state" do
2914
+ it "includes processor state" do
2915
2915
  expect(@plugin["cpu"]["0"]["state"]).to eql("on-line")
2916
2916
  expect(@plugin["cpu"]["1"]["state"]).to eql("on-line")
2917
2917
  expect(@plugin["cpu"]["2"]["state"]).to eql("on-line")
@@ -112,14 +112,14 @@ SOLARIS_DMI_OUT = <<~EOS.freeze
112
112
  EOS
113
113
 
114
114
  describe Ohai::System, "Solaris2.X DMI plugin" do
115
- before(:each) do
115
+ before do
116
116
  @plugin = get_plugin("solaris2/dmi")
117
117
  allow(@plugin).to receive(:collect_os).and_return("solaris2")
118
118
  @stdout = SOLARIS_DMI_OUT
119
119
  allow(@plugin).to receive(:shell_out).with("smbios").and_return(mock_shell_out(0, @stdout, ""))
120
120
  end
121
121
 
122
- it "should run smbios" do
122
+ it "runs smbios" do
123
123
  expect(@plugin).to receive(:shell_out).with("smbios").and_return(mock_shell_out(0, @stdout, ""))
124
124
  @plugin.run
125
125
  end
@@ -139,14 +139,14 @@ describe Ohai::System, "Solaris2.X DMI plugin" do
139
139
  },
140
140
  }.each do |id, data|
141
141
  data.each do |attribute, value|
142
- it "should have [:dmi][:#{id}][:#{attribute}] set" do
142
+ it "has [:dmi][:#{id}][:#{attribute}] set" do
143
143
  @plugin.run
144
144
  expect(@plugin[:dmi][id][attribute]).to eql(value)
145
145
  end
146
146
  end
147
147
  end
148
148
 
149
- it "should ignore unwanted types" do
149
+ it "ignores unwanted types" do
150
150
  @plugin.run
151
151
  expect(@plugin[:dmi]).not_to have_key(:on_board_devices)
152
152
  end
@@ -20,14 +20,14 @@ require_relative "spec_helper"
20
20
  describe Ohai::System, "Solaris2.X filesystem plugin" do
21
21
  let(:plugin) { get_plugin("filesystem") }
22
22
 
23
- before(:each) do
23
+ before do
24
24
  allow(plugin).to receive(:collect_os).and_return("solaris2")
25
25
  end
26
26
 
27
27
  describe "filesystem properties" do
28
28
  let(:plugin_config) { {} }
29
29
 
30
- before(:each) do
30
+ before do
31
31
  @original_plugin_config = Ohai.config[:plugin]
32
32
  Ohai.config[:plugin] = plugin_config
33
33
  allow(plugin).to receive(:shell_out).with("df -Pka").and_return(mock_shell_out(0, "", ""))
@@ -326,7 +326,7 @@ describe Ohai::System, "Solaris2.X filesystem plugin" do
326
326
  ZFS_GET
327
327
  end
328
328
 
329
- after(:each) do
329
+ after do
330
330
  Ohai.config[:plugin] = @original_plugin_config
331
331
  end
332
332