Change in osmo-ttcn3-hacks[master]: msc: Add Iu related tests for most existing 2G tests

Harald Welte gerrit-no-reply at lists.osmocom.org
Tue Apr 30 20:41:55 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13753 )

Change subject: msc: Add Iu related tests for most existing 2G tests
......................................................................

msc: Add Iu related tests for most existing 2G tests

This might look a bit like copy+paste programming for our testcases.

However, we actually want the Iu related tests show up as separate
'testscase' in the TTCN-3 sense, so there's no way that's more elegant
than this :/

Change-Id: I3b56e17487c9df839e67ed390a1ff89979683e8e
---
M msc/BSC_ConnectionHandler.ttcn
M msc/MSC_Tests.ttcn
A msc/MSC_Tests_Iu.ttcn
3 files changed, 590 insertions(+), 58 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn
index 1fd02aa..b1a0491 100644
--- a/msc/BSC_ConnectionHandler.ttcn
+++ b/msc/BSC_ConnectionHandler.ttcn
@@ -86,7 +86,7 @@
 	boolean ran_is_geran
 };
 
-private function imsi_hex2oct(hexstring imsi) return octetstring {
+function imsi_hex2oct(hexstring imsi) return octetstring {
 	var hexstring tmp := ''H;
 	var octetstring ret;
 	var integer i;
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index af654a3..d4be96b 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -1,5 +1,7 @@
 module MSC_Tests {
 
+friend module MSC_Tests_Iu;
+
 import from General_Types all;
 import from Osmocom_Types all;
 
@@ -41,6 +43,7 @@
 import from BSSMAP_Templates all;
 import from RAN_Emulation all;
 import from BSC_ConnectionHandler all;
+import from RANAP_Templates all;
 
 import from SGsAP_Templates all;
 import from SGsAP_Types all;
@@ -518,6 +521,10 @@
 		use_umts_aka := false,
 		ran_is_geran := ran_is_geran
 	};
+	if (not ran_is_geran) {
+		pars.use_umts_aka := true;
+		pars.net.expect_auth := true;
+	}
 	return pars;
 }
 
@@ -587,7 +594,7 @@
 }
 
 /* Do LU by IMSI, refuse it on GSUP and expect LU REJ back to MS */
-private function f_tc_lu_imsi_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+friend function f_tc_lu_imsi_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	f_init_handler(pars);
 	var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi);
 
@@ -613,8 +620,10 @@
 	vc_conn.done;
 }
 
+
+
 /* Do LU by IMSI, timeout on GSUP */
-private function f_tc_lu_imsi_timeout_gsup(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+friend function f_tc_lu_imsi_timeout_gsup(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	f_init_handler(pars);
 	var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi);
 
@@ -641,6 +650,7 @@
 	vc_conn.done;
 }
 
+
 private function f_tc_lu_imsi_auth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	pars.net.expect_auth := true;
 	f_init_handler(pars);
@@ -655,7 +665,8 @@
 	vc_conn.done;
 }
 
-private function f_tc_lu_imsi_auth3g_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+
+friend function f_tc_lu_imsi_auth3g_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	pars.net.expect_auth := true;
 	pars.use_umts_aka := true;
 	f_init_handler(pars);
@@ -670,8 +681,9 @@
 	vc_conn.done;
 }
 
+
 /* Send CM SERVICE REQ for IMSI that has never performed LU before */
-private function f_tc_cmserv_imsi_unknown(charstring id, BSC_ConnHdlrPars pars)
+friend function f_tc_cmserv_imsi_unknown(charstring id, BSC_ConnHdlrPars pars)
 runs on BSC_ConnHdlr {
 	f_init_handler(pars);
 
@@ -712,7 +724,8 @@
 	vc_conn.done;
 }
 
-private function f_tc_lu_and_mo_call(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+
+friend function f_tc_lu_and_mo_call(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	f_init_handler(pars);
 	var CallParameters cpars := valueof(t_CallParams('12345'H, 0));
 	cpars.bss_rtp_port := 1110;
@@ -731,8 +744,9 @@
 	vc_conn.done;
 }
 
+
 /* Test LU (with authentication enabled), where HLR times out sending SAI response */
-private function f_tc_lu_auth_sai_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+friend function f_tc_lu_auth_sai_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	f_init_handler(pars);
 
 	var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi)
@@ -745,7 +759,9 @@
 	f_cl3_or_initial_ue(l3_lu);
 
 	/* Send Early Classmark, just for the fun of it */
-	BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3));
+	if (pars.ran_is_geran) {
+		BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3));
+	}
 
 	GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi));
 	/* The HLR would normally return an auth vector here, but we fail to do so. */
@@ -762,8 +778,9 @@
 	vc_conn.done;
 }
 
+
 /* Test LU (with authentication enabled), where HLR rejects sending SAI error */
-private function f_tc_lu_auth_sai_err(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+friend function f_tc_lu_auth_sai_err(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	f_init_handler(pars);
 
 	var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi)
@@ -776,7 +793,9 @@
 	f_cl3_or_initial_ue(l3_lu);
 
 	/* Send Early Classmark, just for the fun of it */
-	BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3));
+	if (pars.ran_is_geran) {
+		BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3));
+	}
 
 	GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi));
 	GSUP.send(ts_GSUP_SAI_ERR(g_pars.imsi, 13));
@@ -793,6 +812,7 @@
 	vc_conn.done;
 }
 
+
 /* Test LU but BSC will send a clear request in the middle */
 private function f_tc_lu_clear_request(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	f_init_handler(pars);
@@ -837,7 +857,7 @@
 }
 
 /* Test LU but BSC will send a clear request in the middle */
-private function f_tc_lu_disconnect(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+friend function f_tc_lu_disconnect(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	f_init_handler(pars);
 
 	var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi)
@@ -850,7 +870,9 @@
 	f_cl3_or_initial_ue(l3_lu);
 
 	/* Send Early Classmark, just for the fun of it */
-	BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3));
+	if (pars.ran_is_geran) {
+		BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3));
+	}
 
 	f_sleep(1.0);
 	/* send clear request in the middle of the LU */
@@ -866,9 +888,8 @@
 	vc_conn.done;
 }
 
-
 /* Test LU but with illegal mobile identity type = IMEI */
-private function f_tc_lu_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+friend function f_tc_lu_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	f_init_handler(pars);
 
 	var PDU_ML3_MS_NW l3_lu := f_build_lu_imei(g_pars.imei)
@@ -881,7 +902,9 @@
 	f_cl3_or_initial_ue(l3_lu);
 
 	/* Send Early Classmark, just for the fun of it */
-	BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3));
+	if (pars.ran_is_geran) {
+		BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3));
+	}
 	/* wait for LU reject, ignore any ID REQ */
 	alt {
 	[] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { }
@@ -898,6 +921,7 @@
 	vc_conn.done;
 }
 
+
 /* Test LU by TMSI with unknown TMSI, expect (and answer) ID REQ. */
 private function f_tc_lu_tmsi_noauth_unknown(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	/* We piggyback a test for an MSC crash on overlong IMSI (OS#2864) onto this test. */
@@ -953,7 +977,7 @@
 
 
 /* Test IMSI DETACH (MI=IMSI) */
-private function f_tc_imsi_detach_by_imsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+friend function f_tc_imsi_detach_by_imsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	f_init_handler(pars);
 
 	var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi));
@@ -962,7 +986,9 @@
 	f_cl3_or_initial_ue(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi)));
 
 	/* Send Early Classmark, just for the fun of it? */
-	BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3));
+	if (pars.ran_is_geran) {
+		BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3));
+	}
 
 	/* wait for normal teardown */
 	f_expect_clear();
@@ -975,8 +1001,9 @@
 	vc_conn.done;
 }
 
+
 /* Test IMSI DETACH (MI=TMSI) */
-private function f_tc_imsi_detach_by_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+friend function f_tc_imsi_detach_by_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	f_init_handler(pars);
 
 	var MobileIdentityLV mi := valueof(ts_MI_TMSI_LV('01020304'O));
@@ -985,7 +1012,9 @@
 	f_cl3_or_initial_ue(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi)));
 
 	/* Send Early Classmark, just for the fun of it? */
-	BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3));
+	if (pars.ran_is_geran) {
+		BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3));
+	}
 
 	/* wait for normal teardown */
 	f_expect_clear();
@@ -998,8 +1027,9 @@
 	vc_conn.done;
 }
 
+
 /* Test IMSI DETACH (MI=IMEI), which is illegal */
-private function f_tc_imsi_detach_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+friend function f_tc_imsi_detach_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	f_init_handler(pars);
 
 	var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imei));
@@ -1008,7 +1038,9 @@
 	f_cl3_or_initial_ue(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi)));
 
 	/* Send Early Classmark, just for the fun of it? */
-	BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3));
+	if (pars.ran_is_geran) {
+		BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3));
+	}
 
 	/* wait for normal teardown */
 	f_expect_clear();
@@ -1032,7 +1064,7 @@
 }
 
 /* establish an emergency call by IMEI, no SIM inserted (and hence no IMSI) */
-private function f_tc_emerg_call_imei_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+friend function f_tc_emerg_call_imei_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	f_init_handler(pars);
 
 	var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imei));
@@ -1049,8 +1081,9 @@
 	vc_conn.done;
 }
 
+
 /* establish an emergency call by IMSI, SIM inserted (and hence IMSI) */
-private function f_tc_emerg_call_imsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+friend function f_tc_emerg_call_imsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	f_init_handler(pars);
 	/* First perform location update to ensure subscriber is known */
 	f_perform_lu();
@@ -1065,6 +1098,7 @@
 	vc_conn.done;
 }
 
+
 /* CM Service Request for VGCS -> reject */
 private function f_tc_cm_serv_req_vgcs_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	f_init_handler(pars);
@@ -1276,7 +1310,7 @@
 }
 
 /* Test Complete L3 with random payload */
-private function f_tc_establish_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+friend function f_tc_establish_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	f_init_handler(pars);
 
 	f_perform_lu();
@@ -1292,8 +1326,9 @@
 	vc_conn.done;
 }
 
+
 /* Test MO Call SETUP with no response from MNCC */
-private function f_tc_mo_setup_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+friend function f_tc_mo_setup_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	f_init_handler(pars, 190.0);
 
 	var CallParameters cpars := valueof(t_CallParams('12345'H, 0));
@@ -1322,8 +1357,9 @@
 	vc_conn.done;
 }
 
+
 /* Test MO Call with no response to RAN-side CRCX */
-private function f_tc_mo_crcx_ran_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+friend function f_tc_mo_crcx_ran_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	f_init_handler(pars);
 	var CallParameters cpars := valueof(t_CallParams('12345'H, 0));
 	var MNCC_PDU mncc;
@@ -1361,8 +1397,9 @@
 	vc_conn.done;
 }
 
+
 /* Test MO Call with reject to RAN-side CRCX */
-private function f_tc_mo_crcx_ran_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+friend function f_tc_mo_crcx_ran_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	f_init_handler(pars);
 	var CallParameters cpars := valueof(t_CallParams('12345'H, 0));
 	var MNCC_PDU mncc;
@@ -1475,7 +1512,7 @@
 }
 
 /* Test MT Call */
-private function f_tc_mt_crcx_ran_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+friend function f_tc_mt_crcx_ran_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	f_init_handler(pars);
 	var CallParameters cpars := valueof(t_CallParams('123456'H, 0));
 	var MNCC_PDU mncc;
@@ -1544,8 +1581,9 @@
 }
 
 
+
 /* Test MT Call T310 timer */
-private function f_tc_mt_t310(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+friend function f_tc_mt_t310(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	f_init_handler(pars, 200.0);
 	var CallParameters cpars := valueof(t_CallParams('123456'H, 0));
 	var MNCC_PDU mncc;
@@ -1596,8 +1634,9 @@
 	vc_conn.done;
 }
 
+
 /* Perform successful LU + MO call, then GSUP LocationCancel. Subscriber must be denied CM SERV */
-private function f_tc_gsup_cancel(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+friend function f_tc_gsup_cancel(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	f_init_handler(pars);
 	var CallParameters cpars := valueof(t_CallParams('12345'H, 0));
 	cpars.bss_rtp_port := 1110;
@@ -1644,6 +1683,7 @@
 	vc_conn.done;
 }
 
+
 /* A5/1 only permitted on network side, and MS capable to do it */
 private function f_tc_lu_imsi_auth_tmsi_encr_1_13(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	pars.net.expect_auth := true;
@@ -1900,7 +1940,7 @@
 }
 
 /* Test MO Call with no response to RAN-side CRCX or DTAP Release */
-private function f_tc_mo_release_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+friend function f_tc_mo_release_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	f_init_handler(pars);
 	var CallParameters cpars := valueof(t_CallParams('12345'H, 0));
 	var MNCC_PDU mncc;
@@ -1983,12 +2023,20 @@
 	setverdict(pass);
 }
 
+/* Two BSSMAP resets from two different BSCs plus one IuCS RANAP Reset */
+testcase TC_reset_two_1iu() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+	f_sleep(2.0);
+	setverdict(pass);
+}
+
 /***********************************************************************
  * SMS Testing
  ***********************************************************************/
 
 /* LU followed by MO SMS */
-private function f_tc_lu_and_mo_sms(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+friend function f_tc_lu_and_mo_sms(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	var SmsParameters spars := valueof(t_SmsPars);
 
 	f_init_handler(pars);
@@ -2010,6 +2058,7 @@
 	vc_conn.done;
 }
 
+
 private function f_vty_sms_send(charstring imsi, charstring msisdn, charstring text)
 runs on BSC_ConnHdlr {
 	f_vty_transceive(MSCVTY, "subscriber imsi "&imsi&" sms sender msisdn "&msisdn&" send "&text);
@@ -2023,7 +2072,7 @@
 }
 
 /* LU followed by MT SMS */
-private function f_tc_lu_and_mt_sms(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+friend function f_tc_lu_and_mt_sms(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	var SmsParameters spars := valueof(t_SmsPars);
 	var OCT4 tmsi;
 
@@ -2062,8 +2111,9 @@
 	vc_conn.done;
 }
 
+
 /* Paging for MT SMS but no response */
-private function f_tc_lu_and_mt_sms_paging_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+friend function f_tc_lu_and_mt_sms_paging_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	var SmsParameters spars := valueof(t_SmsPars);
 	var OCT4 tmsi;
 	f_init_handler(pars, 150.0);
@@ -2082,18 +2132,22 @@
 	f_vty_sms_send(hex2str(pars.imsi), "2342", "Hello SMS");
 
 	/* Expect the MSC to page exactly once */
-	BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)) { };
+	f_expect_paging();
 
 	/* Wait some time to make sure the MSC is not delivering any further
 	 * paging messages or anything else that could be unexpected. */
 	timer T := 20.0;
 	T.start
 	alt {
-		[] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi))
+		[pars.ran_is_geran] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi))
 		{
 			setverdict(fail, "paging seems not to stop!");
 			mtc.stop;
 		}
+		[not pars.ran_is_geran] BSSAP.receive(tr_RANAP_Paging(cs_domain, imsi_hex2oct(g_pars.imsi), ?)) {
+			setverdict(fail, "paging seems not to stop!");
+			mtc.stop;
+		}
 		[] BSSAP.receive {
 			setverdict(fail, "unexpected BSSAP message received");
 			self.stop;
@@ -2116,8 +2170,9 @@
 	vc_conn.done;
 }
 
+
 /* mobile originated SMS from MS/BTS/BSC side to SMPP */
-private function f_tc_smpp_mo_sms(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+friend function f_tc_smpp_mo_sms(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	var SmsParameters spars := valueof(t_SmsPars);
 
 	f_init_handler(pars);
@@ -2175,8 +2230,9 @@
 	f_vty_config2(MSCVTY, { "smpp", "esme msc_tester"}, "no default-route");
 }
 
+
 /* Test MO-SMS from MS/BTS/BSC towards HLR (via GSUP) */
-private function f_tc_gsup_mo_sms(charstring id, BSC_ConnHdlrPars pars)
+friend function f_tc_gsup_mo_sms(charstring id, BSC_ConnHdlrPars pars)
 runs on BSC_ConnHdlr {
 	var SmsParameters spars := valueof(t_SmsPars);
 	var GSUP_PDU gsup_msg_rx;
@@ -2244,8 +2300,9 @@
 	f_vty_config(MSCVTY, "msc", "no sms-over-gsup");
 }
 
+
 /* Test MO-SMMA from MS/BTS/BSC towards HLR (via GSUP) */
-private function f_tc_gsup_mo_smma(charstring id, BSC_ConnHdlrPars pars)
+friend function f_tc_gsup_mo_smma(charstring id, BSC_ConnHdlrPars pars)
 runs on BSC_ConnHdlr {
 	var SmsParameters spars := valueof(t_SmsPars);
 	var GSUP_PDU gsup_msg_rx;
@@ -2300,6 +2357,7 @@
 	f_vty_config(MSCVTY, "msc", "no sms-over-gsup");
 }
 
+
 /* Helper for sending MT SMS over GSUP */
 private function f_gsup_forwardSM_req(SmsParameters spars, OCT1 mms := '00'O)
 runs on BSC_ConnHdlr {
@@ -2319,7 +2377,7 @@
 }
 
 /* Test successful MT-SMS (RP-ACK) over GSUP */
-private function f_tc_gsup_mt_sms_ack(charstring id, BSC_ConnHdlrPars pars)
+friend function f_tc_gsup_mt_sms_ack(charstring id, BSC_ConnHdlrPars pars)
 runs on BSC_ConnHdlr {
 	var SmsParameters spars := valueof(t_SmsPars);
 
@@ -2381,8 +2439,9 @@
 	f_vty_config(MSCVTY, "msc", "no sms-over-gsup");
 }
 
+
 /* Test rejected MT-SMS (RP-ERROR) over GSUP */
-private function f_tc_gsup_mt_sms_err(charstring id, BSC_ConnHdlrPars pars)
+friend function f_tc_gsup_mt_sms_err(charstring id, BSC_ConnHdlrPars pars)
 runs on BSC_ConnHdlr {
 	var SmsParameters spars := valueof(t_SmsPars);
 	var OCT1 sm_rp_cause := '78'O; /* dummy RP-Cause value */
@@ -2447,8 +2506,9 @@
 	f_vty_config(MSCVTY, "msc", "no sms-over-gsup");
 }
 
+
 /* Test SM-RP-MR assignment for MT-SMS over GSUP */
-private function f_tc_gsup_mt_sms_rp_mr(charstring id, BSC_ConnHdlrPars pars)
+friend function f_tc_gsup_mt_sms_rp_mr(charstring id, BSC_ConnHdlrPars pars)
 runs on BSC_ConnHdlr {
 	var SmsParameters spars1 := valueof(t_SmsPars); /* 1st SMS */
 	var SmsParameters spars2 := valueof(t_SmsPars); /* 2nd SMS */
@@ -2559,8 +2619,9 @@
 	f_vty_config(MSCVTY, "msc", "no sms-over-gsup");
 }
 
+
 /* Test SM-RP-MR assignment for MT-SMS over GSUP */
-private function f_tc_gsup_mo_mt_sms_rp_mr(charstring id, BSC_ConnHdlrPars pars)
+friend function f_tc_gsup_mo_mt_sms_rp_mr(charstring id, BSC_ConnHdlrPars pars)
 runs on BSC_ConnHdlr {
 	var SmsParameters spars_mo := valueof(t_SmsPars); /* MO SMMA */
 	var SmsParameters spars_mt := valueof(t_SmsPars); /* MT SMS */
@@ -2663,6 +2724,7 @@
 	f_vty_config(MSCVTY, "msc", "no sms-over-gsup");
 }
 
+
 /* Test multi-part MT-SMS over GSUP */
 private function f_tc_gsup_mt_multi_part_sms(charstring id, BSC_ConnHdlrPars pars)
 runs on BSC_ConnHdlr {
@@ -2696,7 +2758,7 @@
 
 		/* Expect Paging Request and Establish connection */
 		if (i == 3) { /* ... only once! */
-			BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi));
+			f_expect_paging();
 			f_establish_fully(EST_TYPE_PAG_RESP);
 		}
 
@@ -2902,7 +2964,7 @@
 }
 
 /* LU followed by MO USSD request */
-private function f_tc_lu_and_mo_ussd_single_request(charstring id, BSC_ConnHdlrPars pars)
+friend function f_tc_lu_and_mo_ussd_single_request(charstring id, BSC_ConnHdlrPars pars)
 runs on BSC_ConnHdlr {
 	f_init_handler(pars);
 
@@ -2978,8 +3040,9 @@
 	vc_conn.done;
 }
 
+
 /* LU followed by MT USSD notification */
-private function f_tc_lu_and_mt_ussd_notification(charstring id, BSC_ConnHdlrPars pars)
+friend function f_tc_lu_and_mt_ussd_notification(charstring id, BSC_ConnHdlrPars pars)
 runs on BSC_ConnHdlr {
 	f_init_handler(pars);
 
@@ -3021,7 +3084,10 @@
 	/* Send it to MSC and expect Paging Request */
 	GSUP.send(gsup_req);
 	alt {
-	[] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)) {
+	[pars.ran_is_geran] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)) {
+		setverdict(pass);
+		}
+	[not pars.ran_is_geran] BSSAP.receive(tr_RANAP_Paging(cs_domain, imsi_hex2oct(g_pars.imsi), ?)) {
 		setverdict(pass);
 		}
 	/* We don't expect anything else */
@@ -3081,8 +3147,9 @@
 	vc_conn.done;
 }
 
+
 /* LU followed by MT call and MO USSD request during this call */
-private function f_tc_lu_and_mo_ussd_during_mt_call(charstring id, BSC_ConnHdlrPars pars)
+friend function f_tc_lu_and_mo_ussd_during_mt_call(charstring id, BSC_ConnHdlrPars pars)
 runs on BSC_ConnHdlr {
 	f_init_handler(pars);
 
@@ -3168,7 +3235,7 @@
 }
 
 /* BSSMAP Clear Request in the middle of a call, see OS#3062 */
-private function f_tc_mo_cc_bssmap_clear(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+friend function f_tc_mo_cc_bssmap_clear(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	f_init_handler(pars);
 	var CallParameters cpars := valueof(t_CallParams('12345'H, 0));
 	var MNCC_PDU mncc;
@@ -3192,15 +3259,28 @@
 	MGCP.receive(tr_CRCX);
 
 	f_sleep(1.0);
-	BSSAP.send(ts_BSSMAP_ClearRequest(0));
+	if (pars.ran_is_geran) {
+		BSSAP.send(ts_BSSMAP_ClearRequest(0));
+	} else {
+		BSSAP.send(ts_RANAP_IuReleaseRequest(ts_RanapCause_om_intervention));
+	}
 
 	var default ccrel := activate(as_optional_cc_rel(cpars));
 
-	interleave {
-	[] MNCC.receive(tr_MNCC_REL_ind(?, ?)) { };
-	[] BSSAP.receive(tr_BSSMAP_ClearCommand) {
+	if (pars.ran_is_geran) {
+		interleave {
+		[] MNCC.receive(tr_MNCC_REL_ind(?, ?)) { };
+		[] BSSAP.receive(tr_BSSMAP_ClearCommand) {
 			BSSAP.send(ts_BSSMAP_ClearComplete);
-		};
+			};
+		}
+	} else {
+		interleave {
+		[] MNCC.receive(tr_MNCC_REL_ind(?, ?)) { };
+		[] BSSAP.receive(tr_RANAP_IuReleaseCommand(?)) {
+			BSSAP.send(ts_RANAP_IuReleaseComplete);
+			};
+		}
 	}
 
 	deactivate(ccrel);
@@ -3215,8 +3295,9 @@
 	vc_conn.done;
 }
 
+
 /* LU followed by MT call and MT USSD request during this call */
-private function f_tc_lu_and_mt_ussd_during_mt_call(charstring id, BSC_ConnHdlrPars pars)
+friend function f_tc_lu_and_mt_ussd_during_mt_call(charstring id, BSC_ConnHdlrPars pars)
 runs on BSC_ConnHdlr {
 	f_init_handler(pars);
 
@@ -3317,8 +3398,9 @@
 	vc_conn.done;
 }
 
+
 /* LU followed by MO USSD request and MO Release during transaction */
-private function f_tc_lu_and_mo_ussd_mo_release(charstring id, BSC_ConnHdlrPars pars)
+friend function f_tc_lu_and_mo_ussd_mo_release(charstring id, BSC_ConnHdlrPars pars)
 runs on BSC_ConnHdlr {
 	f_init_handler(pars);
 
@@ -3414,8 +3496,9 @@
 	vc_conn.done;
 }
 
+
 /* LU followed by MO USSD request and MT Release due to timeout */
-private function f_tc_lu_and_ss_session_timeout(charstring id, BSC_ConnHdlrPars pars)
+friend function f_tc_lu_and_ss_session_timeout(charstring id, BSC_ConnHdlrPars pars)
 runs on BSC_ConnHdlr {
 	f_init_handler(pars);
 
@@ -3486,6 +3569,7 @@
 	f_vty_config(MSCVTY, "msc", "ncss guard-timeout 0");
 }
 
+
 /* A5/1 only permitted on network side; attempt an invalid CIPHER MODE COMPLETE with A5/3 which MSC should reject. */
 private function f_tc_cipher_complete_with_invalid_cipher(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	pars.net.expect_auth := true;
@@ -3571,6 +3655,10 @@
    * too long / short TLV values
  */
 
+/***********************************************************************
+ * SGsAP Testing
+ ***********************************************************************/
+
 /* Check if a subscriber exists in the VLR */
 private function f_ctrl_subscr_in_vlr(charstring imsi_or_msisdn) runs on BSC_ConnHdlr return boolean {
 
@@ -3603,7 +3691,10 @@
 	f_vty_transceive(MSCVTY, "subscriber imsi " & hex2str(g_pars.imsi) & " paging");
 
 	alt {
-	[] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); {
+	[g_pars.ran_is_geran] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); {
+		setverdict(pass);
+		}
+	[not g_pars.ran_is_geran] BSSAP.receive(tr_RANAP_Paging(cs_domain, imsi_hex2oct(g_pars.imsi), ?)) {
 		setverdict(pass);
 		}
 	[] SGsAP.receive {
diff --git a/msc/MSC_Tests_Iu.ttcn b/msc/MSC_Tests_Iu.ttcn
new file mode 100644
index 0000000..991c9b8
--- /dev/null
+++ b/msc/MSC_Tests_Iu.ttcn
@@ -0,0 +1,441 @@
+module MSC_Tests_Iu {
+
+import from General_Types all;
+import from Osmocom_Types all;
+
+import from BSC_ConnectionHandler all;
+import from MSC_Tests all;
+
+import from Osmocom_VTY_Functions all;
+
+import from GSUP_Emulation all;
+import from RAN_Emulation all;
+
+import from RANAP_Templates all;
+
+import from MobileL3_Types all;
+import from MobileL3_CommonIE_Types all;
+import from MobileL3_SMS_Types all;
+import from L3_Templates all;
+import from L3_Common all;
+
+
+
+testcase TC_iu_lu_imsi_reject() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+
+	vc_conn := f_start_handler(refers(f_tc_lu_imsi_reject), 1003, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_lu_imsi_timeout_gsup() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+
+	vc_conn := f_start_handler(refers(f_tc_lu_imsi_timeout_gsup), 1004, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_lu_imsi_auth3g_tmsi() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+	f_vty_config(MSCVTY, "network", "authentication required");
+
+	vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth3g_tmsi), 1005, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_cmserv_imsi_unknown() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+	vc_conn := f_start_handler(refers(f_tc_cmserv_imsi_unknown), 1006, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_lu_and_mo_call() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+
+	vc_conn := f_start_handler(refers(f_tc_lu_and_mo_call), 1007, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_lu_auth_sai_timeout() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+	f_vty_config(MSCVTY, "network", "authentication required");
+
+	vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_timeout), 1008, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_lu_auth_sai_err() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+	f_vty_config(MSCVTY, "network", "authentication required");
+
+	vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_err), 1009, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+/* Test LU but RNC will send a Iu Release request in the middle */
+private function f_tc_iu_lu_release_request(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+	f_init_handler(pars);
+
+	var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi)
+	var PDU_DTAP_MT dtap_mt;
+
+	/* tell GSUP dispatcher to send this IMSI to us */
+	f_create_gsup_expect(hex2str(g_pars.imsi));
+
+	/* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */
+	f_cl3_or_initial_ue(l3_lu);
+
+	f_sleep(1.0);
+	/* send release request in the middle of the LU */
+	BSSAP.send(ts_RANAP_IuReleaseRequest(ts_RanapCause_om_intervention));
+	alt {
+	[] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { repeat; }
+	[] BSSAP.receive(tr_RANAP_IuReleaseCommand(?)) {}
+	}
+	BSSAP.send(ts_RANAP_IuReleaseComplete);
+	alt {
+	/* See https://osmocom.org/issues/2862 */
+	[] BSSAP.receive(tr_RANAP_IuReleaseCommand(?)) {
+			setverdict(fail, "Got a second Iu Release Command, only one expected");
+			mtc.stop;
+			repeat;
+		}
+	[] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {}
+	}
+	setverdict(pass);
+}
+testcase TC_iu_lu_release_request() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+
+	vc_conn := f_start_handler(refers(f_tc_iu_lu_release_request), 1010, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_lu_disconnect() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+
+	vc_conn := f_start_handler(refers(f_tc_lu_disconnect), 1011, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_lu_by_imei() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+
+	vc_conn := f_start_handler(refers(f_tc_lu_by_imei), 1012, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_imsi_detach_by_imsi() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+
+	vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_imsi), 1014, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_imsi_detach_by_tmsi() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+
+	vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_tmsi), 1015, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_imsi_detach_by_imei() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+
+	vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_imei), 1016, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_emerg_call_imei_reject() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+
+	vc_conn := f_start_handler(refers(f_tc_emerg_call_imei_reject), 1017, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_emerg_call_imsi() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+
+	vc_conn := f_start_handler(refers(f_tc_emerg_call_imsi), 1018, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_establish_and_nothing() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+
+	vc_conn := f_start_handler(refers(f_tc_establish_and_nothing), 1027, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_mo_setup_and_nothing() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+
+	vc_conn := f_start_handler(refers(f_tc_mo_setup_and_nothing), 1028, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_mo_crcx_ran_timeout() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+
+	vc_conn := f_start_handler(refers(f_tc_mo_crcx_ran_timeout), 1029, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_mo_crcx_ran_reject() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+
+	vc_conn := f_start_handler(refers(f_tc_mo_crcx_ran_reject), 1030, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_mt_crcx_ran_reject() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+
+	vc_conn := f_start_handler(refers(f_tc_mt_crcx_ran_reject), 1031, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_mt_t310() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+
+	vc_conn := f_start_handler(refers(f_tc_mt_t310), 1032, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_gsup_cancel() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+
+	vc_conn := f_start_handler(refers(f_tc_gsup_cancel), 1033, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_mo_release_timeout() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+
+	vc_conn := f_start_handler(refers(f_tc_mo_release_timeout), 1040, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_lu_and_mo_sms() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+	vc_conn := f_start_handler(refers(f_tc_lu_and_mo_sms), 1042, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_lu_and_mt_sms() runs on MTC_CT {
+	var BSC_ConnHdlrPars pars;
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+	pars := f_init_pars(1043, ran_idx := 2, ran_is_geran := false);
+	vc_conn := f_start_handler_with_pars(refers(f_tc_lu_and_mt_sms), pars);
+	vc_conn.done;
+}
+
+testcase TC_iu_lu_and_mt_sms_paging_and_nothing() runs on MTC_CT {
+	var BSC_ConnHdlrPars pars;
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+	pars := f_init_pars(101843, ran_idx := 2, ran_is_geran := false);
+	vc_conn := f_start_handler_with_pars(refers(f_tc_lu_and_mt_sms_paging_and_nothing), pars);
+	vc_conn.done;
+}
+
+testcase TC_iu_smpp_mo_sms() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+	f_vty_config2(MSCVTY, { "smpp", "esme msc_tester"}, "default-route");
+	vc_conn := f_start_handler(refers(f_tc_smpp_mo_sms), 1044, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+	f_vty_config2(MSCVTY, { "smpp", "esme msc_tester"}, "no default-route");
+}
+
+testcase TC_iu_gsup_mo_sms() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+	f_vty_config(MSCVTY, "msc", "sms-over-gsup");
+	vc_conn := f_start_handler(refers(f_tc_gsup_mo_sms), 1088, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+	f_vty_config(MSCVTY, "msc", "no sms-over-gsup");
+}
+
+testcase TC_iu_gsup_mo_smma() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+	f_vty_config(MSCVTY, "msc", "sms-over-gsup");
+	vc_conn := f_start_handler(refers(f_tc_gsup_mo_smma), 1089, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+	f_vty_config(MSCVTY, "msc", "no sms-over-gsup");
+}
+
+testcase TC_iu_gsup_mt_sms_ack() runs on MTC_CT {
+	var BSC_ConnHdlrPars pars;
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+	pars := f_init_pars(1090, ran_idx := 2, ran_is_geran := false);
+	f_vty_config(MSCVTY, "msc", "sms-over-gsup");
+	vc_conn := f_start_handler_with_pars(refers(f_tc_gsup_mt_sms_ack), pars);
+	vc_conn.done;
+	f_vty_config(MSCVTY, "msc", "no sms-over-gsup");
+}
+
+testcase TC_iu_gsup_mt_sms_err() runs on MTC_CT {
+	var BSC_ConnHdlrPars pars;
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+	pars := f_init_pars(1091, ran_idx := 2, ran_is_geran := false);
+	f_vty_config(MSCVTY, "msc", "sms-over-gsup");
+	vc_conn := f_start_handler_with_pars(refers(f_tc_gsup_mt_sms_err), pars);
+	vc_conn.done;
+	f_vty_config(MSCVTY, "msc", "no sms-over-gsup");
+}
+
+testcase TC_iu_gsup_mt_sms_rp_mr() runs on MTC_CT {
+	var BSC_ConnHdlrPars pars;
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+	pars := f_init_pars(1092, ran_idx := 2, ran_is_geran := false);
+	f_vty_config(MSCVTY, "msc", "sms-over-gsup");
+	vc_conn := f_start_handler_with_pars(refers(f_tc_gsup_mt_sms_rp_mr), pars);
+	vc_conn.done;
+	f_vty_config(MSCVTY, "msc", "no sms-over-gsup");
+}
+
+testcase TC_iu_gsup_mo_mt_sms_rp_mr() runs on MTC_CT {
+	var BSC_ConnHdlrPars pars;
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+	pars := f_init_pars(1093, ran_idx := 2, ran_is_geran := false);
+	f_vty_config(MSCVTY, "msc", "sms-over-gsup");
+	vc_conn := f_start_handler_with_pars(refers(f_tc_gsup_mo_mt_sms_rp_mr), pars);
+	vc_conn.done;
+	f_vty_config(MSCVTY, "msc", "no sms-over-gsup");
+}
+
+testcase TC_iu_lu_and_mo_ussd_single_request() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+	vc_conn := f_start_handler(refers(f_tc_lu_and_mo_ussd_single_request), 1046, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_lu_and_mt_ussd_notification() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+	vc_conn := f_start_handler(refers(f_tc_lu_and_mt_ussd_notification), 1047, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_lu_and_mo_ussd_during_mt_call() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+	vc_conn := f_start_handler(refers(f_tc_lu_and_mo_ussd_during_mt_call), 1048, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_mo_cc_iu_release() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+
+	vc_conn := f_start_handler(refers(f_tc_mo_cc_bssmap_clear), 1043, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_lu_and_mt_ussd_during_mt_call() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+	vc_conn := f_start_handler(refers(f_tc_lu_and_mt_ussd_during_mt_call), 1049, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_lu_and_mo_ussd_mo_release() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init();
+	vc_conn := f_start_handler(refers(f_tc_lu_and_mo_ussd_mo_release), 1050, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+}
+
+testcase TC_iu_lu_and_ss_session_timeout() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init(3);
+	f_vty_config(MSCVTY, "msc", "ncss guard-timeout 3");
+	vc_conn := f_start_handler(refers(f_tc_lu_and_ss_session_timeout), 1051, ran_idx := 2, ran_is_geran := false);
+	vc_conn.done;
+	f_vty_config(MSCVTY, "msc", "ncss guard-timeout 0");
+}
+
+control {
+	execute( TC_iu_lu_imsi_reject() );
+	execute( TC_iu_lu_imsi_timeout_gsup() );
+	execute( TC_iu_lu_imsi_auth3g_tmsi() );
+	execute( TC_iu_cmserv_imsi_unknown() );
+	execute( TC_iu_lu_and_mo_call() );
+	execute( TC_iu_lu_auth_sai_timeout() );
+	execute( TC_iu_lu_auth_sai_err() );
+	execute( TC_iu_lu_release_request() );
+	execute( TC_iu_lu_disconnect() );
+	execute( TC_iu_lu_by_imei() );
+	execute( TC_iu_imsi_detach_by_imsi() );
+	execute( TC_iu_imsi_detach_by_tmsi() );
+	execute( TC_iu_imsi_detach_by_imei() );
+	execute( TC_iu_emerg_call_imei_reject() );
+	execute( TC_iu_emerg_call_imsi() );
+	execute( TC_iu_establish_and_nothing() );
+	execute( TC_iu_mo_setup_and_nothing() );
+	execute( TC_iu_mo_crcx_ran_timeout() );
+	execute( TC_iu_mo_crcx_ran_reject() );
+	execute( TC_iu_mt_crcx_ran_reject() );
+	execute( TC_iu_gsup_cancel() );
+	execute( TC_iu_mo_release_timeout() );
+	execute( TC_reset_two_1iu() );
+
+	execute( TC_iu_lu_and_mo_sms() );
+	execute( TC_iu_lu_and_mt_sms() );
+	execute( TC_iu_lu_and_mt_sms_paging_and_nothing() );
+	execute( TC_iu_smpp_mo_sms() );
+
+	execute( TC_iu_gsup_mo_sms() );
+	execute( TC_iu_gsup_mo_smma() );
+	execute( TC_iu_gsup_mt_sms_ack() );
+	execute( TC_iu_gsup_mt_sms_err() );
+	execute( TC_iu_gsup_mt_sms_rp_mr() );
+	execute( TC_iu_gsup_mo_mt_sms_rp_mr() );
+
+	execute( TC_iu_lu_and_mo_ussd_single_request() );
+	execute( TC_iu_lu_and_mt_ussd_notification() );
+	execute( TC_iu_lu_and_mo_ussd_during_mt_call() );
+	execute( TC_iu_lu_and_mt_ussd_during_mt_call() );
+	execute( TC_iu_lu_and_mo_ussd_mo_release() );
+	execute( TC_iu_lu_and_ss_session_timeout() );
+
+	/* TODO: Iu + SGsAP related tests, e.g. paging on IuCS */
+
+	/* Run this last: at the time of writing this test crashes the MSC */
+	execute( TC_mo_cc_iu_release() );
+}
+
+
+}

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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I3b56e17487c9df839e67ed390a1ff89979683e8e
Gerrit-Change-Number: 13753
Gerrit-PatchSet: 6
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190430/01c2780d/attachment.html>


More information about the gerrit-log mailing list