[Pkg-puppet-devel] [facter] 27/352: adding psrinfo from Solaris with 24 CPUs and using it in processor spec
Stig Sandbeck Mathisen
ssm at debian.org
Sun Apr 6 22:21:28 UTC 2014
This is an automated email from the git hooks/post-receive script.
ssm pushed a commit to branch master
in repository facter.
commit 0fba62bd216e8ac5321c65d6ff0d570bd5e62084
Author: Konstantin Orekhov <korekhov at ebay.com>
Date: Wed May 8 16:21:24 2013 -0700
adding psrinfo from Solaris with 24 CPUs and using it in processor spec
adding psrinfo from Solaris with 24 CPUs and using it in processor spec.
---
spec/fixtures/processorcount/solaris-psrinfo | 24 ++++++++++++++++++++++++
spec/unit/processor_spec.rb | 22 +++++++++-------------
2 files changed, 33 insertions(+), 13 deletions(-)
diff --git a/spec/fixtures/processorcount/solaris-psrinfo b/spec/fixtures/processorcount/solaris-psrinfo
new file mode 100644
index 0000000..a03ce95
--- /dev/null
+++ b/spec/fixtures/processorcount/solaris-psrinfo
@@ -0,0 +1,24 @@
+0 on-line since 10/01/2012 21:05:55
+1 on-line since 10/01/2012 21:06:00
+2 on-line since 10/01/2012 21:06:00
+3 on-line since 10/01/2012 21:06:00
+4 on-line since 10/01/2012 21:06:00
+5 on-line since 10/01/2012 21:06:00
+6 on-line since 10/01/2012 21:06:00
+7 on-line since 10/01/2012 21:06:00
+8 on-line since 10/01/2012 21:06:00
+9 on-line since 10/01/2012 21:06:00
+10 on-line since 10/01/2012 21:06:00
+11 on-line since 10/01/2012 21:06:00
+12 on-line since 10/01/2012 21:06:01
+13 on-line since 10/01/2012 21:06:01
+14 on-line since 10/01/2012 21:06:01
+15 on-line since 10/01/2012 21:06:01
+16 on-line since 10/01/2012 21:06:01
+17 on-line since 10/01/2012 21:06:01
+18 on-line since 10/01/2012 21:06:01
+19 on-line since 10/01/2012 21:06:01
+20 on-line since 10/01/2012 21:06:01
+21 on-line since 10/01/2012 21:06:01
+22 on-line since 10/01/2012 21:06:01
+23 on-line since 10/01/2012 21:06:01
diff --git a/spec/unit/processor_spec.rb b/spec/unit/processor_spec.rb
index 395476a..f5d10ac 100755
--- a/spec/unit/processor_spec.rb
+++ b/spec/unit/processor_spec.rb
@@ -73,15 +73,15 @@ describe "Processor facts" do
end
it "should detect the correct processor count on x86_64" do
- fixture_data = File.read(fixtures('processorcount','solaris-x86_64-kstat-cpu-info'))
- Facter::Util::Resolution.expects(:exec).with("/usr/bin/kstat cpu_info").returns(fixture_data)
- Facter.fact(:processorcount).value.should == 8
+ fixture_data = File.read(fixtures('processorcount','solaris-psrinfo'))
+ Facter::Util::Resolution.expects(:exec).with("/usr/sbin/psrinfo").returns(fixture_data)
+ Facter.fact(:processorcount).value.should == 24
end
it "should detect the correct processor count on sparc" do
- fixture_data = File.read(fixtures('processorcount','solaris-sparc-kstat-cpu-info'))
- Facter::Util::Resolution.expects(:exec).with("/usr/bin/kstat cpu_info").returns(fixture_data)
- Facter.fact(:processorcount).value.should == 8
+ fixture_data = File.read(fixtures('processorcount','solaris-psrinfo'))
+ Facter::Util::Resolution.expects(:exec).with("/usr/sbin/psrinfo").returns(fixture_data)
+ Facter.fact(:processorcount).value.should == 24
end
end
@@ -267,11 +267,6 @@ describe "Processor facts" do
@fixture_kstat_x86_64 = File.read(fixtures('processorcount','solaris-x86_64-kstat-cpu-info'))
end
- let(:psrinfo) do
- "0 on-line since 10/16/2012 14:06:12\n" +
- "1 on-line since 10/16/2012 14:06:14\n"
- end
-
let(:kstat_sparc) { @fixture_kstat_sparc }
let(:kstat_x86_64) { @fixture_kstat_x86_64 }
@@ -292,8 +287,9 @@ describe "Processor facts" do
Facter.fact(:kernel).stubs(:value).returns(:sunos)
Facter.stubs(:value).with(:kernelrelease).returns(release)
- Facter::Util::Resolution.expects(:exec).with("/usr/sbin/psrinfo").returns(psrinfo)
- Facter.fact(:processorcount).value.should == "2"
+ fixture_data = File.read(fixtures('processorcount','solaris-psrinfo'))
+ Facter::Util::Resolution.expects(:exec).with("/usr/sbin/psrinfo").returns(fixture_data)
+ Facter.fact(:processorcount).value.should == "24"
end
end
end
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-puppet/facter.git
More information about the Pkg-puppet-devel
mailing list