bsc: TC_assignment_codec_*: Verify RSL side codec/mode

Let's not only match if the BSSMAP ASSIGNMENT COMPL matches what codec
was requested in BSSMAP ASSIGNMENT CMD, but also verify that the
RSL side channel was activated with the right channel mode IE.

Change-Id: I6ef24b5b82a5c100ffffe056adadd26e69b968b9
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index ea67105..d392a71 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -1652,6 +1652,45 @@
 	return ret;
 }
 
+private function f_rsl_chmod_tmpl_from_codec(BSSMAP_FIELD_CodecElement a_elem)
+return template RSL_IE_Body {
+	var template RSL_IE_Body mode_ie := {
+		chan_mode := {
+			len := ?,
+			reserved := ?,
+			dtx_d := ?,
+			dtx_u := ?,
+			spd_ind := RSL_SPDI_SPEECH,
+			ch_rate_type := -,
+			coding_alg_rate := -
+		}
+	}
+
+	select (a_elem.codecType) {
+	case (GSM_FR) {
+		mode_ie.chan_mode.ch_rate_type := RSL_CHRT_TCH_F;
+		mode_ie.chan_mode.coding_alg_rate := RSL_CMOD_SP_GSM1;
+	}
+	case (GSM_HR) {
+		mode_ie.chan_mode.ch_rate_type := RSL_CHRT_TCH_H;
+		mode_ie.chan_mode.coding_alg_rate := RSL_CMOD_SP_GSM1;
+	}
+	case (GSM_EFR) {
+		mode_ie.chan_mode.ch_rate_type := RSL_CHRT_TCH_F;
+		mode_ie.chan_mode.coding_alg_rate := RSL_CMOD_SP_GSM2;
+	}
+	case (FR_AMR) {
+		mode_ie.chan_mode.ch_rate_type := RSL_CHRT_TCH_F;
+		mode_ie.chan_mode.coding_alg_rate := RSL_CMOD_SP_GSM3;
+	}
+	case (HR_AMR) {
+		mode_ie.chan_mode.ch_rate_type := RSL_CHRT_TCH_H;
+		mode_ie.chan_mode.coding_alg_rate := RSL_CMOD_SP_GSM3;
+	}
+	}
+	return mode_ie;
+}
+
 type record CodecListTest {
 	BSSMAP_IE_SpeechCodecList codec_list,
 	charstring id
@@ -1672,6 +1711,19 @@
 	log("expecting ASS COMPL like this: ", exp_compl);
 
 	f_establish_fully(ass_cmd, exp_compl);
+
+	/* Verify that the RSL-side activation actually matches our expectations */
+	var RSL_Message rsl := f_rslem_get_last_act(RSL_PROC, 0, g_chan_nr);
+
+	var RSL_IE_Body mode_ie;
+	if (f_rsl_find_ie(rsl, RSL_IE_CHAN_MODE, mode_ie) == false) {
+		setverdict(fail, "Couldn't find CHAN_MODE IE");
+		self.stop;
+	}
+	var template RSL_IE_Body t_mode_ie := f_rsl_chmod_tmpl_from_codec(g_pars.ass_codec_list.codecElements[0]);
+	if (not match(mode_ie, t_mode_ie)) {
+		setverdict(fail, "RSL Channel Mode IE doesn't match expectation");
+	}
 }
 
 testcase TC_assignment_codec_fr() runs on test_CT {