diff options
| author | Matt Robinson <matt@puppetlabs.com> | 2010-11-22 15:41:35 -0800 |
|---|---|---|
| committer | Matt Robinson <matt@puppetlabs.com> | 2010-11-22 15:54:10 -0800 |
| commit | 9332f8a69fcf1f623f57f808085af3e1aafabc38 (patch) | |
| tree | c388f198121bfa13ccfad7f6c978994cfa5e2313 | |
| parent | 5b561e3b02b1dbbfb705566f62c34b404b63d7b4 (diff) | |
(#5325) Add tests for SPARC manufacturer and product name
Just tests the regex, won't actually catch problems if prtdiag doesn't
return output like our test.
Paired-with: Nick Lewis
| -rw-r--r-- | spec/unit/util/manufacturer.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/unit/util/manufacturer.rb b/spec/unit/util/manufacturer.rb index c0d4b13..291a6ff 100644 --- a/spec/unit/util/manufacturer.rb +++ b/spec/unit/util/manufacturer.rb @@ -3,6 +3,10 @@ require File.dirname(__FILE__) + '/../../spec_helper' require 'facter/util/manufacturer' describe Facter::Manufacturer do + before :each do + Facter.clear + end + it "should return the system DMI table" do Facter::Manufacturer.should respond_to(:get_dmi_table) end @@ -12,6 +16,13 @@ describe Facter::Manufacturer do Facter::Manufacturer.get_dmi_table().should be_nil end + it "should parse prtdiag output" do + Facter::Util::Resolution.stubs(:exec).returns("System Configuration: Sun Microsystems sun4u Sun SPARC Enterprise M3000 Server") + Facter::Manufacturer.prtdiag_sparc_find_system_info() + Facter.value(:manufacturer).should == "Sun Microsystems" + Facter.value(:productname).should == "Sun SPARC Enterprise M3000 Server" + end + it "should strip white space on dmi output with spaces" do sample_output_file = File.dirname(__FILE__) + "/../data/linux_dmidecode_with_spaces" dmidecode_output = File.new(sample_output_file).read() @@ -23,7 +34,7 @@ describe Facter::Manufacturer do Facter::Manufacturer.dmi_find_system_info(query) Facter.value(:productname).should == "MS-6754" end - + it "should handle output from smbios when run under sunos" do sample_output_file = File.dirname(__FILE__) + "/../data/opensolaris_smbios" smbios_output = File.new(sample_output_file).read() |
