pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42332?usp=email )
Change subject: 5gc: Introduce tests for emergency services ......................................................................
5gc: Introduce tests for emergency services
These tests are expected to fail since open5gs has no specific logic for emergency services in open5gs-amfd, and announces no Emergency Support in Registration Accept.
Change-Id: Ie853b184da7ac8026bb0c360baabba762a7942e0 --- M 5gc/C5G_Tests.ttcn M 5gc/ConnHdlr.ttcn M 5gc/expected-results.xml M library/NG_NAS_Osmo_Templates.ttcn 4 files changed, 120 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/32/42332/1
diff --git a/5gc/C5G_Tests.ttcn b/5gc/C5G_Tests.ttcn index 636a0a3..b10cef5 100644 --- a/5gc/C5G_Tests.ttcn +++ b/5gc/C5G_Tests.ttcn @@ -41,6 +41,7 @@ import from NG_NAS_MsgContainers all; import from NG_NAS_Templates all;
+import from NG_NAS_Osmo_Types all; import from NG_NAS_Osmo_Templates all; import from NG_NAS_Functions all; import from NG_CryptoFunctions all; @@ -613,6 +614,61 @@ vc_conn.done; }
+/* 3GPP TS 23.501 5.16.4 Emergency Services + * 3GPP TS 23.502 4.13.4 Emergency Services + */ +private function f_TC_normal_reg_emergency_services() runs on ConnHdlr { + /* Validate this is set in Register Accept: + * .... 00.. = Emergency service support indicator (EMC): Emergency services not supported (0) + */ + var template (present) NG_NAS_DL_Message_Type exp_registration_accept := + cr_NG_REGISTRATION_ACCEPT(p_NwkFeatureSupport := cr_NG_NetworkFeatureSupport(emc := '11'B), + p_EmergNumList := *); + f_register(exp_registration_accept := exp_registration_accept); + f_pdu_sess_establish(request_type := c_RequestType_initial_emergency_request); + f_sleep(1.0); + f_ping4(g_pars.ue_pars.sess_pars.run_prog_pars.ping_hostname); + f_pdu_sess_release(); + f_deregister(); +} +testcase TC_normal_reg_emergency_services() runs on MTC_CT { + f_init(); + f_ngap_setup(0); + + var ConnHdlrPars pars := f_init_pars(ue_idx := 0); + var ConnHdlr vc_conn; + vc_conn := f_start_handler_with_pars(refers(f_TC_normal_reg_emergency_services), pars); + vc_conn.done; +} + +/* 3GPP TS 23.501 5.16.4 Emergency Services + * 3GPP TS 23.502 4.13.4 Emergency Services + */ +private function f_TC_emergency_registration() runs on ConnHdlr { + /* Validate this is set in Register Accept: + * .... 00.. = Emergency service support indicator (EMC): Emergency services not supported (0) + */ + var template (present) NG_NAS_DL_Message_Type exp_registration_accept := + cr_NG_REGISTRATION_ACCEPT(p_NwkFeatureSupport := cr_NG_NetworkFeatureSupport(emc := '11'B), + p_EmergNumList := *); + f_register(registration_type := tsc_NG_RegistrationEmergency, + exp_registration_accept := exp_registration_accept); + f_pdu_sess_establish(request_type := c_RequestType_initial_emergency_request); + f_sleep(1.0); + f_ping4(g_pars.ue_pars.sess_pars.run_prog_pars.ping_hostname); + f_pdu_sess_release(); + f_deregister(); +} +testcase TC_emergency_registration() runs on MTC_CT { + f_init(); + f_ngap_setup(0); + + var ConnHdlrPars pars := f_init_pars(ue_idx := 0); + var ConnHdlr vc_conn; + vc_conn := f_start_handler_with_pars(refers(f_TC_emergency_registration), pars); + vc_conn.done; +} + /* 3GPP TS 23.502 4.9.1.2.2 Xn based inter NG-RAN handover without User Plane function re-allocation */ private function f_TC_handover_inter_ngran_xn_source() runs on ConnHdlr { f_register(); @@ -840,6 +896,9 @@ execute( TC_connection_inactive() ); execute( TC_connection_suspend() );
+ execute( TC_normal_reg_emergency_services() ); + execute( TC_emergency_registration() ); + execute( TC_handover_inter_ngran_xn() ); execute( TC_handover_inter_ngran_n2() ); execute( TC_handover_inter_ngran_n2_cancel() ); @@ -868,8 +927,7 @@ * - 3GPP TS 23.502 4.13.3.6 MT SMS over NAS in CM-IDLE state and RRC_INACTIVE with CN based MT communication state via 3GPP access * - 3GPP TS 23.502 4.13.3.7 MT SMS over NAS in CM-CONNECTED state via 3GPP access * - 3GPP TS 23.502 4.13.3.8 MT SMS over NAS via non-3GPP access - * - 3GPP TS 23.502 4.13.4 Emergency Services - * - 3GPP TS 23.502 4.13.4.2 Emergency Services Fallback + * - 3GPP TS 23.502 4.13.4.2 Emergency Services Fallback: Not supported by open5gs (see also 3GPP TS 23.501 5.16.4.11) * - 3GPP TS 23.502 4.13.5 Location Services procedures * - 3GPP TS 23.502 4.13.6.1 EPS fallback for IMS voice * - 3GPP TS 23.502 4.13.6.2 Inter RAT Fallback in 5GC for IMS voice diff --git a/5gc/ConnHdlr.ttcn b/5gc/ConnHdlr.ttcn index c81c73a..a6b68bd 100644 --- a/5gc/ConnHdlr.ttcn +++ b/5gc/ConnHdlr.ttcn @@ -695,13 +695,14 @@ }
/* 3GPP TS 23.502 4.2.2.2.2 General Registration */ -function f_register() runs on ConnHdlr { +function f_register(BIT3 registration_type := tsc_NG_RegistrationInitial, + template (present) NG_NAS_DL_Message_Type exp_registration_accept := cr_NG_REGISTRATION_ACCEPT) runs on ConnHdlr { var template (value) NGAP_PDU tx_pdu; var template (value) NG_NAS_UL_Message_Type nas_ul_msg; var NAS_PDU nas_pdu; var NG_NAS_DL_Message_Type rx_nas;
- nas_ul_msg := cs_NG_REGISTRATION_REQUEST(cs_RegistrationType(tsc_NG_RegistrationInitial, '1'B), + nas_ul_msg := cs_NG_REGISTRATION_REQUEST(cs_RegistrationType(registration_type, '1'B), g_pars.kset_id.nasKeySetId, g_pars.kset_id.tsc, cs_NG_MobileIdentitySUCI('0000'B /* Type IMSI */, @@ -730,7 +731,7 @@ /* After receiving DL NAS Transport above, the UE-AMF-Id became known in NGAP_Emulation: */ g_pars.ue_pars.amf_id := f_ngap_obtain_amf_id();
- NGAP.receive(cr_NG_REGISTRATION_ACCEPT) -> value rx_nas; + NGAP.receive(exp_registration_accept) -> value rx_nas; g_pars.ue_pars.guti := rx_nas.registration_Accept.guti.otherDigits; NGAP.send(cs_NG_REGISTRATION_COMPLETE);
diff --git a/5gc/expected-results.xml b/5gc/expected-results.xml index e28ce57..0ad61e3 100644 --- a/5gc/expected-results.xml +++ b/5gc/expected-results.xml @@ -23,6 +23,12 @@ C5G_Tests.ttcn:MASKED TC_connection_suspend testcase </failure> </testcase> + <testcase classname='C5G_Tests' name='TC_normal_reg_emergency_services' time='MASKED'> + <error type='DTE'></error> + </testcase> + <testcase classname='C5G_Tests' name='TC_emergency_registration' time='MASKED'> + <error type='DTE'></error> + </testcase> <testcase classname='C5G_Tests' name='TC_handover_inter_ngran_xn' time='MASKED'/> <testcase classname='C5G_Tests' name='TC_handover_inter_ngran_n2' time='MASKED'/> <testcase classname='C5G_Tests' name='TC_handover_inter_ngran_n2_cancel' time='MASKED'/> diff --git a/library/NG_NAS_Osmo_Templates.ttcn b/library/NG_NAS_Osmo_Templates.ttcn index 393ae69..7edb9f5 100644 --- a/library/NG_NAS_Osmo_Templates.ttcn +++ b/library/NG_NAS_Osmo_Templates.ttcn @@ -86,6 +86,56 @@ replayedNASMsgContainerValue := val };
+/* 24.501 cl 9.11.3.5 */ +template (present) NG_NetworkFeatureSupport cr_NG_NetworkFeatureSupport( + template (present) B1_Type mpsi := ?, + template (present) B1_Type iwk_N26 := ?, + template (present) B2_Type emf := ?, + template (present) B2_Type emc := ?, + template (present) B1_Type imsVoPS_n3GPP := ?, + template (present) B1_Type imsVoPS_3GPP := ?, + template B1_Type ng_UP_CIoT := *, /* Sep20 @sic R5s201387, R5s221179 Baseline Moving sic@ */ + template B1_Type ngIPHC_CP_CIoT := *, /* Sep20 @sic R5s201387, R5s221179 Baseline Moving sic@ */ + template B1_Type n3Data := *, /* Sep20 @sic R5s201387, R5s221179 Baseline Moving sic@ */ + template B1_Type ng_CP_CIoT := *, /* Sep20 @sic R5s201387, R5s221179 Baseline Moving sic@ */ + template B2_Type restrictEC := *, /* Sep20 @sic R5s201387, R5s221179 Baseline Moving sic@ */ + template B1_Type mcsi := *, /* Sep22 @sic R5s221179 Baseline Moving sic@ */ + template B1_Type emcn3 := *, /* Sep22 @sic R5s221179 Baseline Moving sic@ */ + template B1_Type spareBit := *, /* Sep22 @sic R5s221179 Baseline Moving sic@ */ + template B1_Type pr := *, /* Sep22 @sic R5s221179 Baseline Moving sic@ */ + template B1_Type rpr := *, /* Sep22 @sic R5s221179 Baseline Moving sic@ */ + template B1_Type piv := *, /* Sep22 @sic R5s221179 Baseline Moving sic@ */ + template B1_Type ncr := *, /* Sep22 @sic R5s221179 Baseline Moving sic@ */ + template B1_Type ngEHC_CP_CIoT := *, /* Sep20 @sic R5s201387, R5s221179 Baseline Moving sic@ */ + template B1_Type atsInd := *, /* Sep20 @sic R5s201387, R5s221179 Baseline Moving sic@ */ + template B1_Type ngLCS := * /* Sep20 @sic R5s201387, R5s221179 Baseline Moving sic@ */ + ) := +{ + iei := '21'O, /* @sic R5s190109 sic@ */ + iel := *, /* present in case of LV or TLV; omit in case of V @sic R5s201526 sic@ */ + mpsi := mpsi, + iwk_N26 := iwk_N26, + emf := emf, + emc := emc, //@sic R5-198540 sic@ + imsVoPS_n3GPP := imsVoPS_n3GPP, + imsVoPS_3GPP := imsVoPS_3GPP, + ng_UP_CIoT := ng_UP_CIoT, /* Sep20 @sic R5s201387 Baseline Moving sic@ */ + ngIPHC_CP_CIoT := ngIPHC_CP_CIoT, /* Sep20 @sic R5s201387 Baseline Moving sic@ */ + n3Data := n3Data, /* Sep20 @sic R5s201387 Baseline Moving sic@ */ + ng_CP_CIoT := ng_CP_CIoT, /* Sep20 @sic R5s201387 Baseline Moving sic@ */ + restrictEC := restrictEC, /* Sep20 @sic R5s201387 Baseline Moving sic@ */ + mcsi := mcsi, + emcn3 := emcn3, + spareBit := spareBit, + pr := pr, /* Sep22 @sic R5s221179 Baseline Moving sic@ */ + rpr := rpr, /* Sep22 @sic R5s221179 Baseline Moving sic@ */ + piv := piv, /* Sep22 @sic R5s221179 Baseline Moving sic@ */ + ncr := ncr, /* Sep22 @sic R5s221179 Baseline Moving sic@ */ + ngEHC_CP_CIoT := ngEHC_CP_CIoT, /* Sep20 @sic R5s201387 Baseline Moving sic@ */ + atsInd := atsInd, /* Sep20 @sic R5s201387 Baseline Moving sic@ */ + ngLCS := ngLCS /* Sep20 @sic R5s201387 Baseline Moving sic@ */ +}; + /* 24.501 cl. 9.11.3.6 */ template (present) RegistrationResult cr_RegistrationResultLV(template (present) B3_Type p_Result := ?,