bsc: Introduce test TC_paging_imsi_nochan_ci_resp_invalid_mi

Related: SYS#6280
Change-Id: Id0d069f00bc77be33ca61ce469bea8079ae9bd16
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 0cc9552..ea73f4a 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -3514,6 +3514,51 @@
 	f_shutdown_helper();
 }
 
+/* Send paging response containing invalid (wrongly formatted) MobileIdentity IE. */
+testcase TC_paging_imsi_nochan_ci_resp_invalid_mi() runs on test_CT {
+	var template BSSMAP_FIELD_CellIdentificationList cid_list;
+	var BSSAP_N_CONNECT_ind rx_c_ind;
+	var DchanTuple dt;
+	var octetstring rr_pag_resp := '06270003535992617965720000'O;
+	/* { 06 27 } is { GSM48_PDISC_RR, GSM48_MT_RR_PAG_RESP }
+	* see 3GPP TS 44.018, table 9.1.25.1
+	* { 00 } or { 01 } is CKSN + Spare Half Octet, not important
+	* { 03 53 59 92 } is Mobile Station Classmark
+	* { 61 79 65 72 00 00 } is the invalid Mobile Identity IE (3GPP TS 24.008, 10.5.1.4),
+	* Length is 0x61 (97 in decimal).
+	*/
+
+	cid_list := { cIl_CI := { ts_BSSMAP_CI_CI(cid.ci) } };
+	f_pageing_helper('001010000000008'H, cid_list, { 0 });
+
+	/* Send CHAN RQD and wait for allocation; acknowledge it */
+	dt.rsl_chan_nr := f_chreq_act_ack();
+	dt.idx := {0, 0};
+
+	/* Send unsolicited Paging response (no matching Paging CMD stored in BSC) */
+	f_ipa_tx(ts_RSL_EST_IND(dt.rsl_chan_nr, valueof(ts_RslLinkID_DCCH(0)), rr_pag_resp));
+
+	/* Expevct a CR with a matching Paging response on the A-Interface */
+	timer T := 5.0;
+	T.start;
+	alt {
+	[] BSSAP.receive(tr_BSSAP_CONNECT_ind(?, ?, tr_BSSMAP_ComplL3(rr_pag_resp))) -> value rx_c_ind {
+		setverdict(pass);
+		dt.sccp_conn_id := rx_c_ind.connectionId;
+		BSSAP.send(ts_BSSAP_CONNECT_res(dt.sccp_conn_id));
+		}
+	[] BSSAP.receive {
+		setverdict(fail, "Received unexpected message on A-Interface!");
+		}
+	[] T.timeout {
+		setverdict(fail, "Received nothing on A-Interface!");
+		}
+	}
+
+	f_perform_clear_test_ct(dt);
+	f_shutdown_helper();
+}
+
 /* Verify paging retransmission interval + count */
 /* Verify paging stops after channel establishment */
 /* Test behavior under paging overload */
@@ -12237,6 +12282,7 @@
 	execute( TC_paging_resp_unsol() );
 	execute( TC_paging_500req() );
 	execute( TC_paging_450req_no_paging_load_ind() );
+	execute( TC_paging_imsi_nochan_ci_resp_invalid_mi() );
 
 	execute( TC_rsl_drop_counter() );
 	execute( TC_rsl_unknown_unit_id() );