bsc: Test CSFB "Fast Return" in new TC_chan_rel_hard_clear_csfb

When a MSC releases a connection using the BSSMAP CLEAR CMD, it can
specify that this call was part of CSFB.

The BSC is then supposed to add a special IE to the RR RELEASE
message which will help the phone to switch back to LTE as soon
as possible.

This commit adds a new test case testing for exactly that behavior.

The test does *not* verify if the EARFCN information contained is
actually correct, only that the IE is present in the RR RELEASE.

Change-Id: I7501fb25578412c882ff92da5d388f3079bbce7f
Requires: osmo-bsc Ibfbb87e2e16b05032ad1cb91c11fad1b2f76d755
Related: OS#3777
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 555aac8..5d8f375 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -856,7 +856,8 @@
 			   boolean expect_deact_sacch := true,
 			   boolean expect_rr_chan_rel := true,
 			   boolean expect_rll_rel_req := true,
-			   boolean handle_rll_rel := true
+			   boolean handle_rll_rel := true,
+			   boolean is_csfb := false
 			   ) runs on test_CT {
 
 	var RslLinkId main_dcch := valueof(ts_RslLinkID_DCCH(0));
@@ -871,7 +872,11 @@
 		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, ?, decmatch tr_RRM_RR_RELEASE))) {
+	[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))) {
+		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))) {
 		got_rr_chan_rel := true;
 		repeat;
 	}
@@ -932,6 +937,29 @@
 	setverdict(pass);
 }
 
+/* Test behavior of channel release after Clear Command with CSFB indicator from MSC */
+testcase TC_chan_rel_hard_clear_csfb() runs on test_CT {
+	var BSSAP_N_DATA_ind rx_di;
+	var DchanTuple dt;
+
+	f_init(1);
+
+	dt := f_est_dchan('23'O, 23, '00010203040506'O);
+
+	/* Instruct BSC to clear channel */
+	var BssmapCause cause := 0;
+	BSSAP.send(ts_BSSAP_DATA_req(dt.sccp_conn_id, ts_BSSMAP_ClearCommandCSFB(cause)));
+
+	/* expect Clear Complete from BSC on A */
+	BSSAP.receive(tr_BSSAP_DATA_ind(dt.sccp_conn_id, tr_BSSMAP_ClearComplete)) {
+		/* release the SCCP connection */
+		BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0));
+	}
+
+	f_expect_chan_rel(0, dt.rsl_chan_nr, expect_rll_rel_req := false, is_csfb := true);
+	setverdict(pass);
+}
+
 /* Test behavior of channel release after hard RLSD from MSC */
 testcase TC_chan_rel_hard_rlsd() runs on test_CT {
 	var DchanTuple dt;
@@ -3697,6 +3725,7 @@
 	execute( TC_chan_rel_rll_rel_ind() );
 	execute( TC_chan_rel_conn_fail() );
 	execute( TC_chan_rel_hard_clear() );
+	execute( TC_chan_rel_hard_clear_csfb() );
 	execute( TC_chan_rel_hard_rlsd() );
 	execute( TC_chan_rel_hard_rlsd_ms_dead() );
 	execute( TC_chan_rel_a_reset() );