summaryrefslogtreecommitdiffstats
path: root/spec/integration
diff options
context:
space:
mode:
authorJosh Cooper <josh@puppetlabs.com>2011-04-21 14:37:50 -0700
committerJosh Cooper <josh@puppetlabs.com>2011-04-21 14:37:50 -0700
commit01f610bb223b435dc52f491260af3ea002930102 (patch)
tree93565136d5ef2b4156fdd64476792e441bcfbb4e /spec/integration
parentac428b9557e2da251e4b51e48de844833ca0aa2a (diff)
parentfc66e98b84b9a16728af054485883334a5887cca (diff)
Merge branch 'next'
Diffstat (limited to 'spec/integration')
-rwxr-xr-xspec/integration/indirector/catalog/queue_spec.rb4
-rwxr-xr-xspec/integration/transaction_spec.rb56
2 files changed, 58 insertions, 2 deletions
diff --git a/spec/integration/indirector/catalog/queue_spec.rb b/spec/integration/indirector/catalog/queue_spec.rb
index 569f096bf..940c8bab8 100755
--- a/spec/integration/indirector/catalog/queue_spec.rb
+++ b/spec/integration/indirector/catalog/queue_spec.rb
@@ -19,13 +19,13 @@ describe "Puppet::Resource::Catalog::Queue", :if => Puppet.features.pson? do
after { Puppet.settings.clear }
- it "should render catalogs to pson and send them via the queue client when catalogs are saved" do
+ it "should render catalogs to pson and publish them via the queue client when catalogs are saved" do
terminus = Puppet::Resource::Catalog.indirection.terminus(:queue)
client = mock 'client'
terminus.stubs(:client).returns client
- client.expects(:send_message).with(:catalog, @catalog.to_pson)
+ client.expects(:publish_message).with(:catalog, @catalog.to_pson)
request = Puppet::Indirector::Request.new(:catalog, :save, "foo", :instance => @catalog)
diff --git a/spec/integration/transaction_spec.rb b/spec/integration/transaction_spec.rb
index 41a1ebac3..78d62fc51 100755
--- a/spec/integration/transaction_spec.rb
+++ b/spec/integration/transaction_spec.rb
@@ -75,6 +75,62 @@ describe Puppet::Transaction do
transaction.evaluate
end
+ it "should not apply device resources on normal host" do
+ catalog = Puppet::Resource::Catalog.new
+ resource = Puppet::Type.type(:interface).new :name => "FastEthernet 0/1"
+ catalog.add_resource resource
+
+ transaction = Puppet::Transaction.new(catalog)
+ transaction.for_network_device = false
+
+ transaction.expects(:apply).never.with(resource, nil)
+
+ transaction.evaluate
+ transaction.resource_status(resource).should be_skipped
+ end
+
+ it "should not apply host resources on device" do
+ catalog = Puppet::Resource::Catalog.new
+ resource = Puppet::Type.type(:file).new :path => "/foo/bar", :backup => false
+ catalog.add_resource resource
+
+ transaction = Puppet::Transaction.new(catalog)
+ transaction.for_network_device = true
+
+ transaction.expects(:apply).never.with(resource, nil)
+
+ transaction.evaluate
+ transaction.resource_status(resource).should be_skipped
+ end
+
+ it "should apply device resources on device" do
+ catalog = Puppet::Resource::Catalog.new
+ resource = Puppet::Type.type(:interface).new :name => "FastEthernet 0/1"
+ catalog.add_resource resource
+
+ transaction = Puppet::Transaction.new(catalog)
+ transaction.for_network_device = true
+
+ transaction.expects(:apply).with(resource, nil)
+
+ transaction.evaluate
+ transaction.resource_status(resource).should_not be_skipped
+ end
+
+ it "should apply resources appliable on host and device on a device" do
+ catalog = Puppet::Resource::Catalog.new
+ resource = Puppet::Type.type(:schedule).new :name => "test"
+ catalog.add_resource resource
+
+ transaction = Puppet::Transaction.new(catalog)
+ transaction.for_network_device = true
+
+ transaction.expects(:apply).with(resource, nil)
+
+ transaction.evaluate
+ transaction.resource_status(resource).should_not be_skipped
+ end
+
# Verify that one component requiring another causes the contained
# resources in the requiring component to get refreshed.
it "should propagate events from a contained resource through its container to its dependent container's contained resources" do