aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2012-07-30 10:14:13 +0200
committerMicael Karlberg <[email protected]>2012-07-30 10:14:13 +0200
commit11dd52c14f25e6a20f313debc363859a62562b74 (patch)
tree9055c030a9911f8240ca3eafd7d2e4511cd234ff /lib
parent57958e49b0fe80e1fe96bab6fd0d2da196ac5584 (diff)
parent5031e2277c1b1af83bde2d3990d2fc4ab3f119c5 (diff)
downloadotp-11dd52c14f25e6a20f313debc363859a62562b74.tar.gz
otp-11dd52c14f25e6a20f313debc363859a62562b74.tar.bz2
otp-11dd52c14f25e6a20f313debc363859a62562b74.zip
Merge branch 'bmk/inets/ehostunreach' into bmk/inets/inets591_integration
Diffstat (limited to 'lib')
-rw-r--r--lib/inets/test/inets_test_lib.erl35
1 files changed, 14 insertions, 21 deletions
diff --git a/lib/inets/test/inets_test_lib.erl b/lib/inets/test/inets_test_lib.erl
index 7f4b0ec8d8..0f8671b682 100644
--- a/lib/inets/test/inets_test_lib.erl
+++ b/lib/inets/test/inets_test_lib.erl
@@ -531,34 +531,27 @@ connect(ip_comm, Host, Port, Opts, Type) ->
"~n Opts: ~p"
"~n Type: ~p", [Host, Port, Opts, Type]),
- case gen_tcp:connect(Host, Port, Opts) of
+ case gen_tcp:connect(Host, Port, Opts, timer:seconds(10)) of
{ok, Socket} ->
tsp("connect success"),
{ok, Socket};
- {error, nxdomain} when Type =:= inet6 ->
- tsp("connect error nxdomain when"
- "~n Opts: ~p", [Opts]),
- connect(ip_comm, Host, Port, Opts -- [inet6], inet);
- {error, eafnosupport} when Type =:= inet6 ->
- tsp("connect error eafnosupport when"
- "~n Opts: ~p", [Opts]),
- connect(ip_comm, Host, Port, Opts -- [inet6], inet);
- {error, econnreset} when Type =:= inet6 ->
- tsp("connect error econnreset when"
- "~n Opts: ~p", [Opts]),
- connect(ip_comm, Host, Port, Opts -- [inet6], inet);
- {error, enetunreach} when Type =:= inet6 ->
- tsp("connect error eafnosupport when"
- "~n Opts: ~p", [Opts]),
- connect(ip_comm, Host, Port, Opts -- [inet6], inet);
- {error, econnrefused} when Type =:= inet6 ->
- tsp("connect error econnrefused when"
- "~n Opts: ~p", [Opts]),
+ {error, Reason} when ((Type =:= inet6) andalso
+ ((Reason =:= timeout) orelse
+ (Reason =:= nxdomain) orelse
+ (Reason =:= eafnosupport) orelse
+ (Reason =:= econnreset) orelse
+ (Reason =:= enetunreach) orelse
+ (Reason =:= econnrefused) orelse
+ (Reason =:= ehostunreach))) ->
+ tsp("connect(ip_comm) -> Connect error: "
+ "~n Reason: ~p"
+ "~n Type: ~p"
+ "~n Opts: ~p", [Reason, Type, Opts]),
connect(ip_comm, Host, Port, Opts -- [inet6], inet);
Error ->
- tsp("connect(ip_conn) -> Fatal connect error: "
+ tsp("connect(ip_comm) -> Fatal connect error: "
"~n Error: ~p"
"~nwhen"
"~n Host: ~p"