[PATCH] osmo-ttcn3-hacks[master]: sgsn: Add TC_attach_gsup_lu_reject

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Feb 18 09:28:08 UTC 2018


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/6558

to look at the new patch set (#2).

sgsn: Add TC_attach_gsup_lu_reject

Change-Id: Id36733e7e51b252407c7513d8441db9a555fd30d
---
M sgsn/SGSN_Tests.ttcn
1 file changed, 45 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/58/6558/2

diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index bb97c64..490fbc2 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -423,7 +423,7 @@
 testcase TC_attach_auth_sai_reject() runs on test_CT {
 	var BSSGP_ConnHdlr vc_conn;
 	f_init();
-	vc_conn := f_start_handler(refers(f_TC_attach_auth_sai_reject), testcasename(), g_gb[0], 3);
+	vc_conn := f_start_handler(refers(f_TC_attach_auth_sai_reject), testcasename(), g_gb[0], 4);
 	vc_conn.done;
 }
 
@@ -458,9 +458,46 @@
 	var BSSGP_ConnHdlr vc_conn;
 	f_init();
 	f_sleep(1.0);
-	vc_conn := f_start_handler(refers(f_TC_attach_gsup_lu_timeout), testcasename(), g_gb[0], 4);
+	vc_conn := f_start_handler(refers(f_TC_attach_gsup_lu_timeout), testcasename(), g_gb[0], 5);
 	vc_conn.done;
 }
+
+/* HLR rejects UL REQ, expect ATTACH REJECT */
+private function f_TC_attach_gsup_lu_reject(charstring id) runs on BSSGP_ConnHdlr {
+	var BssgpDecoded bd;
+	var MobileIdentityLV mi;
+	var RoutingAreaIdentificationV old_ra := f_random_RAI();
+
+	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));
+	f_gmm_auth();
+	/* Expect MSC to perform LU with HLR */
+	GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)) {
+		GSUP.send(ts_GSUP_UL_ERR(g_pars.imsi, 0));
+	}
+	alt {
+	[] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) {
+		setverdict(pass);
+		}
+	[] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))) -> value bd {
+		f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept);
+		setverdict(fail);
+		}
+	}
+}
+testcase TC_attach_gsup_lu_reject() runs on test_CT {
+	var BSSGP_ConnHdlr vc_conn;
+	f_init();
+	f_sleep(1.0);
+	vc_conn := f_start_handler(refers(f_TC_attach_gsup_lu_reject), testcasename(), g_gb[0], 6);
+	vc_conn.done;
+}
+
 
 /* Attempt of combined GPRS + IMSI attach: network should ACK only GPRS attach  */
 private function f_TC_attach_combined(charstring id) runs on BSSGP_ConnHdlr {
@@ -492,7 +529,7 @@
 	var BSSGP_ConnHdlr vc_conn;
 	f_init();
 	f_sleep(1.0);
-	vc_conn := f_start_handler(refers(f_TC_attach_combined), testcasename(), g_gb[0], 5);
+	vc_conn := f_start_handler(refers(f_TC_attach_combined), testcasename(), g_gb[0], 7);
 	vc_conn.done;
 }
 
@@ -523,7 +560,7 @@
 	f_init();
 	f_sleep(1.0);
 	f_vty_config(SGSNVTY, "sgsn", "auth-policy accept-all");
-	vc_conn := f_start_handler(refers(f_TC_attach_accept_all), testcasename(), g_gb[0], 6);
+	vc_conn := f_start_handler(refers(f_TC_attach_accept_all), testcasename(), g_gb[0], 8);
 	vc_conn.done;
 }
 
@@ -560,10 +597,10 @@
 	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 := f_start_handler(refers(f_TC_attach_closed_foreign), testcasename(), g_gb[0], 9);
 	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 := f_start_handler(refers(f_TC_attach_accept_all), testcasename(), g_gb[0], 10);
 	vc_conn.done;
 }
 
@@ -591,7 +628,7 @@
 	var BSSGP_ConnHdlr vc_conn;
 	f_init();
 	f_sleep(1.0);
-	vc_conn := f_start_handler(refers(f_TC_rau_unknown), testcasename(), g_gb[0], 9);
+	vc_conn := f_start_handler(refers(f_TC_rau_unknown), testcasename(), g_gb[0], 11);
 	vc_conn.done;
 }
 
@@ -604,6 +641,7 @@
 	execute( TC_attach_auth_sai_timeout() );
 	execute( TC_attach_auth_sai_reject() );
 	execute( TC_attach_gsup_lu_timeout() );
+	execute( TC_attach_gsup_lu_reject() );
 	execute( TC_attach_combined() );
 	execute( TC_attach_accept_all() );
 	execute( TC_attach_closed() );

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id36733e7e51b252407c7513d8441db9a555fd30d
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder


More information about the gerrit-log mailing list