diff options
author | Devon Peters <devon.peters@e-hps.com> | 2011-02-02 09:29:53 -0800 |
---|---|---|
committer | Nick Lewis <nick@puppetlabs.com> | 2011-03-01 12:31:30 -0800 |
commit | 9c0e55b43f6db69f060d54c894f2303ecbbe04e3 (patch) | |
tree | 86d05d59d7ad3b9b5250abe8ef6c09a67ec164c7 | |
parent | b1d97284d0fea1cbcc52bc55117a4b1ad3cf385b (diff) | |
download | puppet-9c0e55b43f6db69f060d54c894f2303ecbbe04e3.tar.gz puppet-9c0e55b43f6db69f060d54c894f2303ecbbe04e3.tar.xz puppet-9c0e55b43f6db69f060d54c894f2303ecbbe04e3.zip |
(#5496) Added tests for the new zpool output format
Reviewed-By: Nick Lewis
-rwxr-xr-x | spec/unit/provider/zpool/solaris_spec.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/unit/provider/zpool/solaris_spec.rb b/spec/unit/provider/zpool/solaris_spec.rb index 99e6997e4..f15b7d1f4 100755 --- a/spec/unit/provider/zpool/solaris_spec.rb +++ b/spec/unit/provider/zpool/solaris_spec.rb @@ -76,6 +76,13 @@ describe provider_class do end end + describe "when the vdev is a single mirror on solaris 10u9 or later" do + it "should call create_multi_array with mirror" do + @zpool_data = ["mirrorpool", "mirror-0", "disk1", "disk2"] + @provider.process_zpool_data(@zpool_data)[:mirror].should == ["disk1 disk2"] + end + end + describe "when the vdev is a double mirror" do it "should call create_multi_array with mirror" do @zpool_data = ["mirrorpool", "mirror", "disk1", "disk2", "mirror", "disk3", "disk4"] @@ -83,6 +90,13 @@ describe provider_class do end end + describe "when the vdev is a double mirror on solaris 10u9 or later" do + it "should call create_multi_array with mirror" do + @zpool_data = ["mirrorpool", "mirror-0", "disk1", "disk2", "mirror-1", "disk3", "disk4"] + @provider.process_zpool_data(@zpool_data)[:mirror].should == ["disk1 disk2", "disk3 disk4"] + end + end + describe "when the vdev is a raidz1" do it "should call create_multi_array with raidz1" do @zpool_data = ["mirrorpool", "raidz1", "disk1", "disk2"] @@ -90,6 +104,13 @@ describe provider_class do end end + describe "when the vdev is a raidz1 on solaris 10u9 or later" do + it "should call create_multi_array with raidz1" do + @zpool_data = ["mirrorpool", "raidz1-0", "disk1", "disk2"] + @provider.process_zpool_data(@zpool_data)[:raidz].should == ["disk1 disk2"] + end + end + describe "when the vdev is a raidz2" do it "should call create_multi_array with raidz2 and set the raid_parity" do @zpool_data = ["mirrorpool", "raidz2", "disk1", "disk2"] @@ -98,6 +119,15 @@ describe provider_class do pool[:raid_parity].should == "raidz2" end end + + describe "when the vdev is a raidz2 on solaris 10u9 or later" do + it "should call create_multi_array with raidz2 and set the raid_parity" do + @zpool_data = ["mirrorpool", "raidz2-0", "disk1", "disk2"] + pool = @provider.process_zpool_data(@zpool_data) + pool[:raidz].should == ["disk1 disk2"] + pool[:raid_parity].should == "raidz2" + end + end end describe "when calling the getters and setters" do |