sgsn: add TC_attach_closed_add_vty
Check acl policy closed.
VTY-> SGSN: policy close
MS -> SGSN: Attach Request
MS <- SGSN: Identity Request IMSI
MS -> SGSN: Identity Response IMSI
MS <- SGSN: Attach Reject
VTY-> SGSN: policy imsi-acl add IMSI
MS -> SGSN: Attach Request
MS <- SGSN: Identity Request IMSI
MS -> SGSN: Identity Response IMSI
MS <- SGSN: Identity Request IMEI
MS -> SGSN: Identity Response IMEI
MS <- SGSN: Attach Accept
Change-Id: I1832c339a9d54c0038433ad44e292031a8905e20
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index 4b6fc4c..17abb95 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -1496,6 +1496,60 @@
f_sgsn_vty_destroy_subscriber_imsi(SGSNVTY, imsi);
}
+private function f_TC_attach_closed_imsi_added(charstring id) runs on BSSGP_ConnHdlr {
+ var RoutingAreaIdentificationV old_ra := f_random_RAI();
+ var BssgpDecoded bd;
+
+ /* unregister the old IMSI */
+ f_bssgp_client_unregister(g_pars.imsi);
+ /* Simulate a foreign IMSI */
+ g_pars.imsi := '001010123456789'H;
+ f_bssgp_client_register(g_pars.imsi, g_pars.tlli, g_pars.bssgp_cell_id);
+
+ /* there is no auth */
+ g_pars.net.expect_auth := false;
+
+ BSSGP.send(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
+ f_gmm_auth();
+ alt {
+ [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) {
+ setverdict(fail, "Received unexpected GMM Attach REJECT");
+ }
+ [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT(*, *, *))) -> value bd {
+ f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept);
+ BSSGP.send(ts_GMM_ATTACH_COMPL);
+ setverdict(pass);
+ }
+ }
+}
+testcase TC_attach_closed_add_vty() runs on test_CT {
+ /* VTY-> SGSN: policy close
+ * MS -> SGSN: Attach Request
+ * MS <- SGSN: Identity Request IMSI
+ * MS -> SGSN: Identity Response IMSI
+ * MS <- SGSN: Attach Reject
+ * VTY-> SGSN: policy imsi-acl add IMSI
+ * MS -> SGSN: Attach Request
+ * MS <- SGSN: Identity Request IMSI
+ * MS -> SGSN: Identity Response IMSI
+ * MS <- SGSN: Identity Request IMEI
+ * MS -> SGSN: Identity Response IMEI
+ * MS <- SGSN: Attach Accept
+ */
+ var BSSGP_ConnHdlr vc_conn;
+ f_init();
+ f_sleep(1.0);
+ f_vty_config(SGSNVTY, "sgsn", "auth-policy closed");
+ f_vty_config(SGSNVTY, "sgsn", "imsi-acl del 001010123456789");
+ /* test with foreign IMSI: Must Reject */
+ vc_conn := f_start_handler(refers(f_TC_attach_closed_foreign), testcasename(), g_gb[0], 9);
+ vc_conn.done;
+ f_vty_config(SGSNVTY, "sgsn", "imsi-acl add 001010123456789");
+ /* test with same IMSI: Must Accept */
+ vc_conn := f_start_handler(refers(f_TC_attach_closed_imsi_added), testcasename(), g_gb[0], 10);
+ vc_conn.done;
+}
+
control {
execute( TC_attach() );
execute( TC_attach_mnc3() );
@@ -1511,6 +1565,7 @@
execute( TC_attach_closed() );
execute( TC_attach_no_imei_response() );
execute( TC_attach_no_imsi_response() );
+ execute( TC_attach_closed_add_vty(), 10.0 );
execute( TC_attach_check_subscriber_list(), 10.0 );
execute( TC_attach_detach_check_subscriber_list(), 10.0 );
execute( TC_hlr_location_cancel_request_update(), 10.0 );