Skip to content

Commit

Permalink
Merge branch 'bmk/megaco/20241107/test_tweaking' into maint
Browse files Browse the repository at this point in the history
  • Loading branch information
bmk committed Nov 20, 2024
2 parents dc97ae2 + a3239c4 commit dbbcc28
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions lib/megaco/test/megaco_test_lib.erl
Original file line number Diff line number Diff line change
Expand Up @@ -3199,19 +3199,25 @@ explicit_inet_backend() ->
false
end.

%% We cannot use application:get_all_env(megaco) since that only "works"
%% when the application has been started and this function may be called
%% well before that happens.
test_inet_backends() ->
case application:get_all_env(megaco) of
Env when is_list(Env) ->
case lists:keysearch(test_inet_backends, 1, Env) of
{value, {test_inet_backends, true}} ->
true;
_ ->
false
end;
case init:get_argument(megaco) of
{ok, Args} when is_list(Args) ->
test_inet_backends(Args);
_ ->
false
false
end.

test_inet_backends([]) ->
false;
test_inet_backends([["test_inet_backends","true"]|_]) ->
true;
test_inet_backends([_|Args]) ->
test_inet_backends(Args).


inet_backend_opts(Config) when is_list(Config) ->
case lists:keysearch(socket_create_opts, 1, Config) of
{value, {socket_create_opts, InetBackendOpts}} ->
Expand Down

0 comments on commit dbbcc28

Please sign in to comment.