<p>Vadim Yanitskiy has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/9470">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">WIP: msc/USSD: add unknown request code testcase<br><br>The idea of this testcase is to check reaction of the network on<br>reception of USSD request with unknown/unhandled request code.<br><br>It is not clearly defined by the GSM specs, how the network<br>should react in such cases, but looking at GSM TS 04.80,<br>section 4.3.2 "Error types description", the UnexpectedDataValue<br>error looks suitable. Commercial networks also use this error<br>when an unknown request code is sent.<br><br>Change-Id: I6a3fcaafc37972a38c13722f0b511ea5e1e3fbd8<br>---<br>M msc/MSC_Tests.ttcn<br>1 file changed, 54 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/70/9470/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 05d6b4f..7b8740c 100644</span><br><span>--- a/msc/MSC_Tests.ttcn</span><br><span>+++ b/msc/MSC_Tests.ttcn</span><br><span>@@ -2163,6 +2163,59 @@</span><br><span>       vc_conn.done;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+private function f_tc_lu_and_ussd_wrong_code(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 := "*#999#"</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_ERROR(</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%);">+                 err_code := SS_ERR_CODE_UNEXPECTED_DATA_VALUE</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_wrong_code() 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_wrong_code), 47);</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>@@ -2245,6 +2298,7 @@</span><br><span>    execute( TC_smpp_mt_sms() );</span><br><span> </span><br><span>     execute( TC_lu_and_ussd_single_req() );</span><br><span style="color: hsl(120, 100%, 40%);">+       execute( TC_lu_and_ussd_wrong_code() );</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></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/9470">change 9470</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/9470"/><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: I6a3fcaafc37972a38c13722f0b511ea5e1e3fbd8 </div>
<div style="display:none"> Gerrit-Change-Number: 9470 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Vadim Yanitskiy <axilirator@gmail.com> </div>