aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/test/diameter_relay_SUITE.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/diameter/test/diameter_relay_SUITE.erl')
-rw-r--r--lib/diameter/test/diameter_relay_SUITE.erl17
1 files changed, 1 insertions, 16 deletions
diff --git a/lib/diameter/test/diameter_relay_SUITE.erl b/lib/diameter/test/diameter_relay_SUITE.erl
index 60babd0b9a..f7f65197ed 100644
--- a/lib/diameter/test/diameter_relay_SUITE.erl
+++ b/lib/diameter/test/diameter_relay_SUITE.erl
@@ -269,22 +269,7 @@ realm(Host) ->
server(Host, Dict) ->
ok = diameter:start_service(Host, ?SERVICE(Host, Dict)),
{ok, LRef} = diameter:add_transport(Host, ?LISTEN),
- {LRef, portnr(LRef)}.
-
-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} = inet:port(LSock),
- PortNr;
- [] ->
- receive after 50 -> ok end,
- portnr(LRef, N-1)
- end.
+ {LRef, hd([_] = ?util:lport(tcp, LRef, 20))}.
connect(Host, {_LRef, PortNr}) ->
{ok, Ref} = diameter:add_transport(Host, ?CONNECT(PortNr)),