Change in osmo-ttcn3-hacks[master]: library/IPA_Emulation: assume TRX#0 in ASP_RSL_Unitdata templates

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/.

fixeria gerrit-no-reply at lists.osmocom.org
Mon May 25 15:15:14 UTC 2020


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18457 )


Change subject: library/IPA_Emulation: assume TRX#0 in ASP_RSL_Unitdata templates
......................................................................

library/IPA_Emulation: assume TRX#0 in ASP_RSL_Unitdata templates

Change-Id: I93297680a2644516870222c2bb8eee03c6b575a9
---
M bsc/BSC_Tests.ttcn
M bsc/BSC_Tests_CBSP.ttcn
M library/IPA_Emulation.ttcnpp
M library/RSL_Emulation.ttcn
M selftest/Selftest.ttcn
5 files changed, 37 insertions(+), 45 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/57/18457/1

diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index bcefe67..48766f1 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -228,7 +228,7 @@
 	alt {
 	[] IPA_RSL[i].receive(tr_ASP_IPA_EV(ASP_IPA_EVENT_ID_ACK)) {
 		T.stop;
-		IPA_RSL[i].send(ts_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,ts_RSL_PAGING_LOAD_IND(23)));
+		IPA_RSL[i].send(ts_ASP_RSL_UD(ts_RSL_PAGING_LOAD_IND(23)));
 		}
 	[] IPA_RSL[i].receive(ASP_IPA_Event:?) { repeat }
 	[] IPA_RSL[i].receive { repeat }
@@ -398,7 +398,7 @@
 
 	T.start;
 	alt {
-	[] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(sid, t_rx)) -> value rx_rsl_ud {
+	[] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(t_rx, sid)) -> value rx_rsl_ud {
 		T.stop;
 		}
 	[] IPA_RSL[bts_nr].receive { repeat; }
@@ -413,7 +413,7 @@
 /* helper function to transmit RSL on a given BTS/stream */
 function f_ipa_tx(integer bts_nr, template RSL_Message t_tx, IpaStreamId sid := IPAC_PROTO_RSL_TRX0)
 runs on test_CT {
-	IPA_RSL[bts_nr].send(ts_ASP_RSL_UD(sid, t_tx));
+	IPA_RSL[bts_nr].send(ts_ASP_RSL_UD(t_tx, sid));
 }
 
 
@@ -424,7 +424,7 @@
 
 	f_init(1);
 
-	IPA_RSL[0].send(ts_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,ts_RSL_CHAN_RQD('23'O, 23)));
+	IPA_RSL[0].send(ts_ASP_RSL_UD(ts_RSL_CHAN_RQD('23'O, 23)));
 	rsl_unused := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV));
 	setverdict(pass);
 }
@@ -438,7 +438,7 @@
 	f_init(1);
 
 	chreq_total := f_ctrl_get_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:total");
-	IPA_RSL[0].send(ts_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,ts_RSL_CHAN_RQD('23'O, 23)));
+	IPA_RSL[0].send(ts_ASP_RSL_UD(ts_RSL_CHAN_RQD('23'O, 23)));
 	rsl_unused := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV));
 	f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:total", chreq_total+1);
 
@@ -554,11 +554,10 @@
 	f_ipa_tx(0, ts_RSL_CHAN_RQD('42'O, 42));
 
 	alt {
-	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,
-				tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV))) {
+	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV))) {
 		setverdict(fail, "Received CHAN ACT ACK without resources?!?");
 		}
-	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_IMM_ASSIGN(?))) -> value rsl_ud {
+	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(tr_RSL_IMM_ASSIGN(?))) -> value rsl_ud {
 		var GsmRrMessage rr;
 		/* match on IMM ASS REJ */
 		rr := dec_GsmRrMessage(rsl_ud.rsl.ies[1].body.full_imm_ass_info.payload);
@@ -590,13 +589,11 @@
 
 	/* Expect CHANnel RELease */
 	alt {
-	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,
-			      tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL))) {
+	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL))) {
 		log("Received CHANnel RELease");
 		setverdict(pass);
 		}
-	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,
-			      tr_RSL_IMM_ASSIGN(?))) {
+	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(tr_RSL_IMM_ASSIGN(?))) {
 		/* See OS#3709, OsmoBSC should not send Immediate
 		 * Assignment Reject since a dedicated channel was
 		 * already allocated, and Immediate Assignment was
@@ -926,21 +923,19 @@
 	log("f_expect_chan_rel() expecting: expect_deact_sacch=", expect_deact_sacch, " expect_rr_chan_rel=", expect_rr_chan_rel,
 	    " expect_rll_rel_req=", expect_rll_rel_req);
 	alt {
-	[] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,
-					tr_RSL_DEACT_SACCH(rsl_chan_nr))) {
+	[] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(tr_RSL_DEACT_SACCH(rsl_chan_nr))) {
 		got_deact_sacch := true;
 		repeat;
 	}
-	[is_csfb] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_DATA_REQ(rsl_chan_nr, ?, decmatch tr_RRM_RR_RELEASE_CSFB))) {
+	[is_csfb] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(tr_RSL_DATA_REQ(rsl_chan_nr, ?, decmatch tr_RRM_RR_RELEASE_CSFB))) {
 		got_rr_chan_rel := true;
 		repeat;
 	}
-	[not is_csfb] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_DATA_REQ(rsl_chan_nr, ?, decmatch tr_RRM_RR_RELEASE))) {
+	[not is_csfb] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(tr_RSL_DATA_REQ(rsl_chan_nr, ?, decmatch tr_RRM_RR_RELEASE))) {
 		got_rr_chan_rel := true;
 		repeat;
 	}
-	[] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,
-					tr_RSL_REL_REQ(rsl_chan_nr, ?))) {
+	[] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(tr_RSL_REL_REQ(rsl_chan_nr, ?))) {
 		got_rll_rel_req := true;
 		/* FIXME: Why are we getting this for LinkID SACCH? */
 		if (handle_rll_rel) {
@@ -948,13 +943,12 @@
 		}
 		repeat;
 	}
-	[] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,
-						tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL))) {
+	[] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL))) {
 		/* respond with CHAN REL ACK */
 		f_ipa_tx(0, ts_RSL_RF_CHAN_REL_ACK(rsl_chan_nr));
 		}
 	/* ignore any user data */
-	[] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_MsgTypeR(?))) {
+	[] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(tr_RSL_MsgTypeR(?))) {
 		repeat;
 		}
 	}
@@ -1348,7 +1342,7 @@
 		}
 		T.start;
 		alt {
-		[] IPA_RSL[i].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_PAGING_CMD(mi))) {
+		[] IPA_RSL[i].receive(tr_ASP_RSL_UD(tr_RSL_PAGING_CMD(mi))) {
 			setverdict(fail, "Paging on BTS ", i, " which is not part of ", bts_ids);
 			}
 		[] IPA_RSL[i].receive { repeat; }
@@ -1524,7 +1518,7 @@
 	T.start;
 	T_retrans.start;
 	alt {
-	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_PAGING_CMD(?))) {
+	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(tr_RSL_PAGING_CMD(?))) {
 		setverdict(fail, "Received PAGING after LOAD_IND(0)");
 		mtc.stop;
 		}
@@ -1607,15 +1601,15 @@
 	/* Wait for 3 seconds if any more PAGING CMD are received on RSL */
 	T.start;
 	alt {
-	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_PAGING_CMD(?))) {
+	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(tr_RSL_PAGING_CMD(?))) {
 		setverdict(fail, "Received PAGING after A-RESET");
 		mtc.stop;
 		}
-	[] IPA_RSL[1].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_PAGING_CMD(?))) {
+	[] IPA_RSL[1].receive(tr_ASP_RSL_UD(tr_RSL_PAGING_CMD(?))) {
 		setverdict(fail, "Received PAGING after A-RESET");
 		mtc.stop;
 		}
-	[] IPA_RSL[2].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_PAGING_CMD(?))) {
+	[] IPA_RSL[2].receive(tr_ASP_RSL_UD(tr_RSL_PAGING_CMD(?))) {
 		setverdict(fail, "Received PAGING after A-RESET");
 		mtc.stop;
 		}
diff --git a/bsc/BSC_Tests_CBSP.ttcn b/bsc/BSC_Tests_CBSP.ttcn
index ff054fe..baba4c0 100644
--- a/bsc/BSC_Tests_CBSP.ttcn
+++ b/bsc/BSC_Tests_CBSP.ttcn
@@ -537,7 +537,7 @@
 	timer T := 5.0;
 	T.start;
 	alt {
-	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_DATA_REQ(dt.rsl_chan_nr, ?, ?))) -> value rx_rsl_ud {
+	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(tr_RSL_DATA_REQ(dt.rsl_chan_nr, ?, ?))) -> value rx_rsl_ud {
 		var RSL_IE_Body l3_ie;
 		if (f_rsl_find_ie(rx_rsl_ud.rsl, RSL_IE_L3_INFO, l3_ie) == false) {
 			setverdict(fail, "RSL DATA REQ without L3?");
@@ -575,11 +575,10 @@
 	timer T := 5.0;
 	T.start;
 	alt {
-	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,
-					    tr_RSL_OSMO_ETWS_CMD(t_RslChanNr_PCH_AGCH(0), tr_apdu))) {
+	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(tr_RSL_OSMO_ETWS_CMD(t_RslChanNr_PCH_AGCH(0), tr_apdu))) {
 		setverdict(pass);
 		}
-	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_OSMO_ETWS_CMD(?,?))) {
+	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(tr_RSL_OSMO_ETWS_CMD(?,?))) {
 		setverdict(fail, "Received unexpected OSMO_ETWS_CMD");
 		}
 	[] IPA_RSL[0].receive { repeat; }
@@ -605,11 +604,10 @@
 	timer T := 5.0;
 	T.start;
 	alt {
-	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,
-					    tr_RSL_OSMO_ETWS_CMD(t_RslChanNr_PCH_AGCH(0), tr_apdu))) {
+	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(tr_RSL_OSMO_ETWS_CMD(t_RslChanNr_PCH_AGCH(0), tr_apdu))) {
 		setverdict(pass);
 		}
-	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_OSMO_ETWS_CMD(?,?))) {
+	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(tr_RSL_OSMO_ETWS_CMD(?,?))) {
 		setverdict(fail, "Received unexpected OSMO_ETWS_CMD");
 		}
 	[] IPA_RSL[0].receive { repeat; }
@@ -621,11 +619,10 @@
 	/* then expect it to be disabled after the warning period (5s) */
 	T.start;
 	alt {
-	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,
-					    tr_RSL_OSMO_ETWS_CMD(t_RslChanNr_PCH_AGCH(0), ''O))) {
+	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(tr_RSL_OSMO_ETWS_CMD(t_RslChanNr_PCH_AGCH(0), ''O))) {
 		setverdict(pass);
 		}
-	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_OSMO_ETWS_CMD(?,?))) {
+	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(tr_RSL_OSMO_ETWS_CMD(?,?))) {
 		setverdict(fail, "Received unexpected OSMO_ETWS_CMD");
 		}
 	[] IPA_RSL[0].receive { repeat; }
diff --git a/library/IPA_Emulation.ttcnpp b/library/IPA_Emulation.ttcnpp
index 1bfc8dc..0125c3a 100644
--- a/library/IPA_Emulation.ttcnpp
+++ b/library/IPA_Emulation.ttcnpp
@@ -110,12 +110,14 @@
 	RSL_Message	rsl
 };
 
-template (value) ASP_RSL_Unitdata ts_ASP_RSL_UD(IpaStreamId sid, template (value) RSL_Message rsl) := {
+template (value) ASP_RSL_Unitdata ts_ASP_RSL_UD(template (value) RSL_Message rsl,
+						IpaStreamId sid := IPAC_PROTO_RSL_TRX0) := {
 	streamId := sid,
 	rsl := rsl
 }
 
-template ASP_RSL_Unitdata tr_ASP_RSL_UD(template IpaStreamId sid, template RSL_Message rsl) := {
+template ASP_RSL_Unitdata tr_ASP_RSL_UD(template (present) RSL_Message rsl,
+					template IpaStreamId sid := IPAC_PROTO_RSL_TRX0) := {
 	streamId := sid,
 	rsl := rsl
 }
diff --git a/library/RSL_Emulation.ttcn b/library/RSL_Emulation.ttcn
index 5a0816f..67a473f 100644
--- a/library/RSL_Emulation.ttcn
+++ b/library/RSL_Emulation.ttcn
@@ -385,7 +385,7 @@
 			Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Lost IPA connection!");
 			}
 		[bts_role] IPA_PT.receive(tr_ASP_IPA_EV(ASP_IPA_EVENT_ID_ACK)) {
-			IPA_PT.send(ts_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,ts_RSL_PAGING_LOAD_IND(23)));
+			IPA_PT.send(ts_ASP_RSL_UD(ts_RSL_PAGING_LOAD_IND(23)));
 			}
 		[not bts_role] IPA_PT.receive(tr_ASP_IPA_EV(ASP_IPA_EVENT_ID_ACK)) { }
 		[bts_role] IPA_PT.receive(tr_RSL(tr_RSL_IMM_ASSIGN)) -> value rx_rsl {
@@ -460,7 +460,7 @@
 			chan_nr := rx_rsl.rsl.ies[0].body.chan_nr;
 			trx_nr := f_trx_by_streamId(rx_rsl.streamId);
 			f_store_last_act_data(trx_nr, chan_nr, rx_rsl.rsl);
-			IPA_PT.send(ts_ASP_RSL_UD(rx_rsl.streamId, ts_RSL_CHAN_ACT_ACK(chan_nr, 23)));
+			IPA_PT.send(ts_ASP_RSL_UD(ts_RSL_CHAN_ACT_ACK(chan_nr, 23), rx_rsl.streamId));
 		}
 
 		[not dchan_suspended] IPA_PT.receive(tr_RSL(tr_RSL_MsgTypeDR(?))) -> value rx_rsl {
@@ -483,8 +483,7 @@
 		[bts_role] CLIENT_PT.receive(RSLDC_ChanRqd:?) -> value chan_rqd sender vc_conn {
 			/* Store the knowledge that this sender has requested a certain RQ+time */
 			f_cid_create(chan_rqd.ra, chan_rqd.fn, vc_conn);
-			IPA_PT.send(ts_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,
-						 ts_RSL_CHAN_RQD(chan_rqd.ra, chan_rqd.fn)));
+			IPA_PT.send(ts_ASP_RSL_UD(ts_RSL_CHAN_RQD(chan_rqd.ra, chan_rqd.fn)));
 			}
 
 		[not bts_role] CLIENT_PT.receive(RSLDC_ChanRqd:?) -> value chan_rqd sender vc_conn {
@@ -495,11 +494,11 @@
 		[] CLIENT_PT.receive(tr_RSL_MsgType(?)) -> value rx_rsl_msg sender vc_conn {
 			/* forward to BSC */
 			cid := f_cid_by_comp_ref(vc_conn);
-			IPA_PT.send(ts_ASP_RSL_UD(ConnectionTable[cid].stream_id, rx_rsl_msg));
+			IPA_PT.send(ts_ASP_RSL_UD(rx_rsl_msg, ConnectionTable[cid].stream_id));
 			}
 
 		[] CCHAN_PT.receive(tr_RSL(?)) -> value rx_rsl {
-			IPA_PT.send(ts_ASP_RSL_UD(rx_rsl.streamId, rx_rsl.rsl));
+			IPA_PT.send(ts_ASP_RSL_UD(rx_rsl.rsl, rx_rsl.streamId));
 			}
 
 		/* explicit registration, e.g. in (non-immediate) assignment case */
diff --git a/selftest/Selftest.ttcn b/selftest/Selftest.ttcn
index 263c317..3d74925 100644
--- a/selftest/Selftest.ttcn
+++ b/selftest/Selftest.ttcn
@@ -89,7 +89,7 @@
 	T.timeout;
 
 	for (i := 0; i < 10; i := i+1) {
-		IPA_RSL.receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, rsl));
+		IPA_RSL.receive(tr_ASP_RSL_UD(rsl));
 	}
 	setverdict(pass);
 }

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18457
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: I93297680a2644516870222c2bb8eee03c6b575a9
Gerrit-Change-Number: 18457
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200525/acebe750/attachment.htm>


More information about the gerrit-log mailing list