fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/41491?usp=email )
Change subject: s1ap_proxy_test: update TC scenario for test_drop_proc_error ......................................................................
s1ap_proxy_test: update TC scenario for test_drop_proc_error
A follow-up commit implements handling of late E-RAB setup response. This testcase is going to fail because, by coincidence, currently we simulate the scenario of late INITIAL CONTEXT SETUP RESPONSE and expect the s1ap_proxy to drop the PDU. Change the testcase scenario to simulate an INITIAL CONTEXT SETUP RESPONSE without prior REQUEST instaed, so that it won't be affected by the upcoming patch. Take a chance to add asserts for per-eNB metrics.
Change-Id: I0b24807c9cf08564b53b9d0e087b797fea66e565 Related: SYS#7738, SYS#7599 --- M test/s1ap_proxy_test.erl 1 file changed, 12 insertions(+), 11 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/91/41491/1
diff --git a/test/s1ap_proxy_test.erl b/test/s1ap_proxy_test.erl index 7a93d1d..b1c0e44 100644 --- a/test/s1ap_proxy_test.erl +++ b/test/s1ap_proxy_test.erl @@ -498,21 +498,22 @@
test_drop_proc_error(#{handler := Pid}) -> - %% [eNB <- MME] INITIAL CONTEXT SETUP REQUEST - InitCtxSetupReq = initial_context_setup_req_pdu(?ADDR_U2C, ?TEID_U2C), %% [eNB -> MME] INITIAL CONTEXT SETUP RESPONSE InitCtxSetupRsp = initial_context_setup_rsp_pdu(?ADDR_U2A, ?TEID_U2A), - %% [eNB <- MME] UE CONTEXT RELEASE COMMAND - UeCtxReleaseCmd = ue_ctx_release_cmd_pdu(),
- [?_assertMatch({forward, _}, s1ap_proxy:process_pdu(Pid, InitCtxSetupReq)), - %% eNB does not respond in time, so the MME releases the UE context - ?_assertEqual({forward, UeCtxReleaseCmd}, s1ap_proxy:process_pdu(Pid, UeCtxReleaseCmd)), - %% eNB is late to the party, perhaps because of increased link latency? - ?_assertEqual({drop, InitCtxSetupRsp}, s1ap_proxy:process_pdu(Pid, InitCtxSetupRsp)), - ?_assertMetric(?S1GW_CTR_S1AP_PROXY_IN_PKT_ALL, 3), + [?_assertMatch({forward, _}, s1ap_proxy:process_pdu(Pid, s1_setup_req_pdu())), + ?_assertMatch({forward, _}, s1ap_proxy:process_pdu(Pid, s1_setup_rsp_pdu())), + %% INITIAL CONTEXT SETUP RESPONSE without prior request + %% "Failed to process INITIAL CONTEXT SETUP RESPONSE: erab_not_registered" + ?_assertMatch({drop, _}, s1ap_proxy:process_pdu(Pid, InitCtxSetupRsp)), + %% global metrics + ?_assertMetric(?S1GW_CTR_S1AP_PROXY_IN_PKT_ALL, 2 + 1), ?_assertMetric(?S1GW_CTR_S1AP_PROXY_IN_PKT_PROC_ERROR, 1), - ?_assertMetric(?S1GW_CTR_S1AP_PROXY_IN_PKT_DROP_ALL, 1)]. + ?_assertMetric(?S1GW_CTR_S1AP_PROXY_IN_PKT_DROP_ALL, 1), + %% per-eNB metrics + ?_assertMetricENB(?S1GW_CTR_S1AP_PROXY_IN_PKT_ALL, 2 + 1), + ?_assertMetricENB(?S1GW_CTR_S1AP_PROXY_IN_PKT_PROC_ERROR, 1), + ?_assertMetricENB(?S1GW_CTR_S1AP_PROXY_IN_PKT_DROP_ALL, 1)].
%% ------------------------------------------------------------------