aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/test/diameter_transport_SUITE.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2015-01-25 23:43:56 +0100
committerAnders Svensson <[email protected]>2015-02-20 02:23:38 +0100
commitdfa2a3ce25862720d48c5ff8b71fdf31989ea1dc (patch)
tree04424fcf56c811c930e591724c4de73fc71514a2 /lib/diameter/test/diameter_transport_SUITE.erl
parent77c1b1624d4b8c788f23217f71a85a0700954929 (diff)
downloadotp-dfa2a3ce25862720d48c5ff8b71fdf31989ea1dc.tar.gz
otp-dfa2a3ce25862720d48c5ff8b71fdf31989ea1dc.tar.bz2
otp-dfa2a3ce25862720d48c5ff8b71fdf31989ea1dc.zip
Add pool suite to test transport_opt() pool_size
With testcases that uses restrict_connections and pool_size config to establish multiple connections between two Diameter nodes, checking for the expected number of transport processes using diameter:service_info/2.
Diffstat (limited to 'lib/diameter/test/diameter_transport_SUITE.erl')
-rw-r--r--lib/diameter/test/diameter_transport_SUITE.erl34
1 files changed, 9 insertions, 25 deletions
diff --git a/lib/diameter/test/diameter_transport_SUITE.erl b/lib/diameter/test/diameter_transport_SUITE.erl
index fcffa69c24..23b972a9a0 100644
--- a/lib/diameter/test/diameter_transport_SUITE.erl
+++ b/lib/diameter/test/diameter_transport_SUITE.erl
@@ -104,7 +104,7 @@ tc() ->
reconnect].
init_per_suite(Config) ->
- [{sctp, have_sctp()} | Config].
+ [{sctp, ?util:have_sctp()} | Config].
end_per_suite(_Config) ->
ok.
@@ -127,7 +127,10 @@ tcp_accept(_) ->
accept(tcp).
sctp_accept(Config) ->
- if_sctp(fun accept/1, Config).
+ case lists:member({sctp, true}, Config) of
+ true -> accept(sctp);
+ false -> {skip, no_sctp}
+ end.
%% Start multiple accepting transport processes that are connected to
%% with an equal number of connecting processes using gen_tcp/sctp
@@ -157,7 +160,10 @@ tcp_connect(_) ->
connect(tcp).
sctp_connect(Config) ->
- if_sctp(fun connect/1, Config).
+ case lists:member({sctp, true}, Config) of
+ true -> connect(sctp);
+ false -> {skip, no_sctp}
+ end.
connect(Prot) ->
T = {Prot, make_ref()},
@@ -251,28 +257,6 @@ abort(SvcName, LRef, Ref)
%% ===========================================================================
%% ===========================================================================
-%% have_sctp/0
-
-have_sctp() ->
- case gen_sctp:open() of
- {ok, Sock} ->
- gen_sctp:close(Sock),
- true;
- {error, E} when E == eprotonosupport;
- E == esocktnosupport -> %% fail on any other reason
- false
- end.
-
-%% if_sctp/2
-
-if_sctp(F, Config) ->
- case proplists:get_value(sctp, Config) of
- true ->
- F(sctp);
- false ->
- {skip, no_sctp}
- end.
-
%% init/2
init(accept, {Prot, Ref}) ->