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

Change subject: s1gw: add TC_initial_ctx_setup_failure
......................................................................

s1gw: add TC_initial_ctx_setup_failure

Change-Id: I969ea6813c9b805d116a974c70ab5f6e6e721e48
---
M s1gw/S1GW_Tests.ttcn
M s1gw/expected-results.xml
2 files changed, 46 insertions(+), 2 deletions(-)

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




diff --git a/s1gw/S1GW_Tests.ttcn b/s1gw/S1GW_Tests.ttcn
index 2e8ebcb..fbe9d44 100644
--- a/s1gw/S1GW_Tests.ttcn
+++ b/s1gw/S1GW_Tests.ttcn
@@ -366,7 +366,7 @@
        vc_conn.done;
 }

-/* Test INITIAL CONTEXT SETUP procedure */
+/* Test INITIAL CONTEXT SETUP procedure (successful case) */
 function f_TC_initial_ctx_setup(charstring id) runs on ConnHdlr {
        f_ConnHdlr_s1ap_register(g_pars.genb_id);
        f_ConnHdlr_s1ap_connect(mp_enb_bind_ip, mp_s1gw_enb_ip);
@@ -408,6 +408,48 @@
        f_TC_initial_ctx_setup_exec(num_enbs := mp_multi_enb_num, num_erabs := 
3);
 }

+/* Test INITIAL CONTEXT SETUP procedure (failure) */
+function f_TC_initial_ctx_setup_failure(charstring id) runs on ConnHdlr {
+       var template (present) PDU_PFCP pfcp_pdu;
+       var template (value) S1AP_PDU s1ap_pdu;
+       var S1AP_PDU unused;
+
+       f_ConnHdlr_s1ap_register(g_pars.genb_id);
+       f_ConnHdlr_s1ap_connect(mp_enb_bind_ip, mp_s1gw_enb_ip);
+       f_ConnHdlr_s1ap_setup(g_pars.genb_id);
+
+       /* Initiate E-RAB establishment by sending INITIAL CONTEXT SETUP */
+       f_ConnHdlr_initial_ctx_setup_req(g_pars.erabs);
+       /* At this point, the associated PFCP session is created, but not 
modified yet.
+        * The E-RAB FSM in the IUT is waiting for INITIAL CONTEXT SETUP 
RESPONSE. */
+
+       /* INITIAL CONTEXT SETUP FAILURE does not immediately trigger deletion 
of PFCP
+        * sessions.  It's forwarded as-is without any action. */
+       s1ap_pdu := ts_S1AP_InitialCtxSetupFail(mme_id := 4242,
+                                               enb_id := g_pars.idx,
+                                               cause := { misc := unspecified 
});
+       f_ConnHdlr_tx_s1ap_from_enb(s1ap_pdu);
+       f_ConnHdlr_rx_s1ap_from_enb(unused, s1ap_pdu);
+
+       /* TODO: Ideally, the IUT should terminate PFCP session(s) immediately. 
*/
+
+       /* E-RAB FSM in the IUT terminates due to a timeout and deletes PFCP 
session. */
+       pfcp_pdu := tr_PFCP_Session_Del_Req(g_pars.erabs[0].pfcp_loc_seid);
+       f_ConnHdlr_pfcp_expect(pfcp_pdu, Tval := 8.0); /* > 
ERAB_T_WAIT_RELEASE_RSP */
+
+       f_ConnHdlr_s1ap_disconnect();
+       f_ConnHdlr_s1ap_unregister(g_pars.genb_id);
+}
+testcase TC_initial_ctx_setup_failure() runs on test_CT {
+       var ConnHdlrPars pars := valueof(t_ConnHdlrPars);
+       var ConnHdlr vc_conn;
+
+       f_init();
+
+       vc_conn := f_ConnHdlr_spawn(refers(f_TC_initial_ctx_setup_failure), 
pars);
+       vc_conn.done;
+}
+
 function f_TC_pfcp_heartbeat(charstring id) runs on ConnHdlr {
        var integer rts := f_PFCPEM_get_recovery_timestamp();
        var PDU_PFCP pfcp_pdu;
@@ -445,6 +487,7 @@
        execute( TC_initial_ctx_setup3() );
        execute( TC_initial_ctx_setup_multi() );
        execute( TC_initial_ctx_setup3_multi() );
+       execute( TC_initial_ctx_setup_failure() );
        execute( TC_pfcp_heartbeat() );
 }

diff --git a/s1gw/expected-results.xml b/s1gw/expected-results.xml
index e50f978..3ddbb23 100644
--- a/s1gw/expected-results.xml
+++ b/s1gw/expected-results.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<testsuite name='S1GW_Tests' tests='14' failures='0' errors='0' skipped='0' 
inconc='0' time='MASKED'>
+<testsuite name='S1GW_Tests' tests='15' failures='0' errors='0' skipped='0' 
inconc='0' time='MASKED'>
   <testcase classname='S1GW_Tests' name='TC_setup' time='MASKED'/>
   <testcase classname='S1GW_Tests' name='TC_setup_multi' time='MASKED'/>
   <testcase classname='S1GW_Tests' name='TC_conn_term_by_mme' time='MASKED'/>
@@ -13,5 +13,6 @@
   <testcase classname='S1GW_Tests' name='TC_initial_ctx_setup3' time='MASKED'/>
   <testcase classname='S1GW_Tests' name='TC_initial_ctx_setup_multi' 
time='MASKED'/>
   <testcase classname='S1GW_Tests' name='TC_initial_ctx_setup3_multi' 
time='MASKED'/>
+  <testcase classname='S1GW_Tests' name='TC_initial_ctx_setup_failure' 
time='MASKED'/>
   <testcase classname='S1GW_Tests' name='TC_pfcp_heartbeat' time='MASKED'/>
 </testsuite>

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38280?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: I969ea6813c9b805d116a974c70ab5f6e6e721e48
Gerrit-Change-Number: 38280
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>

Reply via email to