summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-03-22 20:36:16 +0100
committerHarald Welte <laforge@gnumonks.org>2018-03-22 21:16:39 +0100
commita63b91017ab59db045fcc710b816398f34921c50 (patch)
treee85e70c49f0f3f9f13caecca8861b3cab85d48aa
parentad2647b1b5ff990745814a4a3929a37a6208529a (diff)
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
-rw-r--r--bsc/BSC_Tests.ttcn52
1 files changed, 52 insertions, 0 deletions
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 BSSMAP_IE_ChannelType {
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 @@ private function f_TC_assignment_codec(charstring id) runs on MSC_ConnHdlr {
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 {