[MERGED] osmo-ttcn3-hacks[master]: bsc: TC_assignment_codec_*: Verify RSL side codec/mode

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
Fri Mar 23 08:31:49 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: bsc: TC_assignment_codec_*: Verify RSL side codec/mode
......................................................................


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
---
M bsc/BSC_Tests.ttcn
1 file changed, 52 insertions(+), 0 deletions(-)

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



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 {

-- 
To view, visit https://gerrit.osmocom.org/7464
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6ef24b5b82a5c100ffffe056adadd26e69b968b9
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list