[DRE-commits] [ohai] 05/14: debian/patches: update 0001-Drop-dependency-on-wmi-lite.patch
Lucas Kanashiro
kanashiro.duarte at gmail.com
Fri Mar 4 17:49:20 UTC 2016
This is an automated email from the git hooks/post-receive script.
kanashiro-guest pushed a commit to branch master
in repository ohai.
commit 69a9a7daed9a0612fbc25f72de211a314a74ee70
Author: Lucas Kanashiro <kanashiro.duarte at gmail.com>
Date: Fri Mar 4 10:50:31 2016 -0300
debian/patches: update 0001-Drop-dependency-on-wmi-lite.patch
---
debian/changelog | 1 +
.../patches/0001-Drop-dependency-on-wmi-lite.patch | 195 +++++++++++++++++++++
2 files changed, 196 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 896df0a..af18fbd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@ ohai (8.10.0-1) UNRELEASED; urgency=medium
0003-Ruby-plugin-run-only-against-default-Ruby.patch, already applied by
upstream
* debian/control: depends (build and runtime) on ruby-chef-config
+ * debian/patches: update 0001-Drop-dependency-on-wmi-lite.patch
-- Lucas Kanashiro <kanashiro.duarte at gmail.com> Thu, 03 Mar 2016 18:58:48 -0300
diff --git a/debian/patches/0001-Drop-dependency-on-wmi-lite.patch b/debian/patches/0001-Drop-dependency-on-wmi-lite.patch
index c8b7732..f388229 100644
--- a/debian/patches/0001-Drop-dependency-on-wmi-lite.patch
+++ b/debian/patches/0001-Drop-dependency-on-wmi-lite.patch
@@ -52,3 +52,198 @@ wmi-lite is a Windows thing, so we definitely do not need it.
@ohai_system = Ohai::System.new
@plugin = get_plugin("kernel", @ohai_system)
+@@ -61,10 +60,6 @@ describe Ohai::System, "plugin kernel" d
+ allow(os).to receive(:invoke).with(caption.name).and_return('Microsoft Windows 7 Ultimate')
+ allow(os).to receive(:invoke).with(version.name).and_return('6.1.7601')
+
+- os_wmi = WmiLite::Wmi::Instance.new(os)
+-
+- expect_any_instance_of(WmiLite::Wmi).to receive(:first_of).with('Win32_OperatingSystem').and_return(os_wmi)
+-
+ # Mock a Win32_ComputerSystem OLE32 WMI object
+ x64_system_type = 'x64-based PC'
+
+@@ -73,13 +68,9 @@ describe Ohai::System, "plugin kernel" d
+
+ allow(cs).to receive(:invoke).with('SystemType').and_return(x64_system_type)
+
+- cs_wmi = WmiLite::Wmi::Instance.new(cs)
+-
+- expect_any_instance_of(WmiLite::Wmi).to receive(:first_of).with('Win32_ComputerSystem').and_return(cs_wmi)
+-
+ @plugin.run
+ end
+- it "should set the correct system information" do
++ xit "should set the correct system information" do
+ expect(@ohai_system.data[:kernel][:name]).to eq("Microsoft Windows 7 Ultimate")
+ expect(@ohai_system.data[:kernel][:release]).to eq("6.1.7601")
+ expect(@ohai_system.data[:kernel][:version]).to eq("6.1.7601 Service Pack 1 Build 7601")
+--- a/spec/unit/plugins/packages_spec.rb
++++ b/spec/unit/plugins/packages_spec.rb
+@@ -113,7 +113,6 @@ describe Ohai::System, 'plugin packages'
+ end
+
+ context 'on windows', :windows_only do
+- require 'wmi-lite'
+
+ let(:plugin) do
+ get_plugin('packages').tap do |plugin|
+@@ -178,11 +177,10 @@ describe Ohai::System, 'plugin packages'
+
+ before(:each) do
+ allow(plugin).to receive(:collect_os).and_return(:windows)
+- expect_any_instance_of(WmiLite::Wmi).to receive(:instances_of).with('Win32_Product').and_return(win32_product_output)
+ plugin.run
+ end
+
+- it 'gets package info' do
++ xit 'gets package info' do
+ expect(plugin[:packages]['Chef Development Kit v0.7.0'][:version]).to eq('0.7.0.1')
+ expect(plugin[:packages]['Chef Development Kit v0.7.0'][:vendor]).to eq("\"Chef Software, Inc. <maintainers at chef.io>\"")
+ expect(plugin[:packages]['Chef Development Kit v0.7.0'][:installdate]).to eq('20150925')
+--- a/spec/unit/plugins/windows/memory_spec.rb
++++ b/spec/unit/plugins/windows/memory_spec.rb
+@@ -18,7 +18,6 @@ require File.expand_path(File.dirname(__
+
+ describe Ohai::System, "Windows memory plugin", :windows_only do
+ before do
+- require "wmi-lite/wmi"
+ @plugin = get_plugin("windows/memory")
+ mock_os = {
+ "TotalVisibleMemorySize" => "10485760",
+@@ -26,27 +25,26 @@ describe Ohai::System, "Windows memory p
+ "SizeStoredInPagingFiles" => "20971520",
+ "FreeSpaceInPagingFiles" => "15728640"
+ }
+- expect_any_instance_of(WmiLite::Wmi).to receive(:first_of).with('Win32_OperatingSystem').and_return(mock_os)
+ end
+
+- it "should get total memory" do
++ xit "should get total memory" do
+ @plugin.run
+ expect(@plugin["memory"]["total"]).to eql("10485760kB")
+ end
+
+- it "should get free memory" do
++ xit "should get free memory" do
+ @plugin.run
+ expect(@plugin["memory"]["free"]).to eql("5242880kB")
+ end
+
+- it "should get total swap" do
++ xit "should get total swap" do
+ @plugin.run
+ expect(@plugin["memory"]["swap"]["total"]).to eql("20971520kB")
+ end
+
+- it "should get free memory" do
++ xit "should get free memory" do
+ @plugin.run
+ expect(@plugin["memory"]["swap"]["free"]).to eql("15728640kB")
+ end
+
+-end
+\ No newline at end of file
++end
+--- a/spec/functional/plugins/root_group_spec.rb
++++ b/spec/functional/plugins/root_group_spec.rb
+@@ -26,7 +26,7 @@ describe Ohai::System, 'root_group plugi
+ describe 'windows platform', :windows_only do
+ let (:wmi) { wmi = WmiLite::Wmi.new }
+
+- it 'should return the system\'s administrators (root) group' do
++ xit 'should return the system\'s administrators (root) group' do
+ # Notethat the Win32_Group WMI provider can be slow if your
+ # system is domain-joined and has hundreds of thousands of
+ # groups in Active Directory -- not a typical test scenario, but
+--- a/spec/unit/plugins/windows/cpu_spec.rb
++++ b/spec/unit/plugins/windows/cpu_spec.rb
+@@ -60,9 +60,6 @@ describe Ohai::System, 'Windows cpu plug
+ @plugin = get_plugin('windows/cpu')
+ allow(@plugin).to receive(:collect_os).and_return(:windows)
+
+- @double_wmi = double(WmiLite::Wmi)
+- @double_wmi_instance = instance_double(WmiLite::Wmi)
+-
+ @processors = [{ 'description' => 'Intel64 Family 6 Model 70 Stepping 1',
+ 'deviceid' => 'CPU0',
+ 'family' => 2,
+@@ -87,28 +84,20 @@ describe Ohai::System, 'Windows cpu plug
+ 'stepping' => 9,
+ 'l2cachesize' => 64 }]
+
+- allow(WmiLite::Wmi).to receive(:new).and_return(@double_wmi_instance)
+-
+- allow(@double_wmi_instance).to receive(:instances_of)
+- .with('Win32_Processor')
+- .and_return(@processors)
+-
+ @plugin.run
+ end
+
+- it 'should set total cpu to 2' do
++ xit 'should set total cpu to 2' do
+ expect(@plugin[:cpu][:total]).to eq(4)
+ end
+
+- it 'should set real cpu to 2' do
++ xit 'should set real cpu to 2' do
+ expect(@plugin[:cpu][:real]).to eq(2)
+ end
+
+- it 'should set 2 distinct cpus numbered 0 and 1' do
++ xit 'should set 2 distinct cpus numbered 0 and 1' do
+ expect(@plugin[:cpu]).to have_key('0')
+ expect(@plugin[:cpu]).to have_key('1')
+ end
+
+- it_behaves_like 'a cpu', 0
+- it_behaves_like 'a cpu', 1
+ end
+--- a/spec/unit/plugins/windows/virtualization_spec.rb
++++ b/spec/unit/plugins/windows/virtualization_spec.rb
+@@ -28,7 +28,7 @@ describe Ohai::System, 'Windows virtuali
+ end
+
+ context 'when running on vmware' do
+- it 'system is vmware' do
++ xit 'system is vmware' do
+ allow_any_instance_of(WmiLite::Wmi).to receive(:instances_of).with('Win32_BIOS').and_return([{ 'bioscharacteristics' => [4, 7, 8, 9, 10, 11, 12, 14, 15, 16, 19, 26, 27, 28, 29, 30, 32, 39, 40, 41, 42, 50, 57, 58],
+ 'biosversion' => ['INTEL - 6040000', 'PhoenixBIOS 4.0 Release 6.0 '],
+ 'buildnumber' => nil,
+@@ -64,7 +64,7 @@ describe Ohai::System, 'Windows virtuali
+ end
+
+ context 'when running on parallels desktop' do
+- it 'system is parallels' do
++ xit 'system is parallels' do
+ allow_any_instance_of(WmiLite::Wmi).to receive(:instances_of).with('Win32_BIOS').and_return([{ 'bioscharacteristics' => [4, 7, 9, 10, 15, 24, 25, 27, 28, 29, 30, 32, 42, 44, 48, 49, 51, 64, 65, 67],
+ 'biosversion' => ['PRLS - 1'],
+ 'buildnumber' => nil,
+@@ -101,7 +101,7 @@ describe Ohai::System, 'Windows virtuali
+ end
+
+ context 'when running on kvm' do
+- it 'system is kvm' do
++ xit 'system is kvm' do
+ allow_any_instance_of(WmiLite::Wmi).to receive(:instances_of).with('Win32_BIOS').and_return([{ 'bioscharacteristics' => [3, 42, 48, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79],
+ 'biosversion' => ['BOCHS - 1'],
+ 'buildnumber' => nil,
+@@ -137,7 +137,7 @@ describe Ohai::System, 'Windows virtuali
+ end
+
+ context 'when running on virtualbox' do
+- it 'system is vbox' do
++ xit 'system is vbox' do
+ allow_any_instance_of(WmiLite::Wmi).to receive(:instances_of).with('Win32_BIOS').and_return([{ 'bioscharacteristics' => [4, 7, 15, 16, 27, 30, 32],
+ 'biosversion' => ['VBOX - 1'],
+ 'buildnumber' => nil,
+@@ -174,7 +174,7 @@ describe Ohai::System, 'Windows virtuali
+ end
+
+ context 'when running on a hardware system' do
+- it 'does not set virtualization attributes' do
++ xit 'does not set virtualization attributes' do
+ allow_any_instance_of(WmiLite::Wmi).to receive(:instances_of).with('Win32_BIOS').and_return([{ 'bioscharacteristics' => [7, 11, 12, 15, 16, 17, 19, 23, 24, 25, 26, 27, 28, 29, 32, 33, 40, 42, 43],
+ 'biosversion' => ['DELL - 1072009', 'A10', 'American Megatrends - 4028D'],
+ 'buildnumber' => nil,
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ohai.git
More information about the Pkg-ruby-extras-commits
mailing list