pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42417?usp=email )

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

5gc: Introduce test TC_ran_initiated_qos_flow_mobility

Change-Id: I1a1df29fa254496990d3d9099b3072433468ecb1
---
M 5gc/C5G_Tests.ttcn
M 5gc/ConnHdlr.ttcn
M 5gc/expected-results.xml
M library/ngap/NGAP_EncDec.cc
M library/ngap/NGAP_Types.ttcn
5 files changed, 86 insertions(+), 1 deletion(-)

Approvals:
  osmith: Looks good to me, but someone else must approve
  fixeria: Looks good to me, but someone else must approve
  Jenkins Builder: Verified
  pespin: Looks good to me, approved




diff --git a/5gc/C5G_Tests.ttcn b/5gc/C5G_Tests.ttcn
index 02ba9c3..109749a 100644
--- a/5gc/C5G_Tests.ttcn
+++ b/5gc/C5G_Tests.ttcn
@@ -913,6 +913,30 @@

 /* 3GPP TS 23.502 4.21 Secondary RAT Usage Data Reporting Procedure
  * 3GPP TS 38.413 8.15.1 Secondary RAT Data Usage Report
+ * 3GPP TS 29.502 5.2.2.3.7 RAN Initiated QoS Flow Mobility
+ */
+private function f_TC_ran_initiated_qos_flow_mobility() runs on ConnHdlr {
+       f_register();
+       f_pdu_sess_establish();
+       f_sleep(1.0);
+
+       f_pdu_sess_modify_ind();
+
+       f_pdu_sess_release();
+       f_deregister();
+}
+testcase TC_ran_initiated_qos_flow_mobility() 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_ran_initiated_qos_flow_mobility), pars);
+       vc_conn.done;
+}
+
+/* 3GPP TS 23.502 4.21 Secondary RAT Usage Data Reporting Procedure
+ * 3GPP TS 38.413 8.15.1 Secondary RAT Data Usage Report
  */
 private function f_TC_secondary_rat_data_usage_report() runs on ConnHdlr {
        f_register();
@@ -964,6 +988,7 @@
        execute( TC_handover_inter_ngran_n2() );
        execute( TC_handover_inter_ngran_n2_cancel() );

+       execute( TC_ran_initiated_qos_flow_mobility() );
        execute( TC_secondary_rat_data_usage_report() );
 }

@@ -1000,7 +1025,6 @@
  * - 3GPP TS 23.502 4.13.6.1 EPS fallback for IMS voice: Not supported by 
open5gs (https://github.com/open5gs/open5gs/issues/2534)
  * - 3GPP TS 23.502 4.13.6.2 Inter RAT Fallback in 5GC for IMS voice: Not 
supported by open5gs (https://github.com/open5gs/open5gs/issues/2534)
  * - 3GPP TS 23.502 4.13.6.3 Transfer of PDU session used for IMS voice from 
non-3GPP access to 5GS: Not supported by open5gs 
(https://github.com/open5gs/open5gs/issues/2534)
- * - 3GPP TS 23.502 4.14.1 RAN Initiated QoS Flow Mobility
  * - 3GPP TS 23.502 Annex G (normative): Support of GERAN/UTRAN access by 
SMF+PGW-C
  *
  * - Emergency call (PDU Sess Establish "Request Type"="Emergency Request")
diff --git a/5gc/ConnHdlr.ttcn b/5gc/ConnHdlr.ttcn
index 33c7669..37450bf 100644
--- a/5gc/ConnHdlr.ttcn
+++ b/5gc/ConnHdlr.ttcn
@@ -694,6 +694,39 @@
        NGAP.send(nas_ul_msg);
 }

+/* 3GPP TS 38.413 8.2.5 PDU Session Resource Modify Indication
+ * 3GPP TS 38.413 9.3.4.6 PDU Session Resource Modify Indication Transfer
+ * 3GPP TS 29.502 5.2.2.3.7 RAN Initiated QoS Flow Mobility
+ * 3GPP TS 23.502 4.14.1 RAN Initiated QoS Flow Mobility */
+function f_pdu_sess_modify_ind() runs on ConnHdlr {
+       var template (value) QosFlowPerTNLInformation qos;
+       var template (value) PDUSessionResourceModifyIndicationTransfer 
transfer;
+       var octetstring transfer_enc;
+       var template (value) PDUSessionResourceModifyItemModInd it;
+       var template (value) NGAP_PDU tx_pdu;
+       var integer qos_id := 0;
+
+       qos := m_qosFlowPerTNLInformation(f_UPTLI(), { 
m_associatedQosFlowItem(qos_id) });
+       transfer := m_pDUSessionResourceModifyIndicationTransfer(qos);
+       transfer_enc := 
enc_NGAP_PDUSessionResourceModifyIndicationTransfer(valueof(transfer));
+       it := m_pDUSessionResourceModifyItemModInd(g_pars.ue_pars.sess_pars.id,
+                                           transfer_enc);
+
+       tx_pdu := m_ngap_initMsg(
+                       m_n2_PDUSessionResourceModifyIndication(
+                               g_pars.ue_pars.amf_id,
+                               g_pars.ue_pars.ran_id,
+                               { it }));
+       NGAP.send(tx_pdu);
+
+       /* Note: This currently fails because handling 
PDUSessionResourceModifyIndication
+        * is not implemented in open5gs. */
+       NGAP.receive(mw_ngap_succMsg(mw_n2_PDUSessionResourceModifyConfirm(
+                                       g_pars.ue_pars.amf_id,
+                                       g_pars.ue_pars.ran_id,
+                                       ?)));
+}
+
 /* 3GPP TS 23.502 4.2.2.2.2 General Registration */
 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 {
diff --git a/5gc/expected-results.xml b/5gc/expected-results.xml
index ed5ac2b..bc47001 100644
--- a/5gc/expected-results.xml
+++ b/5gc/expected-results.xml
@@ -35,5 +35,10 @@
   <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'/>
+  <testcase classname='C5G_Tests' name='TC_ran_initiated_qos_flow_mobility' 
time='MASKED'>
+    <failure type='fail-verdict'>"C5G_Tests.ttcn:MASKED : Tguard timeout"
+      C5G_Tests.ttcn:MASKED TC_ran_initiated_qos_flow_mobility testcase
+    </failure>
+  </testcase>
   <testcase classname='C5G_Tests' name='TC_secondary_rat_data_usage_report' 
time='MASKED'/>
 </testsuite>
diff --git a/library/ngap/NGAP_EncDec.cc b/library/ngap/NGAP_EncDec.cc
index 64c9755..d6d7ead 100644
--- a/library/ngap/NGAP_EncDec.cc
+++ b/library/ngap/NGAP_EncDec.cc
@@ -109,6 +109,26 @@
        return ret;
 }

+OCTETSTRING enc__NGAP__PDUSessionResourceModifyIndicationTransfer(const 
NGAP__IEs::PDUSessionResourceModifyIndicationTransfer &p)
+{
+       TTCN_Buffer TTCN_buf;
+       TTCN_buf.clear();
+       p.encode(NGAP__IEs::PDUSessionResourceModifyIndicationTransfer_descr_, 
TTCN_buf,
+                  TTCN_EncDec::CT_PER, PER_ALIGNED);
+       return OCTETSTRING(TTCN_buf.get_len(), TTCN_buf.get_data());
+}
+
+NGAP__IEs::PDUSessionResourceModifyIndicationTransfer 
dec__NGAP__PDUSessionResourceModifyIndicationTransfer(const OCTETSTRING &stream)
+{
+       NGAP__IEs::PDUSessionResourceModifyIndicationTransfer ret;
+       TTCN_Buffer TTCN_buf;
+       TTCN_buf.clear();
+       TTCN_buf.put_os(stream);
+       
ret.decode(NGAP__IEs::PDUSessionResourceModifyIndicationTransfer_descr_, 
TTCN_buf,
+                  TTCN_EncDec::CT_PER, PER_ALIGNED);
+       return ret;
+}
+
 OCTETSTRING enc__NGAP__UEContextSuspendRequestTransfer(const 
NGAP__IEs::UEContextSuspendRequestTransfer &p)
 {
        TTCN_Buffer TTCN_buf;
diff --git a/library/ngap/NGAP_Types.ttcn b/library/ngap/NGAP_Types.ttcn
index 86851f5..73378d1 100644
--- a/library/ngap/NGAP_Types.ttcn
+++ b/library/ngap/NGAP_Types.ttcn
@@ -18,6 +18,9 @@
        external function 
enc_NGAP_PDUSessionResourceModifyResponseTransfer(NGAP_IEs.PDUSessionResourceModifyResponseTransfer
 p) return octetstring;
        external function dec_NGAP_PDUSessionResourceModifyResponseTransfer(in 
octetstring pdu) return NGAP_IEs.PDUSessionResourceModifyResponseTransfer;

+       external function 
enc_NGAP_PDUSessionResourceModifyIndicationTransfer(NGAP_IEs.PDUSessionResourceModifyIndicationTransfer
 p) return octetstring;
+       external function 
dec_NGAP_PDUSessionResourceModifyIndicationTransfer(in octetstring pdu) return 
NGAP_IEs.PDUSessionResourceModifyIndicationTransfer;
+
        external function 
enc_NGAP_UEContextSuspendRequestTransfer(NGAP_IEs.UEContextSuspendRequestTransfer
 p) return octetstring;
        external function dec_NGAP_UEContextSuspendRequestTransfer(in 
octetstring pdu) return NGAP_IEs.UEContextSuspendRequestTransfer;


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

Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I1a1df29fa254496990d3d9099b3072433468ecb1
Gerrit-Change-Number: 42417
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>

Reply via email to