<p>Harald Welte <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/9372">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: add single *#100# request testcase<br><br>In this testcase we perform LUR, then request our own number and<br>then expect the response with matching MSISDN.<br><br>Change-Id: I82450c6f48f6c17bc33e0ec6c91f2a73e44793ad<br>---<br>M msc/MSC_Tests.ttcn<br>M msc/expected-results.xml<br>2 files changed, 65 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 f843839..05d6b4f 100644</span><br><span>--- a/msc/MSC_Tests.ttcn</span><br><span>+++ b/msc/MSC_Tests.ttcn</span><br><span>@@ -51,6 +51,10 @@</span><br><span> import from SMPP_Templates all;</span><br><span> import from SMPP_Emulation all;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+import from SS_Types all;</span><br><span style="color: hsl(120, 100%, 40%);">+import from SS_Templates all;</span><br><span style="color: hsl(120, 100%, 40%);">+import from USSD_Helpers all;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> const integer NUM_BSC := 2;</span><br><span> type record of BSSAP_Configuration BSSAP_Configurations;</span><br><span> </span><br><span>@@ -2101,6 +2105,64 @@</span><br><span>   vc_conn.done;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/***********************************************************************</span><br><span style="color: hsl(120, 100%, 40%);">+ * USSD Testing</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%);">+private function f_tc_lu_and_ussd_single_req(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%);">+ /* Compose a new SS/REGISTER message with request */</span><br><span style="color: hsl(120, 100%, 40%);">+  var template (value) PDU_ML3_MS_NW ussd_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 := f_USSD_FACILITY_IE_INVOKE(</span><br><span style="color: hsl(120, 100%, 40%);">+                        invoke_id := 5, /* Phone may not start from 0 or 1 */</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 := "*#100#"</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%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  /* Compose SS/RELEASE_COMPLETE template with expected response */</span><br><span style="color: hsl(120, 100%, 40%);">+     var template PDU_ML3_NW_MS ussd_rsp := tr_ML3_MT_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_REPL, /* Sent to the side that originates the TI */</span><br><span style="color: hsl(120, 100%, 40%);">+          facility := f_USSD_FACILITY_IE_RETURN_RESULT(</span><br><span style="color: hsl(120, 100%, 40%);">+                 invoke_id := 5, /* InvokeID shall be the same for both REQ and RSP */</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 := "Your extension is " & hex2str(g_pars.msisdn) & "\r"</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%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  /* Request own number request */</span><br><span style="color: hsl(120, 100%, 40%);">+      BSSAP.send(ts_PDU_DTAP_MO(ussd_req));</span><br><span style="color: hsl(120, 100%, 40%);">+ alt {</span><br><span style="color: hsl(120, 100%, 40%);">+ /* We expect RELEASE_COMPLETE message with the response */</span><br><span style="color: hsl(120, 100%, 40%);">+    [] BSSAP.receive(tr_PDU_DTAP_MT(ussd_rsp)) {</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%);">+     [] BSSAP.receive {</span><br><span style="color: hsl(120, 100%, 40%);">+            setverdict(fail, "Unknown/unexpected BSSAP received");</span><br><span style="color: hsl(120, 100%, 40%);">+              self.stop;</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%);">+</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_ussd_single_req() 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_ussd_single_req), 46);</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>@@ -2182,6 +2244,8 @@</span><br><span>    execute( TC_smpp_mo_sms() );</span><br><span>         execute( TC_smpp_mt_sms() );</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+      execute( TC_lu_and_ussd_single_req() );</span><br><span style="color: hsl(120, 100%, 40%);">+</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> }</span><br><span>diff --git a/msc/expected-results.xml b/msc/expected-results.xml</span><br><span>index 42e47b2..ac18fde 100644</span><br><span>--- a/msc/expected-results.xml</span><br><span>+++ b/msc/expected-results.xml</span><br><span>@@ -71,4 +71,5 @@</span><br><span>   <testcase classname='MSC_Tests' name='TC_smpp_mo_sms' time='MASKED'/></span><br><span>   <testcase classname='MSC_Tests' name='TC_smpp_mt_sms' 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 style="color: hsl(120, 100%, 40%);">+  <testcase classname='MSC_Tests' name='TC_lu_and_ussd_single_req' time='MASKED'/></span><br><span> </testsuite></span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/9372">change 9372</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/9372"/><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: I82450c6f48f6c17bc33e0ec6c91f2a73e44793ad </div>
<div style="display:none"> Gerrit-Change-Number: 9372 </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>