Change in osmo-ttcn3-hacks[master]: [VAMOS] BTS: add CHANnel ACTIVation test cases

fixeria gerrit-no-reply at lists.osmocom.org
Tue Jun 1 14:34:39 UTC 2021


fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24480 )

Change subject: [VAMOS] BTS: add CHANnel ACTIVation test cases
......................................................................

[VAMOS] BTS: add CHANnel ACTIVation test cases

Change-Id: I79817b3504b0d956e9fa52b8640d3a4d0fd2c4ba
Related: SYS#4895, OS#4941
---
M bts/BTS_Tests.cfg
M bts/BTS_Tests.ttcn
A bts/BTS_Tests_VAMOS.ttcn
3 files changed, 250 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/bts/BTS_Tests.cfg b/bts/BTS_Tests.cfg
index 4673359..4b6e6ca 100644
--- a/bts/BTS_Tests.cfg
+++ b/bts/BTS_Tests.cfg
@@ -37,3 +37,4 @@
 [EXECUTE]
 BTS_Tests.control
 BTS_Tests_SMSCB.control
+BTS_Tests_VAMOS.control
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 8b10d0e..ee5258c 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -66,6 +66,7 @@
 import from BTS_Tests_LAPDm all;
 
 friend module BTS_Tests_SMSCB;
+friend module BTS_Tests_VAMOS;
 friend module BTS_Tests_virtphy;
 friend module BTS_Tests_LAPDm;
 friend module BTS_Tests_perf;
@@ -580,7 +581,7 @@
 	f_connect_reset(L1CTL);
 }
 
-private type function void_fn(charstring id) runs on ConnHdlr;
+friend type function void_fn(charstring id) runs on ConnHdlr;
 
 private type record length(8) of FreqHopGroups FreqHopConfig;
 
diff --git a/bts/BTS_Tests_VAMOS.ttcn b/bts/BTS_Tests_VAMOS.ttcn
new file mode 100644
index 0000000..aa532da
--- /dev/null
+++ b/bts/BTS_Tests_VAMOS.ttcn
@@ -0,0 +1,247 @@
+module BTS_Tests_VAMOS {
+
+/* Integration Tests for OsmoBTS
+ *
+ * (C) 2021 by sysmocom - s.m.f.c. GmbH <info at sysmocom.de>
+ * Author: Vadim Yanitskiy <vyanitskiy at sysmocom.de>
+ *
+ * All rights reserved.
+ *
+ * Released under the terms of GNU General Public License, Version 2 or
+ * (at your option) any later version.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * This module contains VAMOS specific test cases.
+ */
+
+import from Misc_Helpers all;
+import from General_Types all;
+import from Osmocom_Types all;
+import from GSM_Types all;
+import from L1CTL_PortType all;
+import from L1CTL_Types all;
+import from LAPDm_Types all;
+import from IPA_Emulation all;
+import from GSM_RR_Types all;
+import from L3_Templates all;
+
+import from RSL_Emulation all;
+import from RSL_Types all;
+
+import from BTS_Tests all;
+
+private type record of ChanNrModeSet ChanNrModeTest;
+private type record of ChanNrMode ChanNrModeSet;
+private type record ChanNrMode {
+	RslChannelNr chan_nr,
+	RSL_IE_ChannelMode chan_mode
+};
+
+/* VFF: V0(TCH/F) & V1(TCH/F), 2 channels total */
+private template (value) ChanNrModeTest
+ChanNrModeTestVFF(uint3_t tn) := {
+	{
+		{ ts_RslChanNr_Bm(tn), /* V0(TCH/F), signalling */
+		  ts_RSL_ChanMode_SIGN(RSL_CHRT_OSMO_TCH_F_VAMOS) },
+		{ ts_RslChanNr_Osmo_VAMOS_Bm(tn), /* V1(TCH/F), signalling */
+		  ts_RSL_ChanMode_SIGN(RSL_CHRT_OSMO_TCH_F_VAMOS) }
+	},
+	{
+		{ ts_RslChanNr_Bm(tn), /* V0(TCH/F), FR codec */
+		  ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_F_VAMOS, RSL_CMOD_SP_GSM1) },
+		{ ts_RslChanNr_Osmo_VAMOS_Bm(tn), /* V1(TCH/F), signalling */
+		  ts_RSL_ChanMode_SIGN(RSL_CHRT_OSMO_TCH_F_VAMOS) }
+	},
+	{
+		{ ts_RslChanNr_Bm(tn), /* V0(TCH/F), EFR codec */
+		  ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_F_VAMOS, RSL_CMOD_SP_GSM2) },
+		{ ts_RslChanNr_Osmo_VAMOS_Bm(tn), /* V1(TCH/F), AMR codec */
+		  ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_F_VAMOS, RSL_CMOD_SP_GSM3) }
+	},
+	{
+		{ ts_RslChanNr_Bm(tn), /* V0(TCH/F), AMR codec */
+		  ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_F_VAMOS, RSL_CMOD_SP_GSM3) },
+		{ ts_RslChanNr_Osmo_VAMOS_Bm(tn), /* V1(TCH/F), AMR codec */
+		  ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_F_VAMOS, RSL_CMOD_SP_GSM3) }
+	}
+};
+
+/* VHH: V0(TCH/H0) & V1(TCH/H0) + V0(TCH/H1) & V1(TCH/H1), 4 channels total */
+private template (value) ChanNrModeTest
+ChanNrModeTestVHH(uint3_t tn) := {
+	{
+		{ ts_RslChanNr_Lm(tn, 0), /* V0(TCH/H0), signalling */
+		  ts_RSL_ChanMode_SIGN(RSL_CHRT_OSMO_TCH_H_VAMOS) },
+		{ ts_RslChanNr_Lm(tn, 1), /* V0(TCH/H1), signalling */
+		  ts_RSL_ChanMode_SIGN(RSL_CHRT_OSMO_TCH_H_VAMOS) },
+		{ ts_RslChanNr_Osmo_VAMOS_Lm(tn, 0), /* V1(TCH/H0), signalling */
+		  ts_RSL_ChanMode_SIGN(RSL_CHRT_OSMO_TCH_H_VAMOS) },
+		{ ts_RslChanNr_Osmo_VAMOS_Lm(tn, 1), /* V1(TCH/H1), signalling */
+		  ts_RSL_ChanMode_SIGN(RSL_CHRT_OSMO_TCH_H_VAMOS) }
+	},
+	{
+		{ ts_RslChanNr_Lm(tn, 0), /* V0(TCH/H0), signalling */
+		  ts_RSL_ChanMode_SIGN(RSL_CHRT_OSMO_TCH_H_VAMOS) },
+		{ ts_RslChanNr_Lm(tn, 1), /* V0(TCH/H1), HR codec */
+		  ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM1) },
+		{ ts_RslChanNr_Osmo_VAMOS_Lm(tn, 0), /* V1(TCH/H0), HR codec */
+		  ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM1) },
+		{ ts_RslChanNr_Osmo_VAMOS_Lm(tn, 1), /* V1(TCH/H1), signalling */
+		  ts_RSL_ChanMode_SIGN(RSL_CHRT_OSMO_TCH_H_VAMOS) }
+	},
+	{
+		{ ts_RslChanNr_Lm(tn, 0), /* V0(TCH/H0), HR codec */
+		  ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM1) },
+		{ ts_RslChanNr_Lm(tn, 1), /* V0(TCH/H1), AMR codec */
+		  ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3) },
+		{ ts_RslChanNr_Osmo_VAMOS_Lm(tn, 0), /* V1(TCH/H0), signalling */
+		  ts_RSL_ChanMode_SIGN(RSL_CHRT_OSMO_TCH_H_VAMOS) },
+		{ ts_RslChanNr_Osmo_VAMOS_Lm(tn, 1), /* V1(TCH/H1), signalling */
+		  ts_RSL_ChanMode_SIGN(RSL_CHRT_OSMO_TCH_H_VAMOS) }
+	},
+	{
+		{ ts_RslChanNr_Lm(tn, 0), /* V0(TCH/H0), AMR codec */
+		  ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3) },
+		{ ts_RslChanNr_Lm(tn, 1), /* V0(TCH/H1), AMR codec */
+		  ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3) },
+		{ ts_RslChanNr_Osmo_VAMOS_Lm(tn, 0), /* V1(TCH/H0), AMR codec */
+		  ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3) },
+		{ ts_RslChanNr_Osmo_VAMOS_Lm(tn, 1), /* V1(TCH/H1), AMR codec */
+		  ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3) }
+	}
+};
+
+/* HVHH: TCH/H0 + V0(TCH/H1) & V1(TCH/H1), 3 channels total (mixed) */
+private template (value) ChanNrModeTest
+ChanNrModeTestHVHH(uint3_t tn) := {
+	{
+		{ ts_RslChanNr_Lm(tn, 0), /* TCH/H0, signalling */
+		  ts_RSL_ChanMode_SIGN(RSL_CHRT_TCH_H) },
+		{ ts_RslChanNr_Lm(tn, 1), /* V0(TCH/H1), signalling */
+		  ts_RSL_ChanMode_SIGN(RSL_CHRT_OSMO_TCH_H_VAMOS) },
+		{ ts_RslChanNr_Osmo_VAMOS_Lm(tn, 1), /* V1(TCH/H1), signalling */
+		  ts_RSL_ChanMode_SIGN(RSL_CHRT_OSMO_TCH_H_VAMOS) }
+	},
+	{
+		{ ts_RslChanNr_Lm(tn, 0), /* TCH/H0, signalling */
+		  ts_RSL_ChanMode_SIGN(RSL_CHRT_TCH_H) },
+		{ ts_RslChanNr_Lm(tn, 1), /* V0(TCH/H1), AMR codec */
+		  ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3) },
+		{ ts_RslChanNr_Osmo_VAMOS_Lm(tn, 1), /* V1(TCH/H1), AMR codec */
+		  ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3) }
+	},
+	{
+		{ ts_RslChanNr_Lm(tn, 0), /* TCH/H0, HR codec */
+		  ts_RSL_ChanMode(RSL_CHRT_TCH_H, RSL_CMOD_SP_GSM1) },
+		{ ts_RslChanNr_Lm(tn, 1), /* V0(TCH/H1), HR codec */
+		  ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM1) },
+		{ ts_RslChanNr_Osmo_VAMOS_Lm(tn, 1), /* V1(TCH/H1), AMR codec */
+		  ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3) }
+	},
+	{
+		{ ts_RslChanNr_Lm(tn, 0), /* TCH/H0, AMR codec */
+		  ts_RSL_ChanMode(RSL_CHRT_TCH_H, RSL_CMOD_SP_GSM3) },
+		{ ts_RslChanNr_Lm(tn, 1), /* V0(TCH/H1), AMR codec */
+		  ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3) },
+		{ ts_RslChanNr_Osmo_VAMOS_Lm(tn, 1), /* V1(TCH/H1), AMR codec */
+		  ts_RSL_ChanMode(RSL_CHRT_OSMO_TCH_H_VAMOS, RSL_CMOD_SP_GSM3) }
+	}
+};
+
+private template (value) RSL_IE
+ts_RSL_IE_OsmoTSC := {
+	iei := RSL_IE_OSMO_TRAINING_SEQUENCE,
+	body := {
+		osmo_training_sequence := {
+			len := 0, /* overridden */
+			tsc_set := f_rnd_int(4),
+			tsc := f_rnd_int(8)
+		}
+	}
+}
+
+private function f_TC_vamos_exec_async(in ChanNrModeTest test, void_fn handler)
+runs on test_CT {
+	/* Up to 4 simultenious lchans */
+	var ConnHdlrPars pars[4];
+	var ConnHdlr vc_conn[4];
+
+	f_init();
+
+	for (var integer i := 0; i < lengthof(test); i := i + 1) {
+		/* Start a ConnHdlr component for each logical channel */
+		for (var integer ch := 0; ch < lengthof(test[i]); ch := ch + 1) {
+			pars[ch] := valueof(t_Pars(test[i][ch].chan_nr,
+						   test[i][ch].chan_mode));
+			vc_conn[ch] := f_start_handler(handler, pars[ch], l1ctl := false);
+		}
+
+		/* Wait for all ConnHdlr components to finish */
+		for (var integer ch := 0; ch < lengthof(test[i]); ch := ch + 1) {
+			vc_conn[ch].done;
+		}
+	}
+}
+
+private function f_TC_vamos_chan_act(charstring id)
+runs on ConnHdlr {
+	var RSL_IE tsc_ie := valueof(ts_RSL_IE_OsmoTSC);
+
+	/* CHANnel ACTIVation with Osmocom specific TSC IE */
+	f_rsl_chan_act(g_pars.chan_mode, more_ies := { tsc_ie });
+
+	/* Hold the channel for a while */
+	f_sleep(0.3);
+
+	/* DEACTivate the channel */
+	f_rsl_chan_deact();
+	f_rslem_unregister(0, g_chan_nr);
+}
+
+/* VFF: V0(TCH/F) & V1(TCH/F), 2 channels total */
+testcase TC_vamos_chan_act_vff() runs on test_CT { /* TCH/F on TS1 */
+	var ChanNrModeTest test := valueof(ChanNrModeTestVFF(1));
+	f_TC_vamos_exec_async(test, refers(f_TC_vamos_chan_act));
+}
+testcase TC_vamos_chan_act_dyn_ipa_vff() runs on test_CT { /* TCH/F+PDCH on TS3 */
+	var ChanNrModeTest test := valueof(ChanNrModeTestVFF(3));
+	f_TC_vamos_exec_async(test, refers(f_TC_vamos_chan_act));
+}
+testcase TC_vamos_chan_act_dyn_osmo_vff() runs on test_CT { /* TCH/F+TCH/H+PDCH on TS4 */
+	var ChanNrModeTest test := valueof(ChanNrModeTestVFF(4));
+	f_TC_vamos_exec_async(test, refers(f_TC_vamos_chan_act));
+}
+
+/* VHH: V0(TCH/H0) & V1(TCH/H0) + V0(TCH/H1) & V1(TCH/H1), 4 channels total */
+testcase TC_vamos_chan_act_vhh() runs on test_CT {
+	var ChanNrModeTest test := valueof(ChanNrModeTestVHH(5));
+	f_TC_vamos_exec_async(test, refers(f_TC_vamos_chan_act)); /* TCH/H on TS5 */
+}
+testcase TC_vamos_chan_act_dyn_osmo_vhh() runs on test_CT { /* TCH/F+TCH/H+PDCH on TS4 */
+	var ChanNrModeTest test := valueof(ChanNrModeTestVHH(4));
+	f_TC_vamos_exec_async(test, refers(f_TC_vamos_chan_act));
+}
+
+/* HVHH: TCH/H0 + V0(TCH/H1) & V1(TCH/H1), 3 channels total (mixed) */
+testcase TC_vamos_chan_act_hvhh() runs on test_CT {
+	var ChanNrModeTest test := valueof(ChanNrModeTestHVHH(5));
+	f_TC_vamos_exec_async(test, refers(f_TC_vamos_chan_act)); /* TCH/H on TS5 */
+}
+testcase TC_vamos_chan_act_dyn_osmo_hvhh() runs on test_CT { /* TCH/F+TCH/H+PDCH on TS4 */
+	var ChanNrModeTest test := valueof(ChanNrModeTestHVHH(4));
+	f_TC_vamos_exec_async(test, refers(f_TC_vamos_chan_act));
+}
+
+control {
+	/* CHANnel ACTIVation tests */
+	execute( TC_vamos_chan_act_vff() );
+	execute( TC_vamos_chan_act_vhh() );
+	execute( TC_vamos_chan_act_hvhh() );
+	execute( TC_vamos_chan_act_dyn_ipa_vff() );
+	execute( TC_vamos_chan_act_dyn_osmo_vff() );
+	execute( TC_vamos_chan_act_dyn_osmo_vhh() );
+	execute( TC_vamos_chan_act_dyn_osmo_hvhh() );
+}
+
+}

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24480
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I79817b3504b0d956e9fa52b8640d3a4d0fd2c4ba
Gerrit-Change-Number: 24480
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210601/e69ceb7c/attachment.htm>


More information about the gerrit-log mailing list