summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2015-06-30 16:46:32 -0700
committerelijah <elijah@riseup.net>2015-06-30 16:46:32 -0700
commit12a07985492c97a2d2ef683ec04ef82fa82d3b82 (patch)
tree93f9cff8276e0217f2b39581a9682a97006c00ae
parent343818aca5a9607b0adeacb8235eb8cdcbca01be (diff)
more verbose stunnel test errors
-rw-r--r--tests/helpers/network_helper.rb2
-rw-r--r--tests/white-box/network.rb5
2 files changed, 5 insertions, 2 deletions
diff --git a/tests/helpers/network_helper.rb b/tests/helpers/network_helper.rb
index ff92d382..713d57aa 100644
--- a/tests/helpers/network_helper.rb
+++ b/tests/helpers/network_helper.rb
@@ -70,7 +70,7 @@ class LeapTest
#try_tcp_write(socket,1)
#try_tcp_read(socket,1)
rescue StandardError => exc
- fail ["Failed to open socket #{host}:#{port}", exc].join("\n")
+ fail ["Failed to open socket #{host}:#{port}", exc, msg].compact.join("\n")
ensure
socket.close if socket
end
diff --git a/tests/white-box/network.rb b/tests/white-box/network.rb
index f2041710..acb5c5e6 100644
--- a/tests/white-box/network.rb
+++ b/tests/white-box/network.rb
@@ -46,7 +46,10 @@ class Network < LeapTest
assert accept_port = stunnel_conf['accept_port'], "Field `accept` must be present in property `stunnel.servers.#{stunnel_name}`"
assert_tcp_socket('localhost', accept_port)
assert connect_port = stunnel_conf['connect_port'], "Field `connect` must be present in property `stunnel.servers.#{stunnel_name}`"
- assert_tcp_socket('localhost', connect_port)
+ assert_tcp_socket('localhost', connect_port,
+ "The local connect endpoint for stunnel `#{stunnel_name}` is unavailable.\n"+
+ "This is probably caused by a daemon that died or failed to start on\n"+
+ "port `#{connect_port}`, not stunnel itself.")
end
all_stunnel_pids = pgrep('/usr/bin/stunnel').collect{|process| process[:pid]}.uniq
assert_equal good_stunnel_pids.sort, all_stunnel_pids.sort, "There should not be any extra stunnel processes that are not configured in /etc/stunnel"