Skip to content

Commit

Permalink
OTP-24: fix variable '_Handler' is already bound warning
Browse files Browse the repository at this point in the history
  • Loading branch information
RoadRunnr committed Feb 25, 2021
1 parent 7544946 commit d71b404
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion test/ggsn_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ path_failure(Config) ->
CtxKey = #context_key{socket = 'irx', id = {imsi, ?'IMSI', 5}},
{GtpC, _, _} = create_pdp_context(Config),

{_Handler, CtxPid} = gtp_context_reg:lookup(CtxKey),
{_, CtxPid} = gtp_context_reg:lookup(CtxKey),
#{left_tunnel := #tunnel{socket = CSocket}} = gtp_context:info(CtxPid),

ClientIP = proplists:get_value(client_ip, Config),
Expand Down
16 changes: 8 additions & 8 deletions test/ggsn_proxy_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ ggsn_broken_recovery(Config) ->
CtxKey = #context_key{socket = 'irx', id = {imsi, ?'IMSI', 5}},
{GtpC, _, _} = create_pdp_context(Config),

{_Handler, CtxPid} = gtp_context_reg:lookup(CtxKey),
{_, CtxPid} = gtp_context_reg:lookup(CtxKey),
#{right_tunnel := #tunnel{socket = CSocket}} = gtp_context:info(CtxPid),

FinalGSN = proplists:get_value(final_gsn, Config),
Expand Down Expand Up @@ -1055,7 +1055,7 @@ path_failure_to_ggsn(Config) ->

{GtpC, _, _} = create_pdp_context(Config),

{_Handler, CtxPid} = gtp_context_reg:lookup(CtxKey),
{_, CtxPid} = gtp_context_reg:lookup(CtxKey),
#{right_tunnel := #tunnel{socket = CSocket}} = gtp_context:info(CtxPid),

FinalGSN = proplists:get_value(final_gsn, Config),
Expand Down Expand Up @@ -1112,7 +1112,7 @@ path_failure_to_ggsn_and_restore(Config) ->

{GtpC, _, _} = create_pdp_context(Config),

{_Handler, CtxPid} = gtp_context_reg:lookup(CtxKey),
{_, CtxPid} = gtp_context_reg:lookup(CtxKey),
#{right_tunnel := #tunnel{socket = CSocket}} = gtp_context:info(CtxPid),

FinalGSN = proplists:get_value(final_gsn, Config),
Expand Down Expand Up @@ -1174,7 +1174,7 @@ path_failure_to_sgsn(Config) ->
CtxKey = #context_key{socket = 'irx', id = {imsi, ?'IMSI', 5}},
{GtpC, _, _} = create_pdp_context(Config),

{_Handler, CtxPid} = gtp_context_reg:lookup(CtxKey),
{_, CtxPid} = gtp_context_reg:lookup(CtxKey),
#{left_tunnel := #tunnel{socket = CSocket}} = gtp_context:info(CtxPid),

ClientIP = proplists:get_value(client_ip, Config),
Expand Down Expand Up @@ -1504,7 +1504,7 @@ error_indication_ggsn2sgsn(Config) ->

{GtpC, _, _} = create_pdp_context(Config),

{_Handler, CtxPid} = gtp_context_reg:lookup(CtxKey),
{_, CtxPid} = gtp_context_reg:lookup(CtxKey),
true = is_pid(CtxPid),
#{bearer := #{right := RightBearer}} = gtp_context:info(CtxPid),

Expand Down Expand Up @@ -1570,7 +1570,7 @@ update_pdp_context_request_ra_update(Config) ->
RemoteCtxKey = #context_key{socket = 'remote-irx', id = {imsi, ?'PROXY-IMSI', 5}},

{GtpC1, _, _} = create_pdp_context(Config),
{_Handler, CtxPid} = gtp_context_reg:lookup(RemoteCtxKey),
{_, CtxPid} = gtp_context_reg:lookup(RemoteCtxKey),
#{left_tunnel := LeftTunnel1, bearer := #{left := LeftBearer1}} = gtp_context:info(CtxPid),

{GtpC2, _, _} = update_pdp_context(ra_update, GtpC1),
Expand Down Expand Up @@ -1599,7 +1599,7 @@ update_pdp_context_request_tei_update(Config) ->
RemoteCtxKey = #context_key{socket = 'remote-irx', id = {imsi, ?'PROXY-IMSI', 5}},

{GtpC1, _, _} = create_pdp_context(Config),
{_Handler, CtxPid} = gtp_context_reg:lookup(RemoteCtxKey),
{_, CtxPid} = gtp_context_reg:lookup(RemoteCtxKey),
#{left_tunnel := LeftTunnel1, bearer := #{left := LeftBearer1}} = gtp_context:info(CtxPid),

{_Handler, ProxyCtxPid} = gtp_context_reg:lookup(CtxKey),
Expand Down Expand Up @@ -1667,7 +1667,7 @@ update_pdp_context_request_broken_recovery(Config) ->
meck:passthrough([ReqKey, Request, Response])
end),
{GtpC1, _, _} = create_pdp_context(Config),
{_Handler, CtxPid} = gtp_context_reg:lookup(RemoteCtxKey),
{_, CtxPid} = gtp_context_reg:lookup(RemoteCtxKey),
#{left_tunnel := LeftTunnel1, bearer := #{left := LeftBearer1}} = gtp_context:info(CtxPid),

{GtpC2, _, _} = update_pdp_context(simple, GtpC1),
Expand Down
2 changes: 1 addition & 1 deletion test/pgw_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1266,7 +1266,7 @@ path_failure(Config) ->

{GtpC, _, _} = create_session(Config),

{_Handler, CtxPid} = gtp_context_reg:lookup(CtxKey),
{_, CtxPid} = gtp_context_reg:lookup(CtxKey),
#{left_tunnel := #tunnel{socket = CSocket}} = gtp_context:info(CtxPid),

ClientIP = proplists:get_value(client_ip, Config),
Expand Down
16 changes: 8 additions & 8 deletions test/pgw_proxy_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ path_failure_to_pgw(Config) ->

{GtpC, _, _} = create_session(Config),

{_Handler, CtxPid} = gtp_context_reg:lookup(CtxKey),
{_, CtxPid} = gtp_context_reg:lookup(CtxKey),
#{right_tunnel := #tunnel{socket = CSocket}} = gtp_context:info(CtxPid),

FinalGSN = proplists:get_value(final_gsn, Config),
Expand Down Expand Up @@ -1173,7 +1173,7 @@ path_failure_to_pgw_and_restore(Config) ->

{GtpC, _, _} = create_session(Config),

{_Handler, CtxPid} = gtp_context_reg:lookup(CtxKey),
{_, CtxPid} = gtp_context_reg:lookup(CtxKey),
#{right_tunnel := #tunnel{socket = CSocket}} = gtp_context:info(CtxPid),

FinalGSN = proplists:get_value(final_gsn, Config),
Expand Down Expand Up @@ -1237,7 +1237,7 @@ path_failure_to_sgw(Config) ->

{GtpC, _, _} = create_session(Config),

{_Handler, CtxPid} = gtp_context_reg:lookup(CtxKey),
{_, CtxPid} = gtp_context_reg:lookup(CtxKey),
#{left_tunnel := #tunnel{socket = CSocket}} = gtp_context:info(CtxPid),

ClientIP = proplists:get_value(client_ip, Config),
Expand Down Expand Up @@ -1827,7 +1827,7 @@ error_indication_pgw2sgw(Config) ->

{GtpC, _, _} = create_session(Config),

{_Handler, CtxPid} = gtp_context_reg:lookup(CtxKey),
{_, CtxPid} = gtp_context_reg:lookup(CtxKey),
true = is_pid(CtxPid),
#{bearer := #{right := RightBearer}} = gtp_context:info(CtxPid),

Expand Down Expand Up @@ -1894,7 +1894,7 @@ modify_bearer_request_ra_update(Config) ->

{GtpC1, _, _} = create_session(Config),

{_Handler, CtxPid} = gtp_context_reg:lookup(RemoteCtxKey),
{_, CtxPid} = gtp_context_reg:lookup(RemoteCtxKey),
#{left_tunnel := LeftTunnel1, bearer := #{left := LeftBearer1}} = gtp_context:info(CtxPid),

{GtpC2, _, _} = modify_bearer(ra_update, GtpC1),
Expand Down Expand Up @@ -1924,7 +1924,7 @@ modify_bearer_request_tei_update(Config) ->

{GtpC1, _, _} = create_session(Config),

{_Handler, CtxPid} = gtp_context_reg:lookup(RemoteCtxKey),
{_, CtxPid} = gtp_context_reg:lookup(RemoteCtxKey),
#{left_tunnel := LeftTunnel1, bearer := #{left := LeftBearer1}} = gtp_context:info(CtxPid),

{_Handler, ProxyCtxPid} = gtp_context_reg:lookup(CtxKey),
Expand Down Expand Up @@ -2416,7 +2416,7 @@ interop_sgsn_to_sgw(Config) ->

{GtpC1, _, _} = ergw_ggsn_test_lib:create_pdp_context(Config),

{_Handler, CtxPid} = gtp_context_reg:lookup(RemoteCtxKey),
{_, CtxPid} = gtp_context_reg:lookup(RemoteCtxKey),
#{left_tunnel := LeftTunnel1, bearer := #{left := LeftBearer1}} = gtp_context:info(CtxPid),

check_contexts_metric(v1, 3, 1),
Expand Down Expand Up @@ -2468,7 +2468,7 @@ interop_sgw_to_sgsn(Config) ->

{GtpC1, _, _} = create_session(Config),

{_Handler, CtxPid} = gtp_context_reg:lookup(RemoteCtxKey),
{_, CtxPid} = gtp_context_reg:lookup(RemoteCtxKey),
#{left_tunnel := LeftTunnel1, bearer := #{left := LeftBearer1}} = gtp_context:info(CtxPid),

check_contexts_metric(v1, 0, 0),
Expand Down

0 comments on commit d71b404

Please sign in to comment.