summaryrefslogtreecommitdiffstats
path: root/hlr/GSUP_Test.ttcn
diff options
context:
space:
mode:
Diffstat (limited to 'hlr/GSUP_Test.ttcn')
-rw-r--r--hlr/GSUP_Test.ttcn54
1 files changed, 54 insertions, 0 deletions
diff --git a/hlr/GSUP_Test.ttcn b/hlr/GSUP_Test.ttcn
new file mode 100644
index 0000000..1118369
--- /dev/null
+++ b/hlr/GSUP_Test.ttcn
@@ -0,0 +1,54 @@
+module GSUP_Test {
+
+import from GSUP_Types all;
+import from IPA_Emulation all;
+
+type component test_CT {
+ var IPA_Emulation_CT vc_IPA;
+ var IPA_CCM_Parameters ccm_pars;
+ port IPA_GSUP_PT GSUP;
+};
+
+modulepar {
+ charstring mp_hlr_ip := "127.0.0.1";
+ integer mp_hlr_gsup_port := 4222;
+ integer mp_hlr_ctrl_port := 4259;
+};
+
+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));
+}
+
+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() );
+};
+
+};