summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2019-02-20 16:13:41 +0100
committerPhilipp Maier <pmaier@sysmocom.de>2019-02-20 17:00:33 +0100
commit6137c32e05b154971ad8c3f3199e712c1edff9ad (patch)
treef503d318c0a5787b489660bc24309487498d9671
parent07e8dde671b0cf22842d1fb1cec2ed78f3f7bf0f (diff)
MGCP_Test: Add VTY accesspmaier/hrmangle
The MGCP_Test testsuite currenty lacks VTY access capabilities, lets add them so that future testcases can access the VTY in order to change options on the fly. Depends: osmo-ttcn3-hacks Ife949c61156222de3026280071226ef6f5dbd959 Change-Id: If383f81af3306f8f5bdf50152498ae1303d390df Related: OS#3807
-rw-r--r--mgw/MGCP_Test.default10
-rw-r--r--mgw/MGCP_Test.ttcn16
-rwxr-xr-xmgw/gen_links.sh10
-rwxr-xr-xmgw/regen_makefile.sh2
4 files changed, 37 insertions, 1 deletions
diff --git a/mgw/MGCP_Test.default b/mgw/MGCP_Test.default
index 16027cc..4336033 100644
--- a/mgw/MGCP_Test.default
+++ b/mgw/MGCP_Test.default
@@ -2,12 +2,22 @@
FileMask := LOG_ALL | TTCN_MATCHING;
[TESTPORT_PARAMETERS]
+*.MGWVTY.CTRL_MODE := "client"
+*.MGWVTY.CTRL_HOSTNAME := "127.0.0.1"
+*.MGWVTY.CTRL_PORTNUM := "4243"
+*.MGWVTY.CTRL_LOGIN_SKIPPED := "yes"
+*.MGWVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes"
+*.MGWVTY.CTRL_READMODE := "buffered"
+*.MGWVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes"
+*.MGWVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes"
+*.MGWVTY.PROMPT1 := "OsmoMGW> "
[MODULE_PARAMETERS]
mp_local_udp_port := 2727;
mp_local_ip:= "127.0.0.1";
mp_remote_udp_port := 2427;
mp_remote_ip:= "127.0.0.1";
+Osmocom_VTY_Functions.mp_prompt_prefix := "OsmoMGW";
[MAIN_CONTROLLER]
diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn
index 9adeb2a..9eff8c2 100644
--- a/mgw/MGCP_Test.ttcn
+++ b/mgw/MGCP_Test.ttcn
@@ -9,6 +9,12 @@ module MGCP_Test {
import from RTP_CodecPort_CtrlFunct all;
import from RTP_Emulation all;
import from IPL4asp_Types all;
+ import from General_Types all;
+ import from Native_Functions all;
+ import from IPCP_Types all;
+ import from IP_Types all;
+ import from Osmocom_VTY_Functions all;
+ import from TELNETasp_PortType all;
const charstring c_mgw_domain := "mgw";
const charstring c_mgw_ep_rtpbridge := "rtpbridge/";
@@ -24,6 +30,8 @@ module MGCP_Test {
var RTP_Emulation_CT vc_RTPEM[3];
port RTPEM_CTRL_PT RTPEM[3];
+
+ port TELNETasp_PT MGWVTY;
};
function get_next_trans_id() runs on dummy_CT return MgcpTransId {
@@ -44,6 +52,12 @@ module MGCP_Test {
PortNumber mp_local_rtp_port_base := 10000;
}
+ private function f_init_vty() runs on dummy_CT {
+ map(self:MGWVTY, system:MGWVTY);
+ f_vty_set_prompts(MGWVTY);
+ f_vty_transceive(MGWVTY, "enable");
+ }
+
private function f_rtpem_init(inout RTP_Emulation_CT comp_ref, integer i)
runs on dummy_CT {
comp_ref := RTP_Emulation_CT.create("RTPEM" & int2str(i));
@@ -85,6 +99,8 @@ module MGCP_Test {
/* do a DLCX on all connections of the EP */
f_dlcx_ignore(valueof(ep));
}
+
+ f_init_vty();
}
testcase TC_selftest() runs on dummy_CT {
diff --git a/mgw/gen_links.sh b/mgw/gen_links.sh
index 8b2def7..632f2e3 100755
--- a/mgw/gen_links.sh
+++ b/mgw/gen_links.sh
@@ -29,10 +29,20 @@ DIR=$BASEDIR/titan.ProtocolModules.RTP/src
FILES="RTP_EncDec.cc RTP_Types.ttcn"
gen_links $DIR $FILES
+DIR=$BASEDIR/titan.ProtocolModules.IP/src
+FILES="IP_EncDec.cc IP_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="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn
MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc "
FILES+="RTP_CodecPort.ttcn RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_Emulation.ttcn IuUP_EncDec.cc "
+FILES+="Native_Functions.ttcn Native_FunctionDefs.cc IPCP_Types.ttcn "
+FILES+="Osmocom_VTY_Functions.ttcn "
gen_links $DIR $FILES
ignore_pp_results
diff --git a/mgw/regen_makefile.sh b/mgw/regen_makefile.sh
index 2b7d1f4..64a4fc5 100755
--- a/mgw/regen_makefile.sh
+++ b/mgw/regen_makefile.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-FILES="*.ttcn SDP_EncDec.cc *.c MGCP_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc RTP_EncDec.cc RTP_CodecPort_CtrlFunctDef.cc IuUP_EncDec.cc "
+FILES="*.ttcn SDP_EncDec.cc *.c MGCP_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc RTP_EncDec.cc RTP_CodecPort_CtrlFunctDef.cc IuUP_EncDec.cc Native_FunctionDefs.cc TELNETasp_PT.cc IP_EncDec.cc "
../regen-makefile.sh MGCP_Test.ttcn $FILES