pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40272?usp=email )
Change subject: hnbgw: Introduce tests TC_ps_rab_release(_abnormal) ......................................................................
hnbgw: Introduce tests TC_ps_rab_release(_abnormal)
Same as their existing CS counterparts TC_rab_release(_abnormal).
Related: SYS#7451 Change-Id: Ia25efc2d6bf01d4a13e7fd1ce0563d20dd2e321e --- M hnbgw/HNBGW_Tests.ttcn M hnbgw/expected-results.xml M library/ranap/RANAP_Templates.ttcn 3 files changed, 152 insertions(+), 3 deletions(-)
Approvals: osmith: Looks good to me, but someone else must approve Jenkins Builder: Verified pespin: Looks good to me, approved laforge: Looks good to me, but someone else must approve
diff --git a/hnbgw/HNBGW_Tests.ttcn b/hnbgw/HNBGW_Tests.ttcn index 2ce36d5..ef70948 100644 --- a/hnbgw/HNBGW_Tests.ttcn +++ b/hnbgw/HNBGW_Tests.ttcn @@ -1660,6 +1660,85 @@ f_shutdown_helper(); }
+/* PS RAB release with Cause NAS/Normal (successful/orderly release). + * This can happen when MS sent a "SM Deactivate PDP Context Request", then CN answers with + * "SM Deactivate PDP Context Accept" followed by a "RAB Assign Req (ReleaseList)" */ +friend function f_ps_tc_rab_release(charstring id) runs on ConnHdlr { + var charstring hnb0_ctr_prefix := f_hnb_ctr_prefix(g_pars.hnb); + var MgcpCommand mgcp_cmd; + var RANAP_PDU tx; + timer T := 15.0; + + f_statsd_reset(); + + tx := f_build_initial_ue(g_pars); + f_iuh2iu_connect(tx); + + f_create_rab_ps(); + + var charstring ctr_name; + if (g_pars.rab_rel_cause == valueof(ts_RanapCause_nas_normal)) { + ctr_name := "ranap.ps.rab_rel.req.normal"; + } else { + ctr_name := "ranap.ps.rab_rel.req.abnormal"; + } + + /* Expect stats to be 0 */ + var StatsDExpects expect := { + {name := hnb0_ctr_prefix & ctr_name, mtype := "c", min := 0, max := 0} + }; + f_statsd_expect(expect); + + /* Send RAB Release */ + tx := valueof(ts_RANAP_RabAssReq(rab_rl := ts_RAB_RL(t_RAB_id(23), g_pars.rab_rel_cause))); + BSSAP.send(tx); + f_rua_expect(tx); + + tx := valueof(ts_RANAP_RabAssResp(rab_rl := ts_RAB_RLD(t_RAB_id(23)))); + RUA.send(tx); + + if (g_pars.pfcp_pars.pfcp_enabled) { + T.start; + alt { + [] as_pfcp_handle_del_req() {} + [] T.timeout { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + "Timeout waiting for PFCP Sess Del Req"); + } + } + T.stop; + } + + f_bssap_expect(tx); + + expect := { + {name := hnb0_ctr_prefix & ctr_name, mtype := "c", min := 1, max := 1} + }; + f_statsd_expect(expect); +} +testcase TC_ps_rab_release() runs on test_CT { + var ConnHdlr vc_conn; + g_num_hnbs := 1; + f_init(); + + vc_conn := f_start_handler_with_pars(refers(f_ps_tc_rab_release), f_TestHdlrParams(5, true)); + vc_conn.done; + + f_shutdown_helper(); +} +/* PS RAB release with Cause abnormal */ +testcase TC_ps_rab_release_abnormal() runs on test_CT { + var ConnHdlr vc_conn; + g_num_hnbs := 1; + f_init(); + + vc_conn := f_start_handler_with_pars(refers(f_ps_tc_rab_release), + f_TestHdlrParams(8, true, rab_rel_cause := ts_RanapCause_radio_conn_lost)); + vc_conn.done; + + f_shutdown_helper(); +} + /* Default list of counters for a 'cn' entity to test the cnpool feature. */ const CounterNameVals counternames_cnpool := { { "cnpool:subscr:new", 0 }, @@ -2655,6 +2734,8 @@ execute(TC_ps_rua_dt_during_sccp_wait_cc()); execute(TC_ps_rab_assignment()); execute(TC_ps_rab_assignment_concurrent()); + execute(TC_ps_rab_release()); + execute(TC_ps_rab_release_abnormal());
execute( TC_mscpool_L3Compl_on_1_cnlink() ); execute( TC_mscpool_L3Complete_by_imsi_round_robin() ); diff --git a/hnbgw/expected-results.xml b/hnbgw/expected-results.xml index 3777715..c04876d 100644 --- a/hnbgw/expected-results.xml +++ b/hnbgw/expected-results.xml @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<testsuite name='Titan' tests='60' failures='0' errors='0' skipped='0' inconc='0' time='MASKED'> +<testsuite name='Titan' tests='62' failures='0' errors='0' skipped='0' inconc='0' time='MASKED'> <testcase classname='HNBGW_Tests' name='TC_hnb_register' time='MASKED'/> <testcase classname='HNBGW_Tests' name='TC_hnb_register_duplicate' time='MASKED'/> <testcase classname='HNBGW_Tests' name='TC_hnb_register_duplicate_reuse_sctp_assoc' time='MASKED'/> @@ -33,6 +33,8 @@ <testcase classname='HNBGW_Tests' name='TC_ps_rua_dt_during_sccp_wait_cc' time='MASKED'/> <testcase classname='HNBGW_Tests' name='TC_ps_rab_assignment' time='MASKED'/> <testcase classname='HNBGW_Tests' name='TC_ps_rab_assignment_concurrent' time='MASKED'/> + <testcase classname='HNBGW_Tests' name='TC_ps_rab_release' time='MASKED'/> + <testcase classname='HNBGW_Tests' name='TC_ps_rab_release_abnormal' 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'/> <testcase classname='HNBGW_Tests' name='TC_mscpool_LU_by_tmsi_null_nri_0_round_robin' time='MASKED'/> diff --git a/library/ranap/RANAP_Templates.ttcn b/library/ranap/RANAP_Templates.ttcn index c328171..2ea443e 100644 --- a/library/ranap/RANAP_Templates.ttcn +++ b/library/ranap/RANAP_Templates.ttcn @@ -1745,6 +1745,38 @@ } } }
+template (value) RAB_ReleasedList ts_RAB_RLD(template (value) RAB_ID rab_id) := { { + { + id := id_RAB_ReleasedItem, + criticality := ignore, + value_ := { + rAB_ReleasedItem := { + rAB_ID := rab_id, + dl_dataVolumes := omit, + dL_GTP_PDU_SequenceNumber := omit, + uL_GTP_PDU_SequenceNumber := omit, + iE_Extensions := omit + } + } + } +} } + +template RAB_ReleasedList tr_RAB_RLD(template (present) RAB_ID rab_id) := { { + { + id := id_RAB_ReleasedItem, + criticality := ignore, + value_ := { + rAB_ReleasedItem := { + rAB_ID := rab_id, + dl_dataVolumes := *, + dL_GTP_PDU_SequenceNumber := *, + uL_GTP_PDU_SequenceNumber := *, + iE_Extensions := * + } + } + } +} } +
function ts_RANAP_RabAssReq(template (omit) RAB_SetupOrModifyList rab_sml := omit, @@ -1860,6 +1892,7 @@
function ts_RANAP_RabAssResp(template (omit) RAB_SetupOrModifiedList rab_sml := omit, + template (omit) RAB_ReleasedList rab_rl := omit, template (omit) RAB_FailedList rab_fl := omit, template (omit) RAB_AssignmentResponse.protocolExtensions exts := omit) return template RANAP_PDU { var template RANAP_PDU ret; @@ -1867,6 +1900,7 @@ var integer ie_pos := 0;
var template RAB_AssignmentResponse.protocolIEs protocolIEs_rab_sml; + var template RAB_AssignmentResponse.protocolIEs protocolIEs_rab_rl; var template RAB_AssignmentResponse.protocolIEs protocolIEs_rab_fl;
/* RAB-SetupOrModifiedList */ @@ -1885,7 +1919,22 @@ ie_pos := ie_pos + 1; }
- /* TODO: RAB-ReleasedList */ + /* RAB-ReleasedList */ + if (istemplatekind(rab_rl, "value")) { + protocolIEs_rab_rl := { + { + id := id_RAB_ReleasedList, + criticality := ignore, + value_ := { + rAB_ReleasedList := rab_rl + } + } + } + + protocolIEs[ie_pos] := protocolIEs_rab_rl[0]; + ie_pos := ie_pos + 1; + } + /* TODO: RAB-QueuedList */
/* RAB-FailedList */ @@ -1922,6 +1971,7 @@
function tr_RANAP_RabAssResp(template RAB_SetupOrModifiedList rab_sml := omit, + template RAB_ReleasedList rab_rl := omit, template RAB_FailedList rab_fl := omit, template RAB_AssignmentResponse.protocolExtensions exts := *) return template RANAP_PDU { var template RANAP_PDU ret; @@ -1929,6 +1979,7 @@ var integer ie_pos := 0;
var template RAB_AssignmentResponse.protocolIEs protocolIEs_rab_sml; + var template RAB_AssignmentResponse.protocolIEs protocolIEs_rab_rl; var template RAB_AssignmentResponse.protocolIEs protocolIEs_rab_fl;
/* RAB-SetupOrModifiedList */ @@ -1947,7 +1998,22 @@ ie_pos := ie_pos + 1; }
- /* TODO: RAB-ReleasedList */ + /* RAB-ReleasedList */ + if (not istemplatekind(rab_rl, "omit")) { + protocolIEs_rab_rl := { + { + id := id_RAB_ReleasedList, + criticality := ignore, + value_ := { + rAB_ReleasedList := rab_rl + } + } + } + + protocolIEs[ie_pos] := protocolIEs_rab_rl[0]; + ie_pos := ie_pos + 1; + } + /* TODO: RAB-QueuedList */
/* RAB-FailedList */