Harald Welte | 900d01a | 2019-08-13 13:27:51 +0200 | [diff] [blame] | 1 | module SGSN_Tests_Iu { |
| 2 | |
| 3 | import from Osmocom_Types all; |
| 4 | |
| 5 | import from SGSN_Tests all; |
| 6 | |
| 7 | import from RAN_Adapter all; |
| 8 | import from RAN_Emulation all; |
| 9 | import from RANAP_Templates all; |
| 10 | import from RANAP_PDU_Descriptions all; |
| 11 | import from RANAP_IEs all; |
| 12 | |
| 13 | |
| 14 | private 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 | } |
| 21 | testcase 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 Couzens | 1552e79 | 2019-07-23 20:38:39 +0200 | [diff] [blame] | 31 | g_ranap_enable := true; |
Harald Welte | 900d01a | 2019-08-13 13:27:51 +0200 | [diff] [blame] | 32 | 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 Couzens | e5f4a91 | 2019-08-12 18:07:27 +0200 | [diff] [blame] | 39 | private function f_TC_iu_attach_geran_rau(charstring id) runs on BSSGP_ConnHdlr { |
| 40 | var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); |
Harald Welte | 900d01a | 2019-08-13 13:27:51 +0200 | [diff] [blame] | 41 | |
Alexander Couzens | e5f4a91 | 2019-08-12 18:07:27 +0200 | [diff] [blame] | 42 | /* 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 | |
| 49 | testcase 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 Welte | 900d01a | 2019-08-13 13:27:51 +0200 | [diff] [blame] | 61 | |
Alexander Couzens | 6da25e3 | 2019-08-16 03:50:44 +0200 | [diff] [blame] | 62 | private function f_TC_geran_attach_iu_rau(charstring id) runs on BSSGP_ConnHdlr { |
| 63 | var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); |
| 64 | |
| 65 | /* first perform regular attach */ |
| 66 | f_gmm_attach(umts_aka_challenge := true, force_gsm_sres := false, gb_idx := 0); |
| 67 | |
| 68 | /* do a routing area update */ |
| 69 | f_routing_area_update(g_pars.ra, bssgp := 3); |
| 70 | setverdict(pass); |
| 71 | } |
| 72 | |
| 73 | testcase TC_geran_attach_iu_rau() runs on test_CT { |
| 74 | /* MS <-> SGSN: Successful Attach over Geran |
| 75 | * MS <-> SGSN: Routing Area Update over Iu |
| 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_geran_attach_iu_rau), testcasename(), g_gb, 1003); |
| 82 | vc_conn.done; |
| 83 | f_cleanup(); |
| 84 | } |
| 85 | |
Harald Welte | 900d01a | 2019-08-13 13:27:51 +0200 | [diff] [blame] | 86 | control { |
| 87 | execute( TC_iu_attach() ); |
Alexander Couzens | e5f4a91 | 2019-08-12 18:07:27 +0200 | [diff] [blame] | 88 | /* FIXME: will crash the sgsn |
Alexander Couzens | 6da25e3 | 2019-08-16 03:50:44 +0200 | [diff] [blame] | 89 | * execute( TC_iu_attach_geran_rau() ); |
| 90 | * execute( TC_geran_attach_iu_rau() ); */ |
Harald Welte | 900d01a | 2019-08-13 13:27:51 +0200 | [diff] [blame] | 91 | } |
| 92 | |
| 93 | |
| 94 | } |