osmo_dia2gsup: add config option diameter_connect_timer
The diameter_connect_timer can be set to reduce the ttcn3 timing. Otherwise every test case would need to wait for at least one connect timer period to succeed. Related: OS#5657 Change-Id: I669a76022d866824e7b4e9f30dd7e51aa714ae7d
This commit is contained in:
parent
96eb0938db
commit
e9c2b1ddaa
|
@ -70,10 +70,12 @@ init(State) ->
|
|||
% DIAMETER side
|
||||
SvcName = ?MODULE,
|
||||
diameter:start_service(SvcName, ?SERVICE(SvcName)),
|
||||
|
||||
Ip = application:get_env(osmo_dia2gsup, diameter_ip, "127.0.0.8"),
|
||||
Port = application:get_env(osmo_dia2gsup, diameter_port, 3868),
|
||||
Proto = application:get_env(osmo_dia2gsup, diameter_proto, sctp),
|
||||
listen({address, Proto, element(2,inet:parse_address(Ip)), Port}),
|
||||
ConnectTimer = application:get_env(osmo_dia2gsup, diameter_connect_timer, 30000),
|
||||
listen(?SVC_NAME, {address, Proto, element(2,inet:parse_address(Ip)), Port}, {timer, ConnectTimer}),
|
||||
lager:info("Diameter HSS Application started on IP ~s, ~p port ~p~n", [Ip, Proto, Port]),
|
||||
{ok, State}.
|
||||
|
||||
|
@ -114,14 +116,12 @@ terminate(_Reason, _State) ->
|
|||
%% Internal Function Definitions
|
||||
%% ------------------------------------------------------------------
|
||||
|
||||
listen(Name, {address, Protocol, IPAddr, Port}) ->
|
||||
listen(Name, {address, Protocol, IPAddr, Port}, {timer, ConnectTimer}) ->
|
||||
TransOpts = [{transport_module, tmod(Protocol)},
|
||||
{transport_config, [{reuseaddr, true},
|
||||
{ip, IPAddr}, {port, Port}]}],
|
||||
{ip, IPAddr}, {port, Port}]},
|
||||
{connect_timer, ConnectTimer}],
|
||||
{ok, _} = diameter:add_transport(Name, {listen, TransOpts}).
|
||||
|
||||
listen(Address) ->
|
||||
listen(?SVC_NAME, Address).
|
||||
|
||||
tmod(tcp) -> diameter_tcp;
|
||||
tmod(sctp) -> diameter_sctp.
|
||||
|
|
Loading…
Reference in New Issue