summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@puppetlabs.com>2011-03-10 16:08:26 -0800
committerDaniel Pittman <daniel@puppetlabs.com>2011-03-10 16:56:35 -0800
commit1a55c7a4c225dc022fa640bf46f7bc940013151d (patch)
tree0930a8790d0c103c347d8a7aa5386cfa9de7a51d
parent0a2a58c8650e8956a4ae464d364310ced244303b (diff)
downloadpuppet-1a55c7a4c225dc022fa640bf46f7bc940013151d.tar.gz
puppet-1a55c7a4c225dc022fa640bf46f7bc940013151d.tar.xz
puppet-1a55c7a4c225dc022fa640bf46f7bc940013151d.zip
(#5479) Test that we auto-require the zone dataset.
This adds a test at the catalog level to ensure that we generate the right graph relationships; this indirectly tests that the underlying code does the right thing, but importantly also makes us fairly immune to low level changes. Reviewed-By: Daniel Pittman <daniel@puppetlabs.com> Reviewed-By: Matt Robinson <matt@puppetlabs.com>
-rwxr-xr-xspec/unit/type/zone_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/unit/type/zone_spec.rb b/spec/unit/type/zone_spec.rb
index 726ccc28d..a3e748bde 100755
--- a/spec/unit/type/zone_spec.rb
+++ b/spec/unit/type/zone_spec.rb
@@ -57,4 +57,24 @@ describe zone do
zone.new(:name => "dummy", :path => "/dummy", :ip => "if", :iptype => :exclusive)
end
+ it "should auto-require :dataset entries" do
+ fs = 'random-pool/some-zfs'
+
+ # ick
+ provider = stub 'zfs::provider'
+ provider.stubs(:name).returns(:solaris)
+ Puppet::Type.type(:zfs).stubs(:defaultprovider).returns(provider)
+
+ catalog = Puppet::Resource::Catalog.new
+ zfs_instance = Puppet::Type.type(:zfs).new(:name => fs)
+ catalog.add_resource zfs_instance
+
+ zone_instance = zone.new(:name => "dummy",
+ :path => "/foo",
+ :ip => 'en1:1.0.0.0',
+ :dataset => fs)
+ catalog.add_resource zone_instance
+
+ catalog.relationship_graph.dependencies(zone_instance).should == [zfs_instance]
+ end
end