Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings of non use variables for Common Tests #217

Merged
merged 1 commit into from
Sep 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 0 additions & 7 deletions test/bench_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,6 @@ init_per_testcase(_, Config) ->

end_per_testcase(Config) ->
stop_gtpc_server(),

FreeP = [pool, <<"pool-A">>, ipv4, {10,180,0,1}, free],
%% match_metric(FreeP, 1376254),

AppsCfg = proplists:get_value(aaa_cfg, Config),
ok = application:set_env(ergw_aaa, apps, AppsCfg),
ok.
Expand Down Expand Up @@ -520,9 +516,6 @@ contexts_at_scale(Config) ->
wait4tunnels(?TIMEOUT),
ct:sleep({seconds, 30}),

FreeP = [pool, <<"pool-A">>, ipv4, {10,180,0,1}, free],
%% match_metric(FreeP, 1376254),

ok.

%%%===================================================================
Expand Down
2 changes: 1 addition & 1 deletion test/ergw_ggsn_test_lib.erl
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ make_response(#gtp{type = update_pdp_context_request, seq_no = SeqNo},

make_response(#gtp{type = delete_pdp_context_request, seq_no = SeqNo},
invalid_teid,
#gtpc{remote_control_tei = RemoteCntlTEI}) ->
#gtpc{remote_control_tei = _}) ->
IEs = [#cause{value = context_not_found}],
#gtp{version = v1, type = delete_pdp_context_response,
tei = 0, seq_no = SeqNo, ie = IEs};
Expand Down
2 changes: 1 addition & 1 deletion test/ergw_pgw_test_lib.erl
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ make_response(#gtp{type = update_bearer_request, seq_no = SeqNo},
make_response(#gtp{type = delete_bearer_request, seq_no = SeqNo},
invalid_teid,
#gtpc{restart_counter = RCnt,
remote_control_tei = RemoteCntlTEI}) ->
remote_control_tei = _}) ->
IEs = [#v2_recovery{restart_counter = RCnt},
#v2_cause{v2_cause = context_not_found}],
#gtp{version = v2, type = delete_bearer_response,
Expand Down
8 changes: 3 additions & 5 deletions test/ergw_test_sx_up.erl
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ handle_call({send, Msg}, _From,
ok = gen_udp:send(GtpSocket, IP, ?GTP1u_PORT, BinMsg),
{reply, ok, State};

handle_call({usage_report, #pfcp_ctx{seid = #seid{cp = SEID}, urr_by_id = Rules} = PCtx,
handle_call({usage_report, #pfcp_ctx{seid = #seid{cp = SEID}, urr_by_id = Rules},
MatchSpec, Report}, _From, State0) ->
Ids = ets:match_spec_run(maps:to_list(Rules), ets:match_spec_compile(MatchSpec)),
URRs =
Expand All @@ -180,7 +180,7 @@ handle_call({usage_report, #pfcp_ctx{seid = #seid{cp = SEID}, urr_by_id = Rules}
%% only one mandatory 'Report Type' IE is present in this scenario
handle_call({up_inactivity_timer_expiry,
#pfcp_ctx{seid = #seid{cp = SEID},
up_inactivity_timer = _UP_Inactivity_Timer} = PCtx},
up_inactivity_timer = _UP_Inactivity_Timer}},
_From, State0) ->
%% Ignore the up inactivity timer, fire an 'upir' session report request
IE = [#report_type{upir = 1}],
Expand Down Expand Up @@ -217,7 +217,7 @@ handle_info({udp, SxSocket, IP, InPortNo, Packet},
ct:fail("Sx Socket Error"),
{stop, error, State0}
end;
handle_info({udp, GtpSocket, IP, InPortNo, Packet} = Msg,
handle_info({udp, GtpSocket, _, _, _} = Msg,
#state{gtp = GtpSocket} = State) ->
{noreply, record(Msg, State)}.

Expand Down Expand Up @@ -279,8 +279,6 @@ user_plane_ip_resource_information(VRF, #state{up_ip = IP})
ipv6 = ergw_inet:ip2bin(?LOCALHOST_IPv6)
}.

sx_reply(Type, State) ->
sx_reply(Type, undefined, [], State).
sx_reply(Type, IEs, State) ->
sx_reply(Type, undefined, IEs, State).
sx_reply(Type, SEID, IEs, State) ->
Expand Down
4 changes: 2 additions & 2 deletions test/ggsn_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ create_pdp_context_request_pool_exhausted(Config) ->
MetricsBefore = socket_counter_metrics(),

ok = meck:expect(ergw_local_pool, send_pool_request,
fun(_ClientId, {_, ipv6, _, _} = Req) ->
fun(_ClientId, {_, ipv6, _, _}) ->
{error, empty};
(ClientId, Req) ->
meck:passthrough([ClientId, Req])
Expand All @@ -835,7 +835,7 @@ create_pdp_context_request_pool_exhausted(Config) ->
socket_counter_metrics_ok(MetricsBefore, MetricsAfter, all_dynamic_pdp_addresses_are_occupied), % In response

ok = meck:expect(ergw_local_pool, send_pool_request,
fun(_ClientId, {_, ipv4, _, _} = Req) ->
fun(_ClientId, {_, ipv4, _, _}) ->
{error, empty};
(ClientId, Req) ->
meck:passthrough([ClientId, Req])
Expand Down
8 changes: 4 additions & 4 deletions test/pgw_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ create_session_request_pool_exhausted(Config) ->
end),

ok = meck:expect(ergw_local_pool, send_pool_request,
fun(_ClientId, {_, ipv6, _, _} = Req) ->
fun(_ClientId, {_, ipv6, _, _}) ->
{error, empty};
(ClientId, Req) ->
meck:passthrough([ClientId, Req])
Expand All @@ -1099,7 +1099,7 @@ create_session_request_pool_exhausted(Config) ->
%% delete_session(GtpC1),

ok = meck:expect(ergw_local_pool, send_pool_request,
fun(_ClientId, {_, ipv4, _, _} = Req) ->
fun(_ClientId, {_, ipv4, _, _}) ->
{error, empty};
(ClientId, Req) ->
meck:passthrough([ClientId, Req])
Expand Down Expand Up @@ -2960,7 +2960,7 @@ ofcs_no_interim(Config) ->

{_Handler, Server} = gtp_context_reg:lookup({'irx-socket', {imsi, ?'IMSI', 5}}),
true = is_pid(Server),
{ok, PCtx} = gtp_context:test_cmd(Server, pfcp_ctx),
{ok, _} = gtp_context:test_cmd(Server, pfcp_ctx),

[SER|_] = lists:filter(
fun(#pfcp{type = session_establishment_request}) -> true;
Expand Down Expand Up @@ -5094,7 +5094,7 @@ set_online_charging(Set) ->
{ok, Cfg0} = application:get_env(ergw, charging),
Cfg = set_online_charging(['_', rulebase, '_'], Set, Cfg0),
ok = application:set_env(ergw, charging, Cfg).

%% Set APN key data
set_apn_key(Key, Value) ->
{ok, APNs0} = application:get_env(ergw, apns),
Expand Down
10 changes: 5 additions & 5 deletions test/pgw_proxy_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ init_per_testcase(update_bearer_request, Config) ->
meck:passthrough([Type, Content, State, Data])
end),
ok = meck:expect(pgw_s5s8, handle_response,
fun(From, #gtp{type = update_bearer_response}, _Request, _State, Data) ->
fun(From, #gtp{type = update_bearer_response}, _, _, _) ->
gen_statem:reply(From, ok),
keep_state_and_data;
(From, Response, Request, State, Data) ->
Expand Down Expand Up @@ -1222,7 +1222,7 @@ simple_session(Config) ->
periodic_reporting = 1}
}}, Acc) ->
Acc#{{urr, id} => Id};
SERFilter(Value, Acc) ->
SERFilter(_, Acc) ->
Acc
end(maps:values(SER#pfcp.ie), #{}),
ct:pal("SER Map:~n~s", [pfcp_packet:pretty_print(SERMap)]),
Expand Down Expand Up @@ -1313,7 +1313,7 @@ simple_session(Config) ->
} = FAR,
Acc) ->
Acc#{{far, id, Intf} => Id, {far, Intf} => FAR};
SMRFilter(Value, Acc) ->
SMRFilter(_, Acc) ->
Acc
end(maps:values(SMR#pfcp.ie), #{}),
ct:pal("SMR Map:~n~s", [pfcp_packet:pretty_print(SMRMap)]),
Expand Down Expand Up @@ -2537,8 +2537,8 @@ proxy_context_selection_map(ProxyInfo, Context) ->
reset_path_metrics() ->
Name = gtp_path_contexts_total,
Metrics = prometheus_gauge:values(default, Name),
R = [prometheus_gauge:remove(Name, [V || {L,V} <- LabelValues])
|| {LabelValues, Value} <- Metrics],
_ = [prometheus_gauge:remove(Name, [V || {_,V} <- LabelValues])
|| {LabelValues, _} <- Metrics],
ok.

check_contexts_metric(Version, Cnt, Expect) ->
Expand Down
4 changes: 2 additions & 2 deletions test/saegw_s11_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -704,15 +704,15 @@ create_session_request_pool_exhausted(Config) ->
end),

ok = meck:expect(ergw_local_pool, send_pool_request,
fun(_ClientId, {_, ipv6, _, _} = Req) ->
fun(_ClientId, {_, ipv6, _, _}) ->
{error, empty};
(ClientId, Req) ->
meck:passthrough([ClientId, Req])
end),
create_session(pool_exhausted, Config),

ok = meck:expect(ergw_local_pool, send_pool_request,
fun(_ClientId, {_, ipv4, _, _} = Req) ->
fun(_ClientId, {_, ipv4, _, _}) ->
{error, empty};
(ClientId, Req) ->
meck:passthrough([ClientId, Req])
Expand Down