summaryrefslogtreecommitdiff
path: root/spec/support/shared
diff options
context:
space:
mode:
authorsdelano <stephen@opscode.com>2017-04-06 09:21:46 -0700
committersdelano <stephen@opscode.com>2017-04-06 10:00:35 -0700
commitadb0a55cb63f394ed23450e41f8a93cd017d225a (patch)
tree0aff07ce4b93eac5d5a31641596ea20653867bcd /spec/support/shared
parentc36bf3013e7c1f54efc6635145a5fb28daf17c7a (diff)
downloadchef-adb0a55cb63f394ed23450e41f8a93cd017d225a.tar.gz
server enforced required recipe
when the chef-server is configured to serve a requried recipe, chef-client shall load the recipe into the run context and execute it as part of the converge phase. if the chef-server is NOT configured, it will return a 404 and chef-client will continue normally. Signed-off-by: Stephen Delano <stephen@chef.io>
Diffstat (limited to 'spec/support/shared')
-rw-r--r--spec/support/shared/context/client.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/support/shared/context/client.rb b/spec/support/shared/context/client.rb
index 3c86e49882..19ce82fa15 100644
--- a/spec/support/shared/context/client.rb
+++ b/spec/support/shared/context/client.rb
@@ -135,6 +135,12 @@ shared_context "a client run" do
and_return({})
end
+ def stub_for_required_recipe
+ response = Net::HTTPNotFound.new("1.1", "404", "Not Found")
+ exception = Net::HTTPServerException.new('404 "Not Found"', response)
+ expect(http_node_load).to receive(:get).with("required_recipe").and_raise(exception)
+ end
+
def stub_for_converge
# define me
end
@@ -165,6 +171,7 @@ shared_context "a client run" do
stub_for_data_collector_init
stub_for_node_load
stub_for_sync_cookbooks
+ stub_for_required_recipe
stub_for_converge
stub_for_audit
stub_for_node_save