lynxis lazus has uploaded this change for review. (
https://gerrit.osmocom.org/c/erlang/osmo_dia2gsup/+/35002?usp=email )
Change subject: osmo_dia2gsup: add config option diameter_connect_timer
......................................................................
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
---
M src/osmo_dia2gsup.erl
1 file changed, 20 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/erlang/osmo_dia2gsup refs/changes/02/35002/1
diff --git a/src/osmo_dia2gsup.erl b/src/osmo_dia2gsup.erl
index 90f5ddc..5a817fd 100644
--- a/src/osmo_dia2gsup.erl
+++ b/src/osmo_dia2gsup.erl
@@ -70,10 +70,12 @@
% 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 @@
%% 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.
--
To view, visit
https://gerrit.osmocom.org/c/erlang/osmo_dia2gsup/+/35002?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: erlang/osmo_dia2gsup
Gerrit-Branch: master
Gerrit-Change-Id: I669a76022d866824e7b4e9f30dd7e51aa714ae7d
Gerrit-Change-Number: 35002
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-MessageType: newchange