Change in osmo-ttcn3-hacks[master]: sccp: Don't use hardcoded SCCP local references

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Tue Jan 21 12:58:45 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16970 )

Change subject: sccp: Don't use hardcoded SCCP local references
......................................................................

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
---
M sccp/SCCP_Tests_RAW.ttcn
1 file changed, 23 insertions(+), 10 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



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 {

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16970
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I2b52cc637c20d5644f413030edd9040a6e6bfe2f
Gerrit-Change-Number: 16970
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200121/1d1a6c38/attachment.htm>


More information about the gerrit-log mailing list