summaryrefslogtreecommitdiff
path: root/spec/support/proxy_server.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/proxy_server.rb')
-rw-r--r--spec/support/proxy_server.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/support/proxy_server.rb b/spec/support/proxy_server.rb
index 721921a..0ef676d 100644
--- a/spec/support/proxy_server.rb
+++ b/spec/support/proxy_server.rb
@@ -28,6 +28,8 @@ class ProxyServer
end
config_file = License::Management.root.join("spec/fixtures/haproxy.cfg")
self.pid = spawn("/usr/sbin/haproxy -f #{config_file}")
+ wait_for_server
+ pid
end
def stop(pid = self.pid)
@@ -49,4 +51,12 @@ class ProxyServer
system("echo '#{ip} #{name}' >> /etc/hosts")
end
+
+ def wait_for_server
+ DOMAINS.each do |domain|
+ puts "Warming up #{domain}..."
+ print "." until system("curl -s -k https://#{domain} > /dev/null")
+ puts "#{domain} is ready!"
+ end
+ end
end