summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNuo Yan <nuo@opscode.com>2011-06-03 11:51:22 -0700
committerNuo Yan <nuo@opscode.com>2011-06-03 11:51:22 -0700
commit2a6f8e6ecd6a3202f8654500d0c23f696ce2dd62 (patch)
tree98646c6a53504a52a9d04b0f7e075dbb7b07bb91
parent16dd475cd3470de9f1f3818c22916ba6670b806f (diff)
downloadchef-2a6f8e6ecd6a3202f8654500d0c23f696ce2dd62.tar.gz
CHEF-2235: Set timeout for freebsd port compile to 20 mins
-rw-r--r--chef/lib/chef/provider/package/freebsd.rb2
-rw-r--r--chef/spec/unit/provider/package/freebsd_spec.rb8
2 files changed, 5 insertions, 5 deletions
diff --git a/chef/lib/chef/provider/package/freebsd.rb b/chef/lib/chef/provider/package/freebsd.rb
index bfefd1c69d..139bbe02d7 100644
--- a/chef/lib/chef/provider/package/freebsd.rb
+++ b/chef/lib/chef/provider/package/freebsd.rb
@@ -94,7 +94,7 @@ class Chef
unless @current_resource.version
case @new_resource.source
when /^ports$/
- shell_out!("make -DBATCH -f #{port_path}/Makefile install", :env => nil).status
+ shell_out!("make -DBATCH -f #{port_path}/Makefile install", :timeout => 1200, :env => nil).status
when /^http/, /^ftp/
shell_out!("pkg_add -r #{package_name}", :env => { "PACKAGESITE" => @new_resource.source, 'LC_ALL' => nil }).status
Chef::Log.debug("#{@new_resource} installed from: #{@new_resource.source}")
diff --git a/chef/spec/unit/provider/package/freebsd_spec.rb b/chef/spec/unit/provider/package/freebsd_spec.rb
index 1369adbabd..56dd9a6322 100644
--- a/chef/spec/unit/provider/package/freebsd_spec.rb
+++ b/chef/spec/unit/provider/package/freebsd_spec.rb
@@ -130,7 +130,7 @@ describe Chef::Provider::Package::Freebsd, "load_current_resource" do
it "should run make install when installing from ports" do
@new_resource.stub!(:source).and_return("ports")
@provider.should_receive(:port_path).and_return("/usr/ports/shells/zsh")
- @provider.should_receive(:shell_out!).with("make -DBATCH -f /usr/ports/shells/zsh/Makefile install", :env=>nil).and_return(@cmd_result)
+ @provider.should_receive(:shell_out!).with("make -DBATCH -f /usr/ports/shells/zsh/Makefile install", :timeout => 1200, :env=>nil).and_return(@cmd_result)
@provider.install_package("zsh", "4.3.6_7")
end
end
@@ -176,7 +176,7 @@ describe Chef::Provider::Package::Freebsd, "load_current_resource" do
@provider.stub!(:port_path).and_return("/usr/ports/converters/ruby-iconv")
@provider.stub!(:package_name).and_return("ruby18-iconv")
@provider.stub!(:latest_link_name).and_return("ruby18-iconv")
-
+
@install_result = OpenStruct.new(:status => true)
end
@@ -187,7 +187,7 @@ describe Chef::Provider::Package::Freebsd, "load_current_resource" do
it "should run make install when installing from ports" do
@new_resource.stub!(:source).and_return("ports")
- @provider.should_receive(:shell_out!).with("make -DBATCH -f /usr/ports/converters/ruby-iconv/Makefile install", :env=>nil).and_return(@install_result)
+ @provider.should_receive(:shell_out!).with("make -DBATCH -f /usr/ports/converters/ruby-iconv/Makefile install", :timeout => 1200, :env=>nil).and_return(@install_result)
@provider.install_package("ruby-iconv", "1.0")
end
end
@@ -239,7 +239,7 @@ describe Chef::Provider::Package::Freebsd, "load_current_resource" do
end
it "should install the mysql50-server binary package with the correct name" do
-
+
@new_resource = Chef::Resource::Package.new("mysql50-server")
@current_resource = Chef::Resource::Package.new("mysql50-server")
@provider = Chef::Provider::Package::Freebsd.new(@new_resource, @run_context)