pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42338?usp=email )
Change subject: 5gc: Introduce test TC_normal_reg_emergency_services_fallback ......................................................................
5gc: Introduce test TC_normal_reg_emergency_services_fallback
Change-Id: I17f15d901a10791ae0ad208b7d6ea9a333b93dad --- M 5gc/C5G_Tests.ttcn M 5gc/ConnHdlr.ttcn M 5gc/expected-results.xml 3 files changed, 60 insertions(+), 3 deletions(-)
Approvals: fixeria: Looks good to me, but someone else must approve osmith: Looks good to me, approved Jenkins Builder: Verified
diff --git a/5gc/C5G_Tests.ttcn b/5gc/C5G_Tests.ttcn index b10cef5..2528b77 100644 --- a/5gc/C5G_Tests.ttcn +++ b/5gc/C5G_Tests.ttcn @@ -618,8 +618,9 @@ * 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: + /* Validate this is supported in Register Accept: * .... 00.. = Emergency service support indicator (EMC): Emergency services not supported (0) + * This will fail currently, see https://github.com/open5gs/open5gs/issues/4359 */ var template (present) NG_NAS_DL_Message_Type exp_registration_accept := cr_NG_REGISTRATION_ACCEPT(p_NwkFeatureSupport := cr_NG_NetworkFeatureSupport(emc := '11'B), @@ -641,12 +642,51 @@ vc_conn.done; }
+/* 3GPP TS 23.501 5.16.4.11 Emergency Services Fallback + * 3GPP TS 23.502 4.13.4.2 Emergency Services Fallback + */ +private function f_TC_normal_reg_emergency_services_fallback() runs on ConnHdlr { + /* Validate this is supported in Register Accept: + * ..00 .... = Emergency service fallback indicator (EMF): Emergency services fallback not supported (0) + * This will fail currently, see https://github.com/open5gs/open5gs/issues/4360 + */ + var template (present) NG_NAS_DL_Message_Type exp_registration_accept := + cr_NG_REGISTRATION_ACCEPT(p_NwkFeatureSupport := cr_NG_NetworkFeatureSupport(emf := '11'B)); + f_register(exp_registration_accept := exp_registration_accept); + + f_service_request_emergency_services_fallback(); + + /* TODO: "After receiving the Service Request for Emergency Fallback, + * the AMF triggers N2 procedure resulting in either CONNECTED state mobility + * (Handover procedure) or IDLE state mobility (redirection) to either E-UTRA/5GC + * or to E-UTRAN/EPC depending on factors such as N26 availability, network + * configuration and radio conditions." + * Since the following cannot yet be configured in open5gs, we cannot really + * implement it either here. See also 3GPP TS 23.502 4.13.4.2 step 4 + 5. + * Currently open5gs answers the Service Request with a Service Accept, which is wrong. + */ + + f_sleep(1.0); + + f_deregister(); +} +testcase TC_normal_reg_emergency_services_fallback() 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_fallback), 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: + /* Validate this is supported in Register Accept: * .... 00.. = Emergency service support indicator (EMC): Emergency services not supported (0) + * This will fail currently, see https://github.com/open5gs/open5gs/issues/4359 */ var template (present) NG_NAS_DL_Message_Type exp_registration_accept := cr_NG_REGISTRATION_ACCEPT(p_NwkFeatureSupport := cr_NG_NetworkFeatureSupport(emc := '11'B), @@ -897,6 +937,7 @@ execute( TC_connection_suspend() );
execute( TC_normal_reg_emergency_services() ); + execute( TC_normal_reg_emergency_services_fallback() ); execute( TC_emergency_registration() );
execute( TC_handover_inter_ngran_xn() ); @@ -927,7 +968,6 @@ * - 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.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 ebe0376..7716cad 100644 --- a/5gc/ConnHdlr.ttcn +++ b/5gc/ConnHdlr.ttcn @@ -824,6 +824,20 @@ NGAP.send(tx_pdu); }
+/* 3GPP TS 23.502 4.13.4.2 Emergency Services Fallback, step 3 + 4 */ +function f_service_request_emergency_services_fallback() runs on ConnHdlr { + var template (value) NG_NAS_UL_Message_Type nas_ul_msg; + var NAS_PDU nas_pdu; + + nas_ul_msg := cs_NG_SERVICE_REQUEST(c_ServiceType_emergency_services_fallback, + g_pars.kset_id, + f_NG_MobileIdentity_STMSI(), + p_ULDataStatus := f_PDU_SessionStatus(), + p_PDU_SessionStatus := f_PDU_SessionStatus()); + nas_pdu := enc_NG_NAS_UL_Message_Type(valueof(nas_ul_msg)); + NGAP.send(nas_ul_msg); +} + /* 3GPP TS 24.501 5.5.2.2 UE-initiated de-registration procedure, * 3GPP TS 23.502 4.2.2.3.2 UE-initiated Deregistration */ function f_deregister() runs on ConnHdlr { diff --git a/5gc/expected-results.xml b/5gc/expected-results.xml index 0ad61e3..7dfbcfb 100644 --- a/5gc/expected-results.xml +++ b/5gc/expected-results.xml @@ -26,6 +26,9 @@ <testcase classname='C5G_Tests' name='TC_normal_reg_emergency_services' time='MASKED'> <error type='DTE'></error> </testcase> + <testcase classname='C5G_Tests' name='TC_normal_reg_emergency_services_fallback' time='MASKED'> + <error type='DTE'></error> + </testcase> <testcase classname='C5G_Tests' name='TC_emergency_registration' time='MASKED'> <error type='DTE'></error> </testcase>