Change in osmo-ttcn3-hacks[master]: sgsn: add TC_attach_closed_add_vty

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

lynxis lazus gerrit-no-reply at lists.osmocom.org
Tue Jun 12 17:27:29 UTC 2018


lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/9583


Change subject: sgsn: add TC_attach_closed_add_vty
......................................................................

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
---
M sgsn/SGSN_Tests.ttcn
1 file changed, 55 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/83/9583/1

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 );

-- 
To view, visit https://gerrit.osmocom.org/9583
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1832c339a9d54c0038433ad44e292031a8905e20
Gerrit-Change-Number: 9583
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180612/c02b2414/attachment.htm>


More information about the gerrit-log mailing list