<p>Vadim Yanitskiy has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/9686">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">msc/USSD: add test cases with network-initiaded SS/USSD<br><br>This change introduces two new test cases for network-initiaded<br>USSD notification and network-initiaded USSD request, which are<br>based on the existing SS/USSD related test cases.<br><br>The idea of TC_lu_and_mt_ussd_notification is to verify that<br>a network-initiaded USSD notification can arrive subscriber in<br>IDLE mode using Paging procedure.<br><br>The idea of TC_lu_and_mt_ussd_during_mt_call is to verify that<br>a network-initiaded USSD notification can arrive subscriber in<br>DEDICATED mode (in this case during a call) on a separate<br>transaction.<br><br>Change-Id: I073893c6e11be27e9e36f98f11c1491d0c173985<br>---<br>M msc/MSC_Tests.ttcn<br>M msc/expected-results.xml<br>2 files changed, 299 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/86/9686/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 1af77cd..7cb272d 100644</span><br><span>--- a/msc/MSC_Tests.ttcn</span><br><span>+++ b/msc/MSC_Tests.ttcn</span><br><span>@@ -2208,6 +2208,156 @@</span><br><span>   vc_conn.done;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* LU followed by MT USSD notification */</span><br><span style="color: hsl(120, 100%, 40%);">+private function f_tc_lu_and_mt_ussd_notification(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%);">+     f_bssmap_register_imsi(g_pars.imsi, g_pars.tmsi);</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%);">+ /* Facility IE with network-originated USSD notification */</span><br><span style="color: hsl(120, 100%, 40%);">+   var template OCTN facility_req := f_USSD_FACILITY_IE_INVOKE(</span><br><span style="color: hsl(120, 100%, 40%);">+          op_code := SS_OP_CODE_USS_NOTIFY,</span><br><span style="color: hsl(120, 100%, 40%);">+             ussd_string := "Mahlzeit!"</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%);">+  /* Facility IE with acknowledgment to the USSD notification */</span><br><span style="color: hsl(120, 100%, 40%);">+        var template OCTN facility_rsp := enc_SS_FacilityInformation(</span><br><span style="color: hsl(120, 100%, 40%);">+         /* In case of USSD notification, Return Result is empty */</span><br><span style="color: hsl(120, 100%, 40%);">+            valueof(ts_SS_USSD_FACILITY_RETURN_RESULT_EMPTY())</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 a new MT SS/REGISTER message with USSD notification */</span><br><span style="color: hsl(120, 100%, 40%);">+     var template PDU_ML3_NW_MS ussd_ntf := tr_ML3_MT_SS_REGISTER(</span><br><span style="color: hsl(120, 100%, 40%);">+         tid := 0, /* FIXME: most likely, it should be 0 */</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_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 HLR -> MSC GSUP message */</span><br><span style="color: hsl(120, 100%, 40%);">+      var template (value) GSUP_PDU gsup_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 := '20000101'O,</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_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 it to MSC and expect Paging Request */</span><br><span style="color: hsl(120, 100%, 40%);">+        GSUP.send(gsup_req);</span><br><span style="color: hsl(120, 100%, 40%);">+  alt {</span><br><span style="color: hsl(120, 100%, 40%);">+ [] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)) {</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%);">+     [] GSUP.receive {</span><br><span style="color: hsl(120, 100%, 40%);">+             setverdict(fail, "Unexpected GSUP message 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%);">+   /* Send Paging Response and expect USSD notification */</span><br><span style="color: hsl(120, 100%, 40%);">+       f_establish_fully(EST_TYPE_PAG_RESP);</span><br><span style="color: hsl(120, 100%, 40%);">+ alt {</span><br><span style="color: hsl(120, 100%, 40%);">+ /* We expect MT REGISTER message with USSD notification */</span><br><span style="color: hsl(120, 100%, 40%);">+    [] BSSAP.receive(tr_PDU_DTAP_MT(ussd_ntf)) {</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%);">+     [] GSUP.receive {</span><br><span style="color: hsl(120, 100%, 40%);">+             setverdict(fail, "Unexpected GSUP message 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%);">+   /* Compose a new MO SS/FACILITY message with empty response */</span><br><span style="color: hsl(120, 100%, 40%);">+        var template (value) PDU_ML3_MS_NW ussd_rsp := ts_ML3_MO_SS_FACILITY(</span><br><span style="color: hsl(120, 100%, 40%);">+         tid := 0, /* FIXME: it shall match the request 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%);">+          facility := valueof(facility_rsp)</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 GSUP message */</span><br><span style="color: hsl(120, 100%, 40%);">+     var template GSUP_PDU gsup_rsp := 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 := '20000101'O,</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_rsp)</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%);">+  /* MS sends response to the notification */</span><br><span style="color: hsl(120, 100%, 40%);">+   BSSAP.send(ts_PDU_DTAP_MO(ussd_rsp));</span><br><span style="color: hsl(120, 100%, 40%);">+ alt {</span><br><span style="color: hsl(120, 100%, 40%);">+ [] GSUP.receive(gsup_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%);">+     [] GSUP.receive {</span><br><span style="color: hsl(120, 100%, 40%);">+             setverdict(fail, "Unknown/unexpected GSUP 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%);">+     [] BSSAP.receive {</span><br><span style="color: hsl(120, 100%, 40%);">+            setverdict(fail, "Unexpected BSSAP message 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%);">+   /* Compose expected MT SS/RELEASE COMPLETE message */</span><br><span style="color: hsl(120, 100%, 40%);">+ var template PDU_ML3_NW_MS ussd_term := tr_ML3_MT_SS_RELEASE_COMPLETE(</span><br><span style="color: hsl(120, 100%, 40%);">+                tid := 0, /* FIXME: it shall match the request tid */</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%);">+      );</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 HLR -> MSC GSUP message</span><br><span style="color: hsl(120, 100%, 40%);">+  * FIXME: correct template in order to make SS payload optional</span><br><span style="color: hsl(120, 100%, 40%);">+        */</span><br><span style="color: hsl(120, 100%, 40%);">+   var template (value) GSUP_PDU gsup_term := ts_GSUP(</span><br><span style="color: hsl(120, 100%, 40%);">+           OSMO_GSUP_MSGT_PROC_SS_RESULT,</span><br><span style="color: hsl(120, 100%, 40%);">+                {</span><br><span style="color: hsl(120, 100%, 40%);">+                     valueof(ts_GSUP_IE_IMSI(g_pars.imsi)),</span><br><span style="color: hsl(120, 100%, 40%);">+                        valueof(ts_GSUP_IE_SessionId('20000101'O)),</span><br><span style="color: hsl(120, 100%, 40%);">+                   valueof(ts_GSUP_IE_SessionState(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%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  /* Finally, HLR terminates the session */</span><br><span style="color: hsl(120, 100%, 40%);">+     GSUP.send(gsup_term)</span><br><span style="color: hsl(120, 100%, 40%);">+  alt {</span><br><span style="color: hsl(120, 100%, 40%);">+ /* We expect MT RELEASE COMPLETE */</span><br><span style="color: hsl(120, 100%, 40%);">+   [] BSSAP.receive(tr_PDU_DTAP_MT(ussd_term)) {</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%);">+     [] GSUP.receive {</span><br><span style="color: hsl(120, 100%, 40%);">+             setverdict(fail, "Unexpected GSUP message 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_mt_ussd_notification() 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_mt_ussd_notification), 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> /* LU followed by MT call and MO USSD request during this call */</span><br><span> private function f_tc_lu_and_mo_ussd_during_mt_call(charstring id, BSC_ConnHdlrPars pars)</span><br><span> runs on BSC_ConnHdlr {</span><br><span>@@ -2316,6 +2466,151 @@</span><br><span>     vc_conn.done;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* LU followed by MT call and MT USSD request during this call */</span><br><span style="color: hsl(120, 100%, 40%);">+private function f_tc_lu_and_mt_ussd_during_mt_call(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%);">+       /* Call parameters taken from f_tc_lu_and_mt_call */</span><br><span style="color: hsl(120, 100%, 40%);">+  var CallParameters cpars := valueof(t_CallParams('123456'H, 0));</span><br><span style="color: hsl(120, 100%, 40%);">+      cpars.mgcp_connection_id_bss := '10004'H;</span><br><span style="color: hsl(120, 100%, 40%);">+     cpars.mgcp_connection_id_mss := '10005'H;</span><br><span style="color: hsl(120, 100%, 40%);">+     cpars.mgcp_ep := "rtpbridge/1@mgw";</span><br><span style="color: hsl(120, 100%, 40%);">+ cpars.bss_rtp_port := 1110;</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%);">+     /* Establish a MT call */</span><br><span style="color: hsl(120, 100%, 40%);">+     f_mt_call_establish(cpars);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Hold the call for some time */</span><br><span style="color: hsl(120, 100%, 40%);">+     f_sleep(1.0);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       var template OCTN facility_req := f_USSD_FACILITY_IE_INVOKE(</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 := "Please type anything..."</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_rsp := f_USSD_FACILITY_IE_RETURN_RESULT(</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 := "Nope."</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 MT SS/REGISTER message with network-originated request */</span><br><span style="color: hsl(120, 100%, 40%);">+  var template (value) PDU_ML3_NW_MS ussd_req := ts_ML3_MT_SS_REGISTER(</span><br><span style="color: hsl(120, 100%, 40%);">+         tid := 0, /* FIXME: most likely, it should be 0 */</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_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 HLR -> MSC GSUP message */</span><br><span style="color: hsl(120, 100%, 40%);">+      var template (value) GSUP_PDU gsup_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 := '20000101'O,</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_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 it to MSC */</span><br><span style="color: hsl(120, 100%, 40%);">+  GSUP.send(gsup_req);</span><br><span style="color: hsl(120, 100%, 40%);">+  alt {</span><br><span style="color: hsl(120, 100%, 40%);">+ /* We expect MT REGISTER message with USSD request */</span><br><span style="color: hsl(120, 100%, 40%);">+ [] BSSAP.receive(tr_PDU_DTAP_MT(ussd_req)) {</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%);">+     [] GSUP.receive {</span><br><span style="color: hsl(120, 100%, 40%);">+             setverdict(fail, "Unexpected GSUP message 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%);">+   /* Compose a new MO SS/FACILITY message with response */</span><br><span style="color: hsl(120, 100%, 40%);">+      var template (value) PDU_ML3_MS_NW ussd_rsp := ts_ML3_MO_SS_FACILITY(</span><br><span style="color: hsl(120, 100%, 40%);">+         tid := 0, /* FIXME: it shall match the request 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%);">+          facility := valueof(facility_rsp)</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 GSUP message */</span><br><span style="color: hsl(120, 100%, 40%);">+     var template GSUP_PDU gsup_rsp := 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 := '20000101'O,</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_rsp)</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%);">+  /* MS sends response */</span><br><span style="color: hsl(120, 100%, 40%);">+       BSSAP.send(ts_PDU_DTAP_MO(ussd_rsp));</span><br><span style="color: hsl(120, 100%, 40%);">+ alt {</span><br><span style="color: hsl(120, 100%, 40%);">+ [] GSUP.receive(gsup_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%);">+     [] GSUP.receive {</span><br><span style="color: hsl(120, 100%, 40%);">+             setverdict(fail, "Unknown/unexpected GSUP received");</span><br><span style="color: hsl(120, 100%, 40%);">+               log(valueof(ussd_rsp));</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%);">+     [] BSSAP.receive {</span><br><span style="color: hsl(120, 100%, 40%);">+            setverdict(fail, "Unexpected BSSAP message 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%);">+   /* Compose expected MT SS/RELEASE COMPLETE message */</span><br><span style="color: hsl(120, 100%, 40%);">+ var template PDU_ML3_NW_MS ussd_term := tr_ML3_MT_SS_RELEASE_COMPLETE(</span><br><span style="color: hsl(120, 100%, 40%);">+                tid := 0, /* FIXME: it shall match the request tid */</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%);">+      );</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 HLR -> MSC GSUP message</span><br><span style="color: hsl(120, 100%, 40%);">+  * FIXME: correct template in order to make SS payload optional</span><br><span style="color: hsl(120, 100%, 40%);">+        */</span><br><span style="color: hsl(120, 100%, 40%);">+   var template (value) GSUP_PDU gsup_term := ts_GSUP(</span><br><span style="color: hsl(120, 100%, 40%);">+           OSMO_GSUP_MSGT_PROC_SS_RESULT,</span><br><span style="color: hsl(120, 100%, 40%);">+                {</span><br><span style="color: hsl(120, 100%, 40%);">+                     valueof(ts_GSUP_IE_IMSI(g_pars.imsi)),</span><br><span style="color: hsl(120, 100%, 40%);">+                        valueof(ts_GSUP_IE_SessionId('20000101'O)),</span><br><span style="color: hsl(120, 100%, 40%);">+                   valueof(ts_GSUP_IE_SessionState(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%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  /* Finally, HLR terminates the session */</span><br><span style="color: hsl(120, 100%, 40%);">+     GSUP.send(gsup_term)</span><br><span style="color: hsl(120, 100%, 40%);">+  alt {</span><br><span style="color: hsl(120, 100%, 40%);">+ /* We expect MT RELEASE COMPLETE */</span><br><span style="color: hsl(120, 100%, 40%);">+   [] BSSAP.receive(tr_PDU_DTAP_MT(ussd_term)) {</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%);">+     [] GSUP.receive {</span><br><span style="color: hsl(120, 100%, 40%);">+             setverdict(fail, "Unexpected GSUP message 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%);">+   /* Hold the call for some time */</span><br><span style="color: hsl(120, 100%, 40%);">+     f_sleep(1.0);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       /* Release the call (does Clear Complete itself) */</span><br><span style="color: hsl(120, 100%, 40%);">+   f_call_hangup(cpars, true);</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+testcase TC_lu_and_mt_ussd_during_mt_call() 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_mt_ussd_during_mt_call), 49);</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>@@ -2398,7 +2693,9 @@</span><br><span>    execute( TC_smpp_mt_sms() );</span><br><span> </span><br><span>     execute( TC_lu_and_mo_ussd_single_request() );</span><br><span style="color: hsl(120, 100%, 40%);">+        execute( TC_lu_and_mt_ussd_notification() );</span><br><span>         execute( TC_lu_and_mo_ussd_during_mt_call() );</span><br><span style="color: hsl(120, 100%, 40%);">+        execute( TC_lu_and_mt_ussd_during_mt_call() );</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 9595f17..198b9bd 100644</span><br><span>--- a/msc/expected-results.xml</span><br><span>+++ b/msc/expected-results.xml</span><br><span>@@ -72,5 +72,7 @@</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>   <testcase classname='MSC_Tests' name='TC_lu_and_mo_ussd_single_request' time='MASKED'/></span><br><span style="color: hsl(120, 100%, 40%);">+  <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 style="color: hsl(120, 100%, 40%);">+  <testcase classname='MSC_Tests' name='TC_lu_and_mt_ussd_during_mt_call' time='MASKED'/></span><br><span> </testsuite></span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/9686">change 9686</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/9686"/><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: I073893c6e11be27e9e36f98f11c1491d0c173985 </div>
<div style="display:none"> Gerrit-Change-Number: 9686 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Vadim Yanitskiy <axilirator@gmail.com> </div>