aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/test
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2012-10-11 01:40:35 +0200
committerAnders Svensson <[email protected]>2012-11-05 11:55:03 +0100
commitaaff2cb270d6cf13ff3cd074b3f8c212211ccb7f (patch)
treeb7d5fe8ecfb2a7a2349c1bb63985e1cb2e4d7519 /lib/diameter/test
parent6f55c32ccb6811d2896d5a761b528f08bc9052ee (diff)
downloadotp-aaff2cb270d6cf13ff3cd074b3f8c212211ccb7f.tar.gz
otp-aaff2cb270d6cf13ff3cd074b3f8c212211ccb7f.tar.bz2
otp-aaff2cb270d6cf13ff3cd074b3f8c212211ccb7f.zip
Use peer_ref() service_info in traffic suite
Diffstat (limited to 'lib/diameter/test')
-rw-r--r--lib/diameter/test/diameter_traffic_SUITE.erl21
1 files changed, 6 insertions, 15 deletions
diff --git a/lib/diameter/test/diameter_traffic_SUITE.erl b/lib/diameter/test/diameter_traffic_SUITE.erl
index c391ba0317..5744ff0307 100644
--- a/lib/diameter/test/diameter_traffic_SUITE.erl
+++ b/lib/diameter/test/diameter_traffic_SUITE.erl
@@ -626,22 +626,13 @@ pick_peer(Peers, _, ?CLIENT, _State, send_detach, Id, {_,_}) ->
find(Id, Peers).
find(Id, Peers) ->
- [P] = lists:flatmap(fun(C) -> peer(Id, C) end,
- diameter:service_info(?CLIENT, transport)),
- case lists:keyfind(P, 1, Peers) of %% OTP-10470 will provide a better way.
- {_,_} = TC ->
- {ok, TC};
- false = No ->
- No
- end.
+ [P] = [P || P <- Peers, id(Id, P)],
+ {ok, P}.
-peer(Id, [{ref, _},
- {type, connect},
- {options, Opts},
- {watchdog, _},
- {peer, {PeerRef, _}}
- | _]) ->
- [PeerRef || lists:member({id, Id}, Opts)].
+id(Id, {Pid, _Caps}) ->
+ [{ref, _}, {type, _}, {options, Opts} | _]
+ = diameter:service_info(?CLIENT, Pid),
+ lists:member({id, Id}, Opts).
%% prepare_request/5-6