summaryrefslogtreecommitdiffstats
path: root/msc/MSC_Tests.ttcn
diff options
context:
space:
mode:
Diffstat (limited to 'msc/MSC_Tests.ttcn')
-rw-r--r--msc/MSC_Tests.ttcn205
1 files changed, 148 insertions, 57 deletions
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 BSSAP_CodecPort all;
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 @@ runs on MTC_CT return BSC_ConnHdlrPars {
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 @@ testcase TC_lu_imsi_noauth_notmsi() runs on MTC_CT {
}
/* 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 @@ testcase TC_lu_imsi_reject() runs on MTC_CT {
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 @@ testcase TC_lu_imsi_timeout_gsup() runs on MTC_CT {
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 @@ testcase TC_lu_imsi_auth_tmsi() runs on MTC_CT {
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 @@ testcase TC_lu_imsi_auth3g_tmsi() runs on MTC_CT {
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 @@ testcase TC_cmserv_imsi_unknown() runs on MTC_CT {
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 @@ testcase TC_lu_and_mo_call() runs on MTC_CT {
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 @@ private function f_tc_lu_auth_sai_timeout(charstring id, BSC_ConnHdlrPars pars)
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 @@ testcase TC_lu_auth_sai_timeout() runs on MTC_CT {
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 @@ private function f_tc_lu_auth_sai_err(charstring id, BSC_ConnHdlrPars pars) runs
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 @@ testcase TC_lu_auth_sai_err() runs on MTC_CT {
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 @@ testcase TC_lu_clear_request() runs on MTC_CT {
}
/* 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 @@ private function f_tc_lu_disconnect(charstring id, BSC_ConnHdlrPars pars) runs o
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 @@ testcase TC_lu_disconnect() runs on MTC_CT {
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 @@ private function f_tc_lu_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on B
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 @@ testcase TC_lu_by_imei() runs on MTC_CT {
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 @@ testcase TC_lu_by_tmsi_noauth_unknown() runs on MTC_CT {
/* 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 @@ private function f_tc_imsi_detach_by_imsi(charstring id, BSC_ConnHdlrPars pars)
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 @@ testcase TC_imsi_detach_by_imsi() runs on MTC_CT {
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 @@ private function f_tc_imsi_detach_by_tmsi(charstring id, BSC_ConnHdlrPars pars)
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 @@ testcase TC_imsi_detach_by_tmsi() runs on MTC_CT {
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 @@ private function f_tc_imsi_detach_by_imei(charstring id, BSC_ConnHdlrPars pars)
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 @@ private function f_emerg_call(MobileIdentityLV mi) runs on BSC_ConnHdlr {
}
/* 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 @@ testcase TC_emerg_call_imei_reject() runs on MTC_CT {
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 @@ testcase TC_emerg_call_imsi() runs on MTC_CT {
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 @@ testcase TC_cl3_rnd_payload() runs on MTC_CT {
}
/* 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 @@ testcase TC_establish_and_nothing() runs on MTC_CT {
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 @@ testcase TC_mo_setup_and_nothing() runs on MTC_CT {
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 @@ testcase TC_mo_crcx_ran_timeout() runs on MTC_CT {
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 @@ private function f_mt_call_start(inout CallParameters cpars) runs on BSC_ConnHdl
}
/* 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 @@ testcase TC_mt_crcx_ran_reject() runs on MTC_CT {
}
+
/* 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 @@ testcase TC_mt_t310() runs on MTC_CT {
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 @@ testcase TC_gsup_cancel() runs on MTC_CT {
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 @@ testcase TC_cr_before_reset() runs on MTC_CT {
}
/* 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 @@ testcase TC_reset_two() runs on MTC_CT {
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 @@ testcase TC_lu_and_mo_sms() runs on MTC_CT {
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 @@ runs on BSC_ConnHdlr {
}
/* 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 @@ testcase TC_lu_and_mt_sms() runs on MTC_CT {
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 @@ private function f_tc_lu_and_mt_sms_paging_and_nothing(charstring id, BSC_ConnHd
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 @@ testcase TC_lu_and_mt_sms_paging_and_nothing() runs on MTC_CT {
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 @@ testcase TC_smpp_mo_sms() runs on MTC_CT {
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 @@ testcase TC_gsup_mo_sms() runs on MTC_CT {
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 @@ testcase TC_gsup_mo_smma() runs on MTC_CT {
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 @@ runs on BSC_ConnHdlr {
}
/* 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 @@ testcase TC_gsup_mt_sms_ack() runs on MTC_CT {
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 @@ testcase TC_gsup_mt_sms_err() runs on MTC_CT {
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 @@ testcase TC_gsup_mt_sms_rp_mr() runs on MTC_CT {
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 @@ testcase TC_gsup_mo_mt_sms_rp_mr() runs on MTC_CT {
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 @@ runs on BSC_ConnHdlr {
/* 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 @@ runs on BSC_ConnHdlr return PDU_ML3_NW_MS {
}
/* 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 @@ testcase TC_lu_and_mo_ussd_single_request() runs on MTC_CT {
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 @@ runs on BSC_ConnHdlr {
/* 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 @@ testcase TC_lu_and_mt_ussd_notification() runs on MTC_CT {
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 @@ testcase TC_lu_and_mo_ussd_during_mt_call() runs on MTC_CT {
}
/* 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 @@ private function f_tc_mo_cc_bssmap_clear(charstring id, BSC_ConnHdlrPars pars) r
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 @@ testcase TC_mo_cc_bssmap_clear() runs on MTC_CT {
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 @@ testcase TC_lu_and_mt_ussd_during_mt_call() runs on MTC_CT {
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 @@ testcase TC_lu_and_mo_ussd_mo_release() runs on MTC_CT {
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 @@ testcase TC_lu_and_ss_session_timeout() runs on MTC_CT {
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 @@ testcase TC_cipher_complete_with_invalid_cipher() runs on MTC_CT {
* 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 @@ private function f_sgsap_bssmap_screening() runs on BSC_ConnHdlr {
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 {