diff options
author | Anders Svensson <[email protected]> | 2012-11-08 12:56:07 +0100 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2012-11-08 12:56:07 +0100 |
commit | 3a86578f9750b27ab8a42eb8880cef082e9fcec7 (patch) | |
tree | a37b501b342eae1809f12f622bdc9d8613369d4e /lib/diameter/test | |
parent | cedda10e06e39d7d08ab98ee342d7c8eed00edc9 (diff) | |
parent | e18806dce4e043837efb1ddd5e6e31b4237e618a (diff) | |
download | otp-3a86578f9750b27ab8a42eb8880cef082e9fcec7.tar.gz otp-3a86578f9750b27ab8a42eb8880cef082e9fcec7.tar.bz2 otp-3a86578f9750b27ab8a42eb8880cef082e9fcec7.zip |
Merge branch 'anders/diameter/peer_mapping/OTP-10470' into maint
* anders/diameter/peer_mapping/OTP-10470:
Document peer_ref() service_info
Use peer_ref() service_info in traffic suite
Add service_info for a peer_ref()
Diffstat (limited to 'lib/diameter/test')
-rw-r--r-- | lib/diameter/test/diameter_traffic_SUITE.erl | 21 |
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 |