Skip to content

Commit

Permalink
test(lb-mode): add test for lb-mode-ifip
Browse files Browse the repository at this point in the history
  • Loading branch information
qzhuyan committed Sep 19, 2024
1 parent 9500e6d commit 3ad4d52
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/quicer_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
tc_lib_registration_1/1,
tc_lib_re_registration/1,
tc_lib_registration_neg/1,
tc_setopt_global_lb_mode_ifip/1,
tc_open_listener_inval_reg/1,

tc_stream_client_init/1,
Expand Down Expand Up @@ -3081,6 +3082,26 @@ tc_stream_get_owner_remote(Config) ->
SPid ! done,
ensure_server_exit_normal(Ref).

tc_setopt_global_lb_mode_ifip(_Config) ->
{ok, _} = application:ensure_all_started(quicer),
true = code:soft_purge(quicer_nif),
true = code:delete(quicer_nif),
application:set_env(quicer, lb_mode, ?QUICER_LOAD_BALANCING_IFIP_AS_SERVER_ID),
%% If test fail ensure we have this netdev
NetDevName =
case os:type() of
{unix, darwin} -> "lo0";
_ -> "lo"
end,
application:set_env(quicer, lb_dev, NetDevName),
quicer:reg_close(),
quicer:close_lib(),
{ok, _} = quicer:open_lib(),
?assertEqual(
{ok, 2},
quicer:getopt(quic_global, load_balacing_mode)
).

%%% ====================
%%% Internal helpers
%%% ====================
Expand Down

0 comments on commit 3ad4d52

Please sign in to comment.