pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42143?usp=email )


Change subject: 5gc: Introduce test TC_connection_inactive
......................................................................

5gc: Introduce test TC_connection_inactive

The test is expected to fail because open5gs (as of v2.7.3) doesn't
implement such features; see open5gs ticket referenced below.

Related: SYS#7073
Related: open5gs GH#4319
Change-Id: Icf60dde814b7c8ef4cdb4c886423058c7d741a9b
---
M 5gc/C5G_Tests.ttcn
M 5gc/ConnHdlr.ttcn
M 5gc/expected-results.xml
3 files changed, 73 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/43/42143/1

diff --git a/5gc/C5G_Tests.ttcn b/5gc/C5G_Tests.ttcn
index 33aa176..5f1516d 100644
--- a/5gc/C5G_Tests.ttcn
+++ b/5gc/C5G_Tests.ttcn
@@ -202,7 +202,8 @@
                ngran_pars := g_ngran_pars,
                ue_pars := valueof(ts_UeParams(ue_idx)),
                c5g_idx := 0,
-               kset_id := valueof(cs_NAS_KeySetIdentifier_lv(tsc_NasKsi_NoKey, 
'0'B))
+               kset_id := valueof(cs_NAS_KeySetIdentifier_lv(tsc_NasKsi_NoKey, 
'0'B)),
+               exp_CoreNetworkAssistanceInformationForInactive := false
        };
        return pars;
 }
@@ -540,6 +541,37 @@
        vc_conn.done;
 }

+/* 3GPP TS 23.502 4.8.1.1(a) Connection Inactive procedure */
+private function f_TC_connection_inactive() runs on ConnHdlr {
+       f_register();
+       f_pdu_sess_establish(false);
+
+       /* Figure 4.8.1.1a-1 step 2: "NG-RAN sends N2 MT Communication Handling 
request message
+        * to AMF indicating the UE is transitioning to RRC_INACTIVE state". */
+       f_mt_communication_handling();
+
+
+       f_sleep(1.0);
+       f_ue_context_release();
+}
+testcase TC_connection_inactive() runs on MTC_CT {
+       var ConnHdlr vc_conn;
+       var ConnHdlrPars pars;
+
+       f_init();
+       f_ngap_setup(0);
+
+       pars := f_init_pars(ue_idx := 0);
+       /* Validate we received from CN in "INITIAL CONTEXT SETUP REQUEST":
+        * "CN MT Communication Handling IE" inside "Core Network Assistance 
Information for RRC INACTIVE IE",
+        * 3GPP TS 38.413 9.3.1.15.
+        * NOTE: current open5gs v2.7.3 doesn't set it, meaning it doesn't 
support RRC_INACTIVE state. */
+       pars.exp_CoreNetworkAssistanceInformationForInactive := true;
+
+       vc_conn := f_start_handler_with_pars(refers(f_TC_connection_inactive), 
pars);
+       vc_conn.done;
+}
+
 control {
        execute( TC_ng_setup() );
        execute( TC_ng_setup_unknown_global_gnb_id_plmn() );
@@ -562,6 +594,8 @@
        execute( TC_ue_service_request_cm_connected() );

        execute( TC_net_triggered_service_req() );
+       execute( TC_connection_inactive() );
+
 }

 /* TODO:
diff --git a/5gc/ConnHdlr.ttcn b/5gc/ConnHdlr.ttcn
index 0d356b9..ae286c5 100644
--- a/5gc/ConnHdlr.ttcn
+++ b/5gc/ConnHdlr.ttcn
@@ -107,7 +107,9 @@
        /* currently used 5GC (index into ngran_pars, NGAP, ...) */
        integer c5g_idx,
        /* Currently set KSI */
-       NAS_KeySetIdentifier kset_id
+       NAS_KeySetIdentifier kset_id,
+       /* Expect "Core Network Assistance Information for RRC INACTIVE" IE 
present in Inital Context Setup Request */
+       boolean exp_CoreNetworkAssistanceInformationForInactive
 }

 type component ConnHdlr extends NGAP_ConnHdlr, GTP1U_ConnHdlr {
@@ -173,6 +175,19 @@
        }
 }

+private function f_tr_ConnHdlr_CoreNetworkAssistanceInformationForInactive() 
runs on ConnHdlr return template CoreNetworkAssistanceInformationForInactive {
+       var template CoreNetworkAssistanceInformationForInactive exp := omit
+       if (g_pars.exp_CoreNetworkAssistanceInformationForInactive) {
+               /* "CN MT Communication Handling IE" inside "Core Network 
Assistance Information for RRC INACTIVE IE",
+                * 3GPP TS 38.413 9.3.1.15.
+                * NOTE: current open5gs v2.7.3 doesn't set it, meaning it 
doesn't support RRC_INACTIVE state. */
+               var template (present) 
CoreNetworkAssistanceInformationForInactive.iE_Extensions ie_ext;
+               ie_ext := 
f_mw_CoreNetworkAssistanceInformationForInactive_ExtIEs(p_cN_MT_CommunicationHandling
 := supported);
+               exp := 
mw_CoreNetworkAssistanceInformationForInactive(p_iE_Extensions := ie_ext);
+       }
+       return exp;
+}
+
 /* 3GPP TS 24.501 9.6, 3GPP TS 24.007 11.2.3.1a.
  * 0 = "No procedure transaction identity assigned", 255 = "Reserved". */
 private function f_next_pti() runs on ConnHdlr return 
ProcedureTransactionIdentifier
@@ -365,12 +380,14 @@
                mw_ngap_initMsg((f_mw_n2_InitialContextSetupRequest(amf_id,
                                                                    
g_pars.ue_pars.ran_id,
                                                                    
p_uEAggregateMaximumBitRate := ?,
+                                                                   
p_coreNetworkAssistanceInformationForInactive := 
f_tr_ConnHdlr_CoreNetworkAssistanceInformationForInactive(),
                                                                    
p_pDUSessionResourceSetupListCxtReq := ?,
                                                                    p_nextHopNH 
:= ?,
                                                                    
p_maskedIMEISV := ?),
                                 f_mw_n2_InitialContextSetupRequest(amf_id,
                                                                    
g_pars.ue_pars.ran_id,
                                                                    
p_uEAggregateMaximumBitRate := ?,
+                                                                   
p_coreNetworkAssistanceInformationForInactive := 
f_tr_ConnHdlr_CoreNetworkAssistanceInformationForInactive(),
                                                                    
p_pDUSessionResourceSetupListCxtReq := ?,
                                                                    p_nextHopNH 
:= ?,
                                                                    
p_maskedIMEISV := ?,
@@ -811,6 +828,23 @@
        as_ngap_handle_UeContextReleaseCmd(exp_cause := cause);
 }

+/* 3GPP TS 38.413 8.3.13 "MT Communication Handling"
+ * 3GPP TS 23.502 4.8.1.1(a) Connection Inactive procedure step 2. */
+function f_mt_communication_handling() runs on ConnHdlr
+{
+       var template (value) NGAP_PDU tx_pdu;
+
+       tx_pdu := m_ngap_initMsg(m_n2_MTCommunicationHandlingRequest(
+                                       g_pars.ue_pars.amf_id,
+                                       g_pars.ue_pars.ran_id,
+                                       
m_FiveGCAction_HLComActivate(m_hLComActivate(m_nR_Paging_Long_eDRX_Information_for_RRC_INACTIVE(hf1024,
 s32))),
+                                       
{m_PDUSessionListMTCommHReq_Item(g_pars.ue_pars.sess_pars.id)}));
+       NGAP.send(tx_pdu);
+       NGAP.receive(mw_ngap_succMsg(mw_n2_MTCommunicationHandlingResponse(
+                                       g_pars.ue_pars.amf_id,
+                                       g_pars.ue_pars.ran_id)));
+}
+
 /* Handle a PDUSessionResourceSetupRequestTransfer contained inside NGAP 
InitialContextSetupRequest and return a Result for InitialContextSetupResponse 
*/
 private function 
f_pdu_handle_session_resource_released_item(PDUSessionResourceToReleaseItemRelCmd
 cmd) runs on ConnHdlr return PDUSessionResourceReleasedItemRelRes
 {
diff --git a/5gc/expected-results.xml b/5gc/expected-results.xml
index f509895..0472dc7 100644
--- a/5gc/expected-results.xml
+++ b/5gc/expected-results.xml
@@ -15,4 +15,7 @@
   <testcase classname='C5G_Tests' 
name='TC_ue_service_request_cm_idle_unknown_sess_active' time='MASKED'/>
   <testcase classname='C5G_Tests' name='TC_ue_service_request_cm_connected' 
time='MASKED'/>
   <testcase classname='C5G_Tests' name='TC_net_triggered_service_req' 
time='MASKED'/>
+  <testcase classname='C5G_Tests' name='TC_connection_inactive' time='MASKED'>
+    <error type='DTE'></error>
+  </testcase>
 </testsuite>

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42143?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Icf60dde814b7c8ef4cdb4c886423058c7d741a9b
Gerrit-Change-Number: 42143
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>

Reply via email to