<p>Harald Welte <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/9689">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">msc/USSD: introduce TC_lu_and_mo_ussd_mo_release<br><br>The idea of this test case is to check the reaction of OsmoMSC<br>on MS-initiated release during an active transaction. In other<br>words, when the network is waiting for some response from a MS,<br>subscriber can press the 'red button' in order to terminate<br>this conversation.<br><br>It is expected that the MSC would terminate the transaction<br>as on DTAP interface, as on GSUP interface.<br><br>Change-Id: I7936ed5072ed2ae02f039dc90a1fece1e7f70a70<br>---<br>M msc/MSC_Tests.ttcn<br>M msc/expected-results.xml<br>2 files changed, 99 insertions(+), 0 deletions(-)<br><br></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 b247f23..df1d1c2 100644</span><br><span>--- a/msc/MSC_Tests.ttcn</span><br><span>+++ b/msc/MSC_Tests.ttcn</span><br><span>@@ -2593,6 +2593,103 @@</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 MO Release during transaction */</span><br><span style="color: hsl(120, 100%, 40%);">+private function f_tc_lu_and_mo_ussd_mo_release(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 := "*6766*266#"</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%);">+  var template OCTN facility_net_req := f_USSD_FACILITY_IE_INVOKE(</span><br><span style="color: hsl(120, 100%, 40%);">+              invoke_id := 2, /* Counter request */</span><br><span style="color: hsl(120, 100%, 40%);">+         op_code := SS_OP_CODE_USS_REQUEST,</span><br><span style="color: hsl(120, 100%, 40%);">+            ussd_string := "Password?!?"</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%);">+   /* 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%);">+</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%);">+</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 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%);">+     /* Compose the response from HLR using received session ID */</span><br><span style="color: hsl(120, 100%, 40%);">+ var template (value) GSUP_PDU gsup_net_req := ts_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%);">+          sid := gsup_ms_req_complete.ies[1].val.session_id,</span><br><span style="color: hsl(120, 100%, 40%);">+            state := OSMO_GSUP_SESSION_STATE_CONTINUE,</span><br><span style="color: hsl(120, 100%, 40%);">+            ss := valueof(facility_net_req)</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%);">+  /* Compose expected MT SS/FACILITY template with counter request */</span><br><span style="color: hsl(120, 100%, 40%);">+   var template PDU_ML3_NW_MS ussd_net_req := tr_ML3_MT_SS_FACILITY(</span><br><span style="color: hsl(120, 100%, 40%);">+             tid := 1, /* Response should arrive within the same transaction */</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%);">+          facility := valueof(facility_net_req)</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%);">+  /* Send response over GSUP */</span><br><span style="color: hsl(120, 100%, 40%);">+ GSUP.send(gsup_net_req);</span><br><span style="color: hsl(120, 100%, 40%);">+      /* Expect MT SS/FACILITY message with counter request */</span><br><span style="color: hsl(120, 100%, 40%);">+      f_expect_mt_dtap_msg(ussd_net_req);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Compose MO SS/RELEASE COMPLETE */</span><br><span style="color: hsl(120, 100%, 40%);">+  var template (value) PDU_ML3_MS_NW ussd_abort := ts_ML3_MO_SS_RELEASE_COMPLETE(</span><br><span style="color: hsl(120, 100%, 40%);">+               tid := 1, /* Response should arrive within the same 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 := omit</span><br><span style="color: hsl(120, 100%, 40%);">+              /* TODO: cause? */</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%);">+  /* Compose expected HLR -> MSC abort message */</span><br><span style="color: hsl(120, 100%, 40%);">+    var template GSUP_PDU gsup_abort := 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%);">+          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%);">+  );</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  /* Abort transaction */</span><br><span style="color: hsl(120, 100%, 40%);">+       BSSAP.send(ts_PDU_DTAP_MO(ussd_abort));</span><br><span style="color: hsl(120, 100%, 40%);">+       /* Expect GSUP message indicating abort */</span><br><span style="color: hsl(120, 100%, 40%);">+    f_expect_gsup_msg(gsup_abort);</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%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+testcase TC_lu_and_mo_ussd_mo_release() 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%);">+     vc_conn := f_start_handler(refers(f_tc_lu_and_mo_ussd_mo_release), 50);</span><br><span style="color: hsl(120, 100%, 40%);">+       vc_conn.done;</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>@@ -2678,6 +2775,7 @@</span><br><span>    execute( TC_lu_and_mt_ussd_notification() );</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 style="color: hsl(120, 100%, 40%);">+        execute( TC_lu_and_mo_ussd_mo_release() );</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 198b9bd..296d918 100644</span><br><span>--- a/msc/expected-results.xml</span><br><span>+++ b/msc/expected-results.xml</span><br><span>@@ -75,4 +75,5 @@</span><br><span>   <testcase classname='MSC_Tests' name='TC_lu_and_mt_ussd_notification' time='MASKED'/></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 style="color: hsl(120, 100%, 40%);">+  <testcase classname='MSC_Tests' name='TC_lu_and_mo_ussd_mo_release' time='MASKED'/></span><br><span> </testsuite></span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/9689">change 9689</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/9689"/><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: merged </div>
<div style="display:none"> Gerrit-Change-Id: I7936ed5072ed2ae02f039dc90a1fece1e7f70a70 </div>
<div style="display:none"> Gerrit-Change-Number: 9689 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Vadim Yanitskiy <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>