pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38552?usp=email )
Change subject: hnbgw: Introduce test TC_ranap_{cs,ps}_creq_cref ......................................................................
hnbgw: Introduce test TC_ranap_{cs,ps}_creq_cref
Related: SYS#6602 Change-Id: I0313ea741feca90492e25f0adc1c04844a860e41 --- M hnbgw/HNBGW_Tests.ttcn M hnbgw/expected-results.xml M library/SCCP_Templates.ttcn 3 files changed, 39 insertions(+), 0 deletions(-)
Approvals: osmith: Looks good to me, but someone else must approve Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve pespin: Looks good to me, approved
diff --git a/hnbgw/HNBGW_Tests.ttcn b/hnbgw/HNBGW_Tests.ttcn index 639904b..ed4ebda 100644 --- a/hnbgw/HNBGW_Tests.ttcn +++ b/hnbgw/HNBGW_Tests.ttcn @@ -48,6 +48,7 @@ import from RANAP_IEs all; import from RANAP_Templates all; import from RANAP_CodecPort all; +import from SCCP_Templates all;
import from RAN_Adapter all; import from RAN_Emulation all; @@ -1300,6 +1301,38 @@ f_shutdown_helper(); }
+/* SCCP Connect Req is answererd with Connect Refused: */ +private function f_tc_ranap_creq_cref_ConnHdlr(charstring id, TestHdlrParams pars) runs on ConnHdlr { + f_init_handler(pars); + + /* HNB -> MSC: InitialUE */ + f_iuh2iu_connect(f_build_initial_ue(g_pars)); + + /* This triggers a tx of SCCP CREF CN -> HNBGW: */ + BSSAP.send(ts_MSC_CONN_PRIM_DISC_REQ(sccp_par_reason_end_user_failure)); + /* HNBGW disconnects the session on the RUA side as a result: */ + RUA.receive(RUA_Disc_Ind:?); +} +private function f_tc_ranap_creq_cref(integer imsi_suffix, boolean ps_domain) runs on test_CT { + var ConnHdlr vc_conn; + g_num_hnbs := 1; + /* Instruct RAN_Emulation to avoid accepting the conn, we'll trigger an + * SCCP CREF by sending a DISC REQ primitive in ConnHdlr. */ + g_ran_ops.ranap_connect_ind_auto_res := false; + f_init(); + + vc_conn := f_start_handler_with_pars(refers(f_tc_ranap_creq_cref_ConnHdlr), f_TestHdlrParams(imsi_suffix, ps_domain)); + vc_conn.done; + + f_shutdown_helper(); +} +testcase TC_ranap_cs_creq_cref() runs on test_CT { + f_tc_ranap_creq_cref(7, false); +} +testcase TC_ranap_ps_creq_cref() runs on test_CT { + f_tc_ranap_creq_cref(8, true); +} + type record FTeid { HostName addr, OCT4 teid @@ -2398,6 +2431,8 @@ execute(TC_rab_assign_mgw_iuup_addr_chg()); execute(TC_ranap_cs_mo_disconnect()); execute(TC_ranap_ps_mo_disconnect()); + execute(TC_ranap_cs_creq_cref()); + execute(TC_ranap_ps_creq_cref());
if (mp_enable_pfcp_tests) { execute(TC_ps_rab_assignment_with_pfcp()); diff --git a/hnbgw/expected-results.xml b/hnbgw/expected-results.xml index 5f39bc5..0b67ec6 100644 --- a/hnbgw/expected-results.xml +++ b/hnbgw/expected-results.xml @@ -21,6 +21,8 @@ <testcase classname='HNBGW_Tests' name='TC_rab_assign_mgw_iuup_addr_chg' time='MASKED'/> <testcase classname='HNBGW_Tests' name='TC_ranap_cs_mo_disconnect' time='MASKED'/> <testcase classname='HNBGW_Tests' name='TC_ranap_ps_mo_disconnect' time='MASKED'/> + <testcase classname='HNBGW_Tests' name='TC_ranap_cs_creq_cref' time='MASKED'/> + <testcase classname='HNBGW_Tests' name='TC_ranap_ps_creq_cref' time='MASKED'/> <testcase classname='HNBGW_Tests' name='TC_ps_rab_assignment_without_pfcp' time='MASKED'/> <testcase classname='HNBGW_Tests' name='TC_mscpool_L3Compl_on_1_cnlink' time='MASKED'/> <testcase classname='HNBGW_Tests' name='TC_mscpool_L3Complete_by_imsi_round_robin' time='MASKED'/> diff --git a/library/SCCP_Templates.ttcn b/library/SCCP_Templates.ttcn index 6c977ac..40a6156 100644 --- a/library/SCCP_Templates.ttcn +++ b/library/SCCP_Templates.ttcn @@ -15,6 +15,8 @@ import from SCCPasp_Types all; import from SCCP_Emulation all;
+const integer sccp_par_reason_end_user_failure := 2; /* End user failure */ + /* construct a SCCP_PAR_Address with just SSN and no PC or GT */ template (value) SCCP_PAR_Address ts_SccpAddr_SSN(integer ssn) := { addressIndicator := {