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


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

5gc: Introduce test TC_connection_suspend

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#4322

Change-Id: I6da2571518a9b50369fa8e0dd19e447137ea20c6
---
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, 95 insertions(+), 2 deletions(-)



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

diff --git a/5gc/C5G_Tests.ttcn b/5gc/C5G_Tests.ttcn
index 5f1516d..5a35b5a 100644
--- a/5gc/C5G_Tests.ttcn
+++ b/5gc/C5G_Tests.ttcn
@@ -572,6 +572,35 @@
        vc_conn.done;
 }

+/* 3GPP TS 23.502 4.8.1.2 Connection Suspend procedure,
+ * 3GPP TS 23.502 4.8.2.3 Connection Resume procedure */
+private function f_TC_connection_suspend() runs on ConnHdlr {
+       f_register();
+       f_pdu_sess_establish(false);
+
+       f_ue_context_suspend();
+       f_ue_context_resume();
+       f_sleep(1.0);
+       f_ue_context_release();
+}
+testcase TC_connection_suspend() runs on MTC_CT {
+       var ConnHdlr vc_conn;
+       var ConnHdlrPars pars;
+
+       /* TODO: 3GPP TS 23.501 5.31.18 "User Plane CIoT 5GS Optimisation":
+        * - UE and AMF negotiated support User Plane CIoT 5GS Optimisation 
(see clause 5.31.2) over NAS,
+        * - the UE has indicated support of User Plane CIoT 5GS Optimisation 
in the UE radio capabilities as defined in TS 36.331 [51]
+        * AMF has indicated User Plane CIoT 5GS Optimisation support for the 
UE to NG-RAN
+        */
+       f_init();
+       f_ngap_setup(0);
+
+       pars := f_init_pars(ue_idx := 0);
+
+       vc_conn := f_start_handler_with_pars(refers(f_TC_connection_suspend), 
pars);
+       vc_conn.done;
+}
+
 control {
        execute( TC_ng_setup() );
        execute( TC_ng_setup_unknown_global_gnb_id_plmn() );
@@ -611,8 +640,8 @@
  * - 3GPP TS 23.502 4.5.2 Session Management Subscriber Data Update 
Notification to SMF: open5gs-udm supports sotring subscriptions, but never 
triggers notifications whenever subscriber data is changed. open5gs-smfd 
registers to UDM but doesn't implement receiving a notification.
  * - 3GPP TS 23.502 4.7 ME Identity check procedure: N5g-eir 
(OGS_SBI_SERVICE_NAME_N5G_EIR_EIC) not implemented
  * - 3GPP TS 23.502 4.8.1.1(a) Connection Inactive procedure: Not supported by 
open5gs (https://github.com/open5gs/open5gs/issues/4319)
- * - 3GPP TS 23.502 4.8.1.2 Connection Suspend procedure
- * - 3GPP TS 23.502 4.8.2 Connection Resume procedure
+ * - 3GPP TS 23.502 4.8.1.2 Connection Suspend procedure: Not supported by 
open5gs (https://github.com/open5gs/open5gs/issues/4322)
+ * - 3GPP TS 23.502 4.8.2 Connection Resume procedure: Not supported by 
open5gs (https://github.com/open5gs/open5gs/issues/4322)
  * - 3GPP TS 23.502 4.9 Handover procedures
  * - 3GPP TS 23.502 4.12 Procedures for Untrusted non-3GPP access
  * - 3GPP TS 23.502 4.12a Procedures for Trusted non-3GPP access
diff --git a/5gc/ConnHdlr.ttcn b/5gc/ConnHdlr.ttcn
index d31aaa7..ce7d38f 100644
--- a/5gc/ConnHdlr.ttcn
+++ b/5gc/ConnHdlr.ttcn
@@ -845,6 +845,42 @@
                                        g_pars.ue_pars.ran_id)));
 }

+/* 3GPP TS 38.413 9.2.2.16 UE CONTEXT SUSPEND REQUEST
+ * 3GPP TS 23.502 4.8.1.2 Connection Suspend procedure */
+function f_ue_context_suspend() runs on ConnHdlr
+{
+       var template (value) UEContextSuspendRequestTransfer transfer;
+       var octetstring transfer_enc;
+       var template (value) NGAP_PDU tx_pdu;
+
+       transfer := m_uEContextSuspendRequestTransfer(p_suspendIndicator := 
m_suspendIndicator);
+       transfer_enc := 
enc_NGAP_UEContextSuspendRequestTransfer(valueof(transfer));
+       tx_pdu := m_ngap_initMsg(m_n2_UEContextSuspendRequest(
+                                       g_pars.ue_pars.amf_id,
+                                       g_pars.ue_pars.ran_id,
+                                       
{m_pDUSessionResourceSuspendItemSUSReq(g_pars.ue_pars.sess_pars.id, 
transfer_enc)}));
+       NGAP.send(tx_pdu);
+       NGAP.receive(mw_ngap_succMsg(mw_n2_UEContextSuspendResponse(
+                                       g_pars.ue_pars.amf_id,
+                                       g_pars.ue_pars.ran_id)));
+}
+
+/* 3GPP TS 38.413 9.2.2.16 9.2.2.19 UE CONTEXT RESUME REQUEST
+ * 3GPP TS 23.502 4.8.2.3 Connection Resume procedure */
+function f_ue_context_resume() runs on ConnHdlr
+{
+       var template (value) NGAP_PDU tx_pdu;
+
+       tx_pdu := m_ngap_initMsg(m_n2_UEContextResumeRequest(
+                                       g_pars.ue_pars.amf_id,
+                                       g_pars.ue_pars.ran_id,
+                                       m_rRCEstablishmentCause));
+       NGAP.send(tx_pdu);
+       NGAP.receive(mw_ngap_succMsg(mw_n2_UEContextResumeResponse(
+                                       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 0472dc7..78d5a11 100644
--- a/5gc/expected-results.xml
+++ b/5gc/expected-results.xml
@@ -18,4 +18,9 @@
   <testcase classname='C5G_Tests' name='TC_connection_inactive' time='MASKED'>
     <error type='DTE'></error>
   </testcase>
+  <testcase classname='C5G_Tests' name='TC_connection_suspend' time='MASKED'>
+    <failure type='fail-verdict'>"C5G_Tests.ttcn:MASKED : Tguard timeout"
+      C5G_Tests.ttcn:601 TC_connection_suspend testcase
+    </failure>
+  </testcase>
 </testsuite>
diff --git a/library/ngap/NGAP_EncDec.cc b/library/ngap/NGAP_EncDec.cc
index b81591d..8b825d5 100644
--- a/library/ngap/NGAP_EncDec.cc
+++ b/library/ngap/NGAP_EncDec.cc
@@ -109,4 +109,24 @@
        return ret;
 }

+OCTETSTRING enc__NGAP__UEContextSuspendRequestTransfer(const 
NGAP__IEs::UEContextSuspendRequestTransfer &p)
+{
+       TTCN_Buffer TTCN_buf;
+       TTCN_buf.clear();
+       p.encode(NGAP__IEs::UEContextSuspendRequestTransfer_descr_, TTCN_buf,
+                  TTCN_EncDec::CT_PER, PER_ALIGNED);
+       return OCTETSTRING(TTCN_buf.get_len(), TTCN_buf.get_data());
+}
+
+NGAP__IEs::UEContextSuspendRequestTransfer 
dec__NGAP__UEContextSuspendRequestTransfer(const OCTETSTRING &stream)
+{
+       NGAP__IEs::UEContextSuspendRequestTransfer ret;
+       TTCN_Buffer TTCN_buf;
+       TTCN_buf.clear();
+       TTCN_buf.put_os(stream);
+       ret.decode(NGAP__IEs::UEContextSuspendRequestTransfer_descr_, TTCN_buf,
+                  TTCN_EncDec::CT_PER, PER_ALIGNED);
+       return ret;
+}
+
 }
diff --git a/library/ngap/NGAP_Types.ttcn b/library/ngap/NGAP_Types.ttcn
index 96ccea9..d9523b4 100644
--- a/library/ngap/NGAP_Types.ttcn
+++ b/library/ngap/NGAP_Types.ttcn
@@ -17,4 +17,7 @@

        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_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/+/42144?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: I6da2571518a9b50369fa8e0dd19e447137ea20c6
Gerrit-Change-Number: 42144
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>

Reply via email to