<p>Harald Welte <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/9583">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_closed_add_vty<br><br>Check acl policy closed.<br><br>VTY-> SGSN: policy close<br>MS -> SGSN: Attach Request<br>MS <- SGSN: Identity Request IMSI<br>MS -> SGSN: Identity Response IMSI<br>MS <- SGSN: Attach Reject<br>VTY-> SGSN: policy imsi-acl add IMSI<br>MS -> SGSN: Attach Request<br>MS <- SGSN: Identity Request IMSI<br>MS -> SGSN: Identity Response IMSI<br>MS <- SGSN: Identity Request IMEI<br>MS -> SGSN: Identity Response IMEI<br>MS <- SGSN: Attach Accept<br><br>Change-Id: I1832c339a9d54c0038433ad44e292031a8905e20<br>---<br>M sgsn/SGSN_Tests.ttcn<br>1 file changed, 55 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 4b6fc4c..17abb95 100644</span><br><span>--- a/sgsn/SGSN_Tests.ttcn</span><br><span>+++ b/sgsn/SGSN_Tests.ttcn</span><br><span>@@ -1496,6 +1496,60 @@</span><br><span>        f_sgsn_vty_destroy_subscriber_imsi(SGSNVTY, imsi);</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+private function f_TC_attach_closed_imsi_added(charstring id) runs on BSSGP_ConnHdlr {</span><br><span style="color: hsl(120, 100%, 40%);">+   var RoutingAreaIdentificationV old_ra := 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%);">+        /* unregister the old IMSI */</span><br><span style="color: hsl(120, 100%, 40%);">+ f_bssgp_client_unregister(g_pars.imsi);</span><br><span style="color: hsl(120, 100%, 40%);">+       /* Simulate a foreign IMSI */</span><br><span style="color: hsl(120, 100%, 40%);">+ g_pars.imsi := '001010123456789'H;</span><br><span style="color: hsl(120, 100%, 40%);">+    f_bssgp_client_register(g_pars.imsi, g_pars.tlli, g_pars.bssgp_cell_id);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    /* there is no auth */</span><br><span style="color: hsl(120, 100%, 40%);">+        g_pars.net.expect_auth := false;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    BSSGP.send(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));</span><br><span style="color: hsl(120, 100%, 40%);">+       f_gmm_auth();</span><br><span style="color: hsl(120, 100%, 40%);">+ alt {</span><br><span style="color: hsl(120, 100%, 40%);">+         [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) {</span><br><span style="color: hsl(120, 100%, 40%);">+                      setverdict(fail, "Received unexpected GMM Attach REJECT");</span><br><span style="color: hsl(120, 100%, 40%);">+          }</span><br><span style="color: hsl(120, 100%, 40%);">+             [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT(*, *, *))) -> 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%);">+                  BSSGP.send(ts_GMM_ATTACH_COMPL);</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%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+testcase TC_attach_closed_add_vty() runs on test_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+   /* VTY-> SGSN: policy close</span><br><span style="color: hsl(120, 100%, 40%);">+         * MS -> SGSN: Attach Request</span><br><span style="color: hsl(120, 100%, 40%);">+       * MS <- SGSN: Identity Request IMSI</span><br><span style="color: hsl(120, 100%, 40%);">+        * MS -> SGSN: Identity Response IMSI</span><br><span style="color: hsl(120, 100%, 40%);">+       * MS <- SGSN: Attach Reject</span><br><span style="color: hsl(120, 100%, 40%);">+        * VTY-> SGSN: policy imsi-acl add IMSI</span><br><span style="color: hsl(120, 100%, 40%);">+     * MS -> SGSN: Attach Request</span><br><span style="color: hsl(120, 100%, 40%);">+       * MS <- SGSN: Identity Request IMSI</span><br><span style="color: hsl(120, 100%, 40%);">+        * MS -> SGSN: Identity Response IMSI</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: 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%);">+        */</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 closed");</span><br><span style="color: hsl(120, 100%, 40%);">+      f_vty_config(SGSNVTY, "sgsn", "imsi-acl del 001010123456789");</span><br><span style="color: hsl(120, 100%, 40%);">+    /* test with foreign IMSI: Must Reject */</span><br><span style="color: hsl(120, 100%, 40%);">+     vc_conn := f_start_handler(refers(f_TC_attach_closed_foreign), testcasename(), g_gb[0], 9);</span><br><span style="color: hsl(120, 100%, 40%);">+   vc_conn.done;</span><br><span style="color: hsl(120, 100%, 40%);">+ f_vty_config(SGSNVTY, "sgsn", "imsi-acl add 001010123456789");</span><br><span style="color: hsl(120, 100%, 40%);">+    /* test with same IMSI: Must Accept */</span><br><span style="color: hsl(120, 100%, 40%);">+        vc_conn := f_start_handler(refers(f_TC_attach_closed_imsi_added), testcasename(), g_gb[0], 10);</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>@@ -1511,6 +1565,7 @@</span><br><span>         execute( TC_attach_closed() );</span><br><span>       execute( TC_attach_no_imei_response() );</span><br><span>     execute( TC_attach_no_imsi_response() );</span><br><span style="color: hsl(120, 100%, 40%);">+      execute( TC_attach_closed_add_vty(), 10.0 );</span><br><span>         execute( TC_attach_check_subscriber_list(), 10.0 );</span><br><span>  execute( TC_attach_detach_check_subscriber_list(), 10.0 );</span><br><span>   execute( TC_hlr_location_cancel_request_update(), 10.0 );</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/9583">change 9583</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/9583"/><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: I1832c339a9d54c0038433ad44e292031a8905e20 </div>
<div style="display:none"> Gerrit-Change-Number: 9583 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </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 </div>