summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCam Cope <ccope@brightcove.com>2014-04-30 23:56:28 -0400
committerBryan McLellan <btm@getchef.com>2014-05-15 09:32:07 -0700
commit227d43e1a8c30e5edcad8d8adc789b8e1355ce2e (patch)
treecb31b3d5cee9304272253321234609821fafd91d
parent030077c5cf6f90fff22f82bf40782b550c382899 (diff)
downloadohai-227d43e1a8c30e5edcad8d8adc789b8e1355ce2e.tar.gz
add test for solaris2 platform
-rw-r--r--spec/unit/plugins/solaris2/platform_spec.rb40
1 files changed, 40 insertions, 0 deletions
diff --git a/spec/unit/plugins/solaris2/platform_spec.rb b/spec/unit/plugins/solaris2/platform_spec.rb
index ad0fc680..6fae7b95 100644
--- a/spec/unit/plugins/solaris2/platform_spec.rb
+++ b/spec/unit/plugins/solaris2/platform_spec.rb
@@ -65,4 +65,44 @@ UNAME_X
end
+ describe "on Solaris 11" do
+ before(:each) do
+ @uname_x = <<-UNAME_X
+System = SunOS
+Node = node.example.com
+Release = 5.11
+KernelID = 11.1
+Machine = i86pc
+BusType = <unknown>
+Serial = <unknown>
+Users = <unknown>
+OEM# = 0
+Origin# = 1
+NumCPU = 1
+UNAME_X
+
+ File.stub(:exists?).with("/sbin/uname").and_return(true)
+ @plugin.stub(:shell_out).with("/sbin/uname -X").and_return(mock_shell_out(0, @uname_x, ""))
+
+ @release = StringIO.new(" Oracle Solaris 11.1 X86\n")
+ File.stub(:open).with("/etc/release").and_yield(@release)
+ end
+
+ it "should run uname and set platform and build" do
+ @plugin.run
+ @plugin[:platform_build].should == "11.1"
+ end
+
+ it "should set the platform" do
+ @plugin.run
+ @plugin[:platform].should == "solaris2"
+ end
+
+ it "should set the platform_version" do
+ @plugin.run
+ @plugin[:platform_version].should == "5.11"
+ end
+
+ end
+
end