sccp: Don't use hardcoded SCCP local references

as tests are added or order is changed, local references used by the system under test may
change, so let's take and use the one notified instead of harcoding
values.

Change-Id: I2b52cc637c20d5644f413030edd9040a6e6bfe2f
diff --git a/sccp/SCCP_Tests_RAW.ttcn b/sccp/SCCP_Tests_RAW.ttcn
index 6acb4c7..5996846 100644
--- a/sccp/SCCP_Tests_RAW.ttcn
+++ b/sccp/SCCP_Tests_RAW.ttcn
@@ -39,6 +39,8 @@
 
 	var MSC_SCCP_MTP3_parameters g_param;
 
+	var OCT3 g_own_lref := '000001'O
+
 	/*Configure T(tias) over VTY, seconds */
 	var integer g_demo_sccp_timer_ias :=  7 * 60;
 	/*Configure T(tiar) over VTY, seconds */
@@ -109,7 +111,9 @@
 	MTP3.send(tx);
 }
 
-private function f_exp_sccp(template PDU_SCCP sccp) runs on SCCP_Test_RAW_CT {
+private function f_exp_sccp(template PDU_SCCP sccp)
+runs on SCCP_Test_RAW_CT return SCCP_MTP3_TRANSFERind {
+
 	var SCCP_MTP3_TRANSFERind rx;
 	var template SCCP_MTP3_TRANSFERind exp := {
 		sio := g_param.sio,
@@ -122,7 +126,7 @@
 	T.start;
 	alt {
 	[] MTP3.receive(exp) -> value rx {
-		setverdict(pass);
+		return rx;
 		}
 	[] MTP3.receive {
 		setverdict(fail, "Unexpected MTP/SCCP received");
@@ -133,12 +137,17 @@
 		self.stop
 		}
 	}
+	return rx;
 }
 
-private function f_establish_conn(SCCP_PAR_Address calling, SCCP_PAR_Address called) runs on SCCP_Test_RAW_CT {
+private function f_establish_conn(SCCP_PAR_Address calling, SCCP_PAR_Address called)
+runs on SCCP_Test_RAW_CT return OCT3 {
+	var SCCP_MTP3_TRANSFERind mtp3_rx;
 
-	f_send_sccp(ts_SCCP_CR('000001'O, calling, called));
-	f_exp_sccp(tr_SCCP_CC('000000'O, '000001'O));
+	f_send_sccp(ts_SCCP_CR(g_own_lref, calling, called));
+	mtp3_rx := f_exp_sccp(tr_SCCP_CC(?, g_own_lref));
+
+	return mtp3_rx.data.connconfirm.sourceLocRef;
 }
 
 private function f_tx_udt_exp(SCCP_PAR_Address calling, SCCP_PAR_Address called, octetstring data) runs on SCCP_Test_RAW_CT {
@@ -159,6 +168,7 @@
 	calling := valueof(ts_SccpAddr_PC_SSN(mp_sccp_cfg[0].own_pc, mp_sccp_cfg[0].own_ssn,
 					     mp_sccp_cfg[0].sio, mp_sccp_cfg[0].sccp_service_type));
 	f_establish_conn(calling, called);
+	setverdict(pass);
 }
 
 /* Verify sccp_demo_user answers a CR with a CC for PC and SSN set up to echo back */
@@ -175,11 +185,13 @@
 					     mp_sccp_cfg[0].sio, mp_sccp_cfg[0].sccp_service_type));
 
 	f_tx_udt_exp(calling, called, data);
+	setverdict(pass);
 }
 
 /* Verify T(iar) triggers and releases the channel */
 testcase TC_tiar_timeout() runs on SCCP_Test_RAW_CT {
 	var SCCP_PAR_Address calling, called;
+	var OCT3 remote_lref;
 	var octetstring data := f_rnd_octstring(f_rnd_int(100));
 
 	/* Set T(iar) in sccp_demo_user low enough that it will trigger before other side
@@ -194,17 +206,18 @@
 					     mp_sccp_cfg[0].sio, mp_sccp_cfg[0].sccp_service_type));
 	calling := valueof(ts_SccpAddr_PC_SSN(mp_sccp_cfg[0].own_pc, mp_sccp_cfg[0].own_ssn,
 					     mp_sccp_cfg[0].sio, mp_sccp_cfg[0].sccp_service_type));
-	f_establish_conn(calling, called);
+	remote_lref := f_establish_conn(calling, called);
 	f_tx_udt_exp(calling, called, data);
 
 	log("Waiting for first IT");
-	f_exp_sccp(tr_SCCP_IT(?, ?));
+	f_exp_sccp(tr_SCCP_IT(remote_lref, g_own_lref));
 	log("Waiting for second IT");
-	f_exp_sccp(tr_SCCP_IT(?, ?));
+	f_exp_sccp(tr_SCCP_IT(remote_lref, g_own_lref));
 
 	log("Waiting for RLSD");
-	f_exp_sccp(tr_SCCP_RLSD(?, ?, hex2int('0D'H))); /* Cause: Expiration of Rx Inactivity Timer */
-	f_send_sccp(ts_SCCP_RLC('000001'O, '000000'O));
+	f_exp_sccp(tr_SCCP_RLSD(remote_lref, g_own_lref, hex2int('0D'H))); /* Cause: Expiration of Rx Inactivity Timer */
+	f_send_sccp(ts_SCCP_RLC(g_own_lref, remote_lref));
+	setverdict(pass);
 }
 
 control {