aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/test/diameter_relay_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_relay_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_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)),