Harald Welte | 900d01a | 2019-08-13 13:27:51 +0200 | [diff] [blame] | 1 | module SGSN_Tests_Iu { |
| 2 | |
| 3 | import from Osmocom_Types all; |
Neels Hofmeyr | 3ee71d8 | 2022-03-08 21:46:41 +0100 | [diff] [blame] | 4 | import from Osmocom_VTY_Functions all; |
Harald Welte | 900d01a | 2019-08-13 13:27:51 +0200 | [diff] [blame] | 5 | |
| 6 | import from SGSN_Tests all; |
| 7 | |
| 8 | import from RAN_Adapter all; |
| 9 | import from RAN_Emulation all; |
| 10 | import from RANAP_Templates all; |
| 11 | import from RANAP_PDU_Descriptions all; |
| 12 | import from RANAP_IEs all; |
| 13 | |
| 14 | |
| 15 | private 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 Couzens | b1ce118 | 2019-09-15 22:43:40 +0200 | [diff] [blame] | 19 | f_gmm_attach(umts_aka_challenge := true, force_gsm_sres := false, ran_index := 3); |
Harald Welte | 900d01a | 2019-08-13 13:27:51 +0200 | [diff] [blame] | 20 | setverdict(pass); |
| 21 | } |
| 22 | testcase 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 Couzens | 1552e79 | 2019-07-23 20:38:39 +0200 | [diff] [blame] | 32 | g_ranap_enable := true; |
Harald Welte | 900d01a | 2019-08-13 13:27:51 +0200 | [diff] [blame] | 33 | 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 Hofmeyr | 3ee71d8 | 2022-03-08 21:46:41 +0100 | [diff] [blame] | 40 | testcase 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 Couzens | e5f4a91 | 2019-08-12 18:07:27 +0200 | [diff] [blame] | 63 | private function f_TC_iu_attach_geran_rau(charstring id) runs on BSSGP_ConnHdlr { |
| 64 | var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); |
Harald Welte | 900d01a | 2019-08-13 13:27:51 +0200 | [diff] [blame] | 65 | |
Alexander Couzens | e5f4a91 | 2019-08-12 18:07:27 +0200 | [diff] [blame] | 66 | /* first perform regular attach */ |
Alexander Couzens | b1ce118 | 2019-09-15 22:43:40 +0200 | [diff] [blame] | 67 | f_gmm_attach(umts_aka_challenge := true, force_gsm_sres := false, ran_index := 3); |
Alexander Couzens | e5f4a91 | 2019-08-12 18:07:27 +0200 | [diff] [blame] | 68 | |
| 69 | /* do a routing area update */ |
| 70 | f_routing_area_update(g_pars.ra); |
| 71 | } |
| 72 | |
| 73 | testcase 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 Welte | 900d01a | 2019-08-13 13:27:51 +0200 | [diff] [blame] | 85 | |
Alexander Couzens | 6da25e3 | 2019-08-16 03:50:44 +0200 | [diff] [blame] | 86 | private 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 Couzens | b1ce118 | 2019-09-15 22:43:40 +0200 | [diff] [blame] | 90 | f_gmm_attach(umts_aka_challenge := true, force_gsm_sres := false, ran_index := 0); |
Alexander Couzens | 6da25e3 | 2019-08-16 03:50:44 +0200 | [diff] [blame] | 91 | |
| 92 | /* do a routing area update */ |
Alexander Couzens | be76d9c | 2019-09-15 22:48:03 +0200 | [diff] [blame] | 93 | f_routing_area_update(g_pars.ra, ran_index := 3); |
Alexander Couzens | 6da25e3 | 2019-08-16 03:50:44 +0200 | [diff] [blame] | 94 | setverdict(pass); |
| 95 | } |
| 96 | |
| 97 | testcase 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 Welte | 900d01a | 2019-08-13 13:27:51 +0200 | [diff] [blame] | 110 | control { |
| 111 | execute( TC_iu_attach() ); |
Neels Hofmeyr | 3ee71d8 | 2022-03-08 21:46:41 +0100 | [diff] [blame] | 112 | execute( TC_iu_attach_encr() ); |
Daniel Willmann | 69cfc5e | 2020-01-22 18:23:46 +0100 | [diff] [blame] | 113 | execute( TC_iu_attach_geran_rau() ); |
| 114 | execute( TC_geran_attach_iu_rau() ); |
Harald Welte | 900d01a | 2019-08-13 13:27:51 +0200 | [diff] [blame] | 115 | } |
| 116 | |
| 117 | |
| 118 | } |