pcu: Check received IMSI suffix from PCUIF paging request

Change-Id: Ia11447fb71ea0b6a8fcce1a28e93cc166d22ef7a
diff --git a/pcu/PCU_Tests_RAW.ttcn b/pcu/PCU_Tests_RAW.ttcn
index d0181a9..ab412c4 100644
--- a/pcu/PCU_Tests_RAW.ttcn
+++ b/pcu/PCU_Tests_RAW.ttcn
@@ -366,13 +366,19 @@
 }
 
 /* Expect a Paging Request Type 1 from PCU on PCUIF on specified sapi.  */
-private function f_pcuif_rx_pch_pag_req1(out GsmRrMessage rr_pag_req1)
+private function f_pcuif_rx_pch_pag_req1(out integer imsi_suff_rx, out GsmRrMessage rr_pag_req1)
 runs on RAW_PCU_Test_CT {
 	var PCUIF_Message pcu_msg;
+	var octetstring imsi_suff_octstr;
 	var octetstring macblock;
 	BTS.receive(tr_PCUIF_DATA_REQ(bts_nr := 0, trx_nr := 0, ts_nr := 0,
 				      sapi := PCU_IF_SAPI_PCH)) -> value pcu_msg;
-	/* First 3 bytes contain paging group: */
+	/* First 3 bytes contain IMSI suffix to calculate paging group: */
+	imsi_suff_octstr := substr(pcu_msg.u.data_req.data, 0, 3);
+	imsi_suff_rx := str2int(oct2char(imsi_suff_octstr[0])) * 100 +
+			str2int(oct2char(imsi_suff_octstr[1])) * 10 +
+			str2int(oct2char(imsi_suff_octstr[2]));
+
 	macblock := substr(pcu_msg.u.data_req.data, 3, pcu_msg.u.data_req.len - 3);
 	rr_pag_req1 := dec_GsmRrMessage(macblock);
 	if (not match(rr_pag_req1, tr_PAG_REQ1())) {
@@ -1385,7 +1391,9 @@
 private function f_tc_paging_ps_from_sgsn(Nsvci bvci) runs on RAW_PCU_Test_CT {
 	var GsmRrMessage rr_pag_req1;
 	var OCT4 tlli := '00000001'O;
-	var hexstring imsi := f_gen_imsi(42);
+	var integer imsi_suff_rx;
+	var integer imsi_suff_tx := 423;
+	var hexstring imsi := f_gen_imsi(imsi_suff_tx);
 
 	/* Initialize NS/BSSGP side */
 	f_init_bssgp();
@@ -1401,7 +1409,11 @@
 	BSSGP[0].send(ts_BSSGP_PS_PAGING_IMSI(bvci, imsi));
 
 	/* Receive it on BTS side towards MS */
-	f_pcuif_rx_pch_pag_req1(rr_pag_req1);
+	f_pcuif_rx_pch_pag_req1(imsi_suff_rx, rr_pag_req1);
+	if (imsi_suff_rx != imsi_suff_tx) {
+		setverdict(fail, "Wrong IMSI suffix: expected ", imsi_suff_tx, " but received ", imsi_suff_rx);
+		mtc.stop;
+	}
 
 	setverdict(pass);
 }