aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/test/diameter_tls_SUITE.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2011-10-09 20:36:31 +0200
committerAnders Svensson <[email protected]>2011-10-10 11:27:07 +0200
commit52f3b4e508cf1f43c88bd20b0e1e6cc75ec4f020 (patch)
tree57b1353d4f2c531b4ba6cb59029f378eab3acf1f /lib/diameter/test/diameter_tls_SUITE.erl
parent698360f3a8c7bb8298d70ccc054cd2124a11f10e (diff)
downloadotp-52f3b4e508cf1f43c88bd20b0e1e6cc75ec4f020.tar.gz
otp-52f3b4e508cf1f43c88bd20b0e1e6cc75ec4f020.tar.bz2
otp-52f3b4e508cf1f43c88bd20b0e1e6cc75ec4f020.zip
Use tcp/sctp port resolution from testsuites
Diffstat (limited to 'lib/diameter/test/diameter_tls_SUITE.erl')
-rw-r--r--lib/diameter/test/diameter_tls_SUITE.erl28
1 files changed, 1 insertions, 27 deletions
diff --git a/lib/diameter/test/diameter_tls_SUITE.erl b/lib/diameter/test/diameter_tls_SUITE.erl
index 90e32c834f..fb4ddcde0f 100644
--- a/lib/diameter/test/diameter_tls_SUITE.erl
+++ b/lib/diameter/test/diameter_tls_SUITE.erl
@@ -351,7 +351,7 @@ join(Strs) ->
server(Host, {Caps, Opts}) ->
ok = diameter:start_service(Host, ?SERVICE(Host, ?DICT_COMMON)),
{ok, LRef} = diameter:add_transport(Host, ?LISTEN(Caps, Opts)),
- {LRef, portnr(LRef)}.
+ {LRef, hd([_] = ?util:lport(tcp, LRef, 20))}.
sopts(?SERVER1, Dir) ->
{inband_security([?TLS]),
@@ -369,32 +369,6 @@ sopts(?SERVER5, Dir) ->
ssl([{ssl_options = T, Opts}]) ->
[{T, true} | Opts].
-portnr(LRef) ->
- portnr(LRef, 20).
-
-portnr(LRef, N)
- when 0 < N ->
- case diameter_reg:match({diameter_tcp, listener, {LRef, '_'}}) of
- [{T, _Pid}] ->
- {_, _, {LRef, {_Addr, LSock}}} = T,
- {ok, PortNr} = to_portnr(LSock) ,
- PortNr;
- [] ->
- receive after 500 -> ok end,
- portnr(LRef, N-1)
- end.
-
-to_portnr(Sock)
- when is_port(Sock) ->
- inet:port(Sock);
-to_portnr(Sock) ->
- case ssl:sockname(Sock) of
- {ok, {_,N}} ->
- {ok, N};
- No ->
- No
- end.
-
%% connect/3
connect(Host, {_LRef, PortNr}, {Caps, Opts}) ->