Change in osmo-ttcn3-hacks[master]: bsc: Add TC_{early, late}_conn_fail()

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

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu Jun 14 11:42:43 UTC 2018


Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/9630


Change subject: bsc: Add TC_{early,late}_conn_fail()
......................................................................

bsc: Add TC_{early,late}_conn_fail()

Those test cases simulate a BTS-originated RLL CONN FAIL IND at
"unusual" time:

a) before we actually establish any RLL
b) after / while we're tearing down the RLL

This is triggering an osmo-bsc segfault, see OS#3182.

Change-Id: I324c410d7565c189dbc91df577d92b87c036732c
Related: OS#3182
---
M bsc/BSC_Tests.ttcn
1 file changed, 61 insertions(+), 0 deletions(-)



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

diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index a5509fd..59aab02 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -739,6 +739,62 @@
 	setverdict(pass);
 }
 
+/* Test behavior of early CONN FAIL IND from BTS (before EST IND!) */
+/* See also https://www.osmocom.org/issues/3182 */
+testcase TC_early_conn_fail() runs on test_CT {
+	var RSL_Message rx_rsl;
+	var DchanTuple dt;
+
+	f_init(1);
+
+	/* BTS->BSC: Send CHAN RQD and wait for allocation; acknowledge it */
+	dt.rsl_chan_nr := f_chreq_act_ack(f_rnd_octstring(1), 23);
+
+	/* BTS->BSC: simulate CONN FAIL IND */
+	f_ipa_tx(0, ts_RSL_CONN_FAIL_IND(dt.rsl_chan_nr, RSL_ERR_RADIO_LINK_FAIL));
+
+	/* BTS->BSC: Expect RF channel release from BSC on Abis */
+	rx_rsl := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL));
+
+	/* BTS<-BSC: respond with CHAN REL ACK */
+	f_ipa_tx(0, ts_RSL_RF_CHAN_REL_ACK(dt.rsl_chan_nr));
+
+	setverdict(pass);
+}
+
+/* Test behavior of late CONN FAIL IND from BTS (ater REL IND!) */
+/* See also https://www.osmocom.org/issues/3182 */
+testcase TC_late_conn_fail() runs on test_CT {
+	var RSL_Message rx_rsl;
+	var DchanTuple dt;
+
+	f_init(1);
+
+	dt := f_est_dchan('23'O, 23, '00010203040506'O);
+
+	/* BSC<-MSC: Instruct BSC to clear connection */
+	BSSAP.send(ts_BSSAP_DATA_req(dt.sccp_conn_id, ts_BSSMAP_ClearCommand(0)));
+
+	/* BTS->BSC: expect BSC to deactivate SACCH */
+	rx_rsl := f_exp_ipa_rx(0, tr_RSL_DEACT_SACCH(dt.rsl_chan_nr));
+
+	/* BTS->BSC: simulate a late CONN FAIL IND from BTS */
+	f_ipa_tx(0, ts_RSL_CONN_FAIL_IND(dt.rsl_chan_nr, RSL_ERR_RADIO_LINK_FAIL));
+
+	/* BTS<-BSC: Expect RF channel release from BSC on Abis */
+	rx_rsl := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL));
+	/* BTS->BSC: respond with CHAN REL ACK */
+	f_ipa_tx(0, ts_RSL_RF_CHAN_REL_ACK(dt.rsl_chan_nr));
+
+	/* BSC->MSC: expect Clear Complete from BSC */
+	BSSAP.receive(tr_BSSAP_DATA_ind(dt.sccp_conn_id, tr_BSSMAP_ClearComplete));
+
+	/* BSC<-MSC: MSC disconnects as requested. */
+	BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0));
+
+	setverdict(pass);
+}
+
 function f_expect_chan_rel(integer bts_nr, RslChannelNr rsl_chan_nr, boolean flush := true,
 			   boolean handle_rll_rel := true) runs on test_CT {
 
@@ -2515,6 +2571,11 @@
 	execute( TC_dyn_pdch_ipa_act_nack() );
 	execute( TC_dyn_pdch_osmo_act_deact() );
 	execute( TC_dyn_pdch_osmo_act_nack() );
+
+	/* at bottom as they might crash OsmoBSC before OS#3182 is fixed */
+	execute( TC_early_conn_fail() );
+	execute( TC_late_conn_fail() );
+
 }
 
 }

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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I324c410d7565c189dbc91df577d92b87c036732c
Gerrit-Change-Number: 9630
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180614/754eab2a/attachment.htm>


More information about the gerrit-log mailing list