fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40714?usp=email )
Change subject: s1ap_proxy_test: test_s1_setup/1: proxy S1 SETUP RESPONSE PDU ......................................................................
s1ap_proxy_test: test_s1_setup/1: proxy S1 SETUP RESPONSE PDU
Change-Id: If0906c9e598c66189d27f7c6f3985337a7358862 Related: SYS#7065 --- M test/s1ap_proxy_test.erl 1 file changed, 20 insertions(+), 7 deletions(-)
Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved pespin: Looks good to me, but someone else must approve
diff --git a/test/s1ap_proxy_test.erl b/test/s1ap_proxy_test.erl index d606a18..3ea8b89 100644 --- a/test/s1ap_proxy_test.erl +++ b/test/s1ap_proxy_test.erl @@ -41,8 +41,8 @@ %% ------------------------------------------------------------------
s1ap_proxy_test_() -> - [{"S1 SETUP REQUEST (unmodified)", - ?TC(fun test_s1_setup_req/1)}, + [{"S1 SETUP REQUEST/RESPONSE (unmodified)", + ?TC(fun test_s1_setup/1)}, {"E-RAB SETUP REQUEST/RESPONSE", ?TC(fun test_e_rab_setup/1)}, {"E-RAB SETUP REQUEST (failure)", @@ -73,13 +73,15 @@ %% actual testcases %% ------------------------------------------------------------------
-test_s1_setup_req(#{handler := Pid}) -> +test_s1_setup(#{handler := Pid}) -> SetupReq = s1_setup_req_pdu(), - %% Expect the PDU to be proxied unmodified + SetupRsp = s1_setup_rsp_pdu(), + %% Expect the PDUs to be proxied unmodified [?_assertEqual({forward, SetupReq}, s1ap_proxy:process_pdu(Pid, SetupReq)), - ?_assertMetric(?S1GW_CTR_S1AP_PROXY_IN_PKT_ALL, 1), - ?_assertMetric(?S1GW_CTR_S1AP_PROXY_OUT_PKT_FWD_ALL, 1), - ?_assertMetric(?S1GW_CTR_S1AP_PROXY_OUT_PKT_FWD_UNMODIFIED, 1)]. + ?_assertEqual({forward, SetupRsp}, s1ap_proxy:process_pdu(Pid, SetupRsp)), + ?_assertMetric(?S1GW_CTR_S1AP_PROXY_IN_PKT_ALL, 2), + ?_assertMetric(?S1GW_CTR_S1AP_PROXY_OUT_PKT_FWD_ALL, 2), + ?_assertMetric(?S1GW_CTR_S1AP_PROXY_OUT_PKT_FWD_UNMODIFIED, 2)].
test_e_rab_setup(#{handler := Pid}) -> @@ -374,6 +376,17 @@ >>.
+%% S1 SETUP RESPONSE +s1_setup_rsp_pdu() -> + << 16#20, 16#11, 16#00, 16#29, 16#00, 16#00, 16#03, 16#00, + 16#3d, 16#40, 16#0e, 16#05, 16#80, 16#6f, 16#70, 16#65, + 16#6e, 16#35, 16#67, 16#73, 16#2d, 16#6d, 16#6d, 16#65, + 16#30, 16#00, 16#69, 16#00, 16#0b, 16#00, 16#00, 16#00, + 16#f1, 16#10, 16#00, 16#00, 16#00, 16#02, 16#00, 16#01, + 16#00, 16#57, 16#40, 16#01, 16#ff + >>. + + %% [eNB <- MME] E-RAB SETUP REQUEST e_rab_setup_req_pdu(TLA, TEID) when is_binary(TLA), is_integer(TEID) ->