Change in osmo-ttcn3-hacks[master]: bsc: check channel release message presence

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

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Wed Nov 14 17:39:02 UTC 2018


Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/11662 )

Change subject: bsc: check channel release message presence
......................................................................

bsc: check channel release message presence

Instead of vaguely allowing any release messages to be present or not, exactly
pinpoint for each test case the exact release messages expected during lchan
release.

Related: an osmo-bsc change broke sending of RR Release messages, which was
utterly ignored and hence not caught by ttcn tests. That must not happen again.

I am not actually sure that these expectations are 100% correct; if errors
become apparent, we shall change the expectations in ttcn3 and then fix
osmo-bsc according to that.

Adjust f_expect_chan_rel() and callers,
and the Assignment procedures (as_assignment and f_establish_fully).

The current state of the bsc tests should all pass with osmo-bsc
Id3301df059582da2377ef82feae554e94fa42035

Related: OS#3413
Change-Id: Ibc64058f1e214bea585f4e8dcb66f3df8ead3845
---
M bsc/BSC_Tests.ttcn
M bsc/MSC_ConnectionHandler.ttcn
2 files changed, 53 insertions(+), 17 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index b1f3a31..e06f496 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -429,7 +429,7 @@
 
 	/* expect BSC to disable the channel again if there's no response from MSC */
 	/* MS waits 20s (T3210) at LU; 10s (T3230) at CM SERV REQ and 5s (T3220) AT detach */
-	f_expect_chan_rel(0, chan_nr);
+	f_expect_chan_rel(0, chan_nr, expect_rll_rel_req := false);
 	setverdict(pass);
 }
 
@@ -450,7 +450,7 @@
 	BSSAP.send(ts_BSSAP_DISC_req(rx_c_ind.connectionId, 0));
 
 	/* expect BSC to disable the channel */
-	f_expect_chan_rel(0, chan_nr);
+	f_expect_chan_rel(0, chan_nr, expect_rll_rel_req := false);
 	setverdict(pass);
 }
 
@@ -817,32 +817,38 @@
 }
 
 function f_expect_chan_rel(integer bts_nr, RslChannelNr rsl_chan_nr,
-			   boolean handle_rll_rel := true) runs on test_CT {
+			   boolean expect_deact_sacch := true,
+			   boolean expect_rr_chan_rel := true,
+			   boolean expect_rll_rel_req := true,
+			   boolean handle_rll_rel := true
+			   ) runs on test_CT {
 
 	var RslLinkId main_dcch := valueof(ts_RslLinkID_DCCH(0));
 	var octetstring l3_rr_chan_rel := '060D00'O;
+	var boolean got_deact_sacch := false;
+	var boolean got_rr_chan_rel := false;
+	var boolean got_rll_rel_req := false;
+	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 {
-	/* ignore DEACTIVATE SACCH (if any) */
 	[] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,
 					tr_RSL_DEACT_SACCH(rsl_chan_nr))) {
+		got_deact_sacch := true;
 		repeat;
 	}
 	[] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_DATA_REQ(rsl_chan_nr, ?, l3_rr_chan_rel))) {
+		got_rr_chan_rel := true;
 		repeat;
 	}
-	/* acknowledge RLL release (if any)*/
-	[handle_rll_rel] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,
+	[] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,
 					tr_RSL_REL_REQ(rsl_chan_nr, ?))) {
+		got_rll_rel_req := true;
 		/* FIXME: Why are we getting this for LinkID SACCH? */
-		f_ipa_tx(0, ts_RSL_REL_CONF(rsl_chan_nr, main_dcch));
+		if (handle_rll_rel) {
+			f_ipa_tx(0, ts_RSL_REL_CONF(rsl_chan_nr, main_dcch));
+		}
 		repeat;
 	}
-	[not handle_rll_rel] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,
-					tr_RSL_REL_REQ(rsl_chan_nr, ?))) {
-		/* Do not reply, just continue */
-		repeat;
-	}
-	/* Expect RF channel release from BSC on Abis */
 	[] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,
 						tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL))) {
 		/* respond with CHAN REL ACK */
@@ -853,6 +859,19 @@
 		repeat;
 		}
 	}
+
+	log("f_expect_chan_rel() summary: got_deact_sacch=", got_deact_sacch, " got_rr_chan_rel=", got_rr_chan_rel,
+	    " got_rll_rel_req=", got_rll_rel_req);
+
+	if (expect_deact_sacch != got_deact_sacch) {
+		setverdict(fail, "f_expect_chan_rel(): expect_deact_sacch=", expect_deact_sacch, " got_deact_sacch=", got_deact_sacch);
+	}
+	if (expect_rr_chan_rel != got_rr_chan_rel) {
+		setverdict(fail, "f_expect_chan_rel(): expect_rr_chan_rel=", expect_rr_chan_rel, " got_rr_chan_rel=", got_rr_chan_rel);
+	}
+	if (expect_rll_rel_req != got_rll_rel_req) {
+		setverdict(fail, "f_expect_chan_rel(): expect_rll_rel_req=", expect_rll_rel_req, " got_rll_rel_req=", got_rll_rel_req);
+	}
 }
 
 /* Test behavior of channel release after hard Clear Command from MSC */
@@ -874,7 +893,7 @@
 		BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0));
 	}
 
-	f_expect_chan_rel(0, dt.rsl_chan_nr);
+	f_expect_chan_rel(0, dt.rsl_chan_nr, expect_rll_rel_req := false);
 	setverdict(pass);
 }
 
@@ -889,7 +908,7 @@
 	/* release the SCCP connection */
 	BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0));
 
-	f_expect_chan_rel(0, dt.rsl_chan_nr);
+	f_expect_chan_rel(0, dt.rsl_chan_nr, expect_rll_rel_req := false);
 	setverdict(pass);
 }
 
@@ -904,7 +923,7 @@
 	/* release the SCCP connection */
 	BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0));
 
-	f_expect_chan_rel(0, dt.rsl_chan_nr, handle_rll_rel := false);
+	f_expect_chan_rel(0, dt.rsl_chan_nr, expect_rll_rel_req := false);
 	setverdict(pass);
 }
 
@@ -926,7 +945,7 @@
 	[] BSSAP.receive(tr_BSSAP_DISC_ind(dt.sccp_conn_id, ?, ?)) { }
 	}
 
-	f_expect_chan_rel(0, dt.rsl_chan_nr);
+	f_expect_chan_rel(0, dt.rsl_chan_nr, expect_rll_rel_req := false);
 	setverdict(pass);
 }
 
diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index 07eafc7..116d7af 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -603,6 +603,8 @@
 	boolean is_assignment,
 	/* Assignment related bits */
 	boolean rr_ass_cmpl_seen,
+	boolean old_lchan_deact_sacch_seen,
+	boolean old_lchan_rll_rel_req_seen,
 	boolean assignment_done,
 	RslChannelNr old_chan_nr,
 	/* Modify related bits */
@@ -614,6 +616,8 @@
 	voice_call := false,
 	is_assignment := false,
 	rr_ass_cmpl_seen := false,
+	old_lchan_deact_sacch_seen := false,
+	old_lchan_rll_rel_req_seen := false,
 	assignment_done := false,
 	old_chan_nr := -,
 	rr_modify_seen := false,
@@ -683,9 +687,11 @@
 		}
 		}
 	[st.rr_ass_cmpl_seen] RSL.receive(tr_RSL_DEACT_SACCH(st.old_chan_nr)) {
+		st.old_lchan_deact_sacch_seen := true;
 		repeat;
 		}
 	[st.rr_ass_cmpl_seen] RSL.receive(tr_RSL_REL_REQ(st.old_chan_nr, tr_RslLinkID_DCCH(0))) {
+		st.old_lchan_rll_rel_req_seen := true;
 		RSL.send(ts_RSL_REL_CONF(st.old_chan_nr, valueof(ts_RslLinkID_DCCH(0))));
 		repeat;
 		}
@@ -994,6 +1000,17 @@
 	}
 
 	f_check_mgcp_expectations();
+
+	if (st.is_assignment and st.assignment_done) {
+	    if (not st.old_lchan_deact_sacch_seen) {
+		setverdict(fail, "f_establish_fully(): Assignment completed, but the old lchan was not",
+			   " released properly: expected a Deact SACCH on the old lchan, but saw none.");
+	    }
+	    if (st.old_lchan_rll_rel_req_seen) {
+		setverdict(fail, "f_establish_fully(): Assignment completed, but the old lchan was not",
+			   " released properly: saw an RLL Release on the old lchan, but expecting none.");
+	    }
+	}
 }
 
 type record HandoverState {

-- 
To view, visit https://gerrit.osmocom.org/11662
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibc64058f1e214bea585f4e8dcb66f3df8ead3845
Gerrit-Change-Number: 11662
Gerrit-PatchSet: 2
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181114/47cd3c28/attachment.htm>


More information about the gerrit-log mailing list