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

Change subject: msc: Add a test for LU with invalid MCC/MNC in BSSAP/RANAP
......................................................................

msc: Add a test for LU with invalid MCC/MNC in BSSAP/RANAP

Verify that the MSC rejects a location update from a Cell/BSC that
contains a PLMN which does not match the core network's PLMN.

Related: OS#3162
Change-Id: I676894358259b9cc0f973769ce552ba58a2a58a1
---
M msc/MSC_Tests.ttcn
M msc/MSC_Tests_Iu.ttcn
2 files changed, 43 insertions(+), 0 deletions(-)

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



diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index e1e5088..9524afb 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -3614,6 +3614,40 @@
        vc_conn.done;
 }

+/* Location Update with invalid (non-matching) MCC/MNC reported on BSSMAP 
level from BSC */
+friend function f_tc_lu_with_invalid_mcc_mnc(charstring id, BSC_ConnHdlrPars 
pars) runs on BSC_ConnHdlr {
+       f_init_handler(pars);
+
+       /* tell GSUP dispatcher to send this IMSI to us */
+       f_create_gsup_expect(hex2str(g_pars.imsi));
+
+       /* modify the cell ID which will be used to construct the COMPLELTE L3 
or InitialUE */
+       g_pars.cell_id := valueof(ts_CellId_CGI('333'H, '22'H, 23, 42));
+
+       /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */
+       var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi)
+       f_cl3_or_initial_ue(l3_lu);
+
+       /* Expect LU reject from MSC. */
+       alt {
+       [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) {
+               setverdict(pass);
+               }
+       [] BSSAP.receive {
+               setverdict(fail, "Unknown/unexpected BSSAP received");
+               mtc.stop;
+               }
+       }
+       f_expect_clear();
+}
+testcase TC_lu_with_invalid_mcc_mnc() runs on MTC_CT {
+       var BSC_ConnHdlr vc_conn;
+       f_init();
+       vc_conn := f_start_handler(refers(f_tc_lu_with_invalid_mcc_mnc), 54);
+       vc_conn.done;
+}
+
+
 /* TODO (SMS):
    * different user data lengths
    * SMPP transaction mode with unsuccessful delivery
@@ -5282,6 +5316,7 @@
        execute( TC_lu_and_ss_session_timeout() );

        execute( TC_cipher_complete_with_invalid_cipher() );
+       execute( TC_lu_with_invalid_mcc_mnc() );

        execute( TC_sgsap_reset() );
        execute( TC_sgsap_lu() );
diff --git a/msc/MSC_Tests_Iu.ttcn b/msc/MSC_Tests_Iu.ttcn
index 991c9b8..5798821 100644
--- a/msc/MSC_Tests_Iu.ttcn
+++ b/msc/MSC_Tests_Iu.ttcn
@@ -387,6 +387,13 @@
        f_vty_config(MSCVTY, "msc", "ncss guard-timeout 0");
 }

+testcase TC_iu_lu_with_invalid_mcc_mnc() runs on MTC_CT {
+       var BSC_ConnHdlr vc_conn;
+       f_init(3);
+       vc_conn := f_start_handler(refers(f_tc_lu_with_invalid_mcc_mnc), 1054, 
ran_idx := 2, ran_is_geran := false);
+       vc_conn.done;
+}
+
 control {
        execute( TC_iu_lu_imsi_reject() );
        execute( TC_iu_lu_imsi_timeout_gsup() );
@@ -430,6 +437,7 @@
        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() );
+       execute( TC_iu_lu_with_invalid_mcc_mnc() );

        /* TODO: Iu + SGsAP related tests, e.g. paging on IuCS */


--
To view, visit https://gerrit.osmocom.org/12380
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: I676894358259b9cc0f973769ce552ba58a2a58a1
Gerrit-Change-Number: 12380
Gerrit-PatchSet: 4
Gerrit-Owner: Stefan Sperling <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Neels Hofmeyr <[email protected]>
Gerrit-Reviewer: Stefan Sperling <[email protected]>
Gerrit-CC: Vadim Yanitskiy <[email protected]>

Reply via email to