[PATCH] osmo-ttcn3-hacks[master]: sgsn: Add TC_attach_closed for "auth-policy closed"

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sat Feb 17 09:17:19 UTC 2018


Review at  https://gerrit.osmocom.org/6554

sgsn: Add TC_attach_closed for "auth-policy closed"

Change-Id: Ic8aa77d1825fa2e39a09c3f0f0918ef24a3b3f7b
---
M sgsn/SGSN_Tests.ttcn
1 file changed, 42 insertions(+), 0 deletions(-)


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

diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index ba2df3c..2d21f48 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -472,6 +472,47 @@
 	vc_conn.done;
 }
 
+/* Attempt of GPRS ATTACH in 'accept all' mode */
+private function f_TC_attach_closed_foreign(charstring id) runs on BSSGP_ConnHdlr {
+	var MobileIdentityLV mi;
+	var RoutingAreaIdentificationV old_ra := f_random_RAI();
+
+	/* Simulate a foreign IMSI */
+	g_pars.imsi := '001010123456789'H;
+	f_bssgp_client_register(g_pars.imsi, g_pars.tlli, g_pars.bssgp_cell_id);
+
+	g_pars.net.expect_auth := false;
+
+	if (ispresent(g_pars.p_tmsi)) {
+		mi := valueof(ts_MI_TMSI_LV(g_pars.p_tmsi));
+	} else {
+		mi := valueof(ts_MI_IMSI_LV(g_pars.imsi));
+	}
+	BSSGP.send(ts_GMM_ATTACH_REQ(mi, old_ra, false, false, omit, omit));
+	alt {
+	[] as_mm_identity();
+	[] BSSGP.receive(tr_BD_L3(tr_GMM_ATTACH_REJECT('07'O))) {
+		setverdict(pass);
+		}
+	[] BSSGP.receive(tr_BD_L3(tr_GMM_ATTACH_REJECT(?))) {
+		setverdict(pass);
+		}
+	}
+}
+testcase TC_attach_closed() runs on test_CT {
+	var BSSGP_ConnHdlr vc_conn;
+	f_init();
+	f_sleep(1.0);
+	f_vty_config(SGSNVTY, "sgsn", "auth-policy closed");
+	/* test with foreign IMSI: Must Reject */
+	vc_conn := f_start_handler(refers(f_TC_attach_closed_foreign), testcasename(), g_gb[0], 7);
+	vc_conn.done;
+	/* test with home IMSI: Must Accept */
+	vc_conn := f_start_handler(refers(f_TC_attach_accept_all), testcasename(), g_gb[0], 8);
+	vc_conn.done;
+}
+
+
 
 control {
 	execute( TC_attach() );
@@ -480,6 +521,7 @@
 	execute( TC_attach_gsup_lu_timeout() );
 	execute( TC_attach_combined() );
 	execute( TC_attach_accept_all() );
+	execute( TC_attach_closed() );
 }
 
 

-- 
To view, visit https://gerrit.osmocom.org/6554
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic8aa77d1825fa2e39a09c3f0f0918ef24a3b3f7b
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list