hlr: Integrate VTY and CTRL support

Change-Id: I3fbc26a98d31df6d4753848bba655a517801d686
This commit is contained in:
Harald Welte 2018-03-01 10:21:29 +01:00
parent 78cae923fa
commit 39b82d344a
5 changed files with 65 additions and 6 deletions

18
hlr/HLR_Tests.cfg Normal file
View File

@ -0,0 +1,18 @@
[ORDERED_INCLUDE]
# Common configuration, shared between test suites
"../Common.cfg"
# testsuite specific configuration, not expected to change
"./HLR_Tests.default"
# Local configuration below
[LOGGING]
[TESTPORT_PARAMETERS]
[MODULE_PARAMETERS]
[MAIN_CONTROLLER]
[EXECUTE]

18
hlr/HLR_Tests.default Normal file
View File

@ -0,0 +1,18 @@
[LOGGING]
mtc.FileMask := LOG_ALL | TTCN_DEBUG | TTCN_MATCHING; // | DEBUG_ENCDEC;
[TESTPORT_PARAMETERS]
*.VTY.CTRL_MODE := "client"
*.VTY.CTRL_HOSTNAME := "127.0.0.1"
*.VTY.CTRL_PORTNUM := "4241"
*.VTY.CTRL_LOGIN_SKIPPED := "yes"
*.VTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes"
*.VTY.CTRL_READMODE := "buffered"
*.VTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes"
*.VTY.PROMPT1 := "OsmoHLR> "
[MODULE_PARAMETERS]
Osmocom_VTY_Functions.mp_prompt_prefix := "OsmoHLR";
[EXECUTE]
HLR_Tests.control

View File

@ -3,10 +3,17 @@ module HLR_Tests {
import from GSUP_Types all;
import from IPA_Emulation all;
type component test_CT {
import from Osmocom_CTRL_Adapter all;
import from Osmocom_VTY_Functions all;
import from TELNETasp_PortType all;
type component test_CT extends CTRL_Adapter_CT {
var IPA_Emulation_CT vc_IPA;
var IPA_CCM_Parameters ccm_pars;
port IPA_GSUP_PT GSUP;
port TELNETasp_PT VTY;
};
modulepar {
@ -15,6 +22,12 @@ modulepar {
integer mp_hlr_ctrl_port := 4259;
};
function f_init_vty() runs on test_CT {
map(self:VTY, system:VTY);
f_vty_set_prompts(VTY);
f_vty_transceive(VTY, "enable");
}
function f_init() runs on test_CT {
ccm_pars := c_IPA_default_ccm_pars;
ccm_pars.name := "Osmocom TTCN-3 GSUP Simulator";
@ -23,6 +36,10 @@ function f_init() runs on test_CT {
map(vc_IPA:IPA_PORT, system:IPA_CODEC_PT);
connect(vc_IPA:IPA_GSUP_PORT, self:GSUP);
vc_IPA.start(IPA_Emulation.main_client(mp_hlr_ip, mp_hlr_gsup_port, "", -1, ccm_pars));
f_init_vty();
f_ipa_ctrl_start(mp_hlr_ip, mp_hlr_ctrl_port);
}
testcase TC_gsup_sai_err_invalid_imsi() runs on test_CT {

View File

@ -24,7 +24,13 @@ DIR=$BASEDIR/titan.TestPorts.IPL4asp/src
FILES="IPL4asp_Functions.ttcn IPL4asp_PT.cc IPL4asp_PT.hh IPL4asp_PortType.ttcn IPL4asp_Types.ttcn IPL4asp_discovery.cc IPL4asp_protocol_L234.hh"
gen_links $DIR $FILES
DIR=../library
FILES="General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn
IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp Osmocom_CTRL_Types.ttcn GSUP_Types.ttcn"
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 Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp GSUP_Types.ttcn "
FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn "
FILES+="Osmocom_VTY_Functions.ttcn "
gen_links $DIR $FILES

View File

@ -2,8 +2,8 @@
MAIN="HLR_Tests.ttcn"
FILES="*.ttcn *.ttcnpp IPA_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc"
FILES="*.ttcn *.ttcnpp IPA_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc TELNETasp_PT.cc"
export CPPFLAGS_TTCN3="-DIPA_EMULATION_GSUP"
export CPPFLAGS_TTCN3="-DIPA_EMULATION_GSUP -DIPA_EMULATION_CTRL"
../regen-makefile.sh $MAIN $FILES