summaryrefslogtreecommitdiff
path: root/spec/integration
diff options
context:
space:
mode:
authorJohn Keiser <jkeiser@opscode.com>2013-06-07 16:04:51 -0700
committerJohn Keiser <jkeiser@opscode.com>2013-06-07 16:09:27 -0700
commit0828be160568a88626f93a15df3ac283ed9d2f9d (patch)
tree9f7edb059a8ce8fe8a66579cc728ebad3bf39e93 /spec/integration
parentef034544cb7423bdd9567cd2bd76d2464cfd6924 (diff)
downloadchef-0828be160568a88626f93a15df3ac283ed9d2f9d.tar.gz
Use puma for redirection server, not thin
Diffstat (limited to 'spec/integration')
-rw-r--r--spec/integration/knife/redirection_spec.rb22
1 files changed, 6 insertions, 16 deletions
diff --git a/spec/integration/knife/redirection_spec.rb b/spec/integration/knife/redirection_spec.rb
index 72ba3c2b3f..c6dfcf1dac 100644
--- a/spec/integration/knife/redirection_spec.rb
+++ b/spec/integration/knife/redirection_spec.rb
@@ -1,4 +1,4 @@
-require 'thin'
+require 'puma'
require 'support/shared/integration/integration_helper'
require 'chef/knife/list'
@@ -16,18 +16,11 @@ describe 'redirection' do
app = lambda do |env|
[302, {'Content-Type' => 'text','Location' => "#{@real_chef_server_url}#{env['PATH_INFO']}" }, ['302 found'] ]
end
- Thin::Logging.silent = true
- @redirector_server = Thin::Server.new('127.0.0.1', 9018, app, { :signals => false })
- @redirector_thread = Thread.new do
- begin
- @redirector_server.start
- rescue
- @server_error = $!
- Chef::Log.error("#{$!.message}\n#{$!.backtrace.join("\n")}")
- end
- end
+ @redirector_server = Puma::Server.new(app, Puma::Events.new(STDERR, STDOUT))
+ @redirector_server.add_tcp_listener("127.0.0.1", 9018)
+ @redirector_server.run
Timeout::timeout(5) do
- until @redirector_server.running? || @server_error
+ until @redirector_server.running
sleep(0.01)
end
raise @server_error if @server_error
@@ -36,10 +29,7 @@ describe 'redirection' do
after :each do
Chef::Config.chef_server_url = @real_chef_server_url
- @redirector_thread.kill
- @redirector_thread.join(nil)
- @redirector_thread = nil
- @redirector_server = nil
+ @redirector_server.stop(true)
end
it 'knife list /roles returns the role' do