72 lines
1.4 KiB
Plaintext
72 lines
1.4 KiB
Plaintext
module HLR_Tests {
|
|
|
|
import from GSUP_Types all;
|
|
import from IPA_Emulation all;
|
|
|
|
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 {
|
|
charstring mp_hlr_ip := "127.0.0.1";
|
|
integer mp_hlr_gsup_port := 4222;
|
|
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";
|
|
|
|
vc_IPA := IPA_Emulation_CT.create("IPA");
|
|
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 {
|
|
var hexstring imsi;
|
|
timer T := 10.0;
|
|
|
|
f_init();
|
|
|
|
imsi := '01234'H;
|
|
GSUP.send(valueof(ts_GSUP_SAI_REQ(imsi)));
|
|
T.start;
|
|
alt {
|
|
[] GSUP.receive(tr_GSUP_SAI_ERR(imsi, 17)) {
|
|
setverdict(pass);
|
|
}
|
|
[] GSUP.receive(tr_GSUP_SAI_RES(imsi)) {
|
|
setverdict(fail);
|
|
}
|
|
[] T.timeout {
|
|
setverdict(inconc);
|
|
}
|
|
}
|
|
}
|
|
|
|
control {
|
|
execute( TC_gsup_sai_err_invalid_imsi() );
|
|
};
|
|
|
|
};
|