summaryrefslogtreecommitdiffstats
path: root/msc/MSC_Tests_Iu.ttcn
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-04-23 16:52:02 +0200
committerHarald Welte <laforge@gnumonks.org>2019-04-30 22:36:01 +0200
commite13cfb2d2298c2a5f8d62c0451dd7db029b1e541 (patch)
treefb38a3e90fbc54fa3c4c5aaa73c5a4c50a2db347 /msc/MSC_Tests_Iu.ttcn
parentdceacc77e74935c5819c45ed513bdb761a7c1813 (diff)
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
Diffstat (limited to 'msc/MSC_Tests_Iu.ttcn')
-rw-r--r--msc/MSC_Tests_Iu.ttcn441
1 files changed, 441 insertions, 0 deletions
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() );
+}
+
+
+}