pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35591?usp=email )


Change subject: swx: Make diameter_watchdog_config configurable
......................................................................

swx: Make diameter_watchdog_config configurable

This allows tweaking values in config file of TTCN3 tests to speed up
test setup.

Change-Id: I99b5e02264c2c35a3fbfcd2d6083a07e2cfea566
---
M config/sys.config
M src/epdg_diameter_swx.erl
2 files changed, 20 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-epdg 
refs/changes/91/35591/1

diff --git a/config/sys.config b/config/sys.config
index 699df4f..8b8a847 100755
--- a/config/sys.config
+++ b/config/sys.config
@@ -11,6 +11,9 @@
    {diameter_proto, sctp},
    {diameter_connect_timer, 30000},
    {diameter_watchdog_timer, 30000},
+   {diameter_watchdog_config,
+    [{okay, 3},
+     {suspect, 1}]},
    {vendor_id, 0},
    {origin_host, "epdg.localdomain"},
    {origin_realm, "localdomain"},
diff --git a/src/epdg_diameter_swx.erl b/src/epdg_diameter_swx.erl
index d7bea93..1d6c262 100644
--- a/src/epdg_diameter_swx.erl
+++ b/src/epdg_diameter_swx.erl
@@ -123,9 +123,10 @@
     Port = application:get_env(?ENV_APP_NAME, diameter_remote_port, 
?ENV_DEFAULT_DIAMETER_REMOTE_PORT),
     ConnectTimer = application:get_env(?ENV_APP_NAME, diameter_connect_timer, 
30000),
     WatchdogTimer = application:get_env(?ENV_APP_NAME, 
diameter_watchdog_timer, 30000),
+    WatchdogConfig = application:get_env(?ENV_APP_NAME, 
diameter_watchdog_config, [{okay, 3}, {suspect, 1}]),
     ok = diameter:start_service(?MODULE, ?SERVICE),
     % lager:info("DiaServices is ~p~n", [DiaServ]),
-    {ok, _} = connect({address, Proto, Ip, Port}, {timer, ConnectTimer, 
WatchdogTimer}),
+    {ok, _} = connect({address, Proto, Ip, Port}, {timer, ConnectTimer, 
WatchdogTimer, WatchdogConfig}),
     {ok, State}.

 test() ->
@@ -259,7 +260,7 @@
 %% ------------------------------------------------------------------

 %% connect/3
-connect(Name, {address, Protocol, IPAddr, Port}, {timer, ConnectTimer, 
WatchdogTimer}) ->
+connect(Name, {address, Protocol, IPAddr, Port}, {timer, ConnectTimer, 
WatchdogTimer, WatchdogConfig}) ->
     lager:notice("~s connecting to IP ~s port ~p~n", [Name, IPAddr, Port]),
     {ok, IP} = inet_parse:address(IPAddr),
     TransportOpts =
@@ -269,7 +270,8 @@
            {raddr, IP},
            {rport, Port}]},
          {connect_timer, ConnectTimer},
-         {watchdog_timer, WatchdogTimer}],
+         {watchdog_timer, WatchdogTimer},
+         {watchdog_config, WatchdogConfig}],
     diameter:add_transport(Name, {connect, TransportOpts}).

 connect(Address, Timers) ->

--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35591?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: erlang/osmo-epdg
Gerrit-Branch: master
Gerrit-Change-Id: I99b5e02264c2c35a3fbfcd2d6083a07e2cfea566
Gerrit-Change-Number: 35591
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>
Gerrit-MessageType: newchange

Reply via email to