<p>Vadim Yanitskiy has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/11985">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">MSC_Tests.ttcn: introduce TC_lu_and_ss_session_timeout<br><br>The idea of this test case is to verify SS session termination<br>due to expiry of guard timeout.<br><br>Change-Id: I3e1791773d56617172ae27a46889a1ae4d400e2f<br>Depends-on: (OsmoMSC) Icf4d87c45e90324764073e8230e0fb9cb96dd9cb<br>Related: OS#3655<br>---<br>M msc/MSC_Tests.ttcn<br>M msc/expected-results.xml<br>2 files changed, 74 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/85/11985/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn</span><br><span>index 2a6c034..ba1cafa 100644</span><br><span>--- a/msc/MSC_Tests.ttcn</span><br><span>+++ b/msc/MSC_Tests.ttcn</span><br><span>@@ -2694,6 +2694,78 @@</span><br><span>   vc_conn.done;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* LU followed by MO USSD request and MT Release due to timeout */</span><br><span style="color: hsl(120, 100%, 40%);">+private function f_tc_lu_and_ss_session_timeout(charstring id, BSC_ConnHdlrPars pars)</span><br><span style="color: hsl(120, 100%, 40%);">+runs on BSC_ConnHdlr {</span><br><span style="color: hsl(120, 100%, 40%);">+     f_init_handler(pars);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       /* Perform location update */</span><br><span style="color: hsl(120, 100%, 40%);">+ f_perform_lu();</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     /* Send CM Service Request for SS/USSD */</span><br><span style="color: hsl(120, 100%, 40%);">+     f_establish_fully(EST_TYPE_SS_ACT);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* We need to inspect GSUP activity */</span><br><span style="color: hsl(120, 100%, 40%);">+        f_create_gsup_expect(hex2str(g_pars.imsi));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ var template OCTN facility_ms_req := f_USSD_FACILITY_IE_INVOKE(</span><br><span style="color: hsl(120, 100%, 40%);">+               invoke_id := 1, /* Initial request */</span><br><span style="color: hsl(120, 100%, 40%);">+         op_code := SS_OP_CODE_PROCESS_USS_REQ,</span><br><span style="color: hsl(120, 100%, 40%);">+                ussd_string := "#release_me");</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    /* Compose MO SS/REGISTER message with request */</span><br><span style="color: hsl(120, 100%, 40%);">+     var template (value) PDU_ML3_MS_NW ussd_ms_req := ts_ML3_MO_SS_REGISTER(</span><br><span style="color: hsl(120, 100%, 40%);">+              tid := 1, /* We just need a single transaction */</span><br><span style="color: hsl(120, 100%, 40%);">+             ti_flag := c_TIF_ORIG, /* Sent from the side that originates the TI */</span><br><span style="color: hsl(120, 100%, 40%);">+                facility := valueof(facility_ms_req));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      /* Compose expected MSC -> HLR message */</span><br><span style="color: hsl(120, 100%, 40%);">+  var template GSUP_PDU gsup_ms_req := tr_GSUP_PROC_SS_REQ(</span><br><span style="color: hsl(120, 100%, 40%);">+             imsi := g_pars.imsi,</span><br><span style="color: hsl(120, 100%, 40%);">+          state := OSMO_GSUP_SESSION_STATE_BEGIN,</span><br><span style="color: hsl(120, 100%, 40%);">+               ss := valueof(facility_ms_req));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    /* To be used for sending response with correct session ID */</span><br><span style="color: hsl(120, 100%, 40%);">+ var GSUP_PDU gsup_ms_req_complete;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  /* Initiate a new SS transaction */</span><br><span style="color: hsl(120, 100%, 40%);">+   BSSAP.send(ts_PDU_DTAP_MO(ussd_ms_req));</span><br><span style="color: hsl(120, 100%, 40%);">+      /* Expect GSUP request with original Facility IE */</span><br><span style="color: hsl(120, 100%, 40%);">+   gsup_ms_req_complete := f_expect_gsup_msg(gsup_ms_req);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     /* Don't respond, wait for timeout */</span><br><span style="color: hsl(120, 100%, 40%);">+     f_sleep(3.0);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       var template PDU_ML3_NW_MS dtap_rel := tr_ML3_MT_SS_RELEASE_COMPLETE(</span><br><span style="color: hsl(120, 100%, 40%);">+         tid := 1, /* Should match the request's tid */</span><br><span style="color: hsl(120, 100%, 40%);">+            ti_flag := c_TIF_REPL, /* Sent to the side that originates the TI */</span><br><span style="color: hsl(120, 100%, 40%);">+          cause := *, /* TODO: expect some specific value */</span><br><span style="color: hsl(120, 100%, 40%);">+            facility := omit);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  var template GSUP_PDU gsup_rel := tr_GSUP_PROC_SS_ERR(</span><br><span style="color: hsl(120, 100%, 40%);">+                imsi := g_pars.imsi,</span><br><span style="color: hsl(120, 100%, 40%);">+          sid := gsup_ms_req_complete.ies[1].val.session_id,</span><br><span style="color: hsl(120, 100%, 40%);">+            state := OSMO_GSUP_SESSION_STATE_END,</span><br><span style="color: hsl(120, 100%, 40%);">+         cause := ?); /* TODO: expect some specific value */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Expect release on both interfaces */</span><br><span style="color: hsl(120, 100%, 40%);">+       interleave {</span><br><span style="color: hsl(120, 100%, 40%);">+  [] BSSAP.receive(tr_PDU_DTAP_MT(dtap_rel)) {  };</span><br><span style="color: hsl(120, 100%, 40%);">+      [] GSUP.receive(gsup_rel) {  };</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   f_expect_clear();</span><br><span style="color: hsl(120, 100%, 40%);">+     setverdict(pass);</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+testcase TC_lu_and_ss_session_timeout() runs on MTC_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+        var BSC_ConnHdlr vc_conn;</span><br><span style="color: hsl(120, 100%, 40%);">+     f_init();</span><br><span style="color: hsl(120, 100%, 40%);">+     f_vty_config(MSCVTY, "msc", "ss-guard-timeout 3");</span><br><span style="color: hsl(120, 100%, 40%);">+        vc_conn := f_start_handler(refers(f_tc_lu_and_ss_session_timeout), 51);</span><br><span style="color: hsl(120, 100%, 40%);">+       vc_conn.done;</span><br><span style="color: hsl(120, 100%, 40%);">+ f_vty_config(MSCVTY, "msc", "ss-guard-timeout 0");</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /* TODO (SMS):</span><br><span>    * different user data lengths</span><br><span>    * SMPP transaction mode with unsuccessful delivery</span><br><span>@@ -2780,6 +2852,7 @@</span><br><span>   execute( TC_lu_and_mo_ussd_during_mt_call() );</span><br><span>       execute( TC_lu_and_mt_ussd_during_mt_call() );</span><br><span>       execute( TC_lu_and_mo_ussd_mo_release() );</span><br><span style="color: hsl(120, 100%, 40%);">+    execute( TC_lu_and_ss_session_timeout() );</span><br><span> </span><br><span>       /* Run this last: at the time of writing this test crashes the MSC */</span><br><span>        execute( TC_lu_imsi_auth_tmsi_encr_3_1_log_msc_debug() );</span><br><span>diff --git a/msc/expected-results.xml b/msc/expected-results.xml</span><br><span>index 8d9180f..4a9529e 100644</span><br><span>--- a/msc/expected-results.xml</span><br><span>+++ b/msc/expected-results.xml</span><br><span>@@ -68,6 +68,7 @@</span><br><span>   <testcase classname='MSC_Tests' name='TC_lu_and_mo_ussd_during_mt_call' time='MASKED'/></span><br><span>   <testcase classname='MSC_Tests' name='TC_lu_and_mt_ussd_during_mt_call' time='MASKED'/></span><br><span>   <testcase classname='MSC_Tests' name='TC_lu_and_mo_ussd_mo_release' time='MASKED'/></span><br><span style="color: hsl(120, 100%, 40%);">+  <testcase classname='MSC_Tests' name='TC_lu_and_ss_session_timeout' time='MASKED'/></span><br><span>   <testcase classname='MSC_Tests' name='TC_lu_imsi_auth_tmsi_encr_3_1_log_msc_debug' time='MASKED'/></span><br><span>   <testcase classname='MSC_Tests' name='TC_mo_cc_bssmap_clear' time='MASKED'/></span><br><span> </testsuite></span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/11985">change 11985</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/11985"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-ttcn3-hacks </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I3e1791773d56617172ae27a46889a1ae4d400e2f </div>
<div style="display:none"> Gerrit-Change-Number: 11985 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Vadim Yanitskiy <axilirator@gmail.com> </div>