blob: c0a6729e232e97d1e104fc6d94628b138cfc2e9c [file] [log] [blame]
Harald Welte900d01a2019-08-13 13:27:51 +02001module SGSN_Tests_Iu {
2
3import from Osmocom_Types all;
4
5import from SGSN_Tests all;
6
7import from RAN_Adapter all;
8import from RAN_Emulation all;
9import from RANAP_Templates all;
10import from RANAP_PDU_Descriptions all;
11import from RANAP_IEs all;
12
13
14private function f_TC_iu_attach(charstring id) runs on BSSGP_ConnHdlr {
15 var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip));
16
17 /* first perform regular attach */
18 f_gmm_attach(umts_aka_challenge := true, force_gsm_sres := false, gb_idx := 3);
19 setverdict(pass);
20}
21testcase TC_iu_attach() runs on test_CT {
22 /* MS -> SGSN: Attach Request IMSI
23 * MS <- SGSN: Identity Request IMEI
24 * MS -> SGSN: Identity Response IMEI
25 * MS <- SGSN: Auth Request
26 * MS -> SGSN: Auth Response
27 * MS <- SGSN: Attach Accept
28 * MS -> SGSN: Attach Complete
29 */
30 var BSSGP_ConnHdlr vc_conn;
Alexander Couzens1552e792019-07-23 20:38:39 +020031 g_ranap_enable := true;
Harald Welte900d01a2019-08-13 13:27:51 +020032 f_init();
33 f_sleep(1.0);
34 vc_conn := f_start_handler(refers(f_TC_iu_attach), testcasename(), g_gb, 1001);
35 vc_conn.done;
36 f_cleanup();
37}
38
Alexander Couzense5f4a912019-08-12 18:07:27 +020039private function f_TC_iu_attach_geran_rau(charstring id) runs on BSSGP_ConnHdlr {
40 var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip));
Harald Welte900d01a2019-08-13 13:27:51 +020041
Alexander Couzense5f4a912019-08-12 18:07:27 +020042 /* first perform regular attach */
43 f_gmm_attach(umts_aka_challenge := true, force_gsm_sres := false, gb_idx := 3);
44
45 /* do a routing area update */
46 f_routing_area_update(g_pars.ra);
47}
48
49testcase TC_iu_attach_geran_rau() runs on test_CT {
50 /* MS <-> SGSN: Successful Attach over Iu
51 * MS <-> SGSN: Routing Area Update over Geran
52 */
53 var BSSGP_ConnHdlr vc_conn;
54 g_ranap_enable := true;
55 f_init();
56 f_sleep(1.0);
57 vc_conn := f_start_handler(refers(f_TC_iu_attach_geran_rau), testcasename(), g_gb, 1002);
58 vc_conn.done;
59 f_cleanup();
60}
Harald Welte900d01a2019-08-13 13:27:51 +020061
62control {
63 execute( TC_iu_attach() );
Alexander Couzense5f4a912019-08-12 18:07:27 +020064 /* FIXME: will crash the sgsn
65 * execute( TC_iu_attach_geran_rau() ); */
Harald Welte900d01a2019-08-13 13:27:51 +020066}
67
68
69}