From 97b628a766d14a6a8fe6b3b2febb604a570e0cde Mon Sep 17 00:00:00 2001 From: Claire McQuin Date: Mon, 22 Sep 2014 15:31:47 -0700 Subject: Disable unforked interval runs. Clarify error message. Move fork and interval logic to application (specs pending). Clean code logic, fix specs. Allow unforked client runs with daemonize or splay --- spec/unit/application/solo_spec.rb | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'spec/unit/application/solo_spec.rb') diff --git a/spec/unit/application/solo_spec.rb b/spec/unit/application/solo_spec.rb index 787f9ff43c..e29fcc9367 100644 --- a/spec/unit/application/solo_spec.rb +++ b/spec/unit/application/solo_spec.rb @@ -36,6 +36,31 @@ describe Chef::Application::Solo do Chef::Config[:solo].should be_true end + describe "when configured to not fork the client process" do + before do + Chef::Config[:client_fork] = false + Chef::Config[:daemonize] = false + Chef::Config[:interval] = nil + Chef::Config[:splay] = nil + end + + context "when interval is given" do + before do + Chef::Config[:interval] = 600 + end + + it "should terminate with message" do + Chef::Application.should_receive(:fatal!).with( +"Unforked chef-client interval runs are disabled in Chef 12. +Configuration settings: + interval = 600 seconds +Enable chef-client interval runs by setting `:client_fork = true` in your config file or adding `--fork` to your command line options." + ) + @app.reconfigure + end + end + end + describe "when in daemonized mode and no interval has been set" do before do Chef::Config[:daemonize] = true @@ -142,4 +167,3 @@ describe Chef::Application::Solo do end end - -- cgit v1.2.1