blob: 236a6a7f678b2f33b7f5ad94d032132b95145bea [file] [log] [blame]
Harald Welte900d01a2019-08-13 13:27:51 +02001module SGSN_Tests_Iu {
2
3import from Osmocom_Types all;
Neels Hofmeyr3ee71d82022-03-08 21:46:41 +01004import from Osmocom_VTY_Functions all;
Harald Welte900d01a2019-08-13 13:27:51 +02005
6import from SGSN_Tests all;
7
8import from RAN_Adapter all;
9import from RAN_Emulation all;
10import from RANAP_Templates all;
11import from RANAP_PDU_Descriptions all;
12import from RANAP_IEs all;
13
14
15private function f_TC_iu_attach(charstring id) runs on BSSGP_ConnHdlr {
16 var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip));
17
18 /* first perform regular attach */
Alexander Couzensb1ce1182019-09-15 22:43:40 +020019 f_gmm_attach(umts_aka_challenge := true, force_gsm_sres := false, ran_index := 3);
Harald Welte900d01a2019-08-13 13:27:51 +020020 setverdict(pass);
21}
22testcase TC_iu_attach() runs on test_CT {
23 /* MS -> SGSN: Attach Request IMSI
24 * MS <- SGSN: Identity Request IMEI
25 * MS -> SGSN: Identity Response IMEI
26 * MS <- SGSN: Auth Request
27 * MS -> SGSN: Auth Response
28 * MS <- SGSN: Attach Accept
29 * MS -> SGSN: Attach Complete
30 */
31 var BSSGP_ConnHdlr vc_conn;
Alexander Couzens1552e792019-07-23 20:38:39 +020032 g_ranap_enable := true;
Harald Welte900d01a2019-08-13 13:27:51 +020033 f_init();
34 f_sleep(1.0);
35 vc_conn := f_start_handler(refers(f_TC_iu_attach), testcasename(), g_gb, 1001);
36 vc_conn.done;
37 f_cleanup();
38}
39
Neels Hofmeyr3ee71d82022-03-08 21:46:41 +010040testcase TC_iu_attach_encr() runs on test_CT {
41 /* MS -> SGSN: Attach Request IMSI
42 * MS <- SGSN: Identity Request IMEI
43 * MS -> SGSN: Identity Response IMEI
44 * MS <- SGSN: Auth Request
45 * MS -> SGSN: Auth Response
46 * MS <- SGSN: Security Mode Command
47 * MS -> SGSN: Security Mode Complete
48 * hNodeB <- SGSN: Common Id
49 * MS <- SGSN: Attach Accept
50 * MS -> SGSN: Attach Complete
51 */
52 var BSSGP_ConnHdlr vc_conn;
53 g_ranap_enable := true;
54 f_init();
55 f_vty_config(SGSNVTY, "sgsn", "encryption uea 1 2");
56 f_sleep(1.0);
57 vc_conn := f_start_handler(refers(f_TC_iu_attach), testcasename(), g_gb, 1001, expect_ciph := true);
58 vc_conn.done;
59 f_vty_config(SGSNVTY, "sgsn", "encryption uea 0");
60 f_cleanup();
61}
62
Alexander Couzense5f4a912019-08-12 18:07:27 +020063private function f_TC_iu_attach_geran_rau(charstring id) runs on BSSGP_ConnHdlr {
64 var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip));
Harald Welte900d01a2019-08-13 13:27:51 +020065
Alexander Couzense5f4a912019-08-12 18:07:27 +020066 /* first perform regular attach */
Alexander Couzensb1ce1182019-09-15 22:43:40 +020067 f_gmm_attach(umts_aka_challenge := true, force_gsm_sres := false, ran_index := 3);
Alexander Couzense5f4a912019-08-12 18:07:27 +020068
69 /* do a routing area update */
70 f_routing_area_update(g_pars.ra);
71}
72
73testcase TC_iu_attach_geran_rau() runs on test_CT {
74 /* MS <-> SGSN: Successful Attach over Iu
75 * MS <-> SGSN: Routing Area Update over Geran
76 */
77 var BSSGP_ConnHdlr vc_conn;
78 g_ranap_enable := true;
79 f_init();
80 f_sleep(1.0);
81 vc_conn := f_start_handler(refers(f_TC_iu_attach_geran_rau), testcasename(), g_gb, 1002);
82 vc_conn.done;
83 f_cleanup();
84}
Harald Welte900d01a2019-08-13 13:27:51 +020085
Alexander Couzens6da25e32019-08-16 03:50:44 +020086private function f_TC_geran_attach_iu_rau(charstring id) runs on BSSGP_ConnHdlr {
87 var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip));
88
89 /* first perform regular attach */
Alexander Couzensb1ce1182019-09-15 22:43:40 +020090 f_gmm_attach(umts_aka_challenge := true, force_gsm_sres := false, ran_index := 0);
Alexander Couzens6da25e32019-08-16 03:50:44 +020091
92 /* do a routing area update */
Alexander Couzensbe76d9c2019-09-15 22:48:03 +020093 f_routing_area_update(g_pars.ra, ran_index := 3);
Alexander Couzens6da25e32019-08-16 03:50:44 +020094 setverdict(pass);
95}
96
97testcase TC_geran_attach_iu_rau() runs on test_CT {
98 /* MS <-> SGSN: Successful Attach over Geran
99 * MS <-> SGSN: Routing Area Update over Iu
100 */
101 var BSSGP_ConnHdlr vc_conn;
102 g_ranap_enable := true;
103 f_init();
104 f_sleep(1.0);
105 vc_conn := f_start_handler(refers(f_TC_geran_attach_iu_rau), testcasename(), g_gb, 1003);
106 vc_conn.done;
107 f_cleanup();
108}
109
Harald Welte900d01a2019-08-13 13:27:51 +0200110control {
111 execute( TC_iu_attach() );
Neels Hofmeyr3ee71d82022-03-08 21:46:41 +0100112 execute( TC_iu_attach_encr() );
Daniel Willmann69cfc5e2020-01-22 18:23:46 +0100113 execute( TC_iu_attach_geran_rau() );
114 execute( TC_geran_attach_iu_rau() );
Harald Welte900d01a2019-08-13 13:27:51 +0200115}
116
117
118}