[MERGED] osmo-ttcn3-hacks[master]: bts: Add TELNET/VTY module so we can interact with BTS VTY

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
Tue Feb 27 21:39:07 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: bts: Add TELNET/VTY module so we can interact with BTS VTY
......................................................................


bts: Add TELNET/VTY module so we can interact with BTS VTY

Change-Id: Ia1d6ba2c3534d2daaa5ea1fe60b32a99fa4ddad9
---
M bts/BTS_Tests.default
M bts/BTS_Tests.ttcn
M bts/gen_links.sh
M bts/regen_makefile.sh
4 files changed, 19 insertions(+), 4 deletions(-)

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



diff --git a/bts/BTS_Tests.default b/bts/BTS_Tests.default
index 927d7c4..562088b 100644
--- a/bts/BTS_Tests.default
+++ b/bts/BTS_Tests.default
@@ -15,7 +15,7 @@
 *.BTSVTY.PROMPT1 := "OsmoBTS> "
 
 [MODULE_PARAMETERS]
-//Osmocom_VTY_Functions.mp_prompt_prefix := "OsmoBTS";
+Osmocom_VTY_Functions.mp_prompt_prefix := "OsmoBTS";
 
 [EXECUTE]
 BTS_Tests.control
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 45fcb06..261d969 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -27,6 +27,9 @@
 import from MobileL3_Types all;
 import from L3_Templates all;
 
+import from Osmocom_VTY_Functions all;
+import from TELNETasp_PortType all;
+
 /* The tests assume a BTS with the following timeslot configuration:
  * TS0 : Combined CCCH + SDCCH/4
  * TS1 .. TS 4: TCH/F
@@ -56,6 +59,8 @@
 	/* TRXC port (for classic tests) */
 	port TRXC_CODEC_PT BB_TRXC;
 	var integer g_bb_trxc_conn_id;
+
+	port TELNETasp_PT BTSVTY;
 
 	/* SI configuration */
 	var SystemInformationConfig si_cfg := {
@@ -201,11 +206,18 @@
 	f_rsl_bcch_fill_raw(rsl_si_type, si_enc);
 }
 
+private function f_init_vty(charstring id) runs on test_CT {
+	map(self:BTSVTY, system:BTSVTY);
+	f_vty_set_prompts(BTSVTY);
+	f_vty_transceive(BTSVTY, "enable");
+}
+
 /* global init function */
 function f_init(charstring id := "BTS-Test") runs on test_CT {
 	f_init_rsl(id);
 	RSL_CCHAN.receive(ASP_IPA_Event:{up_down := ASP_IPA_EVENT_UP});
 	f_sleep(0.5);	/* workaround for OS#3000 */
+	f_init_vty(id);
 
 	/* Send SI3 to the BTS, it is needed for various computations */
 	f_rsl_bcch_fill(RSL_SYSTEM_INFO_3, ts_SI3_default);
diff --git a/bts/gen_links.sh b/bts/gen_links.sh
index 66ffca3..253b757 100755
--- a/bts/gen_links.sh
+++ b/bts/gen_links.sh
@@ -35,8 +35,12 @@
 FILES="MobileL3_CC_Types.ttcn MobileL3_CommonIE_Types.ttcn MobileL3_GMM_SM_Types.ttcn MobileL3_MM_Types.ttcn MobileL3_RRM_Types.ttcn MobileL3_SMS_Types.ttcn MobileL3_SS_Types.ttcn MobileL3_Types.ttcn"
 gen_links $DIR $FILES
 
+DIR=$BASEDIR/titan.TestPorts.TELNETasp/src
+FILES="TELNETasp_PT.cc  TELNETasp_PT.hh  TELNETasp_PortType.ttcn"
+gen_links $DIR $FILES
+
 DIR=../library
-FILES="General_Types.ttcn GSM_Types.ttcn GSM_RR_Types.ttcn GSM_SystemInformation.ttcn Osmocom_Types.ttcn RLCMAC_Types.ttcn RLCMAC_CSN1_Types.ttcn RLCMAC_EncDec.cc L1CTL_Types.ttcn L1CTL_PortType.ttcn L1CTL_PortType_CtrlFunct.ttcn L1CTL_PortType_CtrlFunctDef.cc LAPDm_RAW_PT.ttcn LAPDm_Types.ttcn "
+FILES="General_Types.ttcn GSM_Types.ttcn GSM_RR_Types.ttcn Osmocom_VTY_Functions.ttcn GSM_SystemInformation.ttcn Osmocom_Types.ttcn RLCMAC_Types.ttcn RLCMAC_CSN1_Types.ttcn RLCMAC_EncDec.cc L1CTL_Types.ttcn L1CTL_PortType.ttcn L1CTL_PortType_CtrlFunct.ttcn L1CTL_PortType_CtrlFunctDef.cc LAPDm_RAW_PT.ttcn LAPDm_Types.ttcn "
 #FILES+="NS_Emulation.ttcn NS_CodecPort.ttcn NS_CodecPort_CtrlFunct.ttcn NS_CodecPort_CtrlFunctDef.cc "
 #FILES+="BSSGP_Emulation.ttcn Osmocom_Gb_Types.ttcn "
 FILES+="IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp IPA_CodecPort.ttcn RSL_Types.ttcn RSL_Emulation.ttcn "
diff --git a/bts/regen_makefile.sh b/bts/regen_makefile.sh
index 46cc4ea..9ed5a06 100755
--- a/bts/regen_makefile.sh
+++ b/bts/regen_makefile.sh
@@ -1,7 +1,6 @@
 #!/bin/sh
 
-FILES="*.ttcn *.ttcnpp IPA_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc
-TCCInterface.cc UD_PT.cc RLCMAC_EncDec.cc Native_FunctionDefs.cc TRXC_CodecPort_CtrlFunctDef.cc L1CTL_PortType_CtrlFunctDef.cc"
+FILES="*.ttcn *.ttcnpp IPA_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc UD_PT.cc RLCMAC_EncDec.cc Native_FunctionDefs.cc TRXC_CodecPort_CtrlFunctDef.cc L1CTL_PortType_CtrlFunctDef.cc TELNETasp_PT.cc"
 
 export CPPFLAGS_TTCN3="-DIPA_EMULATION_RSL"
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia1d6ba2c3534d2daaa5ea1fe60b32a99fa4ddad9
Gerrit-PatchSet: 3
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