summaryrefslogtreecommitdiffstats
path: root/hlr/GSUP_Test.ttcn
blob: 11183698fa328b120fcdeeb2c98440f8ca1f10bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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() );
};

};