<p>Harald Welte <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/10392">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;">sgsn: add TC_attach_gmm_attach_req_while_gmm_attach<br><br>Testing the corner case of receiving an Attach Request<br>while not (yet) sent an Attach Accept.<br><br>MS -> SGSN: Attach Request IMSI<br>MS <- SGSN: Identity Request IMSI (optional)<br>MS -> SGSN: Identity Response IMSI (optional)<br>MS <- SGSN: Identity Request IMEI<br>MS -> SGSN: Attach Request (2nd)<br>MS <- SGSN: Identity Response IMEI<br>MS <- SGSN: Attach Accept<br>MS -> SGSN: Attach Complete<br><br>Change-Id: I0bac50dc5a72ba8f9010b05bcb98aa7ff0b81cf6<br>---<br>M sgsn/SGSN_Tests.ttcn<br>1 file changed, 73 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn</span><br><span>index 3f479da..0112483 100644</span><br><span>--- a/sgsn/SGSN_Tests.ttcn</span><br><span>+++ b/sgsn/SGSN_Tests.ttcn</span><br><span>@@ -1943,6 +1943,78 @@</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_attach_gmm_attach_req_while_gmm_attach(charstring id) runs on BSSGP_ConnHdlr {</span><br><span style="color: hsl(120, 100%, 40%);">+  var integer count_req := 0;</span><br><span style="color: hsl(120, 100%, 40%);">+   var MobileL3_CommonIE_Types.MobileIdentityLV mi;</span><br><span style="color: hsl(120, 100%, 40%);">+      var RoutingAreaIdentificationV rand_rai := f_random_RAI();</span><br><span style="color: hsl(120, 100%, 40%);">+    var BssgpDecoded bd;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), rand_rai, true, false, omit, omit));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     alt {</span><br><span style="color: hsl(120, 100%, 40%);">+         [] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) {</span><br><span style="color: hsl(120, 100%, 40%);">+                   setverdict(fail, "Unexpected GMM ATTACH REJECT");</span><br><span style="color: hsl(120, 100%, 40%);">+                   mtc.stop;</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span style="color: hsl(120, 100%, 40%);">+             [] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ID_REQ('001'B))) {</span><br><span style="color: hsl(120, 100%, 40%);">+                     mi := valueof(ts_MI_IMSI_LV(g_pars.imsi));</span><br><span style="color: hsl(120, 100%, 40%);">+                    f_send_l3_gmm_llc(ts_GMM_ID_RESP(mi));</span><br><span style="color: hsl(120, 100%, 40%);">+                        repeat;</span><br><span style="color: hsl(120, 100%, 40%);">+               }</span><br><span style="color: hsl(120, 100%, 40%);">+             [] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ID_REQ('010'B))) {</span><br><span style="color: hsl(120, 100%, 40%);">+                     /* send out a second GMM_Attach Request.</span><br><span style="color: hsl(120, 100%, 40%);">+                       * If the SGSN follows the rules, this 2nd ATTACH REQ should be ignored, because</span><br><span style="color: hsl(120, 100%, 40%);">+                       * of the same content */</span><br><span style="color: hsl(120, 100%, 40%);">+                     f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), rand_rai, true, false, omit, omit));</span><br><span style="color: hsl(120, 100%, 40%);">+                       mi := valueof(ts_MI_IMEI_LV(g_pars.imei));</span><br><span style="color: hsl(120, 100%, 40%);">+                    f_send_l3_gmm_llc(ts_GMM_ID_RESP(mi));</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_sleep(1.0);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       /* we've sent already a IMEI answer, we should NOT asked again for IMEI */</span><br><span style="color: hsl(120, 100%, 40%);">+        alt {</span><br><span style="color: hsl(120, 100%, 40%);">+         [] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ID_REQ('001'B))) {</span><br><span style="color: hsl(120, 100%, 40%);">+                     mi := valueof(ts_MI_IMSI_LV(g_pars.imsi));</span><br><span style="color: hsl(120, 100%, 40%);">+                    f_send_l3_gmm_llc(ts_GMM_ID_RESP(mi));</span><br><span style="color: hsl(120, 100%, 40%);">+                        repeat;</span><br><span style="color: hsl(120, 100%, 40%);">+               }</span><br><span style="color: hsl(120, 100%, 40%);">+             [] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ID_REQ('010'B))) {</span><br><span style="color: hsl(120, 100%, 40%);">+                     setverdict(fail, "Unexpected GMM ID REQ (IMEI).");</span><br><span style="color: hsl(120, 100%, 40%);">+                  mtc.stop;</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span style="color: hsl(120, 100%, 40%);">+             [] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) {</span><br><span style="color: hsl(120, 100%, 40%);">+                   setverdict(fail, "Unexpected GMM ATTACH REJECT");</span><br><span style="color: hsl(120, 100%, 40%);">+                   mtc.stop;</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span style="color: hsl(120, 100%, 40%);">+             [] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))) -> value bd {</span><br><span style="color: hsl(120, 100%, 40%);">+                 f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept);</span><br><span style="color: hsl(120, 100%, 40%);">+                  f_send_l3_gmm_llc(ts_GMM_ATTACH_COMPL);</span><br><span style="color: hsl(120, 100%, 40%);">+                       setverdict(pass);</span><br><span style="color: hsl(120, 100%, 40%);">+                     /* FIXME: Extract P-TMSI, if any. Only send Complete if necessary */</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%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+testcase TC_attach_gmm_attach_req_while_gmm_attach() runs on test_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+        /* Testing if the SGSN ignore Attach Request with the exact same content */</span><br><span style="color: hsl(120, 100%, 40%);">+   /* MS -> SGSN: Attach Request IMSI</span><br><span style="color: hsl(120, 100%, 40%);">+  * MS <- SGSN: Identity Request IMSI (optional)</span><br><span style="color: hsl(120, 100%, 40%);">+     * MS -> SGSN: Identity Response IMSI (optional)</span><br><span style="color: hsl(120, 100%, 40%);">+    * MS <- SGSN: Identity Request IMEI</span><br><span style="color: hsl(120, 100%, 40%);">+        * MS -> SGSN: Attach Request (2nd)</span><br><span style="color: hsl(120, 100%, 40%);">+         * MS <- SGSN: Identity Response IMEI</span><br><span style="color: hsl(120, 100%, 40%);">+       * MS <- SGSN: Attach Accept</span><br><span style="color: hsl(120, 100%, 40%);">+        * MS -> SGSN: Attach Complete</span><br><span style="color: hsl(120, 100%, 40%);">+      */</span><br><span style="color: hsl(120, 100%, 40%);">+   var BSSGP_ConnHdlr vc_conn;</span><br><span style="color: hsl(120, 100%, 40%);">+   f_init();</span><br><span style="color: hsl(120, 100%, 40%);">+     f_sleep(1.0);</span><br><span style="color: hsl(120, 100%, 40%);">+ f_vty_config(SGSNVTY, "sgsn", "auth-policy accept-all");</span><br><span style="color: hsl(120, 100%, 40%);">+  vc_conn := f_start_handler(refers(f_TC_attach_gmm_attach_req_while_gmm_attach), testcasename(), g_gb, 39);</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> control {</span><br><span>      execute( TC_attach() );</span><br><span>      execute( TC_attach_mnc3() );</span><br><span>@@ -1985,6 +2057,7 @@</span><br><span>         execute( TC_attach_restart_ctr_create() );</span><br><span>   execute( TC_attach_pdp_act_deact_mt_t3395_expire() );</span><br><span>        execute( TC_attach_pdp_act_user_error_ind_ggsn() );</span><br><span style="color: hsl(120, 100%, 40%);">+   execute( TC_attach_gmm_attach_req_while_gmm_attach() );</span><br><span> }</span><br><span> </span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/10392">change 10392</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/10392"/><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: I0bac50dc5a72ba8f9010b05bcb98aa7ff0b81cf6 </div>
<div style="display:none"> Gerrit-Change-Number: 10392 </div>
<div style="display:none"> Gerrit-PatchSet: 5 </div>
<div style="display:none"> Gerrit-Owner: lynxis lazus <lynxis@fe80.eu> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>