Harald Welte | a0895f9 | 2018-03-08 11:51:23 +0100 | [diff] [blame] | 1 | module PCU_Tests { |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2 | |
| 3 | /* "RAW" PCU tests: Talk directly to the PCU socket of OsmoPCU on the one hand side (emulating |
| 4 | the BTS/BSC side PCU socket server) and the Gb interface on the other hand side. No NS/BSSGP |
| 5 | Emulation is used; rather, we simply use the NS_CodecPort to implement both standard and non- |
| 6 | standard procedures on the NS and BSSGP level. The goal of these tests is to test exactly |
| 7 | those NS and BSSGP implementations on the BSS (PCU) side. */ |
| 8 | |
| 9 | /* (C) 2018-2019 Harald Welte <laforge@gnumonks.org> |
Vadim Yanitskiy | 4f56d32 | 2020-05-22 20:15:48 +0700 | [diff] [blame] | 10 | * (C) 2019-2020 Vadim Yanitskiy <axilirator@gmail.com> |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 11 | * All rights reserved. |
| 12 | * |
| 13 | * Released under the terms of GNU General Public License, Version 2 or |
| 14 | * (at your option) any later version. |
| 15 | * |
| 16 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 17 | */ |
| 18 | |
| 19 | friend module PCU_Tests_NS; |
| 20 | |
| 21 | import from General_Types all; |
| 22 | import from Osmocom_Types all; |
| 23 | import from GSM_Types all; |
| 24 | import from GSM_RR_Types all; |
| 25 | |
| 26 | import from Osmocom_VTY_Functions all; |
| 27 | import from TELNETasp_PortType all; |
| 28 | |
| 29 | import from MobileL3_GMM_SM_Types all; |
| 30 | import from RLCMAC_CSN1_Types all; |
Pau Espin Pedrol | e8d7d16 | 2020-04-29 19:07:36 +0200 | [diff] [blame] | 31 | import from RLCMAC_CSN1_Templates all; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 32 | import from RLCMAC_Types all; |
Pau Espin Pedrol | e8d7d16 | 2020-04-29 19:07:36 +0200 | [diff] [blame] | 33 | import from RLCMAC_Templates all; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 34 | |
| 35 | import from MobileL3_CommonIE_Types all; |
| 36 | import from L3_Templates all; |
| 37 | |
| 38 | import from NS_Types all; |
| 39 | import from BSSGP_Types all; |
| 40 | import from Osmocom_Gb_Types all; |
| 41 | |
| 42 | import from BSSGP_Emulation all; /* BssgpConfig */ |
| 43 | import from NS_Emulation all; /* NSConfiguration */ |
| 44 | |
| 45 | import from UD_Types all; |
| 46 | import from PCUIF_Types all; |
| 47 | import from PCUIF_CodecPort all; |
| 48 | import from PCUIF_Components all; |
| 49 | import from IPL4asp_Types all; |
| 50 | import from Native_Functions all; |
| 51 | import from SGSN_Components all; |
Pau Espin Pedrol | aedc511 | 2020-05-16 17:30:42 +0200 | [diff] [blame] | 52 | import from GPRS_Components all; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 53 | |
Daniel Willmann | 535aea6 | 2020-09-21 13:27:08 +0200 | [diff] [blame] | 54 | import from StatsD_Types all; |
| 55 | import from StatsD_CodecPort all; |
| 56 | import from StatsD_CodecPort_CtrlFunct all; |
| 57 | import from StatsD_Checker all; |
| 58 | |
Pau Espin Pedrol | 0637ba0 | 2021-01-22 18:36:12 +0100 | [diff] [blame] | 59 | import from IPA_Emulation all; |
Pau Espin Pedrol | 6a71548 | 2021-02-10 18:40:46 +0100 | [diff] [blame] | 60 | import from Osmocom_CTRL_Types all; |
Pau Espin Pedrol | 0637ba0 | 2021-01-22 18:36:12 +0100 | [diff] [blame] | 61 | import from Osmocom_CTRL_Adapter all; |
| 62 | import from Osmocom_CTRL_Functions all; |
| 63 | |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 64 | modulepar { |
| 65 | charstring mp_pcu_sock_path := PCU_SOCK_DEFAULT; |
| 66 | |
| 67 | float X2002 := 0.2; /* Timer -2002, IMM ASSIGN confirm delay */ |
Daniel Willmann | 535aea6 | 2020-09-21 13:27:08 +0200 | [diff] [blame] | 68 | |
| 69 | charstring mp_pcu_statsd_ip := "127.0.0.1"; |
| 70 | integer mp_pcu_statsd_port := 8125; |
Pau Espin Pedrol | 0637ba0 | 2021-01-22 18:36:12 +0100 | [diff] [blame] | 71 | |
| 72 | charstring mp_ctrl_neigh_ip := "127.0.0.1"; |
| 73 | integer mp_ctrl_neigh_port := 4248; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 74 | } |
| 75 | |
| 76 | |
| 77 | /* FIXME: make sure to use parameters from mp_gb_cfg.cell_id in the PCU INFO IND */ |
Pau Espin Pedrol | 745a48b | 2020-10-30 15:31:07 +0100 | [diff] [blame] | 78 | friend template (value) PCUIF_info_ind ts_PCUIF_INFO_default(template (value) PCUIF_Flags flags := c_PCUIF_Flags_default) |
| 79 | := { |
Vadim Yanitskiy | c155930 | 2020-07-19 16:39:12 +0700 | [diff] [blame] | 80 | version := PCUIF_Types.mp_pcuif_version, |
Pau Espin Pedrol | 745a48b | 2020-10-30 15:31:07 +0100 | [diff] [blame] | 81 | flags := flags, |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 82 | trx := ts_PCUIF_InfoTrxs_def(GPRS_Components.mp_base_arfcn), |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 83 | bsic := 7, |
| 84 | mcc := 262, |
| 85 | mnc := 42, |
| 86 | mnc_3_digits := 0, |
| 87 | lac := 13135, |
| 88 | rac := 0, |
| 89 | nsei := mp_nsconfig.nsei, |
| 90 | nse_timer := { 3, 3, 3, 3, 30, 3, 10 }, |
| 91 | cell_timer := { 3, 3, 3, 3, 3, 10, 3, 10, 3, 10, 3 }, |
| 92 | cell_id := 20960, |
| 93 | repeat_time := 5 * 50, |
| 94 | repeat_count := 3, |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 95 | bvci := mp_gb_cfg.bvc[0].bvci, |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 96 | t3142 := 20, |
| 97 | t3169 := 5, |
| 98 | t3191 := 5, |
| 99 | t3193_10ms := 160, |
| 100 | t3195 := 5, |
Pau Espin Pedrol | 76de166 | 2021-03-01 17:40:58 +0100 | [diff] [blame] | 101 | n3101 := 10, |
| 102 | n3103 := 4, |
| 103 | n3105 := 8, |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 104 | cv_countdown := 15, |
| 105 | dl_tbf_ext := 250 * 10, /* ms */ |
| 106 | ul_tbf_ext := 250 * 10, /* ms */ |
| 107 | initial_cs := 2, |
Pau Espin Pedrol | cb00c52 | 2020-11-06 19:52:05 +0100 | [diff] [blame] | 108 | initial_mcs := 1, |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 109 | nsvci := { mp_nsconfig.nsvc[0].nsvci, 0 }, |
| 110 | local_port := { mp_nsconfig.nsvc[0].provider.ip.remote_udp_port, 0 }, |
| 111 | remote_port := { mp_nsconfig.nsvc[0].provider.ip.local_udp_port, 0 }, |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 112 | remote_addr := f_PCUIF_RemoteAddr( |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 113 | f_PCUIF_AF2addr_type(mp_nsconfig.nsvc[0].provider.ip.address_family), mp_nsconfig.nsvc[0].provider.ip.local_ip) |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 114 | } |
| 115 | |
Pau Espin Pedrol | 43be425 | 2021-01-27 16:40:54 +0100 | [diff] [blame] | 116 | /* Passed in RAN-INFO message from emulated neighbor using RIM */ |
| 117 | const octetstring si1_default := '198fb100000000000000000000000000007900002b'O; |
| 118 | const octetstring si3_default := '1b753000f110236ec9033c2747407900003c0b2b2b'O; |
| 119 | const octetstring si13_default := '009000185a6fc9e08410ab2b2b2b2b2b2b2b2b2b2b'O; |
| 120 | const octetstring si_default := si1_default & si3_default & si13_default; |
| 121 | |
Pau Espin Pedrol | 13ab5ea | 2021-02-05 11:56:15 +0100 | [diff] [blame] | 122 | const MultislotCap_GPRS mscap_gprs_def := { |
| 123 | gprsmultislotclass := '00011'B, |
| 124 | gprsextendeddynalloccap := '0'B |
| 125 | }; |
| 126 | const MultislotCap_EGPRS mscap_egprs_def := { |
| 127 | egprsmultislotclass := '00011'B, |
| 128 | egprsextendeddynalloccap := '0'B |
| 129 | }; |
| 130 | template (value) MSRadioAccessCapabilityV ms_racap_gprs_def := { ts_RaCapRec('0001'B /* E-GSM */, mscap_gprs_def, omit) }; |
| 131 | template (value) MSRadioAccessCapabilityV ms_racap_egprs_def := { ts_RaCapRec('0001'B /* E-GSM */, mscap_gprs_def, mscap_egprs_def) }; |
| 132 | |
| 133 | const MultislotCap_GPRS_BSSGP bssgp_mscap_gprs_def := { |
| 134 | gprsmultislotclass := '00011'B, |
| 135 | gprsextendeddynalloccap := '0'B |
| 136 | }; |
| 137 | const MultislotCap_EGPRS_BSSGP bssgp_mscap_egprs_def := { |
| 138 | egprsmultislotclass := '00011'B, |
| 139 | egprsextendeddynalloccap := '0'B |
| 140 | }; |
| 141 | template (value) MSRadioAccessCapabilityV_BSSGP bssgp_ms_racap_gprs_def := { valueof(ts_RaCapRec_BSSGP('0001'B /* E-GSM */, bssgp_mscap_gprs_def, omit)) }; |
| 142 | template (value) MSRadioAccessCapabilityV_BSSGP bssgp_ms_racap_egprs_def := { valueof(ts_RaCapRec_BSSGP('0001'B /* E-GSM */, bssgp_mscap_gprs_def, bssgp_mscap_egprs_def)) }; |
| 143 | |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 144 | type record lqual_range { |
| 145 | /* component reference to the IPA_Client component used for RSL */ |
| 146 | uint8_t low, |
| 147 | uint8_t high |
| 148 | } |
| 149 | |
Pau Espin Pedrol | 0637ba0 | 2021-01-22 18:36:12 +0100 | [diff] [blame] | 150 | type component RAW_PCU_Test_CT extends bssgp_CT, MS_BTS_IFACE_CT, StatsD_ConnHdlr, CTRL_Adapter_CT { |
Vadim Yanitskiy | 91f8a09 | 2020-05-06 21:41:05 +0700 | [diff] [blame] | 151 | /* PCU interface abstraction component */ |
| 152 | var RAW_PCUIF_CT vc_PCUIF; |
Vadim Yanitskiy | 91f8a09 | 2020-05-06 21:41:05 +0700 | [diff] [blame] | 153 | |
Daniel Willmann | 535aea6 | 2020-09-21 13:27:08 +0200 | [diff] [blame] | 154 | /* StatsD */ |
| 155 | var StatsD_Checker_CT vc_STATSD; |
| 156 | |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 157 | /* Connection to the PCUIF component */ |
| 158 | port RAW_PCU_MSG_PT PCUIF; |
| 159 | /* VTY connection to the PCU */ |
| 160 | port TELNETasp_PT PCUVTY; |
| 161 | |
| 162 | /* Uplink CS/MCS thresholds, default from pcu_main.c: */ |
| 163 | var lqual_range g_cs_lqual_ranges[4] := {{low := 0, high := 6}, |
| 164 | {low := 5, high := 8}, |
| 165 | {low := 7, high := 13}, |
| 166 | {low := 12,high := 35}}; |
| 167 | var lqual_range g_mcs_lqual_ranges[9] := {{low := 0, high := 6}, |
| 168 | {low := 5, high := 8}, |
| 169 | {low := 7, high := 13}, |
| 170 | {low := 12,high := 15}, |
| 171 | {low := 14, high := 17}, |
| 172 | {low := 16, high := 18}, |
| 173 | {low := 17,high := 20}, |
| 174 | {low := 19, high := 24}, |
| 175 | {low := 23,high := 35}}; |
| 176 | var uint8_t g_cs_initial_dl := 1; |
| 177 | var uint8_t g_cs_initial_ul := 1; |
| 178 | var uint8_t g_mcs_initial_dl := 1; |
| 179 | var uint8_t g_mcs_initial_ul := 1; |
| 180 | var uint8_t g_cs_max_dl := 4; |
| 181 | var uint8_t g_cs_max_ul := 4; |
| 182 | var uint8_t g_mcs_max_dl := 9; |
| 183 | var uint8_t g_mcs_max_ul := 9; |
| 184 | |
Pau Espin Pedrol | 0c0bf87 | 2020-05-14 15:50:49 +0200 | [diff] [blame] | 185 | var boolean g_force_two_phase_access := false; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 186 | |
| 187 | /* Guard timeout */ |
| 188 | timer g_T_guard := 60.0; |
| 189 | }; |
| 190 | |
| 191 | private altstep as_Tguard_RAW() runs on RAW_PCU_Test_CT { |
| 192 | [] g_T_guard.timeout { |
| 193 | setverdict(fail, "Timeout of T_guard"); |
Vadim Yanitskiy | 91f8a09 | 2020-05-06 21:41:05 +0700 | [diff] [blame] | 194 | f_shutdown(__BFILE__, __LINE__); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 195 | } |
| 196 | } |
| 197 | |
| 198 | private function f_pcuvty_set_allowed_cs_mcs() runs on RAW_PCU_Test_CT { |
| 199 | f_vty_config2(PCUVTY, {"pcu"}, "cs " & int2str(g_cs_initial_dl) & " " & int2str(g_cs_initial_ul)); |
| 200 | f_vty_config2(PCUVTY, {"pcu"}, "cs max " & int2str(g_cs_max_dl) & " " & int2str(g_cs_max_ul)); |
| 201 | |
| 202 | f_vty_config2(PCUVTY, {"pcu"}, "mcs " & int2str(g_mcs_initial_dl) & " " & int2str(g_mcs_initial_ul)); |
| 203 | f_vty_config2(PCUVTY, {"pcu"}, "mcs max " & int2str(g_mcs_max_dl) & " " & int2str(g_mcs_max_ul)); |
| 204 | } |
| 205 | |
| 206 | private function f_pcuvty_set_link_quality_ranges() runs on RAW_PCU_Test_CT { |
| 207 | var charstring cmd; |
| 208 | |
| 209 | cmd := "cs link-quality-ranges" & |
| 210 | " cs1 " & int2str(g_cs_lqual_ranges[0].high) & |
| 211 | " cs2 " & int2str(g_cs_lqual_ranges[1].low) & " " & int2str(g_cs_lqual_ranges[1].high) & |
| 212 | " cs3 " & int2str(g_cs_lqual_ranges[2].low) & " " & int2str(g_cs_lqual_ranges[2].high) & |
| 213 | " cs4 " & int2str(g_cs_lqual_ranges[3].low); |
| 214 | f_vty_config2(PCUVTY, {"pcu"}, cmd); |
| 215 | |
| 216 | cmd := "mcs link-quality-ranges" & |
| 217 | " mcs1 " & int2str(g_mcs_lqual_ranges[0].high) & |
| 218 | " mcs2 " & int2str(g_mcs_lqual_ranges[1].low) & " " & int2str(g_mcs_lqual_ranges[1].high) & |
| 219 | " mcs3 " & int2str(g_mcs_lqual_ranges[2].low) & " " & int2str(g_mcs_lqual_ranges[2].high) & |
| 220 | " mcs4 " & int2str(g_mcs_lqual_ranges[3].low) & " " & int2str(g_mcs_lqual_ranges[3].high) & |
| 221 | " mcs5 " & int2str(g_mcs_lqual_ranges[4].low) & " " & int2str(g_mcs_lqual_ranges[4].high) & |
| 222 | " mcs6 " & int2str(g_mcs_lqual_ranges[5].low) & " " & int2str(g_mcs_lqual_ranges[5].high) & |
| 223 | " mcs7 " & int2str(g_mcs_lqual_ranges[6].low) & " " & int2str(g_mcs_lqual_ranges[6].high) & |
| 224 | " mcs8 " & int2str(g_mcs_lqual_ranges[7].low) & " " & int2str(g_mcs_lqual_ranges[7].high) & |
| 225 | " mcs9 " & int2str(g_mcs_lqual_ranges[8].low); |
| 226 | f_vty_config2(PCUVTY, {"pcu"}, cmd); |
| 227 | } |
| 228 | |
Pau Espin Pedrol | 43be425 | 2021-01-27 16:40:54 +0100 | [diff] [blame] | 229 | private function f_pcuvty_flush_neigh_caches() runs on RAW_PCU_Test_CT { |
| 230 | f_pcuvty_set_neigh_caches(0, 0); |
| 231 | } |
| 232 | |
| 233 | private function f_pcuvty_set_neigh_caches(integer neigh_cache_secs := -1, integer si_cache_secs := -1) |
| 234 | runs on RAW_PCU_Test_CT { |
| 235 | if (neigh_cache_secs == -1) { |
| 236 | f_vty_config2(PCUVTY, {"pcu"}, "timer X10 default"); |
| 237 | } else { |
| 238 | f_vty_config2(PCUVTY, {"pcu"}, "timer X10 " & int2str(neigh_cache_secs)); |
| 239 | } |
| 240 | if (si_cache_secs == -1) { |
| 241 | f_vty_config2(PCUVTY, {"pcu"}, "timer X11 default"); |
| 242 | } else { |
| 243 | f_vty_config2(PCUVTY, {"pcu"}, "timer X11 " & int2str(si_cache_secs)); |
| 244 | } |
| 245 | } |
| 246 | |
Pau Espin Pedrol | 745a48b | 2020-10-30 15:31:07 +0100 | [diff] [blame] | 247 | private function f_init_vty(charstring id, boolean egprs_only) runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 248 | map(self:PCUVTY, system:PCUVTY); |
| 249 | f_vty_set_prompts(PCUVTY); |
| 250 | f_vty_transceive(PCUVTY, "enable"); |
| 251 | |
Pau Espin Pedrol | 745a48b | 2020-10-30 15:31:07 +0100 | [diff] [blame] | 252 | /* This will be removed soon, not needed. EGPRS support is controlled through pcu_ind flags */ |
| 253 | if (egprs_only) { |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 254 | f_vty_config2(PCUVTY, {"pcu"}, "egprs only"); |
| 255 | } else { |
| 256 | f_vty_config2(PCUVTY, {"pcu"}, "no egprs"); |
| 257 | } |
Pau Espin Pedrol | 0c0bf87 | 2020-05-14 15:50:49 +0200 | [diff] [blame] | 258 | |
| 259 | if (g_force_two_phase_access) { |
| 260 | f_vty_config2(PCUVTY, {"pcu"}, "two-phase-access"); |
| 261 | } else { |
| 262 | f_vty_config2(PCUVTY, {"pcu"}, "no two-phase-access"); |
| 263 | } |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 264 | } |
| 265 | |
Pau Espin Pedrol | 2456dad | 2020-04-30 20:22:38 +0200 | [diff] [blame] | 266 | function f_init_raw(charstring id, template (value) PCUIF_info_ind info_ind := ts_PCUIF_INFO_default) |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 267 | runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 268 | /* Start the guard timer */ |
| 269 | g_T_guard.start; |
| 270 | activate(as_Tguard_RAW()); |
| 271 | |
| 272 | /* Init PCU interface component */ |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 273 | vc_PCUIF := RAW_PCUIF_CT.create("PCUIF"); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 274 | connect(vc_PCUIF:MTC, self:PCUIF); |
| 275 | map(vc_PCUIF:PCU, system:PCU); |
| 276 | |
| 277 | /* Create one BTS component (we may want more some day) */ |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 278 | vc_BTS := RAW_PCU_BTS_CT.create("BTS"); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 279 | connect(vc_BTS:PCUIF, vc_PCUIF:BTS); |
| 280 | connect(vc_BTS:TC, self:BTS); |
| 281 | |
Pau Espin Pedrol | 745a48b | 2020-10-30 15:31:07 +0100 | [diff] [blame] | 282 | f_init_vty(id, f_pcuif_ind_flags_egprs_enabled(valueof(info_ind.flags))); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 283 | |
Daniel Willmann | 535aea6 | 2020-09-21 13:27:08 +0200 | [diff] [blame] | 284 | f_init_statsd(id, vc_STATSD, mp_pcu_statsd_ip, mp_pcu_statsd_port); |
| 285 | /* This is normally done in the ConnHdlr component, but here |
| 286 | * the Test_CT doubles as ConnHdlr */ |
| 287 | connect(self:STATSD_PROC, vc_STATSD:STATSD_PROC); |
| 288 | |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 289 | vc_PCUIF.start(f_PCUIF_CT_handler(mp_pcu_sock_path)); |
Pau Espin Pedrol | b34bb06 | 2021-01-19 18:58:07 +0100 | [diff] [blame] | 290 | vc_BTS.start(f_BTS_CT_handler(0, valueof(info_ind), true)); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 291 | |
| 292 | /* Wait until the BTS is ready (SI13 negotiated) */ |
| 293 | BTS.receive(tr_RAW_PCU_EV(BTS_EV_SI13_NEGO)); |
| 294 | } |
| 295 | |
Vadim Yanitskiy | 8a02b92 | 2020-10-31 21:57:10 +0700 | [diff] [blame] | 296 | /* Register TLLI of each allocated GprsMS instance */ |
| 297 | private function f_multi_ms_bssgp_register() |
| 298 | runs on RAW_PCU_Test_CT { |
| 299 | for (var integer i := 0; i < lengthof(g_ms); i := i + 1) { |
| 300 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, g_ms[i].tlli); |
| 301 | } |
| 302 | } |
| 303 | |
| 304 | /* Allocate [and activate] an Uplink TBF for each allocated GprsMS instance */ |
| 305 | private function f_multi_ms_establish_tbf(boolean do_activate := false) |
| 306 | runs on RAW_PCU_Test_CT { |
| 307 | for (var integer i := 0; i < lengthof(g_ms); i := i + 1) { |
| 308 | /* Establish an Uplink TBF */ |
| 309 | f_ms_establish_ul_tbf(g_ms[i]); |
| 310 | |
| 311 | /* Send a random block, so this TBF becomes "active" */ |
| 312 | if (do_activate) { |
| 313 | /* FIXME: use the new APU by Pau to get correct TRX/TS here */ |
Pau Espin Pedrol | fa64e28 | 2021-02-05 17:56:52 +0100 | [diff] [blame] | 314 | var template (value) TsTrxBtsNum nr := ts_TsTrxBtsNum(7, i mod 8); |
Vadim Yanitskiy | 8a02b92 | 2020-10-31 21:57:10 +0700 | [diff] [blame] | 315 | var octetstring dummy := f_rnd_octstring(12); |
| 316 | var RlcmacDlBlock dl_block; |
| 317 | var uint32_t poll_fn; |
| 318 | |
Pau Espin Pedrol | dee5570 | 2021-04-23 21:08:22 +0200 | [diff] [blame] | 319 | f_ms_tx_ul_data_block(g_ms[i], dummy, with_tlli := true, fn := g_ms[i].ul_tbf.start_time_fn, nr := nr); |
Vadim Yanitskiy | 8a02b92 | 2020-10-31 21:57:10 +0700 | [diff] [blame] | 320 | f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, poll_fn, nr := nr); |
| 321 | } |
| 322 | } |
| 323 | } |
| 324 | |
Pau Espin Pedrol | 8155bf4 | 2020-10-29 17:34:26 +0100 | [diff] [blame] | 325 | private function f_ms_establish_ul_tbf_2phase_access(inout GprsMS ms, |
| 326 | template (omit) RlcmacUlCtrlMsg pkt_res_req := omit) |
| 327 | runs on RAW_PCU_Test_CT return PollFnCtx { |
| 328 | var PollFnCtx pollctx; |
| 329 | |
| 330 | /* Single block (two phase) packet access */ |
| 331 | var uint16_t ra := bit2int(chan_req_sb); |
| 332 | if (g_force_two_phase_access) { |
| 333 | /* If 2phase access is enforced by the network, then let's |
| 334 | * request a One phase packet access, we'll receive a single block |
| 335 | * anyway |
| 336 | */ |
| 337 | ra := bit2int(chan_req_def); |
| 338 | } |
| 339 | |
| 340 | /* Establish an Uplink TBF */ |
| 341 | f_ms_use_ra(ms, ra, ra_is_11bit := 0); |
| 342 | f_ms_establish_ul_tbf(ms); |
| 343 | |
| 344 | /* Make sure we've got an Uplink TBF assignment */ |
| 345 | if (not match(ms.ul_tbf.ass.ccch, tr_PacketUlSglAssign)) { |
| 346 | setverdict(fail, "Wrong Packet Uplink Assignment received: ", ms.ul_tbf.ass.ccch, " vs exp: ", tr_PacketUlSglAssign); |
| 347 | f_shutdown(__BFILE__, __LINE__); |
| 348 | } |
| 349 | |
| 350 | /* Send PACKET RESOURCE REQUEST |
| 351 | * (see 3GPP TS 04.60 "7.1.3.1 Initiation of the Packet resource request procedure") |
| 352 | */ |
| 353 | if (istemplatekind(pkt_res_req, "omit")) { |
| 354 | pkt_res_req := ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, omit); |
| 355 | } |
| 356 | |
Pau Espin Pedrol | dee5570 | 2021-04-23 21:08:22 +0200 | [diff] [blame] | 357 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(valueof(pkt_res_req)), ms.ul_tbf.start_time_fn, nr := f_ms_tx_TsTrxBtsNum(ms)); |
Pau Espin Pedrol | fa64e28 | 2021-02-05 17:56:52 +0100 | [diff] [blame] | 358 | /* Store 1st UlTBF context before receiving next one, will |
Pau Espin Pedrol | 8155bf4 | 2020-10-29 17:34:26 +0100 | [diff] [blame] | 359 | * overwrite the TS allocation on MS with info from new UL TBF: |
| 360 | */ |
| 361 | pollctx.tstrxbts := f_ms_tx_TsTrxBtsNum(ms); |
| 362 | f_ms_rx_pkt_ass_pacch(ms, pollctx.fn, tr_RLCMAC_UL_PACKET_ASS, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 363 | return pollctx; |
| 364 | } |
| 365 | |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 366 | testcase TC_pcuif_suspend() runs on RAW_PCU_Test_CT { |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 367 | var octetstring ra_id := enc_RoutingAreaIdentification(mp_gb_cfg.bvc[0].cell_id.ra_id); |
Pau Espin Pedrol | 2889f87 | 2021-01-11 14:43:35 +0100 | [diff] [blame] | 368 | var GprsTlli tlli := TLLI_UNUSED; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 369 | timer T; |
| 370 | |
| 371 | /* Initialize NS/BSSGP side */ |
| 372 | f_init_bssgp(); |
| 373 | |
| 374 | /* Initialize the PCU interface abstraction */ |
| 375 | f_init_raw(testcasename()); |
| 376 | |
| 377 | /* Establish BSSGP connection to the PCU */ |
| 378 | f_bssgp_establish(); |
| 379 | |
| 380 | BTS.send(ts_PCUIF_SUSP_REQ(0, tlli, ra_id, 0)); |
| 381 | |
| 382 | T.start(2.0); |
| 383 | alt { |
Harald Welte | 9b461a9 | 2020-12-10 23:41:14 +0100 | [diff] [blame] | 384 | [] BSSGP_GLOBAL[0].receive(tr_BSSGP_SUSPEND(tlli, mp_gb_cfg.bvc[0].cell_id.ra_id)) { |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 385 | setverdict(pass); |
| 386 | } |
| 387 | [] T.timeout { |
| 388 | setverdict(fail, "Timeout waiting for BSSGP SUSPEND"); |
| 389 | } |
| 390 | } |
Vadim Yanitskiy | 91f8a09 | 2020-05-06 21:41:05 +0700 | [diff] [blame] | 391 | |
| 392 | f_shutdown(__BFILE__, __LINE__, final := true); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 393 | } |
| 394 | |
Pau Espin Pedrol | 9e04d5e | 2021-01-11 15:03:50 +0100 | [diff] [blame] | 395 | /* Make sure TBF is released and no data is sent for in after reciving a Suspend Request from that MS. See OS#4761 */ |
| 396 | testcase TC_pcuif_suspend_active_tbf() runs on RAW_PCU_Test_CT { |
| 397 | var octetstring ra_id := enc_RoutingAreaIdentification(mp_gb_cfg.bvc[0].cell_id.ra_id); |
| 398 | var RlcmacDlBlock dl_block; |
| 399 | var octetstring data := f_rnd_octstring(10); |
| 400 | var uint32_t sched_fn; |
| 401 | var uint32_t dl_fn; |
| 402 | var GprsMS ms; |
| 403 | timer T; |
| 404 | |
| 405 | /* Initialize NS/BSSGP side */ |
| 406 | f_init_bssgp(); |
| 407 | /* Initialize GPRS MS side */ |
| 408 | f_init_gprs_ms(); |
| 409 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 410 | |
| 411 | /* Initialize the PCU interface abstraction */ |
| 412 | f_init_raw(testcasename(), ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
| 413 | |
| 414 | /* Establish BSSGP connection to the PCU */ |
| 415 | f_bssgp_establish(); |
| 416 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 417 | |
| 418 | /* Establish an Uplink TBF */ |
| 419 | f_ms_establish_ul_tbf(ms); |
| 420 | |
| 421 | /* Send one UL block (with TLLI since we are in One-Phase Access |
| 422 | contention resoultion) and make sure it is ACKED fine */ |
Pau Espin Pedrol | dee5570 | 2021-04-23 21:08:22 +0200 | [diff] [blame] | 423 | f_ms_tx_ul_data_block_multi(ms, 1, with_tlli := true, fn := ms.ul_tbf.start_time_fn); |
Pau Espin Pedrol | 9e04d5e | 2021-01-11 15:03:50 +0100 | [diff] [blame] | 424 | f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn); |
| 425 | /* DL ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 426 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
| 427 | |
| 428 | /* UL block should be received in SGSN */ |
| 429 | BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id)); |
| 430 | |
| 431 | /* Now SGSN sends some DL data, PCU will page on CCCH (PCH) */ |
| 432 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data)); |
| 433 | f_ms_exp_dl_tbf_ass_ccch(ms, PCU_IF_SAPI_PCH); |
| 434 | |
| 435 | /* Wait timer X2002 and DL block is available after CCCH IMM ASS: */ |
| 436 | f_sleep(X2002); |
| 437 | f_rx_rlcmac_dl_block_exp_data(dl_block, dl_fn, data, 0); |
| 438 | |
| 439 | /* MS has moved to CS, it sent SUSP REQ to BTS and PCU gets it, TBF is freed: */ |
| 440 | BTS.send(ts_PCUIF_SUSP_REQ(0, ms.tlli, ra_id, 0)); |
| 441 | |
| 442 | T.start(2.0); |
| 443 | alt { |
| 444 | [] BSSGP_GLOBAL[0].receive(tr_BSSGP_SUSPEND(ms.tlli, mp_gb_cfg.bvc[0].cell_id.ra_id)) { |
| 445 | setverdict(pass); |
| 446 | } |
| 447 | [] T.timeout { |
| 448 | setverdict(fail, "Timeout waiting for BSSGP SUSPEND"); |
| 449 | f_shutdown(__BFILE__, __LINE__); |
| 450 | } |
| 451 | } |
| 452 | |
| 453 | /* Make sure we don't receive data for that TBF since it was released |
| 454 | * before. Also check our TBF is not polled for UL. */ |
| 455 | f_rx_rlcmac_dl_block_exp_dummy(dl_block); |
| 456 | if (dl_block.ctrl.mac_hdr.usf != USF_UNUSED) { |
| 457 | setverdict(fail, "Unexpected USF ", dl_block.ctrl.mac_hdr.usf); |
| 458 | f_shutdown(__BFILE__, __LINE__); |
| 459 | } |
| 460 | |
| 461 | /* New data arrives, PCU should page the MS since no TBF active exists: */ |
| 462 | /* Send some more data, it will never reach the MS */ |
| 463 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data)); |
| 464 | f_ms_exp_dl_tbf_ass_ccch(ms, PCU_IF_SAPI_PCH); |
| 465 | |
| 466 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 467 | } |
| 468 | |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 469 | /* Test of correct Timing Advance at the time of TBF establishment |
| 470 | * (derived from timing offset of the Access Burst). */ |
| 471 | testcase TC_ta_rach_imm_ass() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 472 | var GprsMS ms; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 473 | |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 474 | /* Initialize GPRS MS side */ |
| 475 | f_init_gprs_ms(); |
| 476 | ms := g_ms[0]; /* We only use first MS in this test */ |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 477 | /* Initialize the PCU interface abstraction */ |
Pau Espin Pedrol | 745a48b | 2020-10-30 15:31:07 +0100 | [diff] [blame] | 478 | f_init_raw(testcasename(), ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 479 | |
| 480 | /* We cannot send too many TBF requests in a short time because |
| 481 | * at some point the PCU will fail to allocate a new TBF. */ |
| 482 | for (var TimingAdvance ta := 0; ta < 64; ta := ta + 16) { |
| 483 | /* Establish an Uplink TBF (send RACH.ind with current TA) */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 484 | ms.ta := ta; |
Vadim Yanitskiy | 84d1dd5 | 2020-05-28 21:09:22 +0700 | [diff] [blame] | 485 | f_ms_establish_ul_tbf(ms); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 486 | |
| 487 | /* Make sure Timing Advance IE matches out expectations */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 488 | if (ms.ul_tbf.rr_imm_ass.payload.imm_ass.timing_advance != ta) { |
Vadim Yanitskiy | 8685b38 | 2020-05-06 16:53:26 +0700 | [diff] [blame] | 489 | setverdict(fail, "Timing Advance mismatch: ", |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 490 | ms.ul_tbf.rr_imm_ass.payload.imm_ass.timing_advance, |
Vadim Yanitskiy | 8685b38 | 2020-05-06 16:53:26 +0700 | [diff] [blame] | 491 | " vs expected ", ta); |
Vadim Yanitskiy | 91f8a09 | 2020-05-06 21:41:05 +0700 | [diff] [blame] | 492 | break; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 493 | } |
| 494 | } |
Vadim Yanitskiy | 91f8a09 | 2020-05-06 21:41:05 +0700 | [diff] [blame] | 495 | |
| 496 | f_shutdown(__BFILE__, __LINE__, final := true); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 497 | } |
| 498 | |
| 499 | /* Verify Timing Advance value(s) indicated during the packet Downlink assignment |
| 500 | * procedure as per 3GPP TS 44.018, section 3.5.3. There seems to be a bug in the |
| 501 | * IUT that causes it to send an unreasonable Timing Advance value > 0 despite |
| 502 | * no active TBF exists at the moment of establishment (idle mode). */ |
| 503 | testcase TC_ta_idle_dl_tbf_ass() runs on RAW_PCU_Test_CT { |
Vadim Yanitskiy | 37f3333 | 2021-02-21 00:04:23 +0100 | [diff] [blame] | 504 | var GprsMS ms := valueof(t_GprsMS_def); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 505 | |
| 506 | /* Initialize NS/BSSGP side */ |
| 507 | f_init_bssgp(); |
| 508 | |
| 509 | /* Initialize the PCU interface abstraction */ |
| 510 | f_init_raw(testcasename()); |
| 511 | |
| 512 | /* Establish BSSGP connection to the PCU */ |
| 513 | f_bssgp_establish(); |
Vadim Yanitskiy | 37f3333 | 2021-02-21 00:04:23 +0100 | [diff] [blame] | 514 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 515 | |
| 516 | /* SGSN sends some DL data, PCU will initiate Packet Downlink |
| 517 | * Assignment on CCCH (PCH). We don't care about the payload. */ |
Vadim Yanitskiy | 37f3333 | 2021-02-21 00:04:23 +0100 | [diff] [blame] | 518 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, f_rnd_octstring(10))); |
| 519 | f_ms_exp_dl_tbf_ass_ccch(ms, PCU_IF_SAPI_PCH); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 520 | |
| 521 | /* Make sure that Timing Advance is 0 (the actual value is not known yet). |
| 522 | * As per 3GPP S 44.018, section 3.5.3.1.2, the network *shall* initiate |
| 523 | * the procedures defined in 3GPP TS 44.060 or use the polling mechanism. */ |
Vadim Yanitskiy | 37f3333 | 2021-02-21 00:04:23 +0100 | [diff] [blame] | 524 | if (ms.dl_tbf.rr_imm_ass.payload.imm_ass.timing_advance != 0) { |
Vadim Yanitskiy | 84d1dd5 | 2020-05-28 21:09:22 +0700 | [diff] [blame] | 525 | setverdict(fail, "Timing Advance value doesn't match"); |
| 526 | } |
Vadim Yanitskiy | 91f8a09 | 2020-05-06 21:41:05 +0700 | [diff] [blame] | 527 | |
| 528 | f_shutdown(__BFILE__, __LINE__, final := true); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 529 | } |
| 530 | |
| 531 | /* Verify that the PCU generates valid PTCCH/D messages |
| 532 | * while neither Uplink nor Downlink TBF is established. */ |
| 533 | testcase TC_ta_ptcch_idle() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | b34bb06 | 2021-01-19 18:58:07 +0100 | [diff] [blame] | 534 | var BTS_PTCCH_Block pcu_msg; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 535 | timer T; |
| 536 | |
| 537 | /* Initialize the PCU interface abstraction */ |
| 538 | f_init_raw(testcasename()); |
| 539 | |
| 540 | /* Sent an RTS.req for PTCCH/D */ |
| 541 | BTS.send(ts_PCUIF_RTS_REQ(bts_nr := 0, trx_nr := 0, ts_nr := 7, |
| 542 | sapi := PCU_IF_SAPI_PTCCH, fn := 0, |
| 543 | arfcn := 871, block_nr := 0)); |
Pau Espin Pedrol | b34bb06 | 2021-01-19 18:58:07 +0100 | [diff] [blame] | 544 | |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 545 | T.start(5.0); |
| 546 | alt { |
Pau Espin Pedrol | b34bb06 | 2021-01-19 18:58:07 +0100 | [diff] [blame] | 547 | /* Make sure the message is encoded correctly |
| 548 | * TODO: do we expect all TA values to be equal '1111111'B? */ |
| 549 | [] as_rx_ptcch(pcu_msg, tr_PTCCHDownlinkMsg); |
| 550 | |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 551 | [] BTS.receive(PCUIF_Message:?) { repeat; } |
| 552 | [] T.timeout { |
| 553 | setverdict(fail, "Timeout waiting for a PTCCH/D block"); |
Vadim Yanitskiy | 91f8a09 | 2020-05-06 21:41:05 +0700 | [diff] [blame] | 554 | f_shutdown(__BFILE__, __LINE__); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 555 | } |
| 556 | } |
Pau Espin Pedrol | b34bb06 | 2021-01-19 18:58:07 +0100 | [diff] [blame] | 557 | log("Decoded PTCCH/D message: ", pcu_msg.dl_block); |
Vadim Yanitskiy | 91f8a09 | 2020-05-06 21:41:05 +0700 | [diff] [blame] | 558 | |
| 559 | f_shutdown(__BFILE__, __LINE__, final := true); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 560 | } |
| 561 | |
| 562 | /* Test of correct Timing Advance during an active Uplink TBF. |
| 563 | * |
| 564 | * Unlike the circuit-switched domain, Uplink transmissions on PDCH time-slots |
| 565 | * are not continuous and there can be long time gaps between them. This happens |
| 566 | * due to a bursty nature of packet data. The actual Timing Advance of a MS may |
| 567 | * significantly change between such rare Uplink transmissions, so GPRS introduces |
| 568 | * additional mechanisms to control Timing Advance, and thus reduce interference |
| 569 | * between neighboring TDMA time-slots. |
| 570 | * |
| 571 | * At the moment of Uplink TBF establishment, initial Timing Advance is measured |
| 572 | * from ToA (Timing of Arrival) of an Access Burst. This is covered by another |
| 573 | * test case - TC_ta_rach_imm_ass. In response to that Access Burst the network |
| 574 | * sends Immediate Assignment on AGCH, which _may_ contain Timing Advance Index |
| 575 | * among with the initial Timing Advance value. And here PTCCH comes to play. |
| 576 | * |
| 577 | * PTCCH is a unidirectional channel on which the network can instruct a sub-set |
| 578 | * of 16 MS (whether TBFs are active or not) to adjust their Timing Advance |
| 579 | * continuously. To ensure continuous measurements of the signal propagation |
| 580 | * delay, the MSs shall transmit Access Bursts on Uplink (PTCCH/U) on sub-slots |
| 581 | * defined by an assigned Timing Advance Index (see 3GPP TS 45.002). |
| 582 | * |
| 583 | * The purpose of this test case is to verify the assignment of Timing Advance |
| 584 | * Index, and the process of Timing Advance notification on PTCCH/D. The MTC |
| 585 | * first establishes several Uplink TBFs, but does not transmit any Uplink |
| 586 | * blocks on them. During 4 TDMA multi-frame periods the MTC is sending RACH |
| 587 | * indications to the PCU, checking the correctness of two received PTCCH/D |
| 588 | * messages (period of PTCCH/D is two multi-frames). |
| 589 | */ |
| 590 | |
| 591 | /* List of ToA values for Access Bursts to be sent on PTCCH/U, |
| 592 | * each ToA (Timing of Arrival) value is in units of 1/4 of |
| 593 | * a symbol (i.e. 1 symbol is 4 QTA units). */ |
| 594 | type record length(16) of int16_t PTCCH_TAI_ToA_MAP; |
| 595 | const PTCCH_TAI_ToA_MAP ptcch_toa_map_def := { |
| 596 | 0, 0, 0, 0, |
| 597 | 0, 0, 0, 0, |
| 598 | 0, 0, 0, 0, |
| 599 | 0, 0, 0, 0 |
| 600 | }; |
| 601 | |
| 602 | private altstep as_ta_ptcch(uint8_t bts_nr := 0, uint8_t trx_nr := 0, uint8_t ts_nr := 7, |
| 603 | in PTCCH_TAI_ToA_MAP toa_map := ptcch_toa_map_def) |
| 604 | runs on RAW_PCU_Test_CT { |
| 605 | var RAW_PCU_Event event; |
| 606 | var integer ss; |
| 607 | |
| 608 | /* Send Access Bursts on PTCCH/U for every TA Index */ |
| 609 | [] BTS.receive(tr_RAW_PCU_EV(TDMA_EV_PTCCH_UL_BURST)) -> value event { |
| 610 | ss := f_tdma_ptcch_fn2ss(event.data.tdma_fn); |
Vadim Yanitskiy | 91f8a09 | 2020-05-06 21:41:05 +0700 | [diff] [blame] | 611 | if (ss < 0) { /* Shall not happen */ |
| 612 | f_shutdown(__BFILE__, __LINE__); |
| 613 | } |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 614 | |
| 615 | log("Sending an Access Burst on PTCCH/U", |
| 616 | ", sub-slot=", ss, " (TAI)", |
| 617 | ", fn=", event.data.tdma_fn, |
| 618 | ", ToA=", toa_map[ss], " (QTA)"); |
| 619 | /* TODO: do we care about RA and burst format? */ |
| 620 | BTS.send(ts_PCUIF_RACH_IND(bts_nr, trx_nr, ts_nr, |
| 621 | ra := oct2int('3A'O), |
| 622 | is_11bit := 0, |
| 623 | burst_type := BURST_TYPE_0, |
| 624 | fn := event.data.tdma_fn, |
| 625 | arfcn := 871, |
| 626 | qta := toa_map[ss], |
| 627 | sapi := PCU_IF_SAPI_PTCCH)); |
| 628 | repeat; |
| 629 | } |
| 630 | } |
| 631 | |
| 632 | private function f_TC_ta_ptcch_ul_multi_tbf(in PTCCH_TAI_ToA_MAP ptcch_toa_map, |
| 633 | template PTCCHDownlinkMsg t_ta_msg) |
| 634 | runs on RAW_PCU_Test_CT { |
| 635 | var PTCCHDownlinkMsg ta_msg; |
| 636 | var PCUIF_Message pcu_msg; |
| 637 | timer T; |
| 638 | |
| 639 | /* First, send an RTS.req for the upcoming PTCCH/D block */ |
| 640 | BTS.send(ts_PCUIF_RTS_REQ(bts_nr := 0, trx_nr := 0, ts_nr := 7, |
| 641 | sapi := PCU_IF_SAPI_PTCCH, fn := 0, |
| 642 | arfcn := 871, block_nr := 0)); |
| 643 | T.start(2.0); |
| 644 | alt { |
| 645 | /* Keep sending of Access Bursts during two multi-frames (period of PTCCH/D) |
| 646 | * with increasing ToA (Timing of Arrival) values: 0, 7, 14, 28, 35... */ |
| 647 | [] as_ta_ptcch(bts_nr := 0, trx_nr := 0, ts_nr := 7, toa_map := ptcch_toa_map); |
| 648 | /* In the end of 2nd multi-frame we should receive a PTCCH/D block */ |
| 649 | [] BTS.receive(tr_PCUIF_DATA_REQ(bts_nr := 0, trx_nr := 0, ts_nr := 7, |
| 650 | sapi := PCU_IF_SAPI_PTCCH)) -> value pcu_msg { |
| 651 | ta_msg := dec_PTCCHDownlinkMsg(pcu_msg.u.data_req.data); |
| 652 | log("Rx PTCCH/D message: ", ta_msg); |
| 653 | |
| 654 | /* Make sure Timing Advance values match our expectations */ |
Vadim Yanitskiy | 91f8a09 | 2020-05-06 21:41:05 +0700 | [diff] [blame] | 655 | if (not match(ta_msg, t_ta_msg)) { |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 656 | setverdict(fail, "PTCCH/D message does not match: ", t_ta_msg); |
| 657 | } |
| 658 | } |
| 659 | [] BTS.receive { repeat; } |
| 660 | [] T.timeout { |
| 661 | setverdict(fail, "Timeout waiting for a PTCCH/D block"); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 662 | } |
| 663 | } |
| 664 | } |
| 665 | |
| 666 | testcase TC_ta_ptcch_ul_multi_tbf() runs on RAW_PCU_Test_CT { |
| 667 | var template PacketUlAssign t_ul_tbf_ass; |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 668 | var GprsMS ms; |
| 669 | |
| 670 | /* Initialize GPRS MS side */ |
| 671 | f_init_gprs_ms(); |
| 672 | ms := g_ms[0]; /* We only use first MS in this test */ |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 673 | |
| 674 | /* Initialize the PCU interface abstraction */ |
| 675 | f_init_raw(testcasename()); |
| 676 | |
| 677 | /* Enable forwarding of PTCCH/U TDMA events to us */ |
| 678 | BTS.send(ts_RAW_PCU_CMD(TDMA_CMD_ENABLE_PTCCH_UL_FWD)); |
| 679 | |
| 680 | /* Establish 7 Uplink TBFs (USF flag is 3 bits long, '111'B is reserved) */ |
| 681 | for (var integer i := 0; i < 7; i := i + 1) { |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 682 | /* Establish an Uplink TBF */ |
| 683 | f_ms_establish_ul_tbf(ms); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 684 | |
| 685 | /* We expect incremental TFI/USF assignment (dynamic allocation) */ |
| 686 | t_ul_tbf_ass := tr_PacketUlDynAssign(tfi := i, usf := i); |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 687 | if (not match(ms.ul_tbf.ass.ccch, t_ul_tbf_ass)) { |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 688 | setverdict(fail, "Failed to match Packet Uplink Assignment for #", i); |
Vadim Yanitskiy | 91f8a09 | 2020-05-06 21:41:05 +0700 | [diff] [blame] | 689 | break; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 690 | } |
| 691 | |
| 692 | /* We also expect Timing Advance Index to be a part of the assignment */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 693 | if (ms.ul_tbf.ass.ccch.dynamic.ta_index != i) { |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 694 | setverdict(fail, "Failed to match Timing Advance Index for #", i); |
| 695 | /* Keep going, the current OsmoPCU does not assign TA Index */ |
| 696 | } |
| 697 | } |
| 698 | |
| 699 | /* Prepare a list of ToA values for Access Bursts to be sent on PTCCH/U */ |
| 700 | var PTCCH_TAI_ToA_MAP toa_map := ptcch_toa_map_def; |
| 701 | for (var integer i := 0; i < 7; i := i + 1) { |
| 702 | /* ToA in units of 1/4 of a symbol */ |
| 703 | toa_map[i] := (i + 1) * 7 * 4; |
| 704 | } |
| 705 | |
| 706 | /* Now we have all 7 TBFs established in one-phase access mode, |
| 707 | * however we will not be sending any data on them. Instead, we |
| 708 | * will be sending RACH.ind on PTCCH/U during 4 multi-frame |
| 709 | * periods (TAI 0..8), and then will check two PTCCH/D blocks. |
| 710 | * |
| 711 | * Why not 4 TBFs at once? Because Uplink is delayed by 3 TDMA |
| 712 | * time-slots, so at the moment of scheduling a PTCCH/D block |
| 713 | * the PCU has odd number of PTCCH/U Access Bursts received. */ |
| 714 | f_TC_ta_ptcch_ul_multi_tbf(toa_map, tr_PTCCHDownlinkMsg( |
| 715 | tai0_ta := 7, tai1_ta := 14, tai2_ta := 21, |
| 716 | /* Other values are not known (yet) */ |
| 717 | tai3_ta := ?)); |
| 718 | f_TC_ta_ptcch_ul_multi_tbf(toa_map, tr_PTCCHDownlinkMsg( |
| 719 | tai0_ta := 7, tai1_ta := 14, tai2_ta := 21, |
| 720 | tai3_ta := 28, tai4_ta := 35, tai5_ta := 42, |
| 721 | /* Other values are out of our interest */ |
| 722 | tai6_ta := ?)); |
Vadim Yanitskiy | 91f8a09 | 2020-05-06 21:41:05 +0700 | [diff] [blame] | 723 | |
| 724 | f_shutdown(__BFILE__, __LINE__, final := true); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 725 | } |
| 726 | |
| 727 | /* Default link quality adaptation (Coding Scheme) ranges (inclusive). |
| 728 | * OsmoPCU (VTY): cs link-quality-ranges cs1 6 cs2 5 8 cs3 7 13 cs4 12 |
| 729 | * |
| 730 | * NOTE: the ranges are intentionally overlapping because OsmoPCU |
| 731 | * does not change CS/MCS on the range borders (5-6, 7-8, 12-13). */ |
| 732 | private template integer CS1_lqual_dB_range := (-infinity .. 6); |
| 733 | private template integer CS2_lqual_dB_range := (5 .. 8); |
| 734 | private template integer CS3_lqual_dB_range := (7 .. 13); |
| 735 | private template integer CS4_lqual_dB_range := (12 .. infinity); |
| 736 | |
| 737 | testcase TC_cs_lqual_ul_tbf() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 738 | var RlcmacDlBlock dl_block; |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 739 | var GprsMS ms; |
| 740 | var uint32_t unused_fn, sched_fn; |
| 741 | var uint4_t cv; |
| 742 | |
| 743 | /* Initialize GPRS MS side */ |
| 744 | f_init_gprs_ms(); |
| 745 | ms := g_ms[0]; /* We only use first MS in this test */ |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 746 | |
| 747 | /* Initialize the PCU interface abstraction */ |
Pau Espin Pedrol | 745a48b | 2020-10-30 15:31:07 +0100 | [diff] [blame] | 748 | f_init_raw(testcasename(), ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 749 | |
| 750 | f_pcuvty_set_allowed_cs_mcs(); |
| 751 | f_pcuvty_set_link_quality_ranges(); |
| 752 | |
| 753 | /* Establish an Uplink TBF */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 754 | f_ms_establish_ul_tbf(ms); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 755 | |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 756 | |
| 757 | /* The actual / old link quality values. We need to keep track of the old |
| 758 | * (basically previous) link quality value, because OsmoPCU actually |
| 759 | * changes the coding scheme if not only the actual, but also the old |
| 760 | * value leaves the current link quality range (window). */ |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 761 | var integer lqual_old; |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 762 | ms.lqual_cb := 0; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 763 | |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 764 | /* Send one UL block (with TLLI since we are in One-Phase Access |
| 765 | contention resoultion) and make sure it is ACKED fine. */ |
| 766 | /* 16 bytes fills the llc block (because TLLI takes 4 bytes) */ |
| 767 | /* Set CV = 15 to signal there's still more than BS_CV_MAX blocks to be sent */ |
Pau Espin Pedrol | dee5570 | 2021-04-23 21:08:22 +0200 | [diff] [blame] | 768 | f_ms_tx_ul_data_block(ms, f_rnd_octstring(16), cv := 15, with_tlli := true, fn := ms.ul_tbf.start_time_fn) |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 769 | f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn); |
| 770 | /* DL ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 771 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 772 | |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 773 | /* 16 UL blocks (0 .. 15 dB, step = 1 cB) */ |
| 774 | for (var integer i := 150; i >= 0; i := i - 1) { |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 775 | /* Update the old / actual link quality */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 776 | lqual_old := ms.lqual_cb; |
| 777 | ms.lqual_cb := 150 - i; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 778 | |
| 779 | /* Enqueue DATA.ind (both TDMA frame and block numbers to be patched) */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 780 | log("Sending DATA.ind with link quality (dB): ", ms.lqual_cb); |
| 781 | if (i > g_bs_cv_max) { |
| 782 | cv := 15; |
| 783 | } else { |
| 784 | cv := i; |
| 785 | } |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 786 | |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 787 | f_ms_tx_ul_data_block(ms, f_rnd_octstring(10), cv := cv) |
| 788 | |
| 789 | /* we will receive UL ACK/NACK from time to time. In that case, check CdCofing increases */ |
| 790 | f_rx_rlcmac_dl_block(dl_block, unused_fn); |
| 791 | if (match(dl_block, tr_RLCMAC_DUMMY_CTRL())) { |
| 792 | continue; |
| 793 | } |
| 794 | if (not match(dl_block, tr_RLCMAC_UL_ACK_NACK_GPRS(ul_tfi := ?)) and |
| 795 | not match(dl_block, tr_RLCMAC_UL_ACK_NACK_EGPRS(ul_tfi := ?))) { |
| 796 | setverdict(fail, "Failed to match Packet Uplink ACK / NACK:", dl_block); |
| 797 | f_shutdown(__BFILE__, __LINE__); |
| 798 | } |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 799 | |
| 800 | log("Rx Packet Uplink ACK / NACK with Channel Coding Command: ", |
| 801 | dl_block.ctrl.payload.u.ul_ack_nack.gprs.ch_coding_cmd); |
| 802 | |
| 803 | /* Match the received Channel Coding Command. Since we are increasing |
| 804 | * the link quality value on each iteration and not decreasing, there |
| 805 | * is no need to check the both old and current link quality values. */ |
| 806 | var template ChCodingCommand ch_coding; |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 807 | select (lqual_old / 10) { |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 808 | case (CS1_lqual_dB_range) { ch_coding := CH_CODING_CS1; } |
| 809 | case (CS2_lqual_dB_range) { ch_coding := CH_CODING_CS2; } |
| 810 | case (CS3_lqual_dB_range) { ch_coding := CH_CODING_CS3; } |
| 811 | case (CS4_lqual_dB_range) { ch_coding := CH_CODING_CS4; } |
| 812 | } |
| 813 | |
| 814 | if (not match(dl_block.ctrl.payload.u.ul_ack_nack.gprs.ch_coding_cmd, ch_coding)) { |
| 815 | setverdict(fail, "Channel Coding does not match our expectations: ", ch_coding); |
Pau Espin Pedrol | 1617e31 | 2020-05-22 14:41:14 +0200 | [diff] [blame] | 816 | f_shutdown(__BFILE__, __LINE__); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 817 | } |
| 818 | } |
Vadim Yanitskiy | 91f8a09 | 2020-05-06 21:41:05 +0700 | [diff] [blame] | 819 | |
| 820 | f_shutdown(__BFILE__, __LINE__, final := true); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 821 | } |
| 822 | |
| 823 | /* Test the max UL CS set by VTY works fine */ |
| 824 | testcase TC_cs_initial_ul() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 825 | var RlcmacDlBlock dl_block; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 826 | var ChCodingCommand last_ch_coding; |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 827 | var uint32_t unused_fn, sched_fn; |
| 828 | var GprsMS ms; |
| 829 | |
| 830 | /* Initialize GPRS MS side */ |
| 831 | f_init_gprs_ms(); |
| 832 | ms := g_ms[0]; /* We only use first MS in this test */ |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 833 | |
| 834 | /* Initialize the PCU interface abstraction */ |
Pau Espin Pedrol | 745a48b | 2020-10-30 15:31:07 +0100 | [diff] [blame] | 835 | f_init_raw(testcasename(), ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 836 | |
| 837 | /* Set initial UL CS to 3 */ |
| 838 | g_cs_initial_ul := 3; |
| 839 | f_pcuvty_set_allowed_cs_mcs(); |
| 840 | f_pcuvty_set_link_quality_ranges(); |
| 841 | |
| 842 | /* Take lqual (dB->cB) so that we stay in that CS */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 843 | ms.lqual_cb := g_cs_lqual_ranges[2].low * 10; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 844 | |
| 845 | /* Establish an Uplink TBF */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 846 | f_ms_establish_ul_tbf(ms); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 847 | |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 848 | /* Send one UL block (with TLLI since we are in One-Phase Access |
| 849 | contention resoultion) and make sure it is ACKED fine. */ |
| 850 | /* 16 bytes fills the llc block (because TLLI takes 4 bytes) */ |
| 851 | /* Set CV = 15 to signal there's still more than BS_CV_MAX blocks to be sent */ |
Pau Espin Pedrol | dee5570 | 2021-04-23 21:08:22 +0200 | [diff] [blame] | 852 | f_ms_tx_ul_data_block(ms, f_rnd_octstring(16), cv := 15, with_tlli := true, fn := ms.ul_tbf.start_time_fn) |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 853 | f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn); |
| 854 | /* DL ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 855 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 856 | |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 857 | /* Send UL blocks, until we receive UL ACK/NACK and check we are in same initial CS: */ |
| 858 | while (true) { |
| 859 | f_ms_tx_ul_data_block(ms, f_rnd_octstring(10), cv := 15); |
| 860 | f_rx_rlcmac_dl_block(dl_block, unused_fn); |
| 861 | if (match(dl_block, tr_RLCMAC_DUMMY_CTRL())) { |
| 862 | continue; |
| 863 | } |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 864 | |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 865 | if (not match(dl_block, tr_RLCMAC_UL_ACK_NACK_GPRS(ul_tfi := ?)) and |
| 866 | not match(dl_block, tr_RLCMAC_UL_ACK_NACK_EGPRS(ul_tfi := ?))) { |
| 867 | setverdict(fail, "Failed to match Packet Uplink ACK / NACK:", dl_block); |
| 868 | f_shutdown(__BFILE__, __LINE__); |
| 869 | break; |
| 870 | } |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 871 | |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 872 | last_ch_coding := dl_block.ctrl.payload.u.ul_ack_nack.gprs.ch_coding_cmd; |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 873 | break; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 874 | } |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 875 | if (last_ch_coding != CH_CODING_CS3) { |
| 876 | setverdict(fail, "Channel Coding does not match our expectations (CS-3): ", last_ch_coding); |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 877 | f_shutdown(__BFILE__, __LINE__); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 878 | } |
| 879 | |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 880 | /* Remaining UL blocks are used to make sure regardless of initial |
| 881 | /* lqual, we can go lower at any time */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 882 | /* 0 dB, make sure we downgrade CS */ |
| 883 | ms.lqual_cb := 0; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 884 | /* 5 UL blocks, check we are in same initial CS: */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 885 | f_ms_tx_ul_data_block_multi(ms, 5); |
| 886 | /* Enqueue RTS.req, expect DATA.req with UL ACK from the PCU */ |
| 887 | f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, unused_fn); |
| 888 | last_ch_coding := dl_block.ctrl.payload.u.ul_ack_nack.gprs.ch_coding_cmd; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 889 | |
| 890 | if (last_ch_coding != CH_CODING_CS1) { |
| 891 | setverdict(fail, "Channel Coding does not match our expectations (CS-1): ", last_ch_coding); |
Pau Espin Pedrol | 1617e31 | 2020-05-22 14:41:14 +0200 | [diff] [blame] | 892 | f_shutdown(__BFILE__, __LINE__); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 893 | } |
Vadim Yanitskiy | 91f8a09 | 2020-05-06 21:41:05 +0700 | [diff] [blame] | 894 | |
| 895 | f_shutdown(__BFILE__, __LINE__, final := true); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 896 | } |
| 897 | |
| 898 | /* Test the max UL CS set by VTY works fine */ |
| 899 | testcase TC_cs_max_ul() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 900 | var RlcmacDlBlock dl_block; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 901 | var ChCodingCommand last_ch_coding; |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 902 | var uint32_t unused_fn, sched_fn; |
| 903 | var GprsMS ms; |
| 904 | |
| 905 | /* Initialize GPRS MS side */ |
| 906 | f_init_gprs_ms(); |
| 907 | ms := g_ms[0]; /* We only use first MS in this test */ |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 908 | |
| 909 | /* Initialize the PCU interface abstraction */ |
Pau Espin Pedrol | 745a48b | 2020-10-30 15:31:07 +0100 | [diff] [blame] | 910 | f_init_raw(testcasename(), ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 911 | |
| 912 | /* Set maximum allowed UL CS to 3 */ |
| 913 | g_cs_max_ul := 3; |
| 914 | f_pcuvty_set_allowed_cs_mcs(); |
| 915 | f_pcuvty_set_link_quality_ranges(); |
| 916 | |
| 917 | /* Establish an Uplink TBF */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 918 | f_ms_establish_ul_tbf(ms); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 919 | |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 920 | /* Send one UL block (with TLLI since we are in One-Phase Access |
| 921 | contention resoultion) and make sure it is ACKED fine. */ |
| 922 | /* 16 bytes fills the llc block (because TLLI takes 4 bytes) */ |
| 923 | /* Set CV = 15 to signal there's still more than BS_CV_MAX blocks to be sent */ |
Pau Espin Pedrol | dee5570 | 2021-04-23 21:08:22 +0200 | [diff] [blame] | 924 | f_ms_tx_ul_data_block(ms, f_rnd_octstring(16), cv := 15, with_tlli := true, fn := ms.ul_tbf.start_time_fn) |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 925 | f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn); |
| 926 | /* DL ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 927 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 928 | |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 929 | ms.lqual_cb := 40*10; /* 40 dB */ |
| 930 | f_ms_tx_ul_data_block_multi(ms, 16); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 931 | |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 932 | f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, unused_fn); |
| 933 | last_ch_coding := dl_block.ctrl.payload.u.ul_ack_nack.gprs.ch_coding_cmd; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 934 | |
| 935 | if (last_ch_coding != CH_CODING_CS3) { |
| 936 | setverdict(fail, "Channel Coding does not match our expectations (CS-3): ", last_ch_coding); |
Pau Espin Pedrol | 1617e31 | 2020-05-22 14:41:14 +0200 | [diff] [blame] | 937 | f_shutdown(__BFILE__, __LINE__); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 938 | } |
Vadim Yanitskiy | 91f8a09 | 2020-05-06 21:41:05 +0700 | [diff] [blame] | 939 | |
| 940 | f_shutdown(__BFILE__, __LINE__, final := true); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 941 | } |
| 942 | |
Pau Espin Pedrol | 7512259 | 2020-11-03 15:22:59 +0100 | [diff] [blame] | 943 | /* Test the initial DL CS set by VTY works fine */ |
| 944 | testcase TC_cs_initial_dl() runs on RAW_PCU_Test_CT { |
| 945 | var octetstring data := f_rnd_octstring(10); |
| 946 | var CodingScheme exp_dl_cs_mcs; |
| 947 | var RlcmacDlBlock dl_block; |
| 948 | var uint32_t poll_fn; |
| 949 | var GprsMS ms; |
| 950 | |
| 951 | /* Initialize NS/BSSGP side */ |
| 952 | f_init_bssgp(); |
| 953 | /* Initialize GPRS MS side */ |
| 954 | f_init_gprs_ms(); |
| 955 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 956 | |
| 957 | /* Initialize the PCU interface abstraction */ |
| 958 | f_init_raw(testcasename(), ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
| 959 | |
| 960 | /* Set initial allowed DL CS to 3 */ |
| 961 | g_cs_initial_dl := 3; |
| 962 | exp_dl_cs_mcs := CS_3; |
| 963 | /* Set maximum allowed UL CS to 4 */ |
| 964 | g_cs_max_dl := 4; |
| 965 | f_pcuvty_set_allowed_cs_mcs(); |
| 966 | f_pcuvty_set_link_quality_ranges(); |
| 967 | |
| 968 | /* Establish BSSGP connection to the PCU */ |
| 969 | f_bssgp_establish(); |
| 970 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 971 | |
| 972 | /* SGSN sends some DL data, PCU will page on CCCH (PCH) */ |
| 973 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data)); |
| 974 | f_ms_exp_dl_tbf_ass_ccch(ms, PCU_IF_SAPI_PCH); |
| 975 | |
| 976 | /* Wait timer X2002 and DL block is available after CCCH IMM ASS: */ |
| 977 | f_sleep(X2002); |
| 978 | f_rx_rlcmac_dl_block_exp_data(dl_block, poll_fn, data, 0, exp_dl_cs_mcs); |
| 979 | |
| 980 | /* ACK the DL block */ |
| 981 | f_acknackdesc_ack_block(ms.dl_tbf.acknack_desc, dl_block, '1'B); |
| 982 | f_ms_tx_ul_block(ms, ts_RLCMAC_DL_ACK_NACK(ms.dl_tbf.tfi, ms.dl_tbf.acknack_desc), |
| 983 | f_dl_block_ack_fn(dl_block, poll_fn)); |
| 984 | |
| 985 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 986 | } |
| 987 | |
Pau Espin Pedrol | 5d07ae6 | 2020-11-05 17:59:30 +0100 | [diff] [blame] | 988 | /* Verify scheduling of multiple Downlink data blocks, enough to reach CS4 */ |
Pau Espin Pedrol | fa64e28 | 2021-02-05 17:56:52 +0100 | [diff] [blame] | 989 | function f_dl_data_exp_cs(template (present) CodingScheme exp_final_cs := ?, template (omit) MSRadioAccessCapabilityV_BSSGP ms_racap := omit) runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | 1b9aa78 | 2020-11-12 21:14:16 +0100 | [diff] [blame] | 990 | var octetstring data := f_rnd_octstring(1400); |
Pau Espin Pedrol | 5d07ae6 | 2020-11-05 17:59:30 +0100 | [diff] [blame] | 991 | var RlcmacDlBlock prev_dl_block, dl_block; |
| 992 | var uint32_t ack_fn; |
| 993 | var uint32_t fn; |
| 994 | var GprsMS ms; |
Pau Espin Pedrol | 1b9aa78 | 2020-11-12 21:14:16 +0100 | [diff] [blame] | 995 | var integer tx_data_remain := 10; |
Pau Espin Pedrol | 5d07ae6 | 2020-11-05 17:59:30 +0100 | [diff] [blame] | 996 | var integer bsn := 0; |
Pau Espin Pedrol | 1b9aa78 | 2020-11-12 21:14:16 +0100 | [diff] [blame] | 997 | var boolean using_egprs := f_rlcmac_cs_mcs_is_mcs(valueof(exp_final_cs)); |
| 998 | var integer bsn_mod; |
Pau Espin Pedrol | fa64e28 | 2021-02-05 17:56:52 +0100 | [diff] [blame] | 999 | var template (present) CodingScheme exp_tmp_csmcs; |
Pau Espin Pedrol | 1b9aa78 | 2020-11-12 21:14:16 +0100 | [diff] [blame] | 1000 | |
| 1001 | if (using_egprs) { |
| 1002 | exp_tmp_csmcs := mcs_egprs_any; |
| 1003 | bsn_mod := 2048; |
| 1004 | } else { |
| 1005 | exp_tmp_csmcs := cs_gprs_any; |
| 1006 | bsn_mod := 128; |
| 1007 | } |
Pau Espin Pedrol | 5d07ae6 | 2020-11-05 17:59:30 +0100 | [diff] [blame] | 1008 | |
| 1009 | /* Establish BSSGP connection to the PCU */ |
| 1010 | f_bssgp_establish(); |
| 1011 | |
| 1012 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 1013 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 1014 | |
| 1015 | /* SGSN sends some DL data, PCU will page on CCCH (PCH) */ |
Pau Espin Pedrol | 1b9aa78 | 2020-11-12 21:14:16 +0100 | [diff] [blame] | 1016 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data, ms_racap)); |
Pau Espin Pedrol | 5d07ae6 | 2020-11-05 17:59:30 +0100 | [diff] [blame] | 1017 | f_ms_exp_dl_tbf_ass_ccch(ms, PCU_IF_SAPI_PCH); |
| 1018 | |
| 1019 | /* Wait timer X2002 and DL block is available after CCCH IMM ASS */ |
| 1020 | f_sleep(X2002); |
| 1021 | |
Pau Espin Pedrol | 1b9aa78 | 2020-11-12 21:14:16 +0100 | [diff] [blame] | 1022 | for (var integer i := 0; i < 800; i := i + 1) { |
| 1023 | bsn := i mod bsn_mod; |
Pau Espin Pedrol | 5d07ae6 | 2020-11-05 17:59:30 +0100 | [diff] [blame] | 1024 | f_rx_rlcmac_dl_block(dl_block, fn); |
| 1025 | |
| 1026 | if (match(dl_block, tr_RLCMAC_DUMMY_CTRL)) { |
| 1027 | /* No more data to receive, done */ |
| 1028 | break; |
| 1029 | } |
| 1030 | |
Pau Espin Pedrol | 1b9aa78 | 2020-11-12 21:14:16 +0100 | [diff] [blame] | 1031 | f_rlcmac_dl_block_exp_data(dl_block, ?, bsn, exp_tmp_csmcs); |
Pau Espin Pedrol | 5d07ae6 | 2020-11-05 17:59:30 +0100 | [diff] [blame] | 1032 | |
| 1033 | /* Keep Ack/Nack description updated */ |
Pau Espin Pedrol | 1b9aa78 | 2020-11-12 21:14:16 +0100 | [diff] [blame] | 1034 | f_dltbf_ack_block(ms.dl_tbf, dl_block); |
Pau Espin Pedrol | 5d07ae6 | 2020-11-05 17:59:30 +0100 | [diff] [blame] | 1035 | |
| 1036 | /* TDMA frame number on which we are supposed to send the ACK */ |
Pau Espin Pedrol | 1b9aa78 | 2020-11-12 21:14:16 +0100 | [diff] [blame] | 1037 | if (f_dl_block_rrbp_valid(dl_block)) { |
Pau Espin Pedrol | 5d07ae6 | 2020-11-05 17:59:30 +0100 | [diff] [blame] | 1038 | ack_fn := f_dl_block_ack_fn(dl_block, fn); |
Pau Espin Pedrol | 1b9aa78 | 2020-11-12 21:14:16 +0100 | [diff] [blame] | 1039 | f_ms_tx_ul_block(ms, f_dltbf_ts_RLCMAC_DL_ACK_NACK(ms.dl_tbf, using_egprs), ack_fn); |
Pau Espin Pedrol | 5d07ae6 | 2020-11-05 17:59:30 +0100 | [diff] [blame] | 1040 | if (tx_data_remain != 0) { |
| 1041 | /* Submit more data from time to time to keep the TBF ongoing */ |
| 1042 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data)); |
| 1043 | tx_data_remain := tx_data_remain - 1; |
| 1044 | } |
| 1045 | } |
| 1046 | prev_dl_block := dl_block; |
| 1047 | } |
| 1048 | |
Pau Espin Pedrol | 1b9aa78 | 2020-11-12 21:14:16 +0100 | [diff] [blame] | 1049 | bsn := (bsn + (bsn_mod-1)) mod bsn_mod; /* previous bsn: bsn -1 */ |
| 1050 | f_rlcmac_dl_block_exp_data(prev_dl_block, ?, bsn, exp_final_cs); |
Pau Espin Pedrol | 5d07ae6 | 2020-11-05 17:59:30 +0100 | [diff] [blame] | 1051 | |
| 1052 | |
| 1053 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 1054 | } |
| 1055 | |
| 1056 | /* Verify DL CS above "cs max" set by VTY is never used */ |
| 1057 | testcase TC_cs_max_dl() runs on RAW_PCU_Test_CT { |
| 1058 | /* Initialize NS/BSSGP side */ |
| 1059 | f_init_bssgp(); |
| 1060 | /* Initialize GPRS MS side */ |
| 1061 | f_init_gprs_ms(); |
| 1062 | |
| 1063 | /* Initialize the PCU interface abstraction */ |
| 1064 | f_init_raw(testcasename(), ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
| 1065 | |
| 1066 | /* Set maximum allowed DL CS to 3 */ |
| 1067 | g_cs_initial_dl := 1; |
| 1068 | g_cs_max_dl := 3; |
| 1069 | f_pcuvty_set_allowed_cs_mcs(); |
| 1070 | f_pcuvty_set_link_quality_ranges(); |
| 1071 | |
| 1072 | f_dl_data_exp_cs(f_rlcmac_block_int2cs_mcs(g_cs_max_dl, false)); |
| 1073 | } |
| 1074 | |
| 1075 | /* Check DL CS4 is used in good link conditions if allowed by config */ |
| 1076 | testcase TC_dl_cs1_to_cs4() runs on RAW_PCU_Test_CT { |
| 1077 | /* Initialize NS/BSSGP side */ |
| 1078 | f_init_bssgp(); |
| 1079 | /* Initialize GPRS MS side */ |
| 1080 | f_init_gprs_ms(); |
| 1081 | |
| 1082 | /* Initialize the PCU interface abstraction */ |
| 1083 | f_init_raw(testcasename(), ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
| 1084 | |
| 1085 | /* Set initial DL CS to 1 & maximum allowed DL CS to 4 */ |
| 1086 | g_cs_initial_dl := 1; |
| 1087 | g_cs_max_dl := 4; |
| 1088 | f_pcuvty_set_allowed_cs_mcs(); |
| 1089 | f_pcuvty_set_link_quality_ranges(); |
| 1090 | |
| 1091 | f_dl_data_exp_cs(f_rlcmac_block_int2cs_mcs(g_cs_max_dl, false)); |
| 1092 | } |
| 1093 | |
Pau Espin Pedrol | 2354d6a | 2020-11-05 18:36:59 +0100 | [diff] [blame] | 1094 | /* Test the initial UL MCS set by VTY works fine */ |
| 1095 | testcase TC_mcs_initial_ul() runs on RAW_PCU_Test_CT { |
| 1096 | var RlcmacDlBlock dl_block; |
| 1097 | var PollFnCtx pollctx; |
| 1098 | var EgprsChCodingCommand last_ch_coding; |
| 1099 | var uint32_t unused_fn, sched_fn; |
| 1100 | var GprsMS ms; |
| 1101 | var CodingScheme exp_ul_mcs; |
Pau Espin Pedrol | 2354d6a | 2020-11-05 18:36:59 +0100 | [diff] [blame] | 1102 | |
| 1103 | /* Initialize GPRS MS side */ |
| 1104 | f_init_gprs_ms(); |
| 1105 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 1106 | |
| 1107 | /* Initialize the PCU interface abstraction */ |
| 1108 | f_init_raw(testcasename()); |
| 1109 | |
| 1110 | /* Set initial UL MCS to 3 */ |
| 1111 | g_mcs_initial_ul := 3; |
| 1112 | exp_ul_mcs := f_rlcmac_block_int2cs_mcs(g_mcs_initial_ul, true); |
| 1113 | f_pcuvty_set_allowed_cs_mcs(); |
| 1114 | f_pcuvty_set_link_quality_ranges(); |
| 1115 | |
| 1116 | /* Take lqual (dB->cB) so that we stay in that MCS */ |
| 1117 | ms.lqual_cb := g_mcs_lqual_ranges[2].low * 10; |
| 1118 | |
| 1119 | /* Send PACKET RESOURCE REQUEST to upgrade to EGPRS */ |
Pau Espin Pedrol | 13ab5ea | 2021-02-05 11:56:15 +0100 | [diff] [blame] | 1120 | pollctx := f_ms_establish_ul_tbf_2phase_access(ms, ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, ms_racap_egprs_def)); |
Pau Espin Pedrol | 2354d6a | 2020-11-05 18:36:59 +0100 | [diff] [blame] | 1121 | |
| 1122 | if (not match(ms.ul_tbf.tx_cs_mcs, exp_ul_mcs)) { |
| 1123 | setverdict(fail, "Wrong CS_MCS ", ms.ul_tbf.tx_cs_mcs, " received vs exp ", exp_ul_mcs); |
| 1124 | f_shutdown(__BFILE__, __LINE__); |
| 1125 | } |
| 1126 | |
| 1127 | /* Pkt Uplink Assignment above sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 1128 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), pollctx.fn, nr := pollctx.tstrxbts); |
| 1129 | |
| 1130 | /* Send UL blocks, until we receive UL ACK/NACK and check we are in same initial CS: */ |
| 1131 | while (true) { |
| 1132 | f_ms_tx_ul_data_block(ms, f_rnd_octstring(10), cv := 15); |
| 1133 | f_rx_rlcmac_dl_block(dl_block, unused_fn); |
| 1134 | if (match(dl_block, tr_RLCMAC_DUMMY_CTRL())) { |
| 1135 | continue; |
| 1136 | } |
| 1137 | |
| 1138 | if (not match(dl_block, tr_RLCMAC_UL_ACK_NACK_EGPRS(ul_tfi := ?))) { |
| 1139 | setverdict(fail, "Failed to match Packet Uplink ACK / NACK:", dl_block); |
| 1140 | f_shutdown(__BFILE__, __LINE__); |
| 1141 | break; |
| 1142 | } |
| 1143 | |
| 1144 | last_ch_coding := dl_block.ctrl.payload.u.ul_ack_nack.egprs.ch_coding_cmd; |
| 1145 | break; |
| 1146 | } |
| 1147 | if (f_rlcmac_block_EgprsChCodingCommand2cs_mcs(last_ch_coding) != exp_ul_mcs) { |
| 1148 | setverdict(fail, "Channel Coding does not match our expectations ", exp_ul_mcs, ": ", last_ch_coding); |
| 1149 | f_shutdown(__BFILE__, __LINE__); |
| 1150 | } |
| 1151 | |
| 1152 | /* Remaining UL blocks are used to make sure regardless of initial |
| 1153 | * lqual, we can go lower at any time |
| 1154 | * 0 dB, make sure we downgrade MCS */ |
| 1155 | ms.lqual_cb := 0; |
| 1156 | /* 5 UL blocks, check we are in same initial MCS: */ |
| 1157 | f_ms_tx_ul_data_block_multi(ms, 5); |
| 1158 | /* Enqueue RTS.req, expect DATA.req with UL ACK from the PCU */ |
| 1159 | f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, unused_fn); |
| 1160 | last_ch_coding := dl_block.ctrl.payload.u.ul_ack_nack.egprs.ch_coding_cmd; |
| 1161 | |
| 1162 | if (last_ch_coding != CH_CODING_MCS1) { |
| 1163 | setverdict(fail, "Channel Coding does not match our expectations (MCS-1): ", last_ch_coding); |
| 1164 | f_shutdown(__BFILE__, __LINE__); |
| 1165 | } |
| 1166 | |
| 1167 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 1168 | } |
| 1169 | |
Pau Espin Pedrol | db15fa7 | 2020-11-11 12:58:34 +0100 | [diff] [blame] | 1170 | /* Test the maximum UL MCS set by VTY works fine */ |
| 1171 | testcase TC_mcs_max_ul() runs on RAW_PCU_Test_CT { |
| 1172 | var RlcmacDlBlock dl_block; |
| 1173 | var EgprsChCodingCommand last_ch_coding; |
| 1174 | var PollFnCtx pollctx; |
| 1175 | var uint32_t unused_fn, sched_fn; |
| 1176 | var GprsMS ms; |
Pau Espin Pedrol | db15fa7 | 2020-11-11 12:58:34 +0100 | [diff] [blame] | 1177 | |
| 1178 | /* Initialize GPRS MS side */ |
| 1179 | f_init_gprs_ms(); |
| 1180 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 1181 | |
| 1182 | /* Initialize the PCU interface abstraction */ |
| 1183 | f_init_raw(testcasename()); |
| 1184 | |
| 1185 | /* Set maximum allowed UL MCS to 5 */ |
| 1186 | g_mcs_max_ul := 5; |
| 1187 | f_pcuvty_set_allowed_cs_mcs(); |
| 1188 | f_pcuvty_set_link_quality_ranges(); |
| 1189 | |
| 1190 | /* Send PACKET RESOURCE REQUEST to upgrade to EGPRS */ |
Pau Espin Pedrol | 13ab5ea | 2021-02-05 11:56:15 +0100 | [diff] [blame] | 1191 | pollctx := f_ms_establish_ul_tbf_2phase_access(ms, ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, ms_racap_egprs_def)); |
Pau Espin Pedrol | db15fa7 | 2020-11-11 12:58:34 +0100 | [diff] [blame] | 1192 | /* Pkt Uplink Assignment above sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 1193 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), pollctx.fn, nr := pollctx.tstrxbts); |
| 1194 | |
| 1195 | ms.lqual_cb := 40*10; /* 40 dB */ |
| 1196 | f_ms_tx_ul_data_block_multi(ms, 16); |
| 1197 | |
| 1198 | f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, unused_fn); |
| 1199 | last_ch_coding := dl_block.ctrl.payload.u.ul_ack_nack.egprs.ch_coding_cmd; |
| 1200 | |
| 1201 | if (last_ch_coding != CH_CODING_MCS5) { |
| 1202 | setverdict(fail, "Channel Coding does not match our expectations (MCS-5): ", last_ch_coding); |
| 1203 | f_shutdown(__BFILE__, __LINE__); |
| 1204 | } |
| 1205 | |
| 1206 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 1207 | } |
| 1208 | |
Pau Espin Pedrol | e4fa45b | 2020-11-11 13:28:31 +0100 | [diff] [blame] | 1209 | /* Test the initial DL CS set by VTY works fine */ |
| 1210 | testcase TC_mcs_initial_dl() runs on RAW_PCU_Test_CT { |
| 1211 | var octetstring data := f_rnd_octstring(10); |
| 1212 | var CodingScheme exp_dl_cs_mcs; |
| 1213 | var RlcmacDlBlock dl_block; |
| 1214 | var uint32_t poll_fn; |
| 1215 | var GprsMS ms; |
Pau Espin Pedrol | e4fa45b | 2020-11-11 13:28:31 +0100 | [diff] [blame] | 1216 | |
| 1217 | /* Initialize NS/BSSGP side */ |
| 1218 | f_init_bssgp(); |
| 1219 | /* Initialize GPRS MS side */ |
| 1220 | f_init_gprs_ms(); |
| 1221 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 1222 | |
| 1223 | /* Initialize the PCU interface abstraction */ |
| 1224 | f_init_raw(testcasename()); |
| 1225 | |
| 1226 | /* Set initial allowed DL MCS to 3 */ |
| 1227 | g_mcs_initial_dl := 3; |
| 1228 | exp_dl_cs_mcs := MCS_3; |
| 1229 | /* Set maximum allowed DL MCS to 4 */ |
| 1230 | g_mcs_max_dl := 4; |
| 1231 | f_pcuvty_set_allowed_cs_mcs(); |
| 1232 | f_pcuvty_set_link_quality_ranges(); |
| 1233 | |
| 1234 | /* Establish BSSGP connection to the PCU */ |
| 1235 | f_bssgp_establish(); |
| 1236 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 1237 | |
| 1238 | /* SGSN sends some DL data, PCU will page on CCCH (PCH) */ |
Pau Espin Pedrol | 13ab5ea | 2021-02-05 11:56:15 +0100 | [diff] [blame] | 1239 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data, bssgp_ms_racap_egprs_def)); |
Pau Espin Pedrol | e4fa45b | 2020-11-11 13:28:31 +0100 | [diff] [blame] | 1240 | f_ms_exp_dl_tbf_ass_ccch(ms, PCU_IF_SAPI_PCH); |
| 1241 | |
| 1242 | /* Wait timer X2002 and DL block is available after CCCH IMM ASS: */ |
| 1243 | f_sleep(X2002); |
| 1244 | f_rx_rlcmac_dl_block_exp_data(dl_block, poll_fn, data, 0, exp_dl_cs_mcs); |
| 1245 | |
| 1246 | /* ACK the DL block */ |
Pau Espin Pedrol | e8db673 | 2020-11-12 21:06:41 +0100 | [diff] [blame] | 1247 | f_dltbf_ack_block(ms.dl_tbf, dl_block, '1'B); |
| 1248 | f_ms_tx_ul_block(ms, f_dltbf_ts_RLCMAC_DL_ACK_NACK(ms.dl_tbf, ischosen(dl_block.data_egprs)), |
Pau Espin Pedrol | e4fa45b | 2020-11-11 13:28:31 +0100 | [diff] [blame] | 1249 | f_dl_block_ack_fn(dl_block, poll_fn)); |
| 1250 | |
| 1251 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 1252 | } |
| 1253 | |
Pau Espin Pedrol | 1b9aa78 | 2020-11-12 21:14:16 +0100 | [diff] [blame] | 1254 | /* Verify DL MCS above "mcs max" set by VTY is never used */ |
| 1255 | testcase TC_mcs_max_dl() runs on RAW_PCU_Test_CT { |
| 1256 | /* Initialize NS/BSSGP side */ |
| 1257 | f_init_bssgp(); |
| 1258 | /* Initialize GPRS MS side */ |
| 1259 | f_init_gprs_ms(); |
| 1260 | |
| 1261 | /* Initialize the PCU interface abstraction */ |
| 1262 | f_init_raw(testcasename()); |
| 1263 | |
| 1264 | /* Set maximum allowed DL CS to 3 */ |
| 1265 | g_mcs_initial_dl := 1; |
| 1266 | g_mcs_max_dl := 3; |
| 1267 | f_pcuvty_set_allowed_cs_mcs(); |
| 1268 | f_pcuvty_set_link_quality_ranges(); |
| 1269 | |
Pau Espin Pedrol | 13ab5ea | 2021-02-05 11:56:15 +0100 | [diff] [blame] | 1270 | f_dl_data_exp_cs(f_rlcmac_block_int2cs_mcs(g_mcs_max_dl, true), bssgp_ms_racap_egprs_def); |
Pau Espin Pedrol | 1b9aa78 | 2020-11-12 21:14:16 +0100 | [diff] [blame] | 1271 | } |
| 1272 | |
Pau Espin Pedrol | 1451f9f | 2021-05-11 11:52:37 +0200 | [diff] [blame] | 1273 | /* Verify PCU drops TBF after some time of inactivity. */ |
| 1274 | testcase TC_t3141() runs on RAW_PCU_Test_CT { |
| 1275 | var PCUIF_info_ind info_ind; |
| 1276 | var template (value) TsTrxBtsNum nr; |
| 1277 | var BTS_PDTCH_Block data_msg; |
| 1278 | var GprsMS ms; |
| 1279 | var uint3_t rx_usf; |
| 1280 | timer T_3141 := 1.0; |
| 1281 | var boolean ul_tbf_usf_req := false; |
| 1282 | |
| 1283 | /* Initialize NS/BSSGP side */ |
| 1284 | f_init_bssgp(); |
| 1285 | /* Initialize GPRS MS side */ |
| 1286 | f_init_gprs_ms(); |
| 1287 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 1288 | |
| 1289 | info_ind := valueof(ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
| 1290 | /* Only use 1 PDCH to simplify test: */ |
| 1291 | f_PCUIF_PDCHMask_set(info_ind, '00000001'B, 0); |
| 1292 | f_PCUIF_PDCHMask_set(info_ind, '00000000'B, (1 .. 7)); |
| 1293 | /* Initialize the PCU interface abstraction */ |
| 1294 | f_init_raw(testcasename(), info_ind); |
| 1295 | |
| 1296 | f_vty_config2(PCUVTY, {"pcu"}, "timer T3141 1"); |
| 1297 | |
| 1298 | /* Establish BSSGP connection to the PCU */ |
| 1299 | f_bssgp_establish(); |
| 1300 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 1301 | |
| 1302 | /* Establish a one-phase access Uplink TBF */ |
| 1303 | f_ms_establish_ul_tbf(ms); |
| 1304 | |
| 1305 | T_3141.start; |
| 1306 | |
| 1307 | /* Now we wait for PCU to transmit our USF */ |
| 1308 | nr := ts_TsTrxBtsNum; |
| 1309 | BTS.send(ts_PCUIF_RTS_REQ(nr.bts_nr, nr.trx_nr, nr.ts_nr, |
| 1310 | sapi := PCU_IF_SAPI_PDTCH, fn := 0, |
| 1311 | arfcn := f_trxnr2arfcn(valueof(nr.trx_nr)), |
| 1312 | block_nr := nr.blk_nr)); |
| 1313 | |
| 1314 | alt { |
| 1315 | [] BTS.receive(tr_PCUIF_DATA_PDTCH(nr.bts_nr, |
| 1316 | tr_PCUIF_DATA(nr.trx_nr, nr.ts_nr, sapi := PCU_IF_SAPI_PDTCH), |
| 1317 | ?)) -> value data_msg { |
| 1318 | if (ms.ul_tbf.usf[valueof(nr.ts_nr)] == USF_UNUSED) { |
| 1319 | setverdict(fail, "Unexpected ts_nr ", valueof(nr.ts_nr), " without USF allocated"); |
| 1320 | f_shutdown(__BFILE__, __LINE__); |
| 1321 | } |
| 1322 | |
| 1323 | rx_usf := f_rlcmac_dl_block_get_usf(data_msg.dl_block); |
| 1324 | if (rx_usf == ms.ul_tbf.usf[valueof(nr.ts_nr)]) { |
| 1325 | /* PCU requests our USF, transmit WITHOUT tlli to avoid contention resolution success */ |
| 1326 | ul_tbf_usf_req := true; |
| 1327 | f_ms_tx_ul_data_block(ms, f_rnd_octstring(10), cv := 15, with_tlli := false, fn := f_next_pdch_block(data_msg.raw.fn)) |
| 1328 | } else if (rx_usf == USF_UNUSED) { |
| 1329 | if (data_msg.raw.fn >= ms.ul_tbf.start_time_fn) { |
| 1330 | if (ul_tbf_usf_req) { |
| 1331 | /* TBF was dropped by T3141, success */ |
| 1332 | setverdict(pass); |
| 1333 | break; |
| 1334 | } else { |
| 1335 | log("PCU never requested USF, unexpected"); |
| 1336 | f_shutdown(__BFILE__, __LINE__); |
| 1337 | } |
| 1338 | } /* else: Keep waiting for TBF to be active by network */ |
| 1339 | } else { |
| 1340 | log("PCU requests ", rx_usf, ", we have ", ms.ul_tbf.usf[valueof(nr.ts_nr)]); |
| 1341 | f_shutdown(__BFILE__, __LINE__); |
| 1342 | } |
| 1343 | |
| 1344 | /* Make sure we don't receive a Ul ACK/NACK with TLLI set: */ |
| 1345 | if (match(data_msg.dl_block, |
| 1346 | tr_RLCMAC_UL_ACK_NACK_GPRS(ms.ul_tbf.tfi, |
| 1347 | tr_UlAckNackGprs(tlli := ?, |
| 1348 | acknack_desc := ?, |
| 1349 | rel99 := *)))) |
| 1350 | { |
| 1351 | log("Received UL ACK/NACK with TLLI set"); |
| 1352 | f_shutdown(__BFILE__, __LINE__); |
| 1353 | } |
| 1354 | |
| 1355 | nr := ts_TsTrxBtsNum; |
| 1356 | BTS.send(ts_PCUIF_RTS_REQ(nr.bts_nr, nr.trx_nr, nr.ts_nr, |
| 1357 | sapi := PCU_IF_SAPI_PDTCH, fn := 0, |
| 1358 | arfcn := f_trxnr2arfcn(valueof(nr.trx_nr)), |
| 1359 | block_nr := nr.blk_nr)); |
| 1360 | repeat; |
| 1361 | } |
| 1362 | [] T_3141.timeout { |
| 1363 | log("T_3141 expired but TBF is still active, unexpected"); |
| 1364 | f_shutdown(__BFILE__, __LINE__); |
| 1365 | } |
| 1366 | [] BTS.receive { |
| 1367 | /* We should never receive non-dummy messages, aka UL ACK/NACK, |
| 1368 | * because we never sent the TLLI to the PCU */ |
| 1369 | setverdict(fail, "Unexpected BTS message"); |
| 1370 | f_shutdown(__BFILE__, __LINE__); |
| 1371 | } |
| 1372 | } |
| 1373 | |
| 1374 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 1375 | } |
| 1376 | |
Pau Espin Pedrol | f30fa1d | 2021-03-03 19:55:11 +0100 | [diff] [blame] | 1377 | /* Validate what happens when RACH to get UL TBF and then PCU receives no UL |
| 1378 | * data. It should end up in N3101 reaching N3101_MAX and finally triggering |
| 1379 | * T3169. See OS#5033 */ |
| 1380 | testcase TC_n3101_max_t3169() runs on RAW_PCU_Test_CT { |
| 1381 | var PCUIF_info_ind info_ind; |
| 1382 | var template (value) TsTrxBtsNum nr; |
| 1383 | var BTS_PDTCH_Block data_msg; |
| 1384 | var GprsMS ms; |
| 1385 | var uint3_t rx_usf; |
| 1386 | const integer N3101_MAX := 9; /* N3101 shall be greater than 8 */ |
| 1387 | var integer n3101 := 0; |
| 1388 | timer T_3169 := 1.0; |
| 1389 | |
| 1390 | /* Initialize NS/BSSGP side */ |
| 1391 | f_init_bssgp(); |
| 1392 | /* Initialize GPRS MS side */ |
| 1393 | f_init_gprs_ms(); |
| 1394 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 1395 | |
| 1396 | /* Initialize the PCU interface abstraction */ |
| 1397 | info_ind := valueof(ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
| 1398 | info_ind.n3101 := N3101_MAX; |
| 1399 | info_ind.t3169 := 1; |
| 1400 | f_init_raw(testcasename(), info_ind); |
| 1401 | |
| 1402 | /* Establish BSSGP connection to the PCU */ |
| 1403 | f_bssgp_establish(); |
| 1404 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 1405 | |
| 1406 | /* Establish UL TBF */ |
| 1407 | f_ms_establish_ul_tbf(ms); |
| 1408 | |
| 1409 | /* Now we wait for PCU to transmit our USF */ |
| 1410 | nr := ts_TsTrxBtsNum; |
| 1411 | BTS.send(ts_PCUIF_RTS_REQ(nr.bts_nr, nr.trx_nr, nr.ts_nr, |
| 1412 | sapi := PCU_IF_SAPI_PDTCH, fn := 0, |
| 1413 | arfcn := f_trxnr2arfcn(valueof(nr.trx_nr)), |
| 1414 | block_nr := nr.blk_nr)); |
| 1415 | |
| 1416 | alt { |
| 1417 | [] BTS.receive(tr_PCUIF_DATA_PDTCH(nr.bts_nr, |
| 1418 | tr_PCUIF_DATA(nr.trx_nr, nr.ts_nr, sapi := PCU_IF_SAPI_PDTCH), |
| 1419 | ?)) -> value data_msg { |
| 1420 | if (ms.ul_tbf.usf[valueof(nr.ts_nr)] == USF_UNUSED) { |
| 1421 | setverdict(fail, "Unexpected ts_nr ", valueof(nr.ts_nr), " without USF allocated"); |
| 1422 | f_shutdown(__BFILE__, __LINE__); |
| 1423 | } |
| 1424 | |
| 1425 | rx_usf := f_rlcmac_dl_block_get_usf(data_msg.dl_block); |
| 1426 | if (rx_usf == ms.ul_tbf.usf[valueof(nr.ts_nr)]) { |
| 1427 | log("PCU requests our USF ", rx_usf, ", n3101=", n3101); |
| 1428 | n3101 := n3101 + 1; |
Pau Espin Pedrol | 73c5d37 | 2021-03-24 18:48:24 +0100 | [diff] [blame] | 1429 | if (n3101 > N3101_MAX + 1) { //+1: DL<->UL FN offset |
| 1430 | setverdict(fail, "Reached ", n3101, " > ", N3101_MAX + 1, " (N3101_MAX+1) and PCU still sends us USFs"); |
Pau Espin Pedrol | f30fa1d | 2021-03-03 19:55:11 +0100 | [diff] [blame] | 1431 | f_shutdown(__BFILE__, __LINE__); |
| 1432 | } |
Pau Espin Pedrol | 73c5d37 | 2021-03-24 18:48:24 +0100 | [diff] [blame] | 1433 | } else if (rx_usf == USF_UNUSED and n3101 == N3101_MAX + 1) { |
Pau Espin Pedrol | f30fa1d | 2021-03-03 19:55:11 +0100 | [diff] [blame] | 1434 | /* If we already received USFs for us and we don't receive them anymore, that means the TBF entered T3169 */ |
| 1435 | log("PCU stopped requesting USF ", ms.ul_tbf.usf[valueof(nr.ts_nr)]); |
| 1436 | if (not T_3169.running) { |
| 1437 | log("T3169 started"); |
| 1438 | T_3169.start; |
| 1439 | } |
| 1440 | } else if(rx_usf == USF_UNUSED and n3101 > 0) { |
| 1441 | setverdict(fail, "PCU stopped requesting USFs too early: ", n3101, " < ", N3101_MAX, " (N3101_MAX)"); |
| 1442 | f_shutdown(__BFILE__, __LINE__); |
| 1443 | } else { |
| 1444 | log("PCU requests ", rx_usf, ", we have ", ms.ul_tbf.usf[valueof(nr.ts_nr)]); |
| 1445 | } |
| 1446 | nr := ts_TsTrxBtsNum; |
| 1447 | BTS.send(ts_PCUIF_RTS_REQ(nr.bts_nr, nr.trx_nr, nr.ts_nr, |
| 1448 | sapi := PCU_IF_SAPI_PDTCH, fn := 0, |
| 1449 | arfcn := f_trxnr2arfcn(valueof(nr.trx_nr)), |
| 1450 | block_nr := nr.blk_nr)); |
| 1451 | repeat; |
| 1452 | } |
| 1453 | [] T_3169.timeout { |
| 1454 | log("T_3169 expired"); |
| 1455 | /* Done in alt */ |
| 1456 | } |
| 1457 | [] BTS.receive { |
| 1458 | setverdict(fail, "Unexpected BTS message"); |
| 1459 | f_shutdown(__BFILE__, __LINE__); |
| 1460 | } |
| 1461 | } |
| 1462 | |
| 1463 | /* Now that T3169 has expired, establishing a Ul TBF should provide same |
| 1464 | /* USFs as per previous TBF since they were freed at expiration time: */ |
| 1465 | var uint3_t old_usf[8] := ms.ul_tbf.usf; |
| 1466 | var uint5_t old_tfi := ms.ul_tbf.tfi; |
| 1467 | f_ms_establish_ul_tbf(ms); |
| 1468 | if (old_tfi != ms.ul_tbf.tfi) { |
| 1469 | setverdict(fail, "Unexpected TFI change: ", ms.ul_tbf.tfi, " vs exp ", old_tfi); |
| 1470 | f_shutdown(__BFILE__, __LINE__); |
| 1471 | } |
| 1472 | for (var integer i := 0; i < 8; i := i +1) { |
| 1473 | if (ms.ul_tbf.usf[i] != old_usf[i]) { |
| 1474 | setverdict(fail, "Unexpected USF change: ", ms.ul_tbf.usf[i], " vs exp ", old_usf[i]); |
| 1475 | f_shutdown(__BFILE__, __LINE__); |
| 1476 | } |
| 1477 | } |
| 1478 | |
| 1479 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 1480 | } |
| 1481 | |
Pau Espin Pedrol | cc895df | 2021-04-20 12:58:32 +0200 | [diff] [blame] | 1482 | |
| 1483 | /* Verify after N3103_MAX is reached, T3169 is started and upon timeout TBF is |
| 1484 | freed and no longer available. Trigger it by sending a few UL blocks CTRL ACKING |
| 1485 | the final UL ACK sent at us. */ |
| 1486 | testcase TC_n3103_max_t3169() runs on RAW_PCU_Test_CT { |
| 1487 | var PCUIF_info_ind info_ind; |
| 1488 | var BTS_PDTCH_Block data_msg; |
| 1489 | var RlcmacDlBlock dl_block; |
| 1490 | var uint32_t sched_fn; |
| 1491 | var template (value) TsTrxBtsNum nr; |
| 1492 | var template RlcmacDlBlock exp_ul_ack; |
| 1493 | var template UlAckNackGprs exp_ul_ack_sub; |
| 1494 | var GprsMS ms; |
| 1495 | const integer N3103_MAX := 2; /* N3103 is usually somewhere 2-5 */ |
| 1496 | var integer N3103 := 0; |
| 1497 | timer T_3169 := 1.0; |
| 1498 | |
| 1499 | /* Initialize GPRS MS side */ |
| 1500 | f_init_gprs_ms(); |
| 1501 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 1502 | |
| 1503 | /* Initialize the PCU interface abstraction */ |
| 1504 | info_ind := valueof(ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
| 1505 | info_ind.n3103 := N3103_MAX; |
| 1506 | info_ind.t3169 := 1; |
| 1507 | f_init_raw(testcasename(), info_ind); |
| 1508 | |
| 1509 | /* Establish an Uplink TBF */ |
| 1510 | f_ms_establish_ul_tbf(ms); |
| 1511 | |
Pau Espin Pedrol | 93ae452 | 2021-05-11 15:58:26 +0200 | [diff] [blame] | 1512 | f_ms_tx_ul_data_block_multi(ms, 5, with_tlli := true); |
Pau Espin Pedrol | cc895df | 2021-04-20 12:58:32 +0200 | [diff] [blame] | 1513 | exp_ul_ack_sub := tr_UlAckNackGprs(*, tr_AckNackDescription('1'B), *); |
| 1514 | exp_ul_ack := tr_RLCMAC_UL_ACK_NACK_GPRS(ms.ul_tbf.tfi, exp_ul_ack_sub); |
| 1515 | |
| 1516 | nr := ts_TsTrxBtsNum; |
| 1517 | BTS.send(ts_PCUIF_RTS_REQ(nr.bts_nr, nr.trx_nr, nr.ts_nr, |
| 1518 | sapi := PCU_IF_SAPI_PDTCH, fn := 0, |
| 1519 | arfcn := f_trxnr2arfcn(valueof(nr.trx_nr)), |
| 1520 | block_nr := nr.blk_nr)); |
| 1521 | alt { |
| 1522 | [N3103 < N3103_MAX] BTS.receive(tr_PCUIF_DATA_PDTCH(nr.bts_nr, |
| 1523 | tr_PCUIF_DATA(nr.trx_nr, nr.ts_nr, sapi := PCU_IF_SAPI_PDTCH), |
| 1524 | exp_ul_ack)) -> value data_msg { |
| 1525 | if (not f_dl_block_rrbp_valid(data_msg.dl_block)) { |
| 1526 | setverdict(fail, "Unexpected DL BLOCK has no RRBP: ", data_msg.dl_block); |
| 1527 | f_shutdown(__BFILE__, __LINE__); |
| 1528 | } |
| 1529 | |
| 1530 | nr := ts_TsTrxBtsNum; |
| 1531 | BTS.send(ts_PCUIF_RTS_REQ(nr.bts_nr, nr.trx_nr, nr.ts_nr, |
| 1532 | sapi := PCU_IF_SAPI_PDTCH, fn := 0, |
| 1533 | arfcn := f_trxnr2arfcn(valueof(nr.trx_nr)), |
| 1534 | block_nr := nr.blk_nr)); |
| 1535 | N3103 := N3103 + 1; |
| 1536 | if (N3103 == N3103_MAX) { |
| 1537 | /* At this point in time (N3103_MAX reached), PCU is |
| 1538 | * moving the TBF to RELEASE state so no data/ctrl for |
| 1539 | * it is tx'ed, hence the dummy blocks: */ |
| 1540 | T_3169.start; |
| 1541 | } |
| 1542 | repeat; |
| 1543 | } |
| 1544 | [N3103 >= N3103_MAX] BTS.receive(tr_PCUIF_DATA_PDTCH(nr.bts_nr, |
| 1545 | tr_PCUIF_DATA(nr.trx_nr, nr.ts_nr, sapi := PCU_IF_SAPI_PDTCH), |
| 1546 | exp_ul_ack)) -> value data_msg { |
| 1547 | setverdict(fail, "Unexpected UL ACK/NACK after reaching N3103_MAX"); |
| 1548 | f_shutdown(__BFILE__, __LINE__); |
| 1549 | } |
| 1550 | [] as_ms_rx_ignore_dummy(ms, nr); |
| 1551 | [T_3169.running] T_3169.timeout { |
| 1552 | log("T_3169 timeout"); |
| 1553 | /* Done in alt, wait for pending RTS initiated previously in |
| 1554 | * above case before continuing (expect /* Dummy block): */ |
| 1555 | BTS.receive(tr_PCUIF_DATA_PDTCH(nr.bts_nr, |
| 1556 | tr_PCUIF_DATA(nr.trx_nr, nr.ts_nr, sapi := PCU_IF_SAPI_PDTCH), |
| 1557 | tr_RLCMAC_DUMMY_CTRL)); |
| 1558 | } |
| 1559 | [] BTS.receive { |
| 1560 | setverdict(fail, "Unexpected BTS message"); |
| 1561 | f_shutdown(__BFILE__, __LINE__); |
| 1562 | } |
| 1563 | } |
| 1564 | |
| 1565 | /* Now that T3169 has expired, establishing a Ul TBF should provide same |
| 1566 | * USFs as per previous TBF since they were freed at expiration time: */ |
| 1567 | var uint3_t old_usf[8] := ms.ul_tbf.usf; |
| 1568 | var uint5_t old_tfi := ms.ul_tbf.tfi; |
| 1569 | f_ms_establish_ul_tbf(ms); |
| 1570 | if (old_tfi != ms.ul_tbf.tfi) { |
| 1571 | setverdict(fail, "Unexpected TFI change: ", ms.ul_tbf.tfi, " vs exp ", old_tfi); |
| 1572 | f_shutdown(__BFILE__, __LINE__); |
| 1573 | } |
| 1574 | for (var integer i := 0; i < 8; i := i +1) { |
| 1575 | if (ms.ul_tbf.usf[i] != old_usf[i]) { |
| 1576 | setverdict(fail, "Unexpected USF change: ", ms.ul_tbf.usf[i], " vs exp ", old_usf[i]); |
| 1577 | f_shutdown(__BFILE__, __LINE__); |
| 1578 | } |
| 1579 | } |
| 1580 | |
| 1581 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 1582 | } |
| 1583 | |
Pau Espin Pedrol | 84a8c3c | 2021-03-01 17:22:29 +0100 | [diff] [blame] | 1584 | /* Verify that a Downlink TBF is kept available until T3191 fires, at which |
| 1585 | * point the TBF is no longer available. In order to get to start of T3191, we |
| 1586 | * have to wait for x2031 since that marks the IDLE TBF time, that is, the delay |
| 1587 | * until TBF release procedure starts after draining DL queue. */ |
| 1588 | testcase TC_x2031_t3191() runs on RAW_PCU_Test_CT { |
| 1589 | var PCUIF_info_ind info_ind; |
| 1590 | var RlcmacDlBlock dl_block; |
| 1591 | var octetstring data1 := f_rnd_octstring(200); |
| 1592 | var octetstring data2 := f_rnd_octstring(10); |
| 1593 | var uint32_t dl_fn; |
| 1594 | var template (value) TsTrxBtsNum nr; |
| 1595 | var BTS_PDTCH_Block data_msg; |
| 1596 | var GprsMS ms; |
| 1597 | |
| 1598 | /* Initialize NS/BSSGP side */ |
| 1599 | f_init_bssgp(); |
| 1600 | /* Initialize GPRS MS side */ |
| 1601 | f_init_gprs_ms(); |
| 1602 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 1603 | |
| 1604 | /* Initialize the PCU interface abstraction */ |
| 1605 | info_ind := valueof(ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
| 1606 | /* Set timer to 1 sec (default 5) to speedup test: */ |
| 1607 | info_ind.t3191 := 1; |
| 1608 | f_init_raw(testcasename(), info_ind); |
| 1609 | |
| 1610 | /* Establish BSSGP connection to the PCU */ |
| 1611 | f_bssgp_establish(); |
| 1612 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 1613 | |
| 1614 | /* SGSN sends some DL data, PCU will page on CCCH (PCH) */ |
| 1615 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data1)); |
| 1616 | f_ms_exp_dl_tbf_ass_ccch(ms, PCU_IF_SAPI_PCH); |
| 1617 | |
| 1618 | /* Wait timer X2002 and DL block is available after CCCH IMM ASS: */ |
| 1619 | f_sleep(X2002); |
| 1620 | |
| 1621 | while (true) { |
| 1622 | f_rx_rlcmac_dl_block_exp_data(dl_block, dl_fn, ?, ?); |
| 1623 | |
| 1624 | /* Keep Ack/Nack description updated (except for last BSN) */ |
| 1625 | f_acknackdesc_ack_block(ms.dl_tbf.acknack_desc, dl_block); |
| 1626 | |
| 1627 | if (f_dl_block_rrbp_valid(dl_block)) { |
| 1628 | f_ms_tx_ul_block(ms, ts_RLCMAC_DL_ACK_NACK(ms.dl_tbf.tfi, ms.dl_tbf.acknack_desc), |
| 1629 | f_dl_block_ack_fn(dl_block, dl_fn)); |
| 1630 | break; |
| 1631 | } |
| 1632 | } |
| 1633 | |
| 1634 | /* Now we wait for IDLE TBF timer (X2031) to time out and receive a FINAL ACK */ |
| 1635 | nr := ts_TsTrxBtsNum; |
| 1636 | BTS.send(ts_PCUIF_RTS_REQ(nr.bts_nr, nr.trx_nr, nr.ts_nr, |
| 1637 | sapi := PCU_IF_SAPI_PDTCH, fn := 0, |
| 1638 | arfcn := f_trxnr2arfcn(valueof(nr.trx_nr)), |
| 1639 | block_nr := nr.blk_nr)); |
| 1640 | alt { |
| 1641 | [] as_ms_rx_ignore_dummy(ms, nr); |
| 1642 | [] BTS.receive(tr_PCUIF_DATA_PDTCH(nr.bts_nr, |
| 1643 | tr_PCUIF_DATA(nr.trx_nr, nr.ts_nr, sapi := PCU_IF_SAPI_PDTCH), |
| 1644 | ?)) -> value data_msg { |
| 1645 | if (data_msg.dl_block.data.mac_hdr.hdr_ext.fbi) { |
| 1646 | log("Received FINAL_ACK"); |
| 1647 | ms.dl_tbf.acknack_desc.final_ack := '1'B; |
| 1648 | break; |
| 1649 | } |
| 1650 | if (f_dl_block_rrbp_valid(data_msg.dl_block)) { |
| 1651 | f_acknackdesc_ack_block(ms.dl_tbf.acknack_desc, data_msg.dl_block); |
| 1652 | f_ms_tx_ul_block(ms, ts_RLCMAC_DL_ACK_NACK(ms.dl_tbf.tfi, ms.dl_tbf.acknack_desc), |
| 1653 | f_dl_block_ack_fn(dl_block, data_msg.raw.fn)); |
| 1654 | } |
| 1655 | nr := ts_TsTrxBtsNum; |
| 1656 | BTS.send(ts_PCUIF_RTS_REQ(nr.bts_nr, nr.trx_nr, nr.ts_nr, |
| 1657 | sapi := PCU_IF_SAPI_PDTCH, fn := 0, |
| 1658 | arfcn := f_trxnr2arfcn(valueof(nr.trx_nr)), |
| 1659 | block_nr := nr.blk_nr)); |
| 1660 | repeat; |
| 1661 | } |
| 1662 | [] BTS.receive { |
| 1663 | setverdict(fail, "Unexpected BTS message"); |
| 1664 | f_shutdown(__BFILE__, __LINE__); |
| 1665 | } |
| 1666 | } |
| 1667 | |
| 1668 | /* Avoid ACKing the last RLC data block on purpose here, wait for t3191 |
| 1669 | to time out. We simply sleep instead of requesting blocks because |
| 1670 | otherwise retransmissions would keep restarting the timer. */ |
| 1671 | f_sleep(int2float(info_ind.t3191)); |
| 1672 | |
| 1673 | /* The TBF should be freed now, so new data should trigger an Assignment: */ |
| 1674 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data2)); |
| 1675 | f_ms_exp_dl_tbf_ass_ccch(ms, PCU_IF_SAPI_PCH); |
| 1676 | |
| 1677 | /* Wait timer X2002 and DL block is available after CCCH IMM ASS: */ |
| 1678 | f_sleep(X2002); |
| 1679 | /* Now that we confirmed the new assignment in the dl-tbf, lets receive the data and ack it */ |
| 1680 | f_rx_rlcmac_dl_block_exp_data(dl_block, dl_fn, data2, 0); |
| 1681 | f_acknackdesc_ack_block(ms.dl_tbf.acknack_desc, dl_block, '1'B); |
| 1682 | f_ms_tx_ul_block(ms, ts_RLCMAC_DL_ACK_NACK(ms.dl_tbf.tfi, ms.dl_tbf.acknack_desc), |
| 1683 | f_dl_block_ack_fn(dl_block, dl_fn)); |
| 1684 | |
| 1685 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 1686 | } |
| 1687 | |
| 1688 | /* Same as TC_zero_x2031_t3191, but this time without x2031 (immediate FINAL_ACK). */ |
| 1689 | testcase TC_zero_x2031_t3191() runs on RAW_PCU_Test_CT { |
| 1690 | var PCUIF_info_ind info_ind; |
| 1691 | var RlcmacDlBlock dl_block; |
| 1692 | var octetstring data1 := f_rnd_octstring(1400); |
| 1693 | var octetstring data2 := f_rnd_octstring(10); |
| 1694 | var uint32_t dl_fn; |
| 1695 | var GprsMS ms; |
| 1696 | |
| 1697 | /* Initialize NS/BSSGP side */ |
| 1698 | f_init_bssgp(); |
| 1699 | /* Initialize GPRS MS side */ |
| 1700 | f_init_gprs_ms(); |
| 1701 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 1702 | |
| 1703 | /* Initialize the PCU interface abstraction */ |
| 1704 | info_ind := valueof(ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
| 1705 | /* Set timer to 1 sec (default 5) to speedup test: */ |
| 1706 | info_ind.t3191 := 1; |
| 1707 | f_init_raw(testcasename(), info_ind); |
| 1708 | |
| 1709 | f_vty_config2(PCUVTY, {"pcu"}, "timer X2031 0"); |
| 1710 | |
| 1711 | /* Establish BSSGP connection to the PCU */ |
| 1712 | f_bssgp_establish(); |
| 1713 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 1714 | |
| 1715 | /* SGSN sends some DL data, PCU will page on CCCH (PCH) */ |
| 1716 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data1)); |
| 1717 | f_ms_exp_dl_tbf_ass_ccch(ms, PCU_IF_SAPI_PCH); |
| 1718 | |
| 1719 | /* Wait timer X2002 and DL block is available after CCCH IMM ASS: */ |
| 1720 | f_sleep(X2002); |
| 1721 | |
| 1722 | /* Send enough DL data to at least be able to DL ACK once (excl the |
| 1723 | * FINAL_ACK one), so that PCU sees we are listening in PDCH and avoids |
| 1724 | * other code paths like trying to Imm Assign on CCCH again, etc.. */ |
| 1725 | while (true) { |
| 1726 | f_rx_rlcmac_dl_block_exp_data(dl_block, dl_fn, ?, ?); |
| 1727 | |
| 1728 | if (dl_block.data.mac_hdr.hdr_ext.fbi) { |
| 1729 | log("Received FINAL_ACK"); |
| 1730 | ms.dl_tbf.acknack_desc.final_ack := '1'B; |
| 1731 | break; |
| 1732 | } |
| 1733 | |
| 1734 | /* Keep Ack/Nack description updated (except for last BSN) */ |
| 1735 | f_acknackdesc_ack_block(ms.dl_tbf.acknack_desc, dl_block); |
| 1736 | |
| 1737 | if (f_dl_block_rrbp_valid(dl_block)) { |
| 1738 | f_ms_tx_ul_block(ms, ts_RLCMAC_DL_ACK_NACK(ms.dl_tbf.tfi, ms.dl_tbf.acknack_desc), |
| 1739 | f_dl_block_ack_fn(dl_block, dl_fn)); |
| 1740 | } |
| 1741 | } |
| 1742 | |
| 1743 | /* Avoid ACKing the last RLC data block on purpose here, wait for t3191 |
| 1744 | to time out. We simply sleep instead of requesting blocks because |
| 1745 | otherwise retransmissions would keep restarting the timer. */ |
| 1746 | f_sleep(int2float(info_ind.t3191)); |
| 1747 | |
| 1748 | /* The TBF should be freed now, so new data should trigger an Assignment: */ |
| 1749 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data2)); |
| 1750 | f_ms_exp_dl_tbf_ass_ccch(ms, PCU_IF_SAPI_PCH); |
| 1751 | |
| 1752 | /* Wait timer X2002 and DL block is available after CCCH IMM ASS: */ |
| 1753 | f_sleep(X2002); |
| 1754 | /* Now that we confirmed the new assignment in the dl-tbf, lets receive the data and ack it */ |
| 1755 | f_rx_rlcmac_dl_block_exp_data(dl_block, dl_fn, data2, 0); |
| 1756 | f_acknackdesc_ack_block(ms.dl_tbf.acknack_desc, dl_block, '1'B); |
| 1757 | f_ms_tx_ul_block(ms, ts_RLCMAC_DL_ACK_NACK(ms.dl_tbf.tfi, ms.dl_tbf.acknack_desc), |
| 1758 | f_dl_block_ack_fn(dl_block, dl_fn)); |
| 1759 | |
| 1760 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 1761 | } |
| 1762 | |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 1763 | /* Verify that a Downlink TBF can be assigned using PACCH shortly after the |
| 1764 | * release of prev DL TBF due to MS staying in PDCH for a while (T3192, in PCU |
| 1765 | * T3193) after DL TBF release */ |
| 1766 | testcase TC_t3193() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 1767 | var RlcmacDlBlock dl_block; |
| 1768 | var octetstring data := f_rnd_octstring(10); |
| 1769 | var boolean ok; |
| 1770 | var uint32_t sched_fn; |
Vadim Yanitskiy | b6733a6 | 2020-05-10 14:39:00 +0700 | [diff] [blame] | 1771 | var uint32_t dl_fn; |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 1772 | var GprsMS ms; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 1773 | var AckNackDescription ack_nack_desc := valueof(t_AckNackDescription_init); |
| 1774 | |
| 1775 | /* Initialize NS/BSSGP side */ |
| 1776 | f_init_bssgp(); |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 1777 | /* Initialize GPRS MS side */ |
| 1778 | f_init_gprs_ms(); |
| 1779 | ms := g_ms[0]; /* We only use first MS in this test */ |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 1780 | |
| 1781 | /* Initialize the PCU interface abstraction */ |
| 1782 | f_init_raw(testcasename()); |
| 1783 | |
| 1784 | /* Establish BSSGP connection to the PCU */ |
| 1785 | f_bssgp_establish(); |
Pau Espin Pedrol | 7b761e2 | 2021-01-11 14:43:35 +0100 | [diff] [blame] | 1786 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 1787 | |
| 1788 | /* SGSN sends some DL data, PCU will page on CCCH (PCH) */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 1789 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data)); |
| 1790 | f_ms_exp_dl_tbf_ass_ccch(ms, PCU_IF_SAPI_PCH); |
Vadim Yanitskiy | 2e213ae | 2020-05-06 22:26:17 +0700 | [diff] [blame] | 1791 | |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 1792 | /* Wait timer X2002 and DL block is available after CCCH IMM ASS: */ |
| 1793 | f_sleep(X2002); |
Vadim Yanitskiy | b6733a6 | 2020-05-10 14:39:00 +0700 | [diff] [blame] | 1794 | f_rx_rlcmac_dl_block_exp_data(dl_block, dl_fn, data, 0); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 1795 | |
| 1796 | /* ACK the DL block */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 1797 | f_acknackdesc_ack_block(ms.dl_tbf.acknack_desc, dl_block, '1'B); |
| 1798 | f_ms_tx_ul_block(ms, ts_RLCMAC_DL_ACK_NACK(ms.dl_tbf.tfi, ms.dl_tbf.acknack_desc), |
| 1799 | f_dl_block_ack_fn(dl_block, dl_fn)); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 1800 | |
| 1801 | /* Now that final DL block is ACKED and TBF is released, T3193 in PCU |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 1802 | (T3192 in MS) was started and until it fires the MS will be available |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 1803 | on PDCH in case new data arrives from SGSN. Let's verify it: */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 1804 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data)); |
Vadim Yanitskiy | 7431e9e | 2020-07-21 01:59:17 +0700 | [diff] [blame] | 1805 | f_ms_rx_pkt_ass_pacch(ms, sched_fn, tr_RLCMAC_DL_PACKET_ASS); |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 1806 | |
| 1807 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 1808 | |
| 1809 | /* Now that we confirmed the new assignment in the dl-tbf, lets receive the data and ack it */ |
Vadim Yanitskiy | b6733a6 | 2020-05-10 14:39:00 +0700 | [diff] [blame] | 1810 | f_rx_rlcmac_dl_block_exp_data(dl_block, dl_fn, data, 0); |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 1811 | f_acknackdesc_ack_block(ms.dl_tbf.acknack_desc, dl_block, '1'B); |
| 1812 | f_ms_tx_ul_block(ms, ts_RLCMAC_DL_ACK_NACK(ms.dl_tbf.tfi, ms.dl_tbf.acknack_desc), |
| 1813 | f_dl_block_ack_fn(dl_block, dl_fn)); |
Vadim Yanitskiy | 91f8a09 | 2020-05-06 21:41:05 +0700 | [diff] [blame] | 1814 | |
| 1815 | f_shutdown(__BFILE__, __LINE__, final := true); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 1816 | } |
| 1817 | |
Pau Espin Pedrol | 14ca7e3 | 2021-03-01 17:41:21 +0100 | [diff] [blame] | 1818 | /* Verify after N3105_MAX is reached, T3195 is started and upon timeout TBF is |
| 1819 | freed and no longer available. Trigger it by sending DL blocks and never DL |
| 1820 | ACKing the data (which are requested through RRBP) */ |
| 1821 | testcase TC_n3105_max_t3195() runs on RAW_PCU_Test_CT { |
| 1822 | var PCUIF_info_ind info_ind; |
| 1823 | var RlcmacDlBlock dl_block; |
| 1824 | var octetstring data1 := f_rnd_octstring(1000); |
| 1825 | var octetstring data2 := f_rnd_octstring(10); |
| 1826 | var uint32_t dl_fn; |
| 1827 | var template (value) TsTrxBtsNum nr; |
| 1828 | var BTS_PDTCH_Block data_msg; |
| 1829 | var GprsMS ms; |
| 1830 | const integer N3105_MAX := 2; |
| 1831 | var integer N3105 := 0; |
| 1832 | timer T_3195 := 1.0; |
| 1833 | var integer num_poll_recv := 0; |
| 1834 | |
| 1835 | /* Initialize NS/BSSGP side */ |
| 1836 | f_init_bssgp(); |
| 1837 | /* Initialize GPRS MS side */ |
| 1838 | f_init_gprs_ms(); |
| 1839 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 1840 | |
| 1841 | /* Initialize the PCU interface abstraction */ |
| 1842 | info_ind := valueof(ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
| 1843 | /* Speedup test: */ |
| 1844 | info_ind.n3105 := N3105_MAX; |
| 1845 | info_ind.t3195 := 1; |
| 1846 | f_init_raw(testcasename(), info_ind); |
| 1847 | |
| 1848 | /* Disable "MS delay release" timer, to avoid old DL data kept in cached |
| 1849 | * MS and retransmitted after the TBF is released and later on created |
| 1850 | * (because the MS is reused) */ |
| 1851 | f_vty_config2(PCUVTY, {"pcu"}, "timer X2030 0"); |
| 1852 | |
| 1853 | /* Establish BSSGP connection to the PCU */ |
| 1854 | f_bssgp_establish(); |
| 1855 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 1856 | |
| 1857 | /* SGSN sends some DL data, PCU will page on CCCH (PCH) */ |
| 1858 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data1)); |
| 1859 | f_ms_exp_dl_tbf_ass_ccch(ms, PCU_IF_SAPI_PCH); |
| 1860 | |
| 1861 | /* Wait timer X2002 and DL block is available after CCCH IMM ASS: */ |
| 1862 | f_sleep(X2002); |
| 1863 | |
| 1864 | /* Now we go on receiving DL data and not answering RRBP: */ |
| 1865 | nr := ts_TsTrxBtsNum; |
| 1866 | BTS.send(ts_PCUIF_RTS_REQ(nr.bts_nr, nr.trx_nr, nr.ts_nr, |
| 1867 | sapi := PCU_IF_SAPI_PDTCH, fn := 0, |
| 1868 | arfcn := f_trxnr2arfcn(valueof(nr.trx_nr)), |
| 1869 | block_nr := nr.blk_nr)); |
| 1870 | alt { |
| 1871 | [not T_3195.running] BTS.receive(tr_PCUIF_DATA_PDTCH(nr.bts_nr, |
| 1872 | tr_PCUIF_DATA(nr.trx_nr, nr.ts_nr, sapi := PCU_IF_SAPI_PDTCH), |
| 1873 | tr_RLCMAC_DATA)) -> value data_msg { |
| 1874 | if (f_dl_block_rrbp_valid(data_msg.dl_block)) { |
| 1875 | if (num_poll_recv == 0) { |
| 1876 | /* ACK first one so PCU detects we are there and doesn't retransmit Imm Ass */ |
| 1877 | f_acknackdesc_ack_block(ms.dl_tbf.acknack_desc, data_msg.dl_block); |
| 1878 | f_ms_tx_ul_block(ms, ts_RLCMAC_DL_ACK_NACK(ms.dl_tbf.tfi, ms.dl_tbf.acknack_desc), |
| 1879 | f_dl_block_ack_fn(data_msg.dl_block, data_msg.raw.fn)); |
| 1880 | } else { |
| 1881 | log("Ignoring RRBP ", num_poll_recv); |
| 1882 | N3105 := N3105 + 1; |
| 1883 | } |
| 1884 | num_poll_recv := num_poll_recv + 1; |
| 1885 | } |
| 1886 | |
| 1887 | nr := ts_TsTrxBtsNum; |
| 1888 | BTS.send(ts_PCUIF_RTS_REQ(nr.bts_nr, nr.trx_nr, nr.ts_nr, |
| 1889 | sapi := PCU_IF_SAPI_PDTCH, fn := 0, |
| 1890 | arfcn := f_trxnr2arfcn(valueof(nr.trx_nr)), |
| 1891 | block_nr := nr.blk_nr)); |
| 1892 | repeat; |
| 1893 | } |
| 1894 | /* At this point in time (N3105_MAX reached), PCU already moved TBF to |
| 1895 | * RELEASE state so no data for it is tx'ed, hence the dummy blocks: |
| 1896 | */ |
| 1897 | [N3105 == N3105_MAX] BTS.receive(tr_PCUIF_DATA_PDTCH(nr.bts_nr, |
| 1898 | tr_PCUIF_DATA(nr.trx_nr, nr.ts_nr, sapi := PCU_IF_SAPI_PDTCH), |
| 1899 | tr_RLCMAC_DUMMY_CTRL)) -> value data_msg { |
| 1900 | if (not T_3195.running) { |
| 1901 | T_3195.start; |
| 1902 | /* We even send some new data, nothing should be sent to MS */ |
| 1903 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data1)); |
| 1904 | } |
| 1905 | nr := ts_TsTrxBtsNum; |
| 1906 | BTS.send(ts_PCUIF_RTS_REQ(nr.bts_nr, nr.trx_nr, nr.ts_nr, |
| 1907 | sapi := PCU_IF_SAPI_PDTCH, fn := 0, |
| 1908 | arfcn := f_trxnr2arfcn(valueof(nr.trx_nr)), |
| 1909 | block_nr := nr.blk_nr)); |
| 1910 | repeat; |
| 1911 | } |
Pau Espin Pedrol | bf8c71f | 2021-04-20 12:23:28 +0200 | [diff] [blame] | 1912 | [T_3195.running] T_3195.timeout { |
Pau Espin Pedrol | 14ca7e3 | 2021-03-01 17:41:21 +0100 | [diff] [blame] | 1913 | log("T_3195 timeout"); |
Pau Espin Pedrol | bf8c71f | 2021-04-20 12:23:28 +0200 | [diff] [blame] | 1914 | /* Done in alt, wait for pending RTS initiated previously in |
| 1915 | * above case before continuing (expect /* Dummy block): */ |
| 1916 | BTS.receive(tr_PCUIF_DATA_PDTCH(nr.bts_nr, |
| 1917 | tr_PCUIF_DATA(nr.trx_nr, nr.ts_nr, sapi := PCU_IF_SAPI_PDTCH), |
| 1918 | tr_RLCMAC_DUMMY_CTRL)); |
Pau Espin Pedrol | 14ca7e3 | 2021-03-01 17:41:21 +0100 | [diff] [blame] | 1919 | } |
| 1920 | [] BTS.receive { |
| 1921 | setverdict(fail, "Unexpected BTS message"); |
| 1922 | f_shutdown(__BFILE__, __LINE__); |
| 1923 | } |
| 1924 | } |
| 1925 | |
| 1926 | /* after T_3195 timeout, TBF is released */ |
| 1927 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data2)); |
| 1928 | f_ms_exp_dl_tbf_ass_ccch(ms, PCU_IF_SAPI_PCH); |
| 1929 | |
| 1930 | /* Wait timer X2002 and DL block is available after CCCH IMM ASS: */ |
| 1931 | f_sleep(X2002); |
| 1932 | f_rx_rlcmac_dl_block_exp_data(dl_block, dl_fn, data2, 0); |
| 1933 | |
| 1934 | /* ACK the DL block */ |
| 1935 | f_acknackdesc_ack_block(ms.dl_tbf.acknack_desc, dl_block, '1'B); |
| 1936 | f_ms_tx_ul_block(ms, ts_RLCMAC_DL_ACK_NACK(ms.dl_tbf.tfi, ms.dl_tbf.acknack_desc), |
| 1937 | f_dl_block_ack_fn(dl_block, dl_fn)); |
| 1938 | |
| 1939 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 1940 | } |
| 1941 | |
Pau Espin Pedrol | 487d634 | 2020-05-14 19:22:33 +0200 | [diff] [blame] | 1942 | /* Verify PCU handles correctly Countdown Procedure based on BS_CV_MAX */ |
| 1943 | testcase TC_countdown_procedure() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | 487d634 | 2020-05-14 19:22:33 +0200 | [diff] [blame] | 1944 | var RlcmacDlBlock dl_block; |
Pau Espin Pedrol | 487d634 | 2020-05-14 19:22:33 +0200 | [diff] [blame] | 1945 | var uint32_t sched_fn; |
Pau Espin Pedrol | 487d634 | 2020-05-14 19:22:33 +0200 | [diff] [blame] | 1946 | var octetstring total_payload; |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 1947 | var GprsMS ms; |
Pau Espin Pedrol | 487d634 | 2020-05-14 19:22:33 +0200 | [diff] [blame] | 1948 | |
| 1949 | /* Initialize NS/BSSGP side */ |
| 1950 | f_init_bssgp(); |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 1951 | /* Initialize GPRS MS side */ |
| 1952 | f_init_gprs_ms(); |
| 1953 | ms := g_ms[0]; /* We only use first MS in this test */ |
Pau Espin Pedrol | 487d634 | 2020-05-14 19:22:33 +0200 | [diff] [blame] | 1954 | |
| 1955 | /* Initialize the PCU interface abstraction */ |
Pau Espin Pedrol | 745a48b | 2020-10-30 15:31:07 +0100 | [diff] [blame] | 1956 | f_init_raw(testcasename(), ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
Pau Espin Pedrol | 487d634 | 2020-05-14 19:22:33 +0200 | [diff] [blame] | 1957 | |
| 1958 | /* Establish BSSGP connection to the PCU */ |
| 1959 | f_bssgp_establish(); |
Pau Espin Pedrol | 7b761e2 | 2021-01-11 14:43:35 +0100 | [diff] [blame] | 1960 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
Pau Espin Pedrol | 487d634 | 2020-05-14 19:22:33 +0200 | [diff] [blame] | 1961 | |
| 1962 | /* Establish an Uplink TBF */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 1963 | f_ms_establish_ul_tbf(ms); |
Pau Espin Pedrol | 487d634 | 2020-05-14 19:22:33 +0200 | [diff] [blame] | 1964 | |
| 1965 | /* Send one UL block (with TLLI since we are in One-Phase Access |
| 1966 | contention resoultion) and make sure it is ACKED fine. */ |
Pau Espin Pedrol | cb00c52 | 2020-11-06 19:52:05 +0100 | [diff] [blame] | 1967 | total_payload := f_rnd_octstring(f_ultbf_payload_fill_length(ms.ul_tbf, true)); |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 1968 | /* Set CV = 15 to signal there's still more than BS_CV_MAX blocks to be sent */ |
Pau Espin Pedrol | dee5570 | 2021-04-23 21:08:22 +0200 | [diff] [blame] | 1969 | f_ms_tx_ul_data_block(ms, total_payload, cv := 15, with_tlli := true, fn := ms.ul_tbf.start_time_fn) |
Pau Espin Pedrol | 487d634 | 2020-05-14 19:22:33 +0200 | [diff] [blame] | 1970 | f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn); |
| 1971 | /* DL ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 1972 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
Pau Espin Pedrol | 487d634 | 2020-05-14 19:22:33 +0200 | [diff] [blame] | 1973 | |
| 1974 | /* Send enough blocks to test whole procedure: Until Nth block |
| 1975 | (N=BS_CV_MAX), CV=15 is sent, and then the decreasing countdown value is sent. |
| 1976 | */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 1977 | total_payload := total_payload & f_ms_tx_ul_data_block_multi(ms, 20); |
Pau Espin Pedrol | 487d634 | 2020-05-14 19:22:33 +0200 | [diff] [blame] | 1978 | f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn); |
| 1979 | /* DL ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 1980 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
Pau Espin Pedrol | 487d634 | 2020-05-14 19:22:33 +0200 | [diff] [blame] | 1981 | |
| 1982 | /* receive one message on BSSGP with all aggregated data in payload: */ |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 1983 | BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id, total_payload)); |
Vadim Yanitskiy | 8e6df0c | 2020-10-18 00:13:15 +0700 | [diff] [blame] | 1984 | |
| 1985 | f_shutdown(__BFILE__, __LINE__, final := true); |
Pau Espin Pedrol | 487d634 | 2020-05-14 19:22:33 +0200 | [diff] [blame] | 1986 | } |
| 1987 | |
Pau Espin Pedrol | fb2301e | 2020-06-30 20:46:54 +0200 | [diff] [blame] | 1988 | /* Verify PCU handles correctly CS1..4 with all possible LLC payload sizes fitting alone in one RLC block */ |
| 1989 | testcase TC_ul_all_sizes() runs on RAW_PCU_Test_CT { |
| 1990 | var RlcmacDlBlock dl_block; |
| 1991 | var uint32_t dl_fn, sched_fn; |
| 1992 | var octetstring payload; |
| 1993 | var template (value) RlcmacUlBlock ul_data; |
Vadim Yanitskiy | ceb1f98 | 2020-10-17 15:58:19 +0700 | [diff] [blame] | 1994 | var template (value) LlcBlockHdr blk_hdr; |
| 1995 | var template (value) LlcBlocks blocks; |
Pau Espin Pedrol | cb00c52 | 2020-11-06 19:52:05 +0100 | [diff] [blame] | 1996 | var integer blk_len; |
| 1997 | var CodingScheme tx_cs; |
Pau Espin Pedrol | fb2301e | 2020-06-30 20:46:54 +0200 | [diff] [blame] | 1998 | var GprsMS ms; |
| 1999 | |
| 2000 | /* Initialize NS/BSSGP side */ |
| 2001 | f_init_bssgp(); |
| 2002 | /* Initialize GPRS MS side */ |
| 2003 | f_init_gprs_ms(); |
| 2004 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 2005 | |
| 2006 | /* Initialize the PCU interface abstraction */ |
Pau Espin Pedrol | 745a48b | 2020-10-30 15:31:07 +0100 | [diff] [blame] | 2007 | f_init_raw(testcasename(), ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
Pau Espin Pedrol | fb2301e | 2020-06-30 20:46:54 +0200 | [diff] [blame] | 2008 | |
| 2009 | /* Establish BSSGP connection to the PCU */ |
| 2010 | f_bssgp_establish(); |
Pau Espin Pedrol | 7b761e2 | 2021-01-11 14:43:35 +0100 | [diff] [blame] | 2011 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
Pau Espin Pedrol | fb2301e | 2020-06-30 20:46:54 +0200 | [diff] [blame] | 2012 | |
| 2013 | /* Establish an Uplink TBF */ |
| 2014 | f_ms_establish_ul_tbf(ms); |
| 2015 | |
| 2016 | /* Send one UL block (with TLLI since we are in One-Phase Access |
| 2017 | contention resoultion) and make sure it is ACKED fine. */ |
| 2018 | payload := f_rnd_octstring(16); /* 16 bytes fills the llc block (because TLLI takes 4 bytes) */ |
Vadim Yanitskiy | ceb1f98 | 2020-10-17 15:58:19 +0700 | [diff] [blame] | 2019 | blk_hdr := t_RLCMAC_LLCBLOCK_HDR(length_ind := lengthof(payload), |
| 2020 | more := false, e := true); |
| 2021 | blocks := { t_RLCMAC_LLCBLOCK(payload, blk_hdr) }; |
Pau Espin Pedrol | fb2301e | 2020-06-30 20:46:54 +0200 | [diff] [blame] | 2022 | /* Set CV = 15 to signal there's still more than BS_CV_MAX blocks to be sent */ |
Pau Espin Pedrol | cb00c52 | 2020-11-06 19:52:05 +0100 | [diff] [blame] | 2023 | ul_data := t_RLCMAC_UL_DATA_TLLI(cs := ms.ul_tbf.tx_cs_mcs, |
| 2024 | tfi := ms.ul_tbf.tfi, |
Vadim Yanitskiy | ceb1f98 | 2020-10-17 15:58:19 +0700 | [diff] [blame] | 2025 | cv := 15, |
| 2026 | bsn := ms.ul_tbf.bsn, |
| 2027 | blocks := blocks, |
| 2028 | tlli := ms.tlli); |
Pau Espin Pedrol | fb2301e | 2020-06-30 20:46:54 +0200 | [diff] [blame] | 2029 | f_ultbf_inc_bsn(ms.ul_tbf); |
Pau Espin Pedrol | dee5570 | 2021-04-23 21:08:22 +0200 | [diff] [blame] | 2030 | f_ms_tx_ul_block(ms, ul_data, ms.ul_tbf.start_time_fn); |
Pau Espin Pedrol | fb2301e | 2020-06-30 20:46:54 +0200 | [diff] [blame] | 2031 | |
| 2032 | /* ACK and check it was received fine */ |
| 2033 | f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn); |
| 2034 | /* DL ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 2035 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
| 2036 | /* receive one message on BSSGP with all aggregated data in payload: */ |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 2037 | BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id, payload)); |
Pau Espin Pedrol | fb2301e | 2020-06-30 20:46:54 +0200 | [diff] [blame] | 2038 | |
| 2039 | /* Test sending LLC PDUS of incrementing size */ |
| 2040 | var integer max_size := 49; |
| 2041 | for (var integer i := 1; i <= max_size; i := i + 1) { |
| 2042 | var integer cv; |
| 2043 | /* Enqueue DATA.ind (both TDMA frame and block numbers to be patched) */ |
| 2044 | log("Sending DATA.ind with LLC payload size ", i); |
| 2045 | if (i < max_size - g_bs_cv_max) { |
| 2046 | cv := 15; |
| 2047 | } else { |
| 2048 | cv := max_size - i; |
| 2049 | } |
| 2050 | |
Pau Espin Pedrol | cb00c52 | 2020-11-06 19:52:05 +0100 | [diff] [blame] | 2051 | blk_len := 3 + 1 + i; /* 3 Header bytes + LI byte + payload length */ |
| 2052 | tx_cs := f_rlcmac_block_len_required_cs_mcs(blk_len, false); |
Pau Espin Pedrol | fb2301e | 2020-06-30 20:46:54 +0200 | [diff] [blame] | 2053 | payload := f_rnd_octstring(i); |
Vadim Yanitskiy | ceb1f98 | 2020-10-17 15:58:19 +0700 | [diff] [blame] | 2054 | blk_hdr := t_RLCMAC_LLCBLOCK_HDR(length_ind := lengthof(payload), |
| 2055 | more := false, e := true); |
| 2056 | blocks := { t_RLCMAC_LLCBLOCK(payload, blk_hdr) }; |
Pau Espin Pedrol | fb2301e | 2020-06-30 20:46:54 +0200 | [diff] [blame] | 2057 | /* Set CV = 15 to signal there's still more than BS_CV_MAX blocks to be sent */ |
Pau Espin Pedrol | cb00c52 | 2020-11-06 19:52:05 +0100 | [diff] [blame] | 2058 | ul_data := t_RLCMAC_UL_DATA(cs := tx_cs, |
| 2059 | tfi := ms.ul_tbf.tfi, |
Pau Espin Pedrol | fb2301e | 2020-06-30 20:46:54 +0200 | [diff] [blame] | 2060 | cv := cv, |
| 2061 | bsn := ms.ul_tbf.bsn, |
Vadim Yanitskiy | ceb1f98 | 2020-10-17 15:58:19 +0700 | [diff] [blame] | 2062 | blocks := blocks); |
Pau Espin Pedrol | fb2301e | 2020-06-30 20:46:54 +0200 | [diff] [blame] | 2063 | f_ultbf_inc_bsn(ms.ul_tbf); |
| 2064 | f_ms_tx_ul_block(ms, ul_data); |
| 2065 | |
| 2066 | /* receive one message on BSSGP with all aggregated data in payload: */ |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 2067 | BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id, payload)); |
Pau Espin Pedrol | fb2301e | 2020-06-30 20:46:54 +0200 | [diff] [blame] | 2068 | |
| 2069 | /* we will receive UL ACK/NACK from time to time, handle it. */ |
| 2070 | f_rx_rlcmac_dl_block(dl_block, dl_fn); |
| 2071 | if (match(dl_block, tr_RLCMAC_DUMMY_CTRL())) { |
| 2072 | continue; |
| 2073 | } |
| 2074 | if (not match(dl_block, tr_RLCMAC_UL_ACK_NACK_GPRS(ul_tfi := ?)) and |
| 2075 | not match(dl_block, tr_RLCMAC_UL_ACK_NACK_EGPRS(ul_tfi := ?))) { |
| 2076 | setverdict(fail, "Failed to match Packet Uplink ACK / NACK:", dl_block); |
| 2077 | f_shutdown(__BFILE__, __LINE__); |
| 2078 | } |
| 2079 | |
| 2080 | log("Rx Packet Uplink ACK / NACK"); |
| 2081 | sched_fn := f_rrbp_ack_fn(dl_fn, dl_block.ctrl.mac_hdr.rrbp); |
| 2082 | /* DL ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 2083 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
| 2084 | } |
Vadim Yanitskiy | 8e6df0c | 2020-10-18 00:13:15 +0700 | [diff] [blame] | 2085 | |
| 2086 | f_shutdown(__BFILE__, __LINE__, final := true); |
Pau Espin Pedrol | fb2301e | 2020-06-30 20:46:54 +0200 | [diff] [blame] | 2087 | } |
| 2088 | |
Pau Espin Pedrol | 5e6844d | 2020-07-01 17:24:02 +0200 | [diff] [blame] | 2089 | function f_TC_ul_data_toolong_fills_padding_cs(inout GprsMS ms, CodingScheme cs, integer cv) runs on RAW_PCU_Test_CT { |
| 2090 | var octetstring payload; |
| 2091 | var template (value) RlcmacUlBlock ul_data; |
Vadim Yanitskiy | ceb1f98 | 2020-10-17 15:58:19 +0700 | [diff] [blame] | 2092 | var template (value) LlcBlockHdr blk_hdr; |
| 2093 | var template (value) LlcBlocks blocks; |
Pau Espin Pedrol | 5e6844d | 2020-07-01 17:24:02 +0200 | [diff] [blame] | 2094 | var integer block_len, max_valid_data_len; |
| 2095 | timer T; |
| 2096 | |
| 2097 | block_len := f_rlcmac_cs_mcs2block_len(cs); |
| 2098 | /* We need to send with TLLI since we are in One-Phase Access Contenion |
| 2099 | * resoultion), so that's -4 bytes of data, -3 for headers, -1 for LI |
| 2100 | * indicator, -1 for spare bits octet at the end */ |
| 2101 | max_valid_data_len := block_len - 4 - 3 - 1 - 1; |
| 2102 | payload := f_rnd_octstring(max_valid_data_len + 1); /* +1 to write LLC data on last padding octet */ |
Vadim Yanitskiy | ceb1f98 | 2020-10-17 15:58:19 +0700 | [diff] [blame] | 2103 | blk_hdr := t_RLCMAC_LLCBLOCK_HDR(length_ind := lengthof(payload), |
| 2104 | more := false, e := true); |
| 2105 | blocks := { t_RLCMAC_LLCBLOCK(payload, blk_hdr) }; |
Pau Espin Pedrol | cb00c52 | 2020-11-06 19:52:05 +0100 | [diff] [blame] | 2106 | ul_data := t_RLCMAC_UL_DATA_TLLI(cs := cs, |
| 2107 | tfi := ms.ul_tbf.tfi, |
Vadim Yanitskiy | ceb1f98 | 2020-10-17 15:58:19 +0700 | [diff] [blame] | 2108 | cv := cv, |
| 2109 | bsn := ms.ul_tbf.bsn, |
| 2110 | blocks := blocks, |
| 2111 | tlli := ms.tlli); |
Pau Espin Pedrol | 5e6844d | 2020-07-01 17:24:02 +0200 | [diff] [blame] | 2112 | f_ultbf_inc_bsn(ms.ul_tbf); |
| 2113 | f_ms_tx_data_ind(ms, enc_RlcmacUlBlock(valueof(ul_data))); |
| 2114 | |
| 2115 | T.start(0.5); |
| 2116 | alt { |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 2117 | [] BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id, ?)) { |
Pau Espin Pedrol | 5e6844d | 2020-07-01 17:24:02 +0200 | [diff] [blame] | 2118 | setverdict(fail, "LLC PDU in Malformed RLC block was forwarded"); |
| 2119 | f_shutdown(__BFILE__, __LINE__); |
| 2120 | } |
| 2121 | [] T.timeout { |
| 2122 | setverdict(pass); |
| 2123 | } |
| 2124 | } |
| 2125 | } |
| 2126 | /* Verify PCU finds out incorrectly formated RLC block and discards it. This |
| 2127 | blocks intentionally contain last byte of data placed in last byte of RLC |
| 2128 | containing padding/spare bits, which is incorrect. Spare bits exist and are |
| 2129 | described for CS2..4 in 3GPP TS 44.060 Table 10.2.1: "RLC data block size, |
| 2130 | discounting padding in octet" */ |
| 2131 | testcase TC_ul_data_toolong_fills_padding() runs on RAW_PCU_Test_CT { |
| 2132 | var GprsMS ms; |
| 2133 | var integer block_len, max_valid_data_len; |
| 2134 | |
| 2135 | /* Initialize NS/BSSGP side */ |
| 2136 | f_init_bssgp(); |
| 2137 | /* Initialize GPRS MS side */ |
| 2138 | f_init_gprs_ms(); |
| 2139 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 2140 | |
| 2141 | /* Initialize the PCU interface abstraction */ |
Pau Espin Pedrol | 745a48b | 2020-10-30 15:31:07 +0100 | [diff] [blame] | 2142 | f_init_raw(testcasename(), ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
Pau Espin Pedrol | 5e6844d | 2020-07-01 17:24:02 +0200 | [diff] [blame] | 2143 | |
| 2144 | /* Establish BSSGP connection to the PCU */ |
| 2145 | f_bssgp_establish(); |
Pau Espin Pedrol | 7b761e2 | 2021-01-11 14:43:35 +0100 | [diff] [blame] | 2146 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
Pau Espin Pedrol | 5e6844d | 2020-07-01 17:24:02 +0200 | [diff] [blame] | 2147 | |
| 2148 | /* Establish an Uplink TBF */ |
| 2149 | f_ms_establish_ul_tbf(ms); |
| 2150 | |
| 2151 | f_TC_ul_data_toolong_fills_padding_cs(ms, CS_2, 2); |
| 2152 | f_TC_ul_data_toolong_fills_padding_cs(ms, CS_3, 1); |
| 2153 | f_TC_ul_data_toolong_fills_padding_cs(ms, CS_4, 0); |
| 2154 | |
Vadim Yanitskiy | 8e6df0c | 2020-10-18 00:13:15 +0700 | [diff] [blame] | 2155 | f_shutdown(__BFILE__, __LINE__, final := true); |
Pau Espin Pedrol | 5e6844d | 2020-07-01 17:24:02 +0200 | [diff] [blame] | 2156 | } |
| 2157 | |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2158 | /* Test scenario where MS wants to send some data on PDCH against SGSN and it is |
| 2159 | * answered, so TBFs for uplink and later for downlink are created. |
| 2160 | */ |
Pau Espin Pedrol | 02c972d | 2020-05-13 15:56:16 +0200 | [diff] [blame] | 2161 | private function f_TC_mo_ping_pong_1phase_access(template (present) CodingScheme exp_cs_mcs := ?) runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2162 | var RlcmacDlBlock dl_block; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2163 | var octetstring data := f_rnd_octstring(10); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2164 | var uint32_t sched_fn; |
Vadim Yanitskiy | b6733a6 | 2020-05-10 14:39:00 +0700 | [diff] [blame] | 2165 | var uint32_t dl_fn; |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2166 | var GprsMS ms; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2167 | |
| 2168 | /* Initialize NS/BSSGP side */ |
| 2169 | f_init_bssgp(); |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2170 | /* Initialize GPRS MS side */ |
| 2171 | f_init_gprs_ms(); |
| 2172 | ms := g_ms[0]; /* We only use first MS in this test */ |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2173 | |
| 2174 | /* Initialize the PCU interface abstraction */ |
Pau Espin Pedrol | 745a48b | 2020-10-30 15:31:07 +0100 | [diff] [blame] | 2175 | f_init_raw(testcasename(), ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2176 | |
| 2177 | /* Establish BSSGP connection to the PCU */ |
| 2178 | f_bssgp_establish(); |
Pau Espin Pedrol | 7b761e2 | 2021-01-11 14:43:35 +0100 | [diff] [blame] | 2179 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2180 | |
| 2181 | /* Establish an Uplink TBF */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2182 | f_ms_establish_ul_tbf(ms); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2183 | |
Pau Espin Pedrol | 4aac3d0 | 2020-05-13 15:13:49 +0200 | [diff] [blame] | 2184 | /* Send one UL block (with TLLI since we are in One-Phase Access |
| 2185 | contention resoultion) and make sure it is ACKED fine */ |
Pau Espin Pedrol | dee5570 | 2021-04-23 21:08:22 +0200 | [diff] [blame] | 2186 | f_ms_tx_ul_data_block_multi(ms, 1, with_tlli := true, fn := ms.ul_tbf.start_time_fn); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2187 | f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn); |
| 2188 | /* DL ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2189 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2190 | |
| 2191 | /* UL block should be received in SGSN */ |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 2192 | BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id)); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2193 | |
| 2194 | /* Now SGSN sends some DL data, PCU will page on CCCH (PCH) */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2195 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data)); |
| 2196 | f_ms_exp_dl_tbf_ass_ccch(ms, PCU_IF_SAPI_PCH); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2197 | |
| 2198 | /* Wait timer X2002 and DL block is available after CCCH IMM ASS: */ |
| 2199 | f_sleep(X2002); |
Vadim Yanitskiy | b6733a6 | 2020-05-10 14:39:00 +0700 | [diff] [blame] | 2200 | f_rx_rlcmac_dl_block_exp_data(dl_block, dl_fn, data, 0, exp_cs_mcs); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2201 | |
| 2202 | /* ACK the DL block */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2203 | f_acknackdesc_ack_block(ms.dl_tbf.acknack_desc, dl_block, '1'B); |
| 2204 | f_ms_tx_ul_block(ms, ts_RLCMAC_DL_ACK_NACK(ms.dl_tbf.tfi, ms.dl_tbf.acknack_desc), |
| 2205 | f_dl_block_ack_fn(dl_block, dl_fn)); |
Vadim Yanitskiy | 91f8a09 | 2020-05-06 21:41:05 +0700 | [diff] [blame] | 2206 | |
| 2207 | f_shutdown(__BFILE__, __LINE__, final := true); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2208 | } |
| 2209 | |
| 2210 | /* Test scenario where MS wants to send some data on PDCH against SGSN and it is |
| 2211 | * answered, so TBFs for uplink and later for downlink are created. |
| 2212 | */ |
| 2213 | testcase TC_mo_ping_pong() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | fa64e28 | 2021-02-05 17:56:52 +0100 | [diff] [blame] | 2214 | var template (present) CodingScheme exp_cs_mcs := cs_gprs_any; |
Pau Espin Pedrol | 02c972d | 2020-05-13 15:56:16 +0200 | [diff] [blame] | 2215 | f_TC_mo_ping_pong_1phase_access(exp_cs_mcs); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2216 | } |
| 2217 | |
Pau Espin Pedrol | 02c972d | 2020-05-13 15:56:16 +0200 | [diff] [blame] | 2218 | /* Test scenario where MS wants to send some data on PDCH against SGSN and it is |
| 2219 | * answered, so TBFs for uplink and later for downlink are created. |
| 2220 | */ |
Pau Espin Pedrol | 745a48b | 2020-10-30 15:31:07 +0100 | [diff] [blame] | 2221 | private function f_TC_mo_ping_pong_2phase_access(PCUIF_Flags ind_flags, |
| 2222 | template (value) MSRadioAccessCapabilityV ms_racap, |
Pau Espin Pedrol | 42acafc | 2020-05-14 15:18:38 +0200 | [diff] [blame] | 2223 | template (present) CodingScheme exp_ul_cs_mcs := ?, |
| 2224 | template (present) CodingScheme exp_dl_cs_mcs := ?) |
| 2225 | runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | 02c972d | 2020-05-13 15:56:16 +0200 | [diff] [blame] | 2226 | var RlcmacDlBlock dl_block; |
Pau Espin Pedrol | 02c972d | 2020-05-13 15:56:16 +0200 | [diff] [blame] | 2227 | var octetstring data := f_rnd_octstring(10); |
Pau Espin Pedrol | 8155bf4 | 2020-10-29 17:34:26 +0100 | [diff] [blame] | 2228 | var PollFnCtx pollctx; |
Pau Espin Pedrol | 02c972d | 2020-05-13 15:56:16 +0200 | [diff] [blame] | 2229 | var uint32_t sched_fn; |
| 2230 | var uint32_t dl_fn; |
Pau Espin Pedrol | adbbe1e | 2020-05-17 00:28:01 +0200 | [diff] [blame] | 2231 | var uint32_t unused_fn; |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2232 | var GprsMS ms; |
| 2233 | |
Pau Espin Pedrol | 02c972d | 2020-05-13 15:56:16 +0200 | [diff] [blame] | 2234 | /* Initialize NS/BSSGP side */ |
| 2235 | f_init_bssgp(); |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2236 | /* Initialize GPRS MS side */ |
| 2237 | f_init_gprs_ms(); |
| 2238 | ms := g_ms[0]; /* We only use first MS in this test */ |
Pau Espin Pedrol | 02c972d | 2020-05-13 15:56:16 +0200 | [diff] [blame] | 2239 | |
| 2240 | /* Initialize the PCU interface abstraction */ |
Pau Espin Pedrol | 745a48b | 2020-10-30 15:31:07 +0100 | [diff] [blame] | 2241 | f_init_raw(testcasename(), ts_PCUIF_INFO_default(ind_flags)); |
Pau Espin Pedrol | 02c972d | 2020-05-13 15:56:16 +0200 | [diff] [blame] | 2242 | |
| 2243 | /* Establish BSSGP connection to the PCU */ |
| 2244 | f_bssgp_establish(); |
Pau Espin Pedrol | 7b761e2 | 2021-01-11 14:43:35 +0100 | [diff] [blame] | 2245 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
Pau Espin Pedrol | 02c972d | 2020-05-13 15:56:16 +0200 | [diff] [blame] | 2246 | |
Pau Espin Pedrol | 8155bf4 | 2020-10-29 17:34:26 +0100 | [diff] [blame] | 2247 | /* Send PACKET RESOURCE REQUEST to upgrade to EGPRS */ |
| 2248 | pollctx := f_ms_establish_ul_tbf_2phase_access(ms, ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, ms_racap)); |
Pau Espin Pedrol | 02c972d | 2020-05-13 15:56:16 +0200 | [diff] [blame] | 2249 | |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2250 | if (not match(ms.ul_tbf.tx_cs_mcs, exp_ul_cs_mcs)) { |
| 2251 | setverdict(fail, "Wrong CS_MCS ", ms.ul_tbf.tx_cs_mcs, " received vs exp ", exp_ul_cs_mcs); |
Pau Espin Pedrol | 42acafc | 2020-05-14 15:18:38 +0200 | [diff] [blame] | 2252 | f_shutdown(__BFILE__, __LINE__); |
| 2253 | } |
Pau Espin Pedrol | 02c972d | 2020-05-13 15:56:16 +0200 | [diff] [blame] | 2254 | |
| 2255 | /* Send one UL block (without TLLI since we are in Second-Phase Access) |
| 2256 | and make sure it is ACKED fine */ |
Pau Espin Pedrol | fdbce84 | 2021-03-03 11:43:40 +0100 | [diff] [blame] | 2257 | f_ms_tx_ul_data_block_multi(ms, 1); |
Pau Espin Pedrol | 02c972d | 2020-05-13 15:56:16 +0200 | [diff] [blame] | 2258 | |
Pau Espin Pedrol | 02c972d | 2020-05-13 15:56:16 +0200 | [diff] [blame] | 2259 | /* DL ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
Pau Espin Pedrol | 8155bf4 | 2020-10-29 17:34:26 +0100 | [diff] [blame] | 2260 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), pollctx.fn, nr := pollctx.tstrxbts); |
Pau Espin Pedrol | 02c972d | 2020-05-13 15:56:16 +0200 | [diff] [blame] | 2261 | |
| 2262 | /* UL block should be received in SGSN */ |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 2263 | BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id)); |
Pau Espin Pedrol | 02c972d | 2020-05-13 15:56:16 +0200 | [diff] [blame] | 2264 | |
| 2265 | /* Now SGSN sends some DL data, PCU will page on PACCH */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2266 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data)); |
Pau Espin Pedrol | ddd6c3f | 2021-03-03 12:01:20 +0100 | [diff] [blame] | 2267 | /* Sleep a bit to make sure PCU received the DL data and hence it will be prioritized by scheduler: */ |
| 2268 | f_sleep(0.5); |
Vadim Yanitskiy | 7431e9e | 2020-07-21 01:59:17 +0700 | [diff] [blame] | 2269 | f_ms_rx_pkt_ass_pacch(ms, sched_fn, tr_RLCMAC_DL_PACKET_ASS); |
Pau Espin Pedrol | 02c972d | 2020-05-13 15:56:16 +0200 | [diff] [blame] | 2270 | /* DL Ass sets poll+rrbp requesting PACKET CONTROL ACK */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2271 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
Pau Espin Pedrol | 02c972d | 2020-05-13 15:56:16 +0200 | [diff] [blame] | 2272 | |
Pau Espin Pedrol | adbbe1e | 2020-05-17 00:28:01 +0200 | [diff] [blame] | 2273 | /* PCU acks the UL data after having received CV=0) */ |
| 2274 | f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, unused_fn); |
| 2275 | |
Pau Espin Pedrol | 02c972d | 2020-05-13 15:56:16 +0200 | [diff] [blame] | 2276 | /* After acking the dl assignment, dl tbf goes into FLOW state and PCU will provide DL data when BTS asks for it */ |
Pau Espin Pedrol | 42acafc | 2020-05-14 15:18:38 +0200 | [diff] [blame] | 2277 | f_rx_rlcmac_dl_block_exp_data(dl_block, dl_fn, data, 0, exp_dl_cs_mcs); |
Pau Espin Pedrol | 02c972d | 2020-05-13 15:56:16 +0200 | [diff] [blame] | 2278 | |
| 2279 | /* ACK the DL block */ |
Pau Espin Pedrol | e8db673 | 2020-11-12 21:06:41 +0100 | [diff] [blame] | 2280 | f_dltbf_ack_block(ms.dl_tbf, dl_block, '1'B); |
| 2281 | f_ms_tx_ul_block(ms, f_dltbf_ts_RLCMAC_DL_ACK_NACK(ms.dl_tbf, ischosen(dl_block.data_egprs)), |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2282 | f_dl_block_ack_fn(dl_block, dl_fn)); |
Pau Espin Pedrol | 02c972d | 2020-05-13 15:56:16 +0200 | [diff] [blame] | 2283 | |
| 2284 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 2285 | } |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2286 | |
| 2287 | testcase TC_mo_ping_pong_with_ul_racap() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | fa64e28 | 2021-02-05 17:56:52 +0100 | [diff] [blame] | 2288 | var template (present) CodingScheme exp_ul_cs_mcs := cs_gprs_any; |
| 2289 | var template (present) CodingScheme exp_dl_cs_mcs := cs_gprs_any; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2290 | |
Pau Espin Pedrol | 13ab5ea | 2021-02-05 11:56:15 +0100 | [diff] [blame] | 2291 | f_TC_mo_ping_pong_2phase_access(c_PCUIF_Flags_noMCS, ms_racap_gprs_def, exp_ul_cs_mcs, exp_dl_cs_mcs); |
Pau Espin Pedrol | 42acafc | 2020-05-14 15:18:38 +0200 | [diff] [blame] | 2292 | } |
| 2293 | |
| 2294 | testcase TC_mo_ping_pong_with_ul_racap_egprs_only() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | fa64e28 | 2021-02-05 17:56:52 +0100 | [diff] [blame] | 2295 | var template (present) CodingScheme exp_ul_cs_mcs := mcs_egprs_any; |
| 2296 | var template (present) CodingScheme exp_dl_cs_mcs := mcs_egprs_any; |
Pau Espin Pedrol | 42acafc | 2020-05-14 15:18:38 +0200 | [diff] [blame] | 2297 | |
Pau Espin Pedrol | 13ab5ea | 2021-02-05 11:56:15 +0100 | [diff] [blame] | 2298 | f_TC_mo_ping_pong_2phase_access(c_PCUIF_Flags_default, ms_racap_egprs_def, exp_ul_cs_mcs, exp_dl_cs_mcs); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2299 | } |
| 2300 | |
Pau Espin Pedrol | 0c0bf87 | 2020-05-14 15:50:49 +0200 | [diff] [blame] | 2301 | testcase TC_force_two_phase_access() runs on RAW_PCU_Test_CT { |
| 2302 | /* Configure PCU to force two phase access */ |
| 2303 | g_force_two_phase_access := true; |
| 2304 | |
Pau Espin Pedrol | 0c0bf87 | 2020-05-14 15:50:49 +0200 | [diff] [blame] | 2305 | var CodingScheme exp_ul_cs_mcs := f_rlcmac_block_int2cs_mcs(g_mcs_initial_ul, false); |
Pau Espin Pedrol | fa64e28 | 2021-02-05 17:56:52 +0100 | [diff] [blame] | 2306 | var template (present) CodingScheme exp_dl_cs_mcs := cs_gprs_any; |
Pau Espin Pedrol | 0c0bf87 | 2020-05-14 15:50:49 +0200 | [diff] [blame] | 2307 | |
Pau Espin Pedrol | 13ab5ea | 2021-02-05 11:56:15 +0100 | [diff] [blame] | 2308 | f_TC_mo_ping_pong_2phase_access(c_PCUIF_Flags_noMCS, ms_racap_gprs_def, exp_ul_cs_mcs, exp_dl_cs_mcs); |
Pau Espin Pedrol | 0c0bf87 | 2020-05-14 15:50:49 +0200 | [diff] [blame] | 2309 | } |
| 2310 | |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2311 | /* Test scenario where SGSN wants to send some data against MS and it is |
| 2312 | * answered by the MS on PDCH, so TBFs for downlink and later for uplink are created. |
| 2313 | */ |
Vadim Yanitskiy | c67240a | 2020-10-17 15:59:37 +0700 | [diff] [blame] | 2314 | private function f_TC_mt_ping_pong(template (omit) MSRadioAccessCapabilityV_BSSGP ms_racap := omit, |
| 2315 | template (present) CodingScheme exp_cs_mcs := ?) |
| 2316 | runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2317 | var RlcmacDlBlock dl_block; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2318 | var octetstring data := f_rnd_octstring(10); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2319 | var uint32_t sched_fn; |
Vadim Yanitskiy | b6733a6 | 2020-05-10 14:39:00 +0700 | [diff] [blame] | 2320 | var uint32_t dl_fn; |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2321 | var GprsMS ms; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2322 | |
| 2323 | /* Initialize NS/BSSGP side */ |
| 2324 | f_init_bssgp(); |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2325 | /* Initialize GPRS MS side */ |
| 2326 | f_init_gprs_ms(); |
| 2327 | ms := g_ms[0]; /* We only use first MS in this test */ |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2328 | |
| 2329 | /* Initialize the PCU interface abstraction */ |
Pau Espin Pedrol | 745a48b | 2020-10-30 15:31:07 +0100 | [diff] [blame] | 2330 | f_init_raw(testcasename(), ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2331 | |
| 2332 | /* Establish BSSGP connection to the PCU */ |
| 2333 | f_bssgp_establish(); |
Pau Espin Pedrol | 7b761e2 | 2021-01-11 14:43:35 +0100 | [diff] [blame] | 2334 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2335 | |
| 2336 | /* SGSN sends some DL data, PCU will page on CCCH (PCH) */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2337 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data, ms_racap)); |
| 2338 | f_ms_exp_dl_tbf_ass_ccch(ms, PCU_IF_SAPI_PCH); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2339 | |
| 2340 | /* Wait timer X2002 and DL block is available after CCCH IMM ASS: */ |
| 2341 | f_sleep(X2002); |
Vadim Yanitskiy | b6733a6 | 2020-05-10 14:39:00 +0700 | [diff] [blame] | 2342 | f_rx_rlcmac_dl_block_exp_data(dl_block, dl_fn, data, 0, exp_cs_mcs); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2343 | |
Pau Espin Pedrol | 6791eb6 | 2020-05-20 18:27:10 +0200 | [diff] [blame] | 2344 | /* ACK the DL block, and request UL TBF at the same time */ |
Pau Espin Pedrol | e8db673 | 2020-11-12 21:06:41 +0100 | [diff] [blame] | 2345 | f_dltbf_ack_block(ms.dl_tbf, dl_block, '1'B); |
| 2346 | f_ms_tx_ul_block(ms, f_dltbf_ts_RLCMAC_DL_ACK_NACK(ms.dl_tbf, ischosen(dl_block.data_egprs), c_ChReqDesc_default), |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2347 | f_dl_block_ack_fn(dl_block, dl_fn)); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2348 | |
Pau Espin Pedrol | 6791eb6 | 2020-05-20 18:27:10 +0200 | [diff] [blame] | 2349 | /* Expect UL ass */ |
Vadim Yanitskiy | 7431e9e | 2020-07-21 01:59:17 +0700 | [diff] [blame] | 2350 | f_ms_rx_pkt_ass_pacch(ms, sched_fn, tr_RLCMAC_UL_PACKET_ASS); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2351 | |
Pau Espin Pedrol | 4aac3d0 | 2020-05-13 15:13:49 +0200 | [diff] [blame] | 2352 | /* Send one UL block (with TLLI since we are in One-Phase Access |
| 2353 | contention resoultion) and make sure it is ACKED fine */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2354 | f_ms_tx_ul_data_block_multi(ms, 1, with_tlli := true); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2355 | f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn); |
| 2356 | /* DL ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2357 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2358 | |
| 2359 | /* UL block should be received in SGSN */ |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 2360 | BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id)); |
Vadim Yanitskiy | 91f8a09 | 2020-05-06 21:41:05 +0700 | [diff] [blame] | 2361 | |
| 2362 | f_shutdown(__BFILE__, __LINE__, final := true); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2363 | } |
| 2364 | |
| 2365 | testcase TC_mt_ping_pong() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | fa64e28 | 2021-02-05 17:56:52 +0100 | [diff] [blame] | 2366 | var template (present) CodingScheme exp_cs_mcs := cs_gprs_any; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2367 | f_TC_mt_ping_pong(omit, exp_cs_mcs); |
| 2368 | } |
| 2369 | |
| 2370 | /* TC_mt_ping_pong, but DL-UNITDATA contains RA Access capability with (M)CS |
| 2371 | /* information about the MS */ |
| 2372 | testcase TC_mt_ping_pong_with_dl_racap() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | fa64e28 | 2021-02-05 17:56:52 +0100 | [diff] [blame] | 2373 | var template (present) CodingScheme exp_cs_mcs := cs_gprs_any; |
Pau Espin Pedrol | 13ab5ea | 2021-02-05 11:56:15 +0100 | [diff] [blame] | 2374 | f_TC_mt_ping_pong(bssgp_ms_racap_gprs_def, exp_cs_mcs); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2375 | } |
| 2376 | |
Pau Espin Pedrol | a416cb8 | 2020-05-15 14:09:02 +0200 | [diff] [blame] | 2377 | /* Verify that if PCU doesn't get one of the intermediate UL data blocks in a UL |
| 2378 | * TBF, it will request retransmission through UL ACK/NACK (with missing block |
| 2379 | * in its bitmap) when CV=0 is received (and hence it knows no more data is to |
| 2380 | * be transferred). |
| 2381 | */ |
| 2382 | testcase TC_ul_intermediate_retrans() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | a416cb8 | 2020-05-15 14:09:02 +0200 | [diff] [blame] | 2383 | var RlcmacDlBlock dl_block; |
| 2384 | var template (value) RlcmacUlBlock ul_data; |
Pau Espin Pedrol | a416cb8 | 2020-05-15 14:09:02 +0200 | [diff] [blame] | 2385 | var uint32_t sched_fn; |
Pau Espin Pedrol | a416cb8 | 2020-05-15 14:09:02 +0200 | [diff] [blame] | 2386 | var octetstring total_payload; |
| 2387 | var octetstring payload; |
| 2388 | var octetstring lost_payload; |
Pau Espin Pedrol | a416cb8 | 2020-05-15 14:09:02 +0200 | [diff] [blame] | 2389 | var uint5_t tfi; |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2390 | var GprsMS ms; |
Pau Espin Pedrol | cb00c52 | 2020-11-06 19:52:05 +0100 | [diff] [blame] | 2391 | var uint32_t payload_fill_len; |
Pau Espin Pedrol | a416cb8 | 2020-05-15 14:09:02 +0200 | [diff] [blame] | 2392 | |
| 2393 | /* Initialize NS/BSSGP side */ |
| 2394 | f_init_bssgp(); |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2395 | /* Initialize GPRS MS side */ |
| 2396 | f_init_gprs_ms(); |
| 2397 | ms := g_ms[0]; /* We only use first MS in this test */ |
Pau Espin Pedrol | a416cb8 | 2020-05-15 14:09:02 +0200 | [diff] [blame] | 2398 | |
| 2399 | /* Initialize the PCU interface abstraction */ |
Pau Espin Pedrol | 745a48b | 2020-10-30 15:31:07 +0100 | [diff] [blame] | 2400 | f_init_raw(testcasename(), ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
Pau Espin Pedrol | a416cb8 | 2020-05-15 14:09:02 +0200 | [diff] [blame] | 2401 | |
| 2402 | /* Establish BSSGP connection to the PCU */ |
| 2403 | f_bssgp_establish(); |
Pau Espin Pedrol | 7b761e2 | 2021-01-11 14:43:35 +0100 | [diff] [blame] | 2404 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
Pau Espin Pedrol | a416cb8 | 2020-05-15 14:09:02 +0200 | [diff] [blame] | 2405 | |
| 2406 | /* Establish an Uplink TBF */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2407 | f_ms_establish_ul_tbf(ms); |
| 2408 | tfi := ms.ul_tbf.tfi; |
Pau Espin Pedrol | a416cb8 | 2020-05-15 14:09:02 +0200 | [diff] [blame] | 2409 | |
| 2410 | /* Send one UL block (with TLLI since we are in One-Phase Access |
| 2411 | contention resoultion) and make sure it is ACKED fine. */ |
Pau Espin Pedrol | cb00c52 | 2020-11-06 19:52:05 +0100 | [diff] [blame] | 2412 | payload := f_rnd_octstring(f_ultbf_payload_fill_length(ms.ul_tbf, true)); /* 16 bytes fills the llc block (because TLLI takes 4 bytes) */ |
Pau Espin Pedrol | dee5570 | 2021-04-23 21:08:22 +0200 | [diff] [blame] | 2413 | f_ms_tx_ul_data_block(ms, payload, cv := 15, with_tlli := true, fn := ms.ul_tbf.start_time_fn); |
Pau Espin Pedrol | a416cb8 | 2020-05-15 14:09:02 +0200 | [diff] [blame] | 2414 | |
Pau Espin Pedrol | a416cb8 | 2020-05-15 14:09:02 +0200 | [diff] [blame] | 2415 | f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn); |
| 2416 | /* DL ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2417 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
Pau Espin Pedrol | a416cb8 | 2020-05-15 14:09:02 +0200 | [diff] [blame] | 2418 | total_payload := payload; |
| 2419 | |
Pau Espin Pedrol | cb00c52 | 2020-11-06 19:52:05 +0100 | [diff] [blame] | 2420 | payload_fill_len := f_ultbf_payload_fill_length(ms.ul_tbf); |
| 2421 | |
Pau Espin Pedrol | a416cb8 | 2020-05-15 14:09:02 +0200 | [diff] [blame] | 2422 | /* Send 2 packets, skip 1 (inc bsn) and send another one */ |
Pau Espin Pedrol | cb00c52 | 2020-11-06 19:52:05 +0100 | [diff] [blame] | 2423 | payload := f_rnd_octstring(payload_fill_len); |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2424 | f_ms_tx_ul_data_block(ms, payload, cv := 15); |
Pau Espin Pedrol | a416cb8 | 2020-05-15 14:09:02 +0200 | [diff] [blame] | 2425 | total_payload := total_payload & payload; |
| 2426 | |
Pau Espin Pedrol | cb00c52 | 2020-11-06 19:52:05 +0100 | [diff] [blame] | 2427 | payload := f_rnd_octstring(payload_fill_len); |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2428 | f_ms_tx_ul_data_block(ms, payload, cv := 15); |
Pau Espin Pedrol | a416cb8 | 2020-05-15 14:09:02 +0200 | [diff] [blame] | 2429 | total_payload := total_payload & payload; |
| 2430 | |
Pau Espin Pedrol | cb00c52 | 2020-11-06 19:52:05 +0100 | [diff] [blame] | 2431 | lost_payload := f_rnd_octstring(payload_fill_len); |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2432 | ms.ul_tbf.bsn := ms.ul_tbf.bsn + 1; /* LOST PAYLOAD bsn=3, will be retransmitted, next bsn is increased +2 */ |
Pau Espin Pedrol | a416cb8 | 2020-05-15 14:09:02 +0200 | [diff] [blame] | 2433 | total_payload := total_payload & lost_payload; |
| 2434 | |
Pau Espin Pedrol | cb00c52 | 2020-11-06 19:52:05 +0100 | [diff] [blame] | 2435 | payload := f_rnd_octstring(payload_fill_len) |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2436 | f_ms_tx_ul_data_block(ms, payload, cv := 15); |
Pau Espin Pedrol | a416cb8 | 2020-05-15 14:09:02 +0200 | [diff] [blame] | 2437 | total_payload := total_payload & payload; |
| 2438 | |
| 2439 | /* Send enough blocks to finish the transmission (since we were sending BSN=15, send BS_CV_MAX packets) */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2440 | total_payload := total_payload & f_ms_tx_ul_data_block_multi(ms, g_bs_cv_max); |
Pau Espin Pedrol | a416cb8 | 2020-05-15 14:09:02 +0200 | [diff] [blame] | 2441 | |
| 2442 | /* On CV=0, we'll receive a UL ACK asking about missing block */ |
| 2443 | f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn); |
| 2444 | /* TODO: check ack ack bitmap (URBB) */ |
Pau Espin Pedrol | cb00c52 | 2020-11-06 19:52:05 +0100 | [diff] [blame] | 2445 | ul_data := t_RLCMAC_UL_DATA(cs := ms.ul_tbf.tx_cs_mcs, |
| 2446 | tfi := tfi, |
| 2447 | cv := 15, |
| 2448 | bsn := 3, |
| 2449 | blocks := {t_RLCMAC_LLCBLOCK(lost_payload)}); |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2450 | f_ms_tx_ul_block(ms, ul_data); |
Pau Espin Pedrol | a416cb8 | 2020-05-15 14:09:02 +0200 | [diff] [blame] | 2451 | |
| 2452 | /* Now final ack is recieved */ |
| 2453 | f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn); |
| 2454 | /* DL ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2455 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
Pau Espin Pedrol | a416cb8 | 2020-05-15 14:09:02 +0200 | [diff] [blame] | 2456 | |
| 2457 | /* receive one message on BSSGP with all aggregated data in payload: */ |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 2458 | BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id, total_payload)); |
Vadim Yanitskiy | 8e6df0c | 2020-10-18 00:13:15 +0700 | [diff] [blame] | 2459 | |
| 2460 | f_shutdown(__BFILE__, __LINE__, final := true); |
Pau Espin Pedrol | a416cb8 | 2020-05-15 14:09:02 +0200 | [diff] [blame] | 2461 | } |
| 2462 | |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2463 | /* Verify that if PCU doesn't get an ACK for first DL block after IMM ASS, it |
| 2464 | * will retry by retransmitting both the IMM ASS + DL block after poll (ack) |
| 2465 | * timeout occurs (specified by sent RRBP on DL block). */ |
| 2466 | testcase TC_imm_ass_dl_block_retrans() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2467 | var RlcmacDlBlock dl_block; |
| 2468 | var octetstring data := f_rnd_octstring(10); |
Vadim Yanitskiy | b6733a6 | 2020-05-10 14:39:00 +0700 | [diff] [blame] | 2469 | var uint32_t dl_fn; |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2470 | var GprsMS ms; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2471 | |
| 2472 | /* Initialize NS/BSSGP side */ |
| 2473 | f_init_bssgp(); |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2474 | /* Initialize GPRS MS side */ |
| 2475 | f_init_gprs_ms(); |
| 2476 | ms := g_ms[0]; /* We only use first MS in this test */ |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2477 | |
| 2478 | /* Initialize the PCU interface abstraction */ |
| 2479 | f_init_raw(testcasename()); |
| 2480 | |
| 2481 | /* Establish BSSGP connection to the PCU */ |
| 2482 | f_bssgp_establish(); |
Pau Espin Pedrol | 7b761e2 | 2021-01-11 14:43:35 +0100 | [diff] [blame] | 2483 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2484 | |
| 2485 | /* SGSN sends some DL data, PCU will page on CCCH (PCH) */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2486 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data)); |
| 2487 | f_ms_exp_dl_tbf_ass_ccch(ms, PCU_IF_SAPI_PCH); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2488 | |
| 2489 | /* Wait timer X2002 and DL block is available after CCCH IMM ASS: */ |
| 2490 | f_sleep(X2002); |
Vadim Yanitskiy | b6733a6 | 2020-05-10 14:39:00 +0700 | [diff] [blame] | 2491 | f_rx_rlcmac_dl_block_exp_data(dl_block, dl_fn, data, 0); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2492 | |
| 2493 | /* Now we don't ack the dl block (emulate MS failed receiveing IMM ASS |
| 2494 | * or GPRS DL, or DL ACK was lost for some reason). As a result, PCU |
| 2495 | * should retrigger IMM ASS + GPRS DL procedure after poll timeout. */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2496 | f_ms_exp_dl_tbf_ass_ccch(ms, PCU_IF_SAPI_PCH); |
Vadim Yanitskiy | 2e213ae | 2020-05-06 22:26:17 +0700 | [diff] [blame] | 2497 | |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2498 | /* Wait timer X2002 and DL block is available after CCCH IMM ASS: */ |
| 2499 | f_sleep(X2002); |
Vadim Yanitskiy | b6733a6 | 2020-05-10 14:39:00 +0700 | [diff] [blame] | 2500 | f_rx_rlcmac_dl_block_exp_data(dl_block, dl_fn, data, 0); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2501 | |
| 2502 | /* ACK the DL block */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2503 | f_acknackdesc_ack_block(ms.dl_tbf.acknack_desc, dl_block, '1'B); |
| 2504 | f_ms_tx_ul_block(ms, ts_RLCMAC_DL_ACK_NACK(ms.dl_tbf.tfi, ms.dl_tbf.acknack_desc), |
| 2505 | f_dl_block_ack_fn(dl_block, dl_fn)); |
Vadim Yanitskiy | 91f8a09 | 2020-05-06 21:41:05 +0700 | [diff] [blame] | 2506 | |
| 2507 | f_shutdown(__BFILE__, __LINE__, final := true); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 2508 | } |
| 2509 | |
Vadim Yanitskiy | 71238c1 | 2020-05-11 03:48:06 +0700 | [diff] [blame] | 2510 | /* Verify scheduling of multiple Downlink data blocks during one RRBP. */ |
| 2511 | testcase TC_dl_flow_more_blocks() runs on RAW_PCU_Test_CT { |
| 2512 | var AckNackDescription ack_nack_desc := valueof(t_AckNackDescription_init); |
| 2513 | var octetstring data := f_rnd_octstring(16); |
Vadim Yanitskiy | 71238c1 | 2020-05-11 03:48:06 +0700 | [diff] [blame] | 2514 | var PacketDlAssign dl_tbf_ass; |
Vadim Yanitskiy | 71238c1 | 2020-05-11 03:48:06 +0700 | [diff] [blame] | 2515 | var RlcmacDlBlock dl_block; |
| 2516 | var uint32_t ack_fn; |
| 2517 | var uint32_t fn; |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2518 | var GprsMS ms; |
Vadim Yanitskiy | 71238c1 | 2020-05-11 03:48:06 +0700 | [diff] [blame] | 2519 | timer T := 5.0; |
| 2520 | |
| 2521 | /* Initialize NS/BSSGP side */ |
| 2522 | f_init_bssgp(); |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2523 | /* Initialize GPRS MS side */ |
| 2524 | f_init_gprs_ms(); |
| 2525 | ms := g_ms[0]; /* We only use first MS in this test */ |
Vadim Yanitskiy | 71238c1 | 2020-05-11 03:48:06 +0700 | [diff] [blame] | 2526 | |
| 2527 | /* Initialize the PCU interface abstraction */ |
Pau Espin Pedrol | 745a48b | 2020-10-30 15:31:07 +0100 | [diff] [blame] | 2528 | f_init_raw(testcasename(), ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
Vadim Yanitskiy | 71238c1 | 2020-05-11 03:48:06 +0700 | [diff] [blame] | 2529 | |
Daniel Willmann | 535aea6 | 2020-09-21 13:27:08 +0200 | [diff] [blame] | 2530 | f_statsd_reset(); |
| 2531 | |
Vadim Yanitskiy | 71238c1 | 2020-05-11 03:48:06 +0700 | [diff] [blame] | 2532 | /* Establish BSSGP connection to the PCU */ |
| 2533 | f_bssgp_establish(); |
Pau Espin Pedrol | 7b761e2 | 2021-01-11 14:43:35 +0100 | [diff] [blame] | 2534 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
Vadim Yanitskiy | 71238c1 | 2020-05-11 03:48:06 +0700 | [diff] [blame] | 2535 | |
| 2536 | /* SGSN sends some DL data, PCU will page on CCCH (PCH) */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2537 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data)); |
| 2538 | f_ms_exp_dl_tbf_ass_ccch(ms, PCU_IF_SAPI_PCH); |
Vadim Yanitskiy | 71238c1 | 2020-05-11 03:48:06 +0700 | [diff] [blame] | 2539 | |
| 2540 | /* Wait timer X2002 and DL block is available after CCCH IMM ASS */ |
| 2541 | f_sleep(X2002); |
| 2542 | |
| 2543 | /* Expect the first (GPRS DL) block with bsn=0 and rrbp_valid=1 */ |
| 2544 | f_rx_rlcmac_dl_block_exp_data(dl_block, fn, data, 0); |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2545 | f_acknackdesc_ack_block(ms.dl_tbf.acknack_desc, dl_block); |
Vadim Yanitskiy | 71238c1 | 2020-05-11 03:48:06 +0700 | [diff] [blame] | 2546 | |
| 2547 | /* TDMA frame number on which we are supposed to send the ACK */ |
| 2548 | ack_fn := f_dl_block_ack_fn(dl_block, fn); |
| 2549 | |
| 2550 | /* SGSN sends more blocks during the indicated RRBP */ |
| 2551 | for (var integer bsn := 1; bsn < 63; bsn := bsn + 1) { |
| 2552 | data := f_rnd_octstring(16); /* Random LLC data */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2553 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data)); |
Vadim Yanitskiy | 71238c1 | 2020-05-11 03:48:06 +0700 | [diff] [blame] | 2554 | |
| 2555 | f_rx_rlcmac_dl_block_exp_data(dl_block, fn, data, bsn); |
| 2556 | |
| 2557 | /* Make sure this block has the same TFI as was assigned |
| 2558 | * FIXME: this is only valid for GPRS, not EGPRS. */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2559 | if (dl_block.data.mac_hdr.hdr_ext.tfi != ms.dl_tbf.tfi) { |
Vadim Yanitskiy | 71238c1 | 2020-05-11 03:48:06 +0700 | [diff] [blame] | 2560 | setverdict(fail, "Rx DL data block with unexpected TFI: ", |
| 2561 | dl_block.data.mac_hdr.hdr_ext.tfi); |
| 2562 | f_shutdown(__BFILE__, __LINE__); |
| 2563 | } |
| 2564 | |
| 2565 | /* Keep Ack/Nack description updated */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2566 | f_acknackdesc_ack_block(ms.dl_tbf.acknack_desc, dl_block); |
Vadim Yanitskiy | 71238c1 | 2020-05-11 03:48:06 +0700 | [diff] [blame] | 2567 | |
| 2568 | /* Break if this is the end of RRBP */ |
| 2569 | if (fn == ack_fn) { |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2570 | ms.dl_tbf.acknack_desc.final_ack := '1'B; |
Vadim Yanitskiy | 71238c1 | 2020-05-11 03:48:06 +0700 | [diff] [blame] | 2571 | break; |
| 2572 | } |
| 2573 | } |
| 2574 | |
| 2575 | /* This is the end of RRBP, send Packet Downlink Ack/Nack */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 2576 | f_ms_tx_ul_block(ms, ts_RLCMAC_DL_ACK_NACK(ms.dl_tbf.tfi, ms.dl_tbf.acknack_desc), fn := fn); |
Vadim Yanitskiy | 71238c1 | 2020-05-11 03:48:06 +0700 | [diff] [blame] | 2577 | |
| 2578 | /* Make sure that the next block (after the Ack) is dummy */ |
| 2579 | f_rx_rlcmac_dl_block_exp_dummy(dl_block); |
| 2580 | |
Daniel Willmann | 535aea6 | 2020-09-21 13:27:08 +0200 | [diff] [blame] | 2581 | var StatsDExpects expect := { |
| 2582 | { name := "TTCN3.bts.0.rach.requests", mtype := "c", min := 0, max := 0}, |
| 2583 | { name := "TTCN3.bts.0.immediate.assignment_DL", mtype := "c", min := 1, max := 1}, |
| 2584 | { name := "TTCN3.bts.0.immediate.assignment_UL", mtype := "c", min := 0, max := 0}, |
| 2585 | { name := "TTCN3.bts.0.tbf.dl.alloc", mtype := "c", min := 1, max := 1}, |
| 2586 | { name := "TTCN3.bts.0.tbf.ul.alloc", mtype := "c", min := 0, max := 0}, |
Pau Espin Pedrol | 0bf74e5 | 2020-12-11 19:25:42 +0100 | [diff] [blame] | 2587 | { name := "TTCN3.bts.0.rlc.dl_payload_bytes", mtype := "c", min := 64, max := 64}, |
Daniel Willmann | 535aea6 | 2020-09-21 13:27:08 +0200 | [diff] [blame] | 2588 | { name := "TTCN3.bts.0.rlc.ul_payload_bytes", mtype := "c", min := 0, max := 0} |
| 2589 | }; |
| 2590 | f_statsd_expect(expect); |
| 2591 | |
Vadim Yanitskiy | 71238c1 | 2020-05-11 03:48:06 +0700 | [diff] [blame] | 2592 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 2593 | } |
| 2594 | |
Pau Espin Pedrol | 05b6c17 | 2020-06-26 17:28:23 +0200 | [diff] [blame] | 2595 | /* Verify Decoding and segmentation of UL LLC PDUs into RLC data blocks, OS#4559. |
| 2596 | * Check "GPRS from A-Z" slide "Example of LI-Field and E-Bit" page 186. |
| 2597 | * Check "3GPP TS 44.060" Annex B. */ |
| 2598 | testcase TC_ul_flow_multiple_llc_blocks() runs on RAW_PCU_Test_CT { |
| 2599 | var RlcmacDlBlock dl_block; |
| 2600 | var octetstring dataA := f_rnd_octstring(20); |
| 2601 | var octetstring dataB := f_rnd_octstring(13); |
| 2602 | var octetstring dataC := f_rnd_octstring(3); |
| 2603 | var octetstring dataD := f_rnd_octstring(12); |
| 2604 | var uint32_t sched_fn; |
| 2605 | var GprsMS ms; |
| 2606 | var template (value) RlcmacUlBlock ul_data; |
| 2607 | |
| 2608 | /* Initialize NS/BSSGP side */ |
| 2609 | f_init_bssgp(); |
| 2610 | /* Initialize GPRS MS side */ |
| 2611 | f_init_gprs_ms(); |
| 2612 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 2613 | |
| 2614 | /* Initialize the PCU interface abstraction */ |
Pau Espin Pedrol | 745a48b | 2020-10-30 15:31:07 +0100 | [diff] [blame] | 2615 | f_init_raw(testcasename(), ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
Pau Espin Pedrol | 05b6c17 | 2020-06-26 17:28:23 +0200 | [diff] [blame] | 2616 | |
| 2617 | /* Establish BSSGP connection to the PCU */ |
| 2618 | f_bssgp_establish(); |
Pau Espin Pedrol | 7b761e2 | 2021-01-11 14:43:35 +0100 | [diff] [blame] | 2619 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
Pau Espin Pedrol | 05b6c17 | 2020-06-26 17:28:23 +0200 | [diff] [blame] | 2620 | |
| 2621 | /* Establish an Uplink TBF */ |
| 2622 | f_ms_establish_ul_tbf(ms); |
| 2623 | |
| 2624 | /* Summary of what's transmitted: |
| 2625 | * 1- UL RlcDataBlock(dataA) [BSN=0, CV=3] |
| 2626 | * 2- UL RlcDataBlock(dataA finished, dataB starts) [BSN=1, CV=2] |
| 2627 | * 3- UL RlcDataBlock(dataB finished, dataC starts and finishes, dataD starts) [BSN=2, CV=1] |
| 2628 | * 4- UL RlcDataBlock(dataD finishes) [BSN=3, CV=0] |
| 2629 | * And on SGSN we receive 4 packets, one for each LlcBlock dataA..D. |
| 2630 | * We'll also receive some UL ACK/NACK we need to reply with CTRL ACK. |
| 2631 | */ |
| 2632 | |
| 2633 | /* UL RlcDataBlock(dataA) [BSN=0, CV=3] */ |
Pau Espin Pedrol | cb00c52 | 2020-11-06 19:52:05 +0100 | [diff] [blame] | 2634 | ul_data := t_RLCMAC_UL_DATA_TLLI(cs := CS_1, |
| 2635 | tfi := ms.ul_tbf.tfi, |
Pau Espin Pedrol | 05b6c17 | 2020-06-26 17:28:23 +0200 | [diff] [blame] | 2636 | cv := 3, |
| 2637 | bsn := ms.ul_tbf.bsn, |
| 2638 | blocks := { t_RLCMAC_LLCBLOCK(substr(dataA, 0, 16)) }, |
| 2639 | tlli := ms.tlli); |
| 2640 | /* Indicate no llc header, meaning first LLC block doesn't finish in current |
| 2641 | * RLCMAC block being sent. */ |
| 2642 | ul_data.data.mac_hdr.e := true; |
| 2643 | f_ultbf_inc_bsn(ms.ul_tbf); |
Pau Espin Pedrol | dee5570 | 2021-04-23 21:08:22 +0200 | [diff] [blame] | 2644 | f_ms_tx_ul_block(ms, ul_data, ms.ul_tbf.start_time_fn); |
Pau Espin Pedrol | 05b6c17 | 2020-06-26 17:28:23 +0200 | [diff] [blame] | 2645 | |
| 2646 | /* UL RlcDataBlock(dataA finished, dataB starts) [BSN=1, CV=2] */ |
Pau Espin Pedrol | cb00c52 | 2020-11-06 19:52:05 +0100 | [diff] [blame] | 2647 | ul_data := t_RLCMAC_UL_DATA_TLLI(cs := CS_1, |
| 2648 | tfi := ms.ul_tbf.tfi, |
Pau Espin Pedrol | 05b6c17 | 2020-06-26 17:28:23 +0200 | [diff] [blame] | 2649 | cv := 2, |
| 2650 | bsn := ms.ul_tbf.bsn, |
| 2651 | blocks := { t_RLCMAC_LLCBLOCK(substr(dataA, 16, 4), |
| 2652 | t_RLCMAC_LLCBLOCK_HDR(length_ind := 4, more := true, e := true)), |
| 2653 | t_RLCMAC_LLCBLOCK(substr(dataB, 0, 11)) |
| 2654 | }, |
| 2655 | tlli := ms.tlli); |
| 2656 | f_ultbf_inc_bsn(ms.ul_tbf); |
| 2657 | f_ms_tx_ul_block(ms, ul_data); |
| 2658 | |
| 2659 | /* UL block dataA should be received in SGSN */ |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 2660 | BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id, dataA)); |
Pau Espin Pedrol | 05b6c17 | 2020-06-26 17:28:23 +0200 | [diff] [blame] | 2661 | |
| 2662 | /* UL RlcDataBlock(dataB finished, dataC starts and finishes, dataD starts) [BSN=2, CV=1] */ |
Pau Espin Pedrol | cb00c52 | 2020-11-06 19:52:05 +0100 | [diff] [blame] | 2663 | ul_data := t_RLCMAC_UL_DATA_TLLI(cs := CS_1, |
| 2664 | tfi := ms.ul_tbf.tfi, |
Pau Espin Pedrol | 05b6c17 | 2020-06-26 17:28:23 +0200 | [diff] [blame] | 2665 | cv := 1, |
| 2666 | bsn := ms.ul_tbf.bsn, |
| 2667 | blocks := { t_RLCMAC_LLCBLOCK(substr(dataB, 11, 2), |
| 2668 | t_RLCMAC_LLCBLOCK_HDR(length_ind := 2, more := true, e := false)), |
| 2669 | t_RLCMAC_LLCBLOCK(substr(dataC, 0, 3), |
| 2670 | t_RLCMAC_LLCBLOCK_HDR(length_ind := 3, more := true, e := true)), |
| 2671 | t_RLCMAC_LLCBLOCK(substr(dataD, 0, 9)) |
| 2672 | }, |
| 2673 | tlli := ms.tlli); |
| 2674 | f_ultbf_inc_bsn(ms.ul_tbf); |
| 2675 | f_ms_tx_ul_block(ms, ul_data); |
| 2676 | |
| 2677 | /* UL block dataB and dataC should be received in SGSN */ |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 2678 | BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id, dataB)); |
| 2679 | BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id, dataC)); |
Pau Espin Pedrol | 05b6c17 | 2020-06-26 17:28:23 +0200 | [diff] [blame] | 2680 | |
| 2681 | /* UL RlcDataBlock(dataD finishes) [BSN=3, CV=0] */ |
Pau Espin Pedrol | cb00c52 | 2020-11-06 19:52:05 +0100 | [diff] [blame] | 2682 | ul_data := t_RLCMAC_UL_DATA_TLLI( |
| 2683 | cs := CS_1, |
| 2684 | tfi := ms.ul_tbf.tfi, |
Pau Espin Pedrol | 05b6c17 | 2020-06-26 17:28:23 +0200 | [diff] [blame] | 2685 | cv := 0, |
| 2686 | bsn := ms.ul_tbf.bsn, |
| 2687 | blocks := { t_RLCMAC_LLCBLOCK(substr(dataD, 9, 3), |
| 2688 | t_RLCMAC_LLCBLOCK_HDR(length_ind := 3, more := false, e := true)) |
| 2689 | }, |
| 2690 | tlli := ms.tlli); |
| 2691 | f_ultbf_inc_bsn(ms.ul_tbf); |
| 2692 | f_ms_tx_ul_block(ms, ul_data); |
| 2693 | |
| 2694 | /* UL block dataB and dataD should be received in SGSN */ |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 2695 | BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id, dataD)); |
Pau Espin Pedrol | 05b6c17 | 2020-06-26 17:28:23 +0200 | [diff] [blame] | 2696 | |
| 2697 | f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn); |
| 2698 | /* DL ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 2699 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
| 2700 | |
| 2701 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 2702 | } |
| 2703 | |
Pau Espin Pedrol | 90fdfed | 2021-03-02 17:29:32 +0100 | [diff] [blame] | 2704 | /* Validate an Imm Assignment is retransmitted if first RRBP requesting DL |
| 2705 | * ACK/NACK is not answered */ |
| 2706 | testcase TC_dl_no_ack_retrans_imm_ass() runs on RAW_PCU_Test_CT { |
| 2707 | var RlcmacDlBlock dl_block; |
| 2708 | var octetstring data1 := f_rnd_octstring(200); |
| 2709 | var octetstring data2 := f_rnd_octstring(10); |
| 2710 | var uint32_t dl_fn; |
| 2711 | var GprsMS ms; |
| 2712 | var template (value) TsTrxBtsNum nr; |
| 2713 | var BTS_PDTCH_Block data_msg; |
| 2714 | |
| 2715 | /* Initialize NS/BSSGP side */ |
| 2716 | f_init_bssgp(); |
| 2717 | /* Initialize GPRS MS side */ |
| 2718 | f_init_gprs_ms(); |
| 2719 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 2720 | |
| 2721 | /* Initialize the PCU interface abstraction */ |
| 2722 | f_init_raw(testcasename()) |
| 2723 | |
| 2724 | /* Establish BSSGP connection to the PCU */ |
| 2725 | f_bssgp_establish(); |
| 2726 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 2727 | |
| 2728 | /* SGSN sends some DL data, PCU will page on CCCH (PCH) */ |
| 2729 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data1)); |
| 2730 | f_ms_exp_dl_tbf_ass_ccch(ms, PCU_IF_SAPI_PCH); |
| 2731 | |
| 2732 | /* Wait timer X2002 and DL block is available after CCCH IMM ASS: */ |
| 2733 | f_sleep(X2002); |
| 2734 | |
| 2735 | /* Recv DL data until receiving RRBP to DL ACK (because it's last queued DL data) */ |
| 2736 | while (true) { |
| 2737 | f_rx_rlcmac_dl_block_exp_data(dl_block, dl_fn, ?, ?); |
| 2738 | |
| 2739 | /* Keep Ack/Nack description updated (except for last BSN) */ |
| 2740 | f_acknackdesc_ack_block(ms.dl_tbf.acknack_desc, dl_block); |
| 2741 | |
| 2742 | if (f_dl_block_rrbp_valid(dl_block)) { |
| 2743 | /* Don't transmit DL ACK here on purpose ignore it */ |
| 2744 | break; |
| 2745 | } |
| 2746 | } |
| 2747 | |
| 2748 | /* PCU starts whole process again */ |
| 2749 | f_ms_exp_dl_tbf_ass_ccch(ms, PCU_IF_SAPI_PCH); |
| 2750 | |
| 2751 | /* Wait timer X2002 and DL block is available after CCCH IMM ASS: */ |
| 2752 | f_sleep(X2002); |
| 2753 | |
| 2754 | /* Recv DL data until receiving RRBP to DL ACK (because it's last queued |
| 2755 | /* DL data), after that we receive only DUMMY blocks so we are done */ |
| 2756 | var boolean data_received := false; |
| 2757 | nr := ts_TsTrxBtsNum; |
| 2758 | BTS.send(ts_PCUIF_RTS_REQ(nr.bts_nr, nr.trx_nr, nr.ts_nr, |
| 2759 | sapi := PCU_IF_SAPI_PDTCH, fn := 0, |
| 2760 | arfcn := f_trxnr2arfcn(valueof(nr.trx_nr)), |
| 2761 | block_nr := nr.blk_nr)); |
| 2762 | alt { |
| 2763 | [data_received] BTS.receive(tr_PCUIF_DATA_PDTCH(nr.bts_nr, |
| 2764 | tr_PCUIF_DATA(nr.trx_nr, nr.ts_nr, sapi := PCU_IF_SAPI_PDTCH), |
| 2765 | tr_RLCMAC_DUMMY_CTRL)) { /* done */ } |
| 2766 | [] BTS.receive(tr_PCUIF_DATA_PDTCH(nr.bts_nr, |
| 2767 | tr_PCUIF_DATA(nr.trx_nr, nr.ts_nr, sapi := PCU_IF_SAPI_PDTCH), |
| 2768 | tr_RLCMAC_DATA)) -> value data_msg { |
| 2769 | data_received := true; |
| 2770 | f_acknackdesc_ack_block(ms.dl_tbf.acknack_desc, data_msg.dl_block); |
| 2771 | if (data_msg.dl_block.data.mac_hdr.hdr_ext.fbi) { |
| 2772 | log("Received FINAL_ACK"); |
| 2773 | ms.dl_tbf.acknack_desc.final_ack := '1'B; |
| 2774 | } |
| 2775 | if (f_dl_block_rrbp_valid(data_msg.dl_block)) { |
| 2776 | f_ms_tx_ul_block(ms, ts_RLCMAC_DL_ACK_NACK(ms.dl_tbf.tfi, ms.dl_tbf.acknack_desc), |
| 2777 | f_dl_block_ack_fn(dl_block, data_msg.raw.fn)); |
| 2778 | } |
| 2779 | nr := ts_TsTrxBtsNum; |
| 2780 | BTS.send(ts_PCUIF_RTS_REQ(nr.bts_nr, nr.trx_nr, nr.ts_nr, |
| 2781 | sapi := PCU_IF_SAPI_PDTCH, fn := 0, |
| 2782 | arfcn := f_trxnr2arfcn(valueof(nr.trx_nr)), |
| 2783 | block_nr := nr.blk_nr)); |
| 2784 | repeat; |
| 2785 | } |
| 2786 | [] BTS.receive { |
| 2787 | setverdict(fail, "Unexpected BTS message"); |
| 2788 | f_shutdown(__BFILE__, __LINE__); |
| 2789 | } |
| 2790 | } |
| 2791 | |
| 2792 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 2793 | } |
| 2794 | |
Pau Espin Pedrol | 0ea8b6f | 2020-10-29 20:48:43 +0100 | [diff] [blame] | 2795 | /* Verify allocation and use of multislot tbf, triggered by MS class provided in SGSN. SYS#5131 */ |
| 2796 | testcase TC_dl_multislot_tbf_ms_class_from_sgsn() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | 745a48b | 2020-10-30 15:31:07 +0100 | [diff] [blame] | 2797 | var PCUIF_info_ind info_ind := valueof(ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
Pau Espin Pedrol | 0ea8b6f | 2020-10-29 20:48:43 +0100 | [diff] [blame] | 2798 | var octetstring data := f_rnd_octstring(10); |
| 2799 | var PacketDlAssign dl_tbf_ass; |
| 2800 | var RlcmacDlBlock dl_block; |
| 2801 | var uint32_t poll_fn; |
| 2802 | var uint32_t sched_fn; |
| 2803 | var GprsMS ms; |
| 2804 | timer T := 5.0; |
| 2805 | |
| 2806 | /* Initialize NS/BSSGP side */ |
| 2807 | f_init_bssgp(); |
| 2808 | /* Initialize GPRS MS side */ |
| 2809 | f_init_gprs_ms(); |
| 2810 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 2811 | |
| 2812 | /* Only 1 TRX with 8 PDCH */ |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 2813 | f_PCUIF_PDCHMask_set(info_ind, '11111111'B, 0); |
| 2814 | f_PCUIF_PDCHMask_set(info_ind, '00000000'B, (1 .. 7)); |
Pau Espin Pedrol | 0ea8b6f | 2020-10-29 20:48:43 +0100 | [diff] [blame] | 2815 | |
| 2816 | /* Initialize the PCU interface abstraction */ |
| 2817 | f_init_raw(testcasename(), info_ind); |
| 2818 | |
| 2819 | /* Establish BSSGP connection to the PCU */ |
| 2820 | f_bssgp_establish(); |
| 2821 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 2822 | |
| 2823 | /* Establish an Uplink TBF, this way the PCU can send DL Assignment |
| 2824 | through PDCH (no multiblock assignment possible through PCH) */ |
| 2825 | f_ms_establish_ul_tbf(ms); |
| 2826 | |
| 2827 | /* Send one UL block (with TLLI since we are in One-Phase Access |
| 2828 | contention resoultion) and make sure it is ACKED fine */ |
Pau Espin Pedrol | dee5570 | 2021-04-23 21:08:22 +0200 | [diff] [blame] | 2829 | f_ms_tx_ul_data_block(ms, data, with_tlli := true, fn := ms.ul_tbf.start_time_fn, |
| 2830 | nr := f_ms_tx_TsTrxBtsNum(ms)); |
Pau Espin Pedrol | 0ea8b6f | 2020-10-29 20:48:43 +0100 | [diff] [blame] | 2831 | /* DL ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 2832 | f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, poll_fn, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 2833 | |
| 2834 | /* SGSN sends some DL data, PCU will assign DL TBF through PACCH */ |
| 2835 | var MultislotCap_GPRS_BSSGP mscap_gprs := { |
| 2836 | gprsmultislotclass := '10010'B, /* MS class 18, supports 8 DL and 8 UL */ |
| 2837 | gprsextendeddynalloccap := '0'B |
| 2838 | }; |
| 2839 | var MSRadioAccessCapabilityV_BSSGP ms_racap := { valueof(ts_RaCapRec_BSSGP('0001'B /* E-GSM */, mscap_gprs, omit)) }; |
| 2840 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data, ms_racap)); |
| 2841 | dl_block := f_ms_rx_pkt_ass_pacch(ms, sched_fn, tr_RLCMAC_DL_PACKET_ASS, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 2842 | if (f_dltbf_num_slots(ms.dl_tbf) != 8) { |
| 2843 | setverdict(fail, "Expected 8 PDCH slots allocated but got ", f_dltbf_num_slots(ms.dl_tbf)); |
| 2844 | f_shutdown(__BFILE__, __LINE__); |
| 2845 | } |
| 2846 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 2847 | |
| 2848 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 2849 | } |
| 2850 | |
Pau Espin Pedrol | 8155bf4 | 2020-10-29 17:34:26 +0100 | [diff] [blame] | 2851 | testcase TC_dl_multislot_tbf_ms_class_from_2phase() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | 745a48b | 2020-10-30 15:31:07 +0100 | [diff] [blame] | 2852 | var PCUIF_info_ind info_ind := valueof(ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
Pau Espin Pedrol | 8155bf4 | 2020-10-29 17:34:26 +0100 | [diff] [blame] | 2853 | var RlcmacDlBlock dl_block; |
| 2854 | var octetstring data := f_rnd_octstring(10); |
| 2855 | var PollFnCtx pollctx; |
| 2856 | var uint32_t sched_fn; |
| 2857 | var GprsMS ms; |
| 2858 | |
| 2859 | var MultislotCap_GPRS mscap_gprs := { |
| 2860 | gprsmultislotclass := '10010'B, /* MS class 18, supports 8 DL and 8 UL */ |
| 2861 | gprsextendeddynalloccap := '0'B |
| 2862 | }; |
| 2863 | var MSRadioAccessCapabilityV ms_racap := { valueof(ts_RaCapRec('0001'B /* E-GSM */, mscap_gprs, omit)) }; |
| 2864 | |
| 2865 | |
| 2866 | /* Initialize NS/BSSGP side */ |
| 2867 | f_init_bssgp(); |
| 2868 | /* Initialize GPRS MS side */ |
| 2869 | f_init_gprs_ms(); |
| 2870 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 2871 | |
| 2872 | /* Only 1 TRX with 8 PDCH */ |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 2873 | f_PCUIF_PDCHMask_set(info_ind, '11111111'B, 0); |
| 2874 | f_PCUIF_PDCHMask_set(info_ind, '00000000'B, (1 .. 7)); |
Pau Espin Pedrol | 8155bf4 | 2020-10-29 17:34:26 +0100 | [diff] [blame] | 2875 | |
| 2876 | /* Initialize the PCU interface abstraction */ |
| 2877 | f_init_raw(testcasename(), info_ind); |
| 2878 | |
| 2879 | /* Establish BSSGP connection to the PCU */ |
| 2880 | f_bssgp_establish(); |
| 2881 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 2882 | |
| 2883 | /* Send PACKET RESOURCE REQUEST to notify the MultiSlot Class */ |
| 2884 | pollctx := f_ms_establish_ul_tbf_2phase_access(ms, ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, ms_racap)); |
| 2885 | |
| 2886 | /* Pkt Uplink Assignment above sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 2887 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), pollctx.fn, nr := pollctx.tstrxbts); |
| 2888 | |
| 2889 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data)); |
| 2890 | dl_block := f_ms_rx_pkt_ass_pacch(ms, sched_fn, tr_RLCMAC_DL_PACKET_ASS, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 2891 | if (f_dltbf_num_slots(ms.dl_tbf) != 8) { |
| 2892 | setverdict(fail, "Expected 8 PDCH slot allocated but got ", f_dltbf_num_slots(ms.dl_tbf)); |
| 2893 | f_shutdown(__BFILE__, __LINE__); |
| 2894 | } |
| 2895 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 2896 | |
| 2897 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 2898 | } |
| 2899 | |
Pau Espin Pedrol | a9f27fa | 2020-10-30 13:16:21 +0100 | [diff] [blame] | 2900 | testcase TC_ul_multislot_tbf_ms_class_from_2phase() runs on RAW_PCU_Test_CT { |
| 2901 | var PCUIF_info_ind info_ind := valueof(ts_PCUIF_INFO_default); |
| 2902 | var RlcmacDlBlock dl_block; |
| 2903 | var octetstring data := f_rnd_octstring(10); |
| 2904 | var PollFnCtx pollctx; |
| 2905 | var uint32_t sched_fn; |
| 2906 | var GprsMS ms; |
| 2907 | |
| 2908 | var MultislotCap_GPRS mscap_gprs := { |
| 2909 | gprsmultislotclass := '10010'B, /* MS class 18, supports 8 DL and 8 UL */ |
| 2910 | gprsextendeddynalloccap := '0'B |
| 2911 | }; |
| 2912 | var MSRadioAccessCapabilityV ms_racap := { valueof(ts_RaCapRec('0001'B /* E-GSM */, mscap_gprs, omit)) }; |
| 2913 | |
| 2914 | |
| 2915 | /* Initialize NS/BSSGP side */ |
| 2916 | f_init_bssgp(); |
| 2917 | /* Initialize GPRS MS side */ |
| 2918 | f_init_gprs_ms(); |
| 2919 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 2920 | |
| 2921 | /* Only 1 TRX with 8 PDCH */ |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 2922 | f_PCUIF_PDCHMask_set(info_ind, '11111111'B, 0); |
| 2923 | f_PCUIF_PDCHMask_set(info_ind, '00000000'B, (1 .. 7)); |
Pau Espin Pedrol | a9f27fa | 2020-10-30 13:16:21 +0100 | [diff] [blame] | 2924 | |
| 2925 | /* Initialize the PCU interface abstraction */ |
| 2926 | f_init_raw(testcasename(), info_ind); |
| 2927 | |
| 2928 | /* Establish BSSGP connection to the PCU */ |
| 2929 | f_bssgp_establish(); |
| 2930 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 2931 | |
| 2932 | /* Send PACKET RESOURCE REQUEST to notify the MultiSlot Class */ |
| 2933 | pollctx := f_ms_establish_ul_tbf_2phase_access(ms, ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, ms_racap)); |
| 2934 | |
| 2935 | if (f_ultbf_num_slots(ms.ul_tbf) != 8) { |
| 2936 | setverdict(fail, "Expected 8 PDCH slot allocated but got ", f_ultbf_num_slots(ms.ul_tbf)); |
| 2937 | f_shutdown(__BFILE__, __LINE__); |
| 2938 | } |
| 2939 | |
| 2940 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 2941 | } |
| 2942 | |
Pau Espin Pedrol | cdbe903 | 2020-07-07 20:20:42 +0200 | [diff] [blame] | 2943 | /* Test scenario where MS wants to request a new TBF once the current one is |
| 2944 | * ending, by means of sending a Packet Resource Request on ul slot provided by |
| 2945 | * last Pkt Ul ACK's RRBP. |
| 2946 | * See 3GPP TS 44.060 sec 9.3.2.4.2 "Non-extended uplink TBF mode" */ |
| 2947 | testcase TC_ul_tbf_reestablish_with_pkt_resource_req() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | cdbe903 | 2020-07-07 20:20:42 +0200 | [diff] [blame] | 2948 | var RlcmacDlBlock dl_block; |
| 2949 | var octetstring data := f_rnd_octstring(10); |
| 2950 | var uint32_t sched_fn; |
| 2951 | var uint32_t dl_fn; |
| 2952 | var template RlcmacDlBlock acknack_tmpl; |
| 2953 | var GprsMS ms; |
| 2954 | |
| 2955 | /* Initialize NS/BSSGP side */ |
| 2956 | f_init_bssgp(); |
| 2957 | /* Initialize GPRS MS side */ |
| 2958 | f_init_gprs_ms(); |
| 2959 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 2960 | |
| 2961 | /* Initialize the PCU interface abstraction */ |
| 2962 | f_init_raw(testcasename()); |
| 2963 | |
| 2964 | /* Establish BSSGP connection to the PCU */ |
| 2965 | f_bssgp_establish(); |
Pau Espin Pedrol | 7b761e2 | 2021-01-11 14:43:35 +0100 | [diff] [blame] | 2966 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
Pau Espin Pedrol | cdbe903 | 2020-07-07 20:20:42 +0200 | [diff] [blame] | 2967 | |
| 2968 | /* Establish an Uplink TBF */ |
| 2969 | f_ms_establish_ul_tbf(ms); |
| 2970 | |
| 2971 | /* Send one UL block (with TLLI since we are in One-Phase Access |
| 2972 | contention resoultion) and make sure it is ACKED fine */ |
Pau Espin Pedrol | dee5570 | 2021-04-23 21:08:22 +0200 | [diff] [blame] | 2973 | f_ms_tx_ul_data_block_multi(ms, 1, with_tlli := true, fn := ms.ul_tbf.start_time_fn); |
Pau Espin Pedrol | cdbe903 | 2020-07-07 20:20:42 +0200 | [diff] [blame] | 2974 | |
| 2975 | /* UL block should be received in SGSN */ |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 2976 | BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id)); |
Pau Espin Pedrol | cdbe903 | 2020-07-07 20:20:42 +0200 | [diff] [blame] | 2977 | |
| 2978 | acknack_tmpl := tr_RLCMAC_UL_ACK_NACK_GPRS(ms.ul_tbf.tfi, |
| 2979 | tr_UlAckNackGprs(ms.tlli, |
| 2980 | tr_AckNackDescription(final_ack := '1'B), |
| 2981 | tr_UlAckNackGprsAdditionsRel99(tbf_est := true))) |
| 2982 | f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn, acknack_tmpl); |
| 2983 | |
| 2984 | /* TODO: verify TBF_EST and FinalACK are both '1' above */ |
| 2985 | |
| 2986 | /* Send PACKET RESOURCE REQUEST to request a new UL TBF */ |
Vadim Yanitskiy | f3cb4dd | 2020-07-21 01:52:33 +0700 | [diff] [blame] | 2987 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, omit)), sched_fn); |
Vadim Yanitskiy | 7431e9e | 2020-07-21 01:59:17 +0700 | [diff] [blame] | 2988 | f_ms_rx_pkt_ass_pacch(ms, sched_fn, tr_RLCMAC_UL_PACKET_ASS); |
Pau Espin Pedrol | cdbe903 | 2020-07-07 20:20:42 +0200 | [diff] [blame] | 2989 | /* DL ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 2990 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
| 2991 | |
| 2992 | /* Send one UL block (without TLLI since we are in Second-Phase Access) |
| 2993 | and make sure it is ACKED fine */ |
| 2994 | f_ms_tx_ul_data_block_multi(ms, 1, with_tlli := false); /* TODO: send using cs_mcs */ |
| 2995 | |
| 2996 | /* UL block should be received in SGSN */ |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 2997 | BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id)); |
Pau Espin Pedrol | cdbe903 | 2020-07-07 20:20:42 +0200 | [diff] [blame] | 2998 | |
| 2999 | f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn, acknack_tmpl); |
| 3000 | /* ACK the ACK */ |
| 3001 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
| 3002 | |
| 3003 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 3004 | } |
| 3005 | |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3006 | /* Test CS paging over the BTS<->PCU socket. |
| 3007 | * When a (class B or C, not A) MS has an active TBF (or is on the PDCH), the MS can not react on CS paging over CCCH. |
| 3008 | * Paging should be send on the PACCH. |
| 3009 | * |
| 3010 | * 1. Send a Paging Request over PCU socket. |
| 3011 | * 2. Send a Ready-To-Send message over PCU socket |
| 3012 | * 3. Expect a Paging Frame |
| 3013 | */ |
| 3014 | testcase TC_paging_cs_from_bts() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3015 | var RlcmacDlBlock dl_block; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3016 | var MobileIdentityLV mi; |
| 3017 | var octetstring mi_enc_lv; |
| 3018 | var hexstring imsi := f_gen_imsi(42); |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 3019 | var GprsMS ms; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3020 | |
| 3021 | /* Initialize NS/BSSGP side */ |
| 3022 | f_init_bssgp(); |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 3023 | /* Initialize GPRS MS side */ |
| 3024 | f_init_gprs_ms(); |
| 3025 | ms := g_ms[0]; /* We only use first MS in this test */ |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3026 | |
| 3027 | /* Initialize the PCU interface abstraction */ |
Pau Espin Pedrol | 745a48b | 2020-10-30 15:31:07 +0100 | [diff] [blame] | 3028 | f_init_raw(testcasename(), ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3029 | |
| 3030 | /* Establish BSSGP connection to the PCU */ |
| 3031 | f_bssgp_establish(); |
Pau Espin Pedrol | 7b761e2 | 2021-01-11 14:43:35 +0100 | [diff] [blame] | 3032 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3033 | |
| 3034 | /* Establish an Uplink TBF */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 3035 | f_ms_establish_ul_tbf(ms); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3036 | |
| 3037 | /* build mobile Identity */ |
| 3038 | mi := valueof(ts_MI_IMSI_LV(imsi)); |
| 3039 | mi_enc_lv := enc_MobileIdentityLV(mi); |
| 3040 | /* Send paging request */ |
| 3041 | BTS.send(ts_PCUIF_PAG_REQ(bts_nr := 0, id_lv := mi_enc_lv, chan_needed := 0, |
| 3042 | sapi :=PCU_IF_SAPI_PDTCH)); |
| 3043 | |
| 3044 | /* Receive it on BTS side towards MS */ |
| 3045 | f_rx_rlcmac_dl_block_exp_pkt_pag_req(dl_block); |
| 3046 | |
| 3047 | /* Make sure that Packet Paging Request contains the same IMSI */ |
Vadim Yanitskiy | 3e5f074 | 2020-11-01 03:30:18 +0700 | [diff] [blame] | 3048 | var PacketPagingReq req := dl_block.ctrl.payload.u.paging; |
| 3049 | if (not f_pkt_paging_match_imsi(req, imsi, ps_domain := false)) { |
| 3050 | setverdict(fail, "Failed to match IMSI ", imsi, " in ", req); |
| 3051 | } |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3052 | |
Vadim Yanitskiy | 91f8a09 | 2020-05-06 21:41:05 +0700 | [diff] [blame] | 3053 | f_shutdown(__BFILE__, __LINE__, final := true); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3054 | } |
| 3055 | |
| 3056 | /* Test CS paging over Gb (SGSN->PCU->BTS[PDCH]). |
| 3057 | */ |
| 3058 | private function f_tc_paging_cs_from_sgsn(Nsvci bvci, boolean use_ptmsi := false) |
| 3059 | runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3060 | var RlcmacDlBlock dl_block; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3061 | var hexstring imsi := f_gen_imsi(42); |
| 3062 | var GsmTmsi tmsi; |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 3063 | var GprsMS ms; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3064 | |
| 3065 | /* Initialize NS/BSSGP side */ |
| 3066 | f_init_bssgp(); |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 3067 | /* Initialize GPRS MS side */ |
| 3068 | f_init_gprs_ms(); |
| 3069 | ms := g_ms[0]; /* We only use first MS in this test */ |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3070 | |
| 3071 | /* Initialize the PCU interface abstraction */ |
Pau Espin Pedrol | 745a48b | 2020-10-30 15:31:07 +0100 | [diff] [blame] | 3072 | f_init_raw(testcasename(), ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3073 | |
| 3074 | /* Establish BSSGP connection to the PCU */ |
| 3075 | f_bssgp_establish(); |
Pau Espin Pedrol | 7b761e2 | 2021-01-11 14:43:35 +0100 | [diff] [blame] | 3076 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3077 | |
| 3078 | /* Establish an Uplink TBF */ |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 3079 | f_ms_establish_ul_tbf(ms); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3080 | |
| 3081 | /* Send paging request with or without TMSI */ |
| 3082 | if (use_ptmsi) { |
| 3083 | tmsi := oct2int(f_rnd_octstring(4)); /* Random P-TMSI */ |
| 3084 | BSSGP[0].send(ts_BSSGP_CS_PAGING_PTMSI(bvci, imsi, tmsi)); |
| 3085 | } else { |
| 3086 | BSSGP[0].send(ts_BSSGP_CS_PAGING_IMSI(bvci, imsi)); |
| 3087 | } |
| 3088 | |
| 3089 | /* Receive it on BTS side towards MS */ |
| 3090 | f_rx_rlcmac_dl_block_exp_pkt_pag_req(dl_block); |
| 3091 | |
| 3092 | /* Make sure that Packet Paging Request contains the same P-TMSI/IMSI */ |
Vadim Yanitskiy | 3e5f074 | 2020-11-01 03:30:18 +0700 | [diff] [blame] | 3093 | var PacketPagingReq req := dl_block.ctrl.payload.u.paging; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3094 | if (use_ptmsi) { |
Vadim Yanitskiy | 3e5f074 | 2020-11-01 03:30:18 +0700 | [diff] [blame] | 3095 | if (not f_pkt_paging_match_tmsi(req, tmsi, ps_domain := false)) { |
| 3096 | setverdict(fail, "Failed to match P-TMSI ", tmsi, " in ", req); |
| 3097 | } |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3098 | } else { |
Vadim Yanitskiy | 3e5f074 | 2020-11-01 03:30:18 +0700 | [diff] [blame] | 3099 | if (not f_pkt_paging_match_imsi(req, imsi, ps_domain := false)) { |
| 3100 | setverdict(fail, "Failed to match IMSI ", imsi, " in ", req); |
| 3101 | } |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3102 | } |
| 3103 | |
Vadim Yanitskiy | 91f8a09 | 2020-05-06 21:41:05 +0700 | [diff] [blame] | 3104 | f_shutdown(__BFILE__, __LINE__, final := true); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3105 | } |
| 3106 | |
| 3107 | testcase TC_paging_cs_from_sgsn_sign_ptmsi() runs on RAW_PCU_Test_CT { |
| 3108 | f_tc_paging_cs_from_sgsn(0, true); |
| 3109 | } |
| 3110 | |
| 3111 | testcase TC_paging_cs_from_sgsn_sign() runs on RAW_PCU_Test_CT { |
| 3112 | f_tc_paging_cs_from_sgsn(0); |
| 3113 | } |
| 3114 | |
| 3115 | testcase TC_paging_cs_from_sgsn_ptp() runs on RAW_PCU_Test_CT { |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 3116 | f_tc_paging_cs_from_sgsn(mp_gb_cfg.bvc[0].bvci); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3117 | } |
| 3118 | |
| 3119 | /* Test PS paging over Gb (SGSN->PCU->BTS[CCCH]). |
| 3120 | */ |
| 3121 | private function f_tc_paging_ps_from_sgsn(Nsvci bvci, boolean use_ptmsi := false) |
| 3122 | runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3123 | var integer imsi_suff_tx := 423; |
| 3124 | var hexstring imsi := f_gen_imsi(imsi_suff_tx); |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 3125 | var GprsMS ms; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3126 | |
| 3127 | /* Initialize NS/BSSGP side */ |
| 3128 | f_init_bssgp(); |
Pau Espin Pedrol | 4f7b8fd | 2020-05-18 18:28:17 +0200 | [diff] [blame] | 3129 | /* Initialize GPRS MS side */ |
| 3130 | f_init_gprs_ms(); |
| 3131 | ms := g_ms[0]; /* We only use first MS in this test */ |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3132 | |
| 3133 | /* Initialize the PCU interface abstraction */ |
| 3134 | f_init_raw(testcasename()); |
| 3135 | |
| 3136 | /* Establish BSSGP connection to the PCU */ |
| 3137 | f_bssgp_establish(); |
Pau Espin Pedrol | 7b761e2 | 2021-01-11 14:43:35 +0100 | [diff] [blame] | 3138 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3139 | |
| 3140 | /* Send BSSGP PAGING-PS (with or without TMSI), wait for RR Paging Request Type 1. |
| 3141 | * Make sure that both paging group (IMSI suffix) and Mobile Identity match. */ |
| 3142 | if (use_ptmsi) { |
| 3143 | var OCT4 tmsi := f_rnd_octstring(4); /* Random P-TMSI */ |
| 3144 | BSSGP[0].send(ts_BSSGP_PS_PAGING_PTMSI(bvci, imsi, oct2int(tmsi))); |
| 3145 | f_pcuif_rx_pch_pag_req1(t_MI_TMSI(tmsi), imsi_suff_tx); |
| 3146 | } else { |
| 3147 | BSSGP[0].send(ts_BSSGP_PS_PAGING_IMSI(bvci, imsi)); |
| 3148 | f_pcuif_rx_pch_pag_req1(tr_MI_IMSI(imsi), imsi_suff_tx); |
| 3149 | } |
| 3150 | |
Vadim Yanitskiy | 91f8a09 | 2020-05-06 21:41:05 +0700 | [diff] [blame] | 3151 | f_shutdown(__BFILE__, __LINE__, final := true); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3152 | } |
| 3153 | |
| 3154 | testcase TC_paging_ps_from_sgsn_sign_ptmsi() runs on RAW_PCU_Test_CT { |
| 3155 | f_tc_paging_ps_from_sgsn(0, true); |
| 3156 | } |
| 3157 | |
| 3158 | testcase TC_paging_ps_from_sgsn_sign() runs on RAW_PCU_Test_CT { |
| 3159 | f_tc_paging_ps_from_sgsn(0); |
| 3160 | } |
| 3161 | |
| 3162 | testcase TC_paging_ps_from_sgsn_ptp() runs on RAW_PCU_Test_CT { |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 3163 | f_tc_paging_ps_from_sgsn(mp_gb_cfg.bvc[0].bvci); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3164 | } |
| 3165 | |
Pau Espin Pedrol | c03eb12 | 2020-08-27 18:54:24 +0200 | [diff] [blame] | 3166 | /* Verify osmo-pcu handles DL UNIT_DATA from SGSN with IMSI IE correctly. See OS#4729 */ |
| 3167 | testcase TC_bssgp_dl_unitdata_with_valid_imsi() runs on RAW_PCU_Test_CT { |
| 3168 | var RlcmacDlBlock dl_block; |
| 3169 | var octetstring data := f_rnd_octstring(10); |
| 3170 | var uint32_t sched_fn; |
| 3171 | var uint32_t dl_fn; |
| 3172 | var GprsMS ms; |
| 3173 | |
| 3174 | /* Initialize NS/BSSGP side */ |
| 3175 | f_init_bssgp(); |
| 3176 | /* Initialize GPRS MS side */ |
| 3177 | f_init_gprs_ms(); |
| 3178 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 3179 | |
| 3180 | /* Initialize the PCU interface abstraction */ |
Pau Espin Pedrol | 745a48b | 2020-10-30 15:31:07 +0100 | [diff] [blame] | 3181 | f_init_raw(testcasename(), ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
Pau Espin Pedrol | c03eb12 | 2020-08-27 18:54:24 +0200 | [diff] [blame] | 3182 | |
Daniel Willmann | 535aea6 | 2020-09-21 13:27:08 +0200 | [diff] [blame] | 3183 | f_statsd_reset(); |
| 3184 | |
Pau Espin Pedrol | c03eb12 | 2020-08-27 18:54:24 +0200 | [diff] [blame] | 3185 | /* Establish BSSGP connection to the PCU */ |
| 3186 | f_bssgp_establish(); |
Pau Espin Pedrol | 7b761e2 | 2021-01-11 14:43:35 +0100 | [diff] [blame] | 3187 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
Pau Espin Pedrol | c03eb12 | 2020-08-27 18:54:24 +0200 | [diff] [blame] | 3188 | |
| 3189 | /* Establish an Uplink TBF */ |
| 3190 | f_ms_establish_ul_tbf(ms); |
| 3191 | |
| 3192 | /* Fake GMM GPRS Attach or similar, PCU doesn't care about upper layers here */ |
Pau Espin Pedrol | dee5570 | 2021-04-23 21:08:22 +0200 | [diff] [blame] | 3193 | f_ms_tx_ul_data_block_multi(ms, 1, with_tlli := true, fn := ms.ul_tbf.start_time_fn); |
Pau Espin Pedrol | c03eb12 | 2020-08-27 18:54:24 +0200 | [diff] [blame] | 3194 | f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn); |
| 3195 | /* DL ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 3196 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
| 3197 | |
| 3198 | /* UL block should be received in SGSN */ |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 3199 | BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id)); |
Pau Espin Pedrol | c03eb12 | 2020-08-27 18:54:24 +0200 | [diff] [blame] | 3200 | |
| 3201 | /* Now SGSN sends some DL data, PCU will page on CCCH (PCH) */ |
| 3202 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data, imsi := ts_BSSGP_IMSI(ms.imsi))); |
| 3203 | f_ms_exp_dl_tbf_ass_ccch(ms, PCU_IF_SAPI_PCH); |
| 3204 | |
| 3205 | /* Wait timer X2002 and DL block is available after CCCH IMM ASS: */ |
| 3206 | f_sleep(X2002); |
| 3207 | f_rx_rlcmac_dl_block_exp_data(dl_block, dl_fn, data, 0); |
| 3208 | |
| 3209 | /* ACK the DL block */ |
| 3210 | f_acknackdesc_ack_block(ms.dl_tbf.acknack_desc, dl_block, '1'B); |
| 3211 | f_ms_tx_ul_block(ms, ts_RLCMAC_DL_ACK_NACK(ms.dl_tbf.tfi, ms.dl_tbf.acknack_desc), |
| 3212 | f_dl_block_ack_fn(dl_block, dl_fn)); |
| 3213 | |
Daniel Willmann | 535aea6 | 2020-09-21 13:27:08 +0200 | [diff] [blame] | 3214 | var StatsDExpects expect := { |
| 3215 | { name := "TTCN3.bts.0.rach.requests", mtype := "c", min := 1, max := 1}, |
| 3216 | { name := "TTCN3.bts.0.immediate.assignment_DL", mtype := "c", min := 1, max := 1}, |
| 3217 | { name := "TTCN3.bts.0.tbf.dl.alloc", mtype := "c", min := 1, max := 1}, |
| 3218 | { name := "TTCN3.bts.0.tbf.ul.alloc", mtype := "c", min := 1, max := 1}, |
Pau Espin Pedrol | 0bf74e5 | 2020-12-11 19:25:42 +0100 | [diff] [blame] | 3219 | { name := "TTCN3.bts.0.rlc.dl_payload_bytes", mtype := "c", min := 10, max := 10}, |
Pau Espin Pedrol | 599d56b | 2020-11-17 12:01:46 +0100 | [diff] [blame] | 3220 | { name := "TTCN3.bts.0.rlc.ul_payload_bytes", mtype := "c", min := 26, max := 26} |
Daniel Willmann | 535aea6 | 2020-09-21 13:27:08 +0200 | [diff] [blame] | 3221 | }; |
| 3222 | f_statsd_expect(expect); |
| 3223 | |
Pau Espin Pedrol | c03eb12 | 2020-08-27 18:54:24 +0200 | [diff] [blame] | 3224 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 3225 | } |
| 3226 | |
| 3227 | /* Verify osmo-pcu acts on incorrect IMSI IE content in DL UNIT_DATA from SGSN. See OS#4729 */ |
| 3228 | testcase TC_bssgp_dl_unitdata_with_invalid_imsi() runs on RAW_PCU_Test_CT { |
| 3229 | var RlcmacDlBlock dl_block; |
| 3230 | var octetstring data := f_rnd_octstring(10); |
| 3231 | var uint32_t sched_fn; |
| 3232 | var uint32_t dl_fn; |
| 3233 | var GprsMS ms; |
| 3234 | |
| 3235 | /* Initialize NS/BSSGP side */ |
| 3236 | f_init_bssgp(); |
| 3237 | /* Initialize GPRS MS side */ |
| 3238 | f_init_gprs_ms(); |
| 3239 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 3240 | |
| 3241 | /* Initialize the PCU interface abstraction */ |
Pau Espin Pedrol | 745a48b | 2020-10-30 15:31:07 +0100 | [diff] [blame] | 3242 | f_init_raw(testcasename(), ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
Pau Espin Pedrol | c03eb12 | 2020-08-27 18:54:24 +0200 | [diff] [blame] | 3243 | |
| 3244 | /* Establish BSSGP connection to the PCU */ |
| 3245 | f_bssgp_establish(); |
Pau Espin Pedrol | 7b761e2 | 2021-01-11 14:43:35 +0100 | [diff] [blame] | 3246 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
Pau Espin Pedrol | c03eb12 | 2020-08-27 18:54:24 +0200 | [diff] [blame] | 3247 | |
| 3248 | /* Establish an Uplink TBF */ |
| 3249 | f_ms_establish_ul_tbf(ms); |
| 3250 | |
| 3251 | /* Fake GMM GPRS Attach or similar, PCU doesn't care about upper layers here */ |
Pau Espin Pedrol | dee5570 | 2021-04-23 21:08:22 +0200 | [diff] [blame] | 3252 | f_ms_tx_ul_data_block_multi(ms, 1, with_tlli := true, fn := ms.ul_tbf.start_time_fn); |
Pau Espin Pedrol | c03eb12 | 2020-08-27 18:54:24 +0200 | [diff] [blame] | 3253 | f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn); |
| 3254 | /* DL ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 3255 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
| 3256 | |
| 3257 | /* UL block should be received in SGSN */ |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 3258 | BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id)); |
Pau Espin Pedrol | c03eb12 | 2020-08-27 18:54:24 +0200 | [diff] [blame] | 3259 | |
| 3260 | /* Now SGSN sends some DL data with an invalid IMSI */ |
| 3261 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data, imsi := ts_BSSGP_IMSI('1122'H))); |
| 3262 | |
Pau Espin Pedrol | f7e947a | 2021-01-25 18:51:33 +0100 | [diff] [blame] | 3263 | BSSGP_GLOBAL[0].receive(tr_BSSGP_STATUS(omit, BSSGP_CAUSE_CONDITIONAL_IE_ERROR, ?)); |
Pau Espin Pedrol | c03eb12 | 2020-08-27 18:54:24 +0200 | [diff] [blame] | 3264 | |
| 3265 | /* TODO: make sure no data is sent over PCU -> MS */ |
| 3266 | |
| 3267 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 3268 | } |
| 3269 | |
Pau Espin Pedrol | 2e459d6 | 2020-11-30 19:34:16 +0100 | [diff] [blame] | 3270 | private function f_tc_dl_data_no_llc_ui_dummy(template (omit) MSRadioAccessCapabilityV_BSSGP ms_racap := omit) runs on RAW_PCU_Test_CT { |
| 3271 | var AckNackDescription ack_nack_desc := valueof(t_AckNackDescription_init); |
| 3272 | var octetstring data := f_rnd_octstring(6); |
| 3273 | var RlcmacDlBlock dl_block; |
| 3274 | var GprsMS ms; |
| 3275 | var uint32_t fn; |
| 3276 | |
| 3277 | /* Initialize NS/BSSGP side */ |
| 3278 | f_init_bssgp(); |
| 3279 | /* Initialize GPRS MS side */ |
| 3280 | f_init_gprs_ms(); |
| 3281 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 3282 | |
| 3283 | /* Initialize the PCU interface abstraction */ |
| 3284 | f_init_raw(testcasename()); |
| 3285 | |
| 3286 | /* Establish BSSGP connection to the PCU */ |
| 3287 | f_bssgp_establish(); |
| 3288 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 3289 | |
| 3290 | /* SGSN sends some DL data, PCU will page on CCCH (PCH) */ |
| 3291 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data, ms_racap)); |
| 3292 | f_ms_exp_dl_tbf_ass_ccch(ms, PCU_IF_SAPI_PCH); |
| 3293 | |
| 3294 | /* Wait timer X2002 and DL block is available after CCCH IMM ASS */ |
| 3295 | f_sleep(X2002); |
| 3296 | |
| 3297 | /* Expect the first (GPRS DL) block with bsn=0 and rrbp_valid=1 */ |
| 3298 | f_rx_rlcmac_dl_block_exp_data(dl_block, fn, data, 0); |
| 3299 | |
| 3300 | if (ischosen(dl_block.data_egprs)) { |
| 3301 | if (lengthof(dl_block.data_egprs.blocks) != 2) { |
| 3302 | setverdict(fail, "DL EGPRS block has unexpected number of LLC frames: ", dl_block.data_egprs); |
| 3303 | f_shutdown(__BFILE__, __LINE__); |
| 3304 | } |
| 3305 | if (dl_block.data_egprs.blocks[1].hdr.length_ind != 127) { |
| 3306 | setverdict(fail, "DL EGPRS block 2nd llc frame is not padding!: ", dl_block.data_egprs); |
| 3307 | f_shutdown(__BFILE__, __LINE__); |
| 3308 | } |
| 3309 | if (not match(dl_block.data_egprs.blocks[1].payload, |
| 3310 | f_pad_oct(''O, lengthof(dl_block.data_egprs.blocks[1].payload), '2B'O))) { |
| 3311 | setverdict(fail, "DL EGPRS block 2nd llc frame is not padding!: ", dl_block.data_egprs); |
| 3312 | f_shutdown(__BFILE__, __LINE__); |
| 3313 | } |
| 3314 | } else if (lengthof(dl_block.data.blocks) > 1) { |
| 3315 | setverdict(fail, "DL GPRS block has extra unexpected LLC frames: ", dl_block.data); |
| 3316 | f_shutdown(__BFILE__, __LINE__); |
| 3317 | } |
| 3318 | |
| 3319 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 3320 | } |
| 3321 | |
| 3322 | /* Verify osmo-pcu Doesn't append LLC UI dummy frames to rlcmac blocks |
| 3323 | * containing llc data. See OS#4849 */ |
| 3324 | testcase TC_dl_gprs_data_no_llc_ui_dummy() runs on RAW_PCU_Test_CT { |
| 3325 | f_tc_dl_data_no_llc_ui_dummy(omit); |
| 3326 | } |
| 3327 | |
| 3328 | /* Verify osmo-pcu Doesn't append LLC UI dummy frames to rlcmac blocks |
| 3329 | * containing llc data. See OS#4849 */ |
| 3330 | testcase TC_dl_egprs_data_no_llc_ui_dummy() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | 13ab5ea | 2021-02-05 11:56:15 +0100 | [diff] [blame] | 3331 | f_tc_dl_data_no_llc_ui_dummy(bssgp_ms_racap_egprs_def); |
Pau Espin Pedrol | 2e459d6 | 2020-11-30 19:34:16 +0100 | [diff] [blame] | 3332 | } |
| 3333 | |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3334 | private function f_TC_egprs_pkt_chan_req(in EGPRSPktChRequest req, |
Vadim Yanitskiy | 4389390 | 2020-05-29 15:21:50 +0700 | [diff] [blame] | 3335 | template GsmRrMessage t_imm_ass := ?, |
| 3336 | PCUIF_BurstType bt := BURST_TYPE_1) |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3337 | runs on RAW_PCU_Test_CT { |
Vadim Yanitskiy | 4389390 | 2020-05-29 15:21:50 +0700 | [diff] [blame] | 3338 | var GsmRrMessage rr_msg; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3339 | var uint16_t ra11; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3340 | |
| 3341 | ra11 := enc_EGPRSPktChRequest2uint(req); |
| 3342 | log("Sending EGPRS Packet Channel Request (", ra11, "): ", req); |
| 3343 | |
Vadim Yanitskiy | 28d18e1 | 2020-05-29 15:25:59 +0700 | [diff] [blame] | 3344 | rr_msg := f_pcuif_tx_rach_rx_imm_ass(ra := ra11, is_11bit := 1, burst_type := bt); |
Vadim Yanitskiy | 4389390 | 2020-05-29 15:21:50 +0700 | [diff] [blame] | 3345 | if (not match(rr_msg, t_imm_ass)) { |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3346 | setverdict(fail, "Immediate Assignment does not match"); |
Vadim Yanitskiy | 91f8a09 | 2020-05-06 21:41:05 +0700 | [diff] [blame] | 3347 | f_shutdown(__BFILE__, __LINE__); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3348 | } |
| 3349 | |
| 3350 | setverdict(pass); |
| 3351 | } |
| 3352 | |
| 3353 | testcase TC_egprs_pkt_chan_req_signalling() runs on RAW_PCU_Test_CT { |
| 3354 | var template GsmRrMessage imm_ass; |
| 3355 | var template IaRestOctets rest; |
| 3356 | var template EgprsUlAss ul_ass; |
| 3357 | |
| 3358 | /* Initialize the PCU interface abstraction */ |
| 3359 | f_init_raw(testcasename()); |
| 3360 | |
| 3361 | var EGPRSPktChRequest req := { |
| 3362 | /* NOTE: other fields are set in the loop */ |
| 3363 | signalling := { tag := '110011'B } |
| 3364 | }; |
| 3365 | |
| 3366 | for (var integer i := 0; i < 6; i := i + 1) { |
| 3367 | var BIT5 ext_ra := int2bit(f_rnd_int(32), 5); |
| 3368 | req.signalling.random_bits := ext_ra; |
| 3369 | |
| 3370 | /* For signalling, do we expect Multiblock UL TBF Assignment? */ |
| 3371 | ul_ass := tr_EgprsUlAssMultiblock(ext_ra := ext_ra); |
| 3372 | rest := tr_IaRestOctets_EGPRSULAss(ul_ass); |
| 3373 | imm_ass := tr_IMM_TBF_ASS(dl := false, rest := rest); |
| 3374 | |
| 3375 | f_TC_egprs_pkt_chan_req(req, imm_ass); |
| 3376 | } |
Vadim Yanitskiy | 91f8a09 | 2020-05-06 21:41:05 +0700 | [diff] [blame] | 3377 | |
| 3378 | f_shutdown(__BFILE__, __LINE__, final := true); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3379 | } |
| 3380 | |
| 3381 | testcase TC_egprs_pkt_chan_req_one_phase() runs on RAW_PCU_Test_CT { |
| 3382 | var template GsmRrMessage imm_ass; |
| 3383 | var template IaRestOctets rest; |
| 3384 | var template EgprsUlAss ul_ass; |
| 3385 | |
| 3386 | /* Initialize the PCU interface abstraction */ |
| 3387 | f_init_raw(testcasename()); |
| 3388 | |
| 3389 | var EGPRSPktChRequest req := { |
| 3390 | /* NOTE: other fields are set in the loop */ |
| 3391 | one_phase := { tag := '0'B } |
| 3392 | }; |
| 3393 | |
| 3394 | for (var integer i := 0; i < 6; i := i + 1) { |
| 3395 | var BIT5 ext_ra := int2bit(f_rnd_int(32), 5); |
| 3396 | var BIT5 mslot_class := int2bit(f_rnd_int(32), 5); |
| 3397 | var BIT2 priority := substr(ext_ra, 0, 2); |
| 3398 | var BIT3 rand := substr(ext_ra, 2, 3); |
| 3399 | |
| 3400 | req.one_phase.multislot_class := mslot_class; |
| 3401 | req.one_phase.priority := priority; |
| 3402 | req.one_phase.random_bits := rand; |
| 3403 | |
| 3404 | /* For one phase access, do we expect Dynamic UL TBF Assignment? */ |
| 3405 | ul_ass := tr_EgprsUlAssDynamic(ext_ra := ext_ra); |
| 3406 | rest := tr_IaRestOctets_EGPRSULAss(ul_ass); |
| 3407 | imm_ass := tr_IMM_TBF_ASS(dl := false, rest := rest); |
| 3408 | |
| 3409 | f_TC_egprs_pkt_chan_req(req, imm_ass); |
| 3410 | } |
Vadim Yanitskiy | 91f8a09 | 2020-05-06 21:41:05 +0700 | [diff] [blame] | 3411 | |
| 3412 | f_shutdown(__BFILE__, __LINE__, final := true); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3413 | } |
| 3414 | |
| 3415 | testcase TC_egprs_pkt_chan_req_two_phase() runs on RAW_PCU_Test_CT { |
| 3416 | var template GsmRrMessage imm_ass; |
| 3417 | var template IaRestOctets rest; |
| 3418 | var template EgprsUlAss ul_ass; |
| 3419 | |
| 3420 | /* Initialize the PCU interface abstraction */ |
| 3421 | f_init_raw(testcasename()); |
| 3422 | |
| 3423 | var EGPRSPktChRequest req := { |
| 3424 | /* NOTE: other fields are set in the loop */ |
| 3425 | two_phase := { tag := '110000'B } |
| 3426 | }; |
| 3427 | |
| 3428 | for (var integer i := 0; i < 6; i := i + 1) { |
| 3429 | var BIT5 ext_ra := int2bit(f_rnd_int(32), 5); |
| 3430 | var BIT2 priority := substr(ext_ra, 0, 2); |
| 3431 | var BIT3 rand := substr(ext_ra, 2, 3); |
| 3432 | |
| 3433 | req.two_phase.priority := priority; |
| 3434 | req.two_phase.random_bits := rand; |
| 3435 | |
| 3436 | /* For two phase access, do we expect Multiblock UL TBF Assignment? */ |
| 3437 | ul_ass := tr_EgprsUlAssMultiblock(ext_ra := ext_ra); |
| 3438 | rest := tr_IaRestOctets_EGPRSULAss(ul_ass); |
| 3439 | imm_ass := tr_IMM_TBF_ASS(dl := false, rest := rest); |
| 3440 | |
| 3441 | f_TC_egprs_pkt_chan_req(req, imm_ass); |
| 3442 | } |
Vadim Yanitskiy | 91f8a09 | 2020-05-06 21:41:05 +0700 | [diff] [blame] | 3443 | |
| 3444 | f_shutdown(__BFILE__, __LINE__, final := true); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 3445 | } |
| 3446 | |
Vadim Yanitskiy | 4f56d32 | 2020-05-22 20:15:48 +0700 | [diff] [blame] | 3447 | private function f_TC_egprs_pkt_chan_req_reject(bitstring ra11, uint32_t fn, |
| 3448 | template IARRestOctets rest := ?, |
Pau Espin Pedrol | a5cee4c | 2021-04-26 13:50:29 +0200 | [diff] [blame] | 3449 | PCUIF_BurstType bt := BURST_TYPE_1, |
| 3450 | template WaitIndication wi := ?) |
Vadim Yanitskiy | 4f56d32 | 2020-05-22 20:15:48 +0700 | [diff] [blame] | 3451 | runs on RAW_PCU_Test_CT { |
| 3452 | var template ReqRefWaitInd tr_ref; |
| 3453 | var GsmRrMessage rr_msg; |
Vadim Yanitskiy | 4f56d32 | 2020-05-22 20:15:48 +0700 | [diff] [blame] | 3454 | |
| 3455 | /* Send RACH.ind with malformed EGPRS Packet Channel Request */ |
| 3456 | BTS.send(ts_PCUIF_RACH_IND(bts_nr := 0, trx_nr := 0, ts_nr := 0, |
| 3457 | ra := bit2int(ra11), is_11bit := 1, |
| 3458 | burst_type := bt, fn := fn, |
| 3459 | arfcn := 871)); |
| 3460 | |
| 3461 | /* Abuse f_pcuif_rx_imm_ass(): wait for Immediate Assignment Reject */ |
Vadim Yanitskiy | 7466c33 | 2020-05-28 20:41:19 +0700 | [diff] [blame] | 3462 | rr_msg := f_pcuif_rx_imm_ass(t_imm_ass := tr_IMM_ASS_REJ); |
Vadim Yanitskiy | 4f56d32 | 2020-05-22 20:15:48 +0700 | [diff] [blame] | 3463 | |
| 3464 | /* Just to have a short-name reference to the actual message */ |
| 3465 | var ImmediateAssignmentReject iar := rr_msg.payload.imm_ass_rej; |
| 3466 | |
| 3467 | /* Make sure that Request Reference list contains at least one entry |
| 3468 | * with our TDMA frame number, and RA is set to 'reserved' value 127. */ |
Pau Espin Pedrol | a5cee4c | 2021-04-26 13:50:29 +0200 | [diff] [blame] | 3469 | tr_ref := tr_ReqRefWaitInd(f_compute_ReqRef(127, fn), wi); |
Vadim Yanitskiy | 4f56d32 | 2020-05-22 20:15:48 +0700 | [diff] [blame] | 3470 | if (not match(iar.payload, { *, tr_ref, * })) { |
| 3471 | setverdict(fail, "Request Reference list does not match"); |
| 3472 | f_shutdown(__BFILE__, __LINE__); |
| 3473 | } |
| 3474 | |
| 3475 | /* Match Feature Indicator (must indicate PS domain) */ |
| 3476 | if (not match(iar.feature_ind, FeatureIndicator:{?, false, true})) { |
| 3477 | setverdict(fail, "Feature Indicator does not match"); |
| 3478 | f_shutdown(__BFILE__, __LINE__); |
| 3479 | } |
| 3480 | |
| 3481 | /* Match IAR Rest Octets */ |
| 3482 | if (not match(iar.rest_octets, rest)) { |
| 3483 | setverdict(fail, "IAR Rest Octets does not match: ", |
| 3484 | iar.rest_octets, " vs expected ", rest); |
| 3485 | f_shutdown(__BFILE__, __LINE__); |
| 3486 | } |
| 3487 | |
| 3488 | setverdict(pass); |
| 3489 | } |
| 3490 | |
| 3491 | /* Verify the contents of RR Immediate Assignment Reject message and its |
| 3492 | * Rest Octets sent in response to EGPRS Packet Channel Request (11 bit). */ |
| 3493 | testcase TC_egprs_pkt_chan_req_reject_content() runs on RAW_PCU_Test_CT { |
| 3494 | var template IARRestOctets rest; |
| 3495 | var BIT5 ext_ra; |
| 3496 | |
| 3497 | /* Initialize the PCU interface abstraction */ |
| 3498 | f_init_raw(testcasename()); |
| 3499 | |
| 3500 | for (var integer i := 0; i < 6; i := i + 1) { |
| 3501 | ext_ra := int2bit(f_rnd_int(32), 5); /* 5 LSB's of RA11 */ |
| 3502 | rest := tr_IARRestOctets({ *, tr_ExtRAOpt(ext_ra), * }); |
| 3503 | |
| 3504 | /* Intentionally incorrect message (see table 11.2.5a.2) */ |
| 3505 | f_TC_egprs_pkt_chan_req_reject('111111'B & ext_ra, 1337 + i, rest); |
| 3506 | } |
| 3507 | |
| 3508 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 3509 | } |
| 3510 | |
Vadim Yanitskiy | 7e06c25 | 2020-05-22 20:48:53 +0700 | [diff] [blame] | 3511 | /* At the moment, the IUT does not support any emergency services. Make sure |
| 3512 | * that EGPRS Packet Channel Request for an emergency call is properly rejected. */ |
| 3513 | testcase TC_egprs_pkt_chan_req_reject_emergency() runs on RAW_PCU_Test_CT { |
| 3514 | var template IARRestOctets rest; |
| 3515 | var BIT5 ext_ra; |
| 3516 | var BIT11 ra11; |
| 3517 | |
| 3518 | /* Initialize the PCU interface abstraction */ |
| 3519 | f_init_raw(testcasename()); |
| 3520 | |
| 3521 | var EGPRSPktChRequest req := { |
| 3522 | /* NOTE: other fields are set in the loop */ |
| 3523 | emergency := { tag := '110111'B } |
| 3524 | }; |
| 3525 | |
| 3526 | for (var integer i := 0; i < 6; i := i + 1) { |
| 3527 | ext_ra := int2bit(f_rnd_int(32), 5); /* 5 LSB's of RA11 */ |
| 3528 | rest := tr_IARRestOctets({ *, tr_ExtRAOpt(ext_ra), * }); |
| 3529 | |
| 3530 | req.emergency.random_bits := ext_ra; |
| 3531 | ra11 := enc_EGPRSPktChRequest2bits(req); |
| 3532 | |
| 3533 | /* Intentionally incorrect message (see table 11.2.5a.2) */ |
| 3534 | f_TC_egprs_pkt_chan_req_reject(ra11, 1337 + i, rest); |
| 3535 | } |
| 3536 | |
| 3537 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 3538 | } |
| 3539 | |
Vadim Yanitskiy | c4324ff | 2020-05-22 21:53:58 +0700 | [diff] [blame] | 3540 | /* Make sure that IUT responds with RR Immediate Assignment Reject due to exhaustion. */ |
| 3541 | testcase TC_egprs_pkt_chan_req_reject_exhaustion() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | 7ebc112 | 2020-10-29 13:33:39 +0100 | [diff] [blame] | 3542 | var PCUIF_info_ind info_ind; |
Vadim Yanitskiy | c4324ff | 2020-05-22 21:53:58 +0700 | [diff] [blame] | 3543 | var template IARRestOctets rest; |
| 3544 | var BIT11 ra11; |
| 3545 | |
Pau Espin Pedrol | 7ebc112 | 2020-10-29 13:33:39 +0100 | [diff] [blame] | 3546 | info_ind := valueof(ts_PCUIF_INFO_default); |
Pau Espin Pedrol | a5cee4c | 2021-04-26 13:50:29 +0200 | [diff] [blame] | 3547 | info_ind.t3142 := 3; |
Vadim Yanitskiy | d5321fb | 2020-10-31 20:23:47 +0700 | [diff] [blame] | 3548 | |
| 3549 | /* Only the first TRX is enabled. */ |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 3550 | f_PCUIF_PDCHMask_set(info_ind, '00000000'B, (1 .. 7)); |
| 3551 | f_PCUIF_PDCHMask_set(info_ind, '00000001'B, 0); |
Pau Espin Pedrol | 7ebc112 | 2020-10-29 13:33:39 +0100 | [diff] [blame] | 3552 | |
Vadim Yanitskiy | c4324ff | 2020-05-22 21:53:58 +0700 | [diff] [blame] | 3553 | /* Initialize the PCU interface abstraction */ |
Pau Espin Pedrol | 7ebc112 | 2020-10-29 13:33:39 +0100 | [diff] [blame] | 3554 | f_init_raw(testcasename(), info_ind); |
Vadim Yanitskiy | c4324ff | 2020-05-22 21:53:58 +0700 | [diff] [blame] | 3555 | |
| 3556 | var EGPRSPktChRequest req := { |
| 3557 | one_phase := { |
| 3558 | tag := '0'B, |
| 3559 | multislot_class := '10101'B, |
| 3560 | priority := '01'B, |
| 3561 | random_bits := '101'B |
| 3562 | } |
| 3563 | }; |
| 3564 | |
| 3565 | /* We send 7 requests, the IUT gives us all available USFs (0..6). |
| 3566 | * TODO: make it configurable: usf_max := mp_pdch_ts_num * 7. */ |
| 3567 | for (var integer i := 0; i < 7; i := i + 1) { |
| 3568 | req.one_phase.random_bits := int2bit(f_rnd_int(8), 3); |
| 3569 | f_TC_egprs_pkt_chan_req(req, tr_IMM_TBF_ASS); |
| 3570 | } |
| 3571 | |
| 3572 | ra11 := enc_EGPRSPktChRequest2bits(req); |
| 3573 | rest := tr_IARRestOctets({ *, tr_ExtRAOpt(substr(ra11, 6, 5)), * }); |
| 3574 | |
| 3575 | /* At this point, the IUT should run out of free USFs */ |
Pau Espin Pedrol | a5cee4c | 2021-04-26 13:50:29 +0200 | [diff] [blame] | 3576 | f_TC_egprs_pkt_chan_req_reject(ra11, 1870, rest, wi := info_ind.t3142); |
Vadim Yanitskiy | c4324ff | 2020-05-22 21:53:58 +0700 | [diff] [blame] | 3577 | |
| 3578 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 3579 | } |
| 3580 | |
Vadim Yanitskiy | ef0c1b5 | 2020-09-05 21:32:18 +0700 | [diff] [blame] | 3581 | /* Randomly generate a set of hopping parameters for one timeslot */ |
Vadim Yanitskiy | 7a04cdd | 2020-09-07 11:43:32 +0700 | [diff] [blame] | 3582 | private function f_TC_pcuif_fh_params_gen(integer max_ma_len) |
Vadim Yanitskiy | ef0c1b5 | 2020-09-05 21:32:18 +0700 | [diff] [blame] | 3583 | return template (value) PCUIF_InfoTrxTs { |
Vadim Yanitskiy | 7a04cdd | 2020-09-07 11:43:32 +0700 | [diff] [blame] | 3584 | /* Pick a random MA length in range 2 .. max_ma_len */ |
| 3585 | var integer ma_len := 2 + f_rnd_int(max_ma_len - 2); |
| 3586 | |
Vadim Yanitskiy | ef0c1b5 | 2020-09-05 21:32:18 +0700 | [diff] [blame] | 3587 | return ts_PCUIF_InfoTrxTsH1(tsc := f_rnd_int(7), |
| 3588 | hsn := f_rnd_int(63), |
| 3589 | maio := f_rnd_int(63), |
| 3590 | ma := f_rnd_bitstring(ma_len)); |
| 3591 | } |
| 3592 | |
Vadim Yanitskiy | 94fe83e | 2020-07-20 04:03:13 +0700 | [diff] [blame] | 3593 | private function f_TC_pcuif_fh_check_imm_ass(in PCUIF_info_ind info_ind, |
| 3594 | in GsmRrMessage rr_msg) |
| 3595 | { |
| 3596 | var ImmediateAssignment ia := rr_msg.payload.imm_ass; |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 3597 | var PCUIF_InfoTrxTs ts := info_ind.trx[0].ts[ia.pkt_chan_desc.tn]; |
Vadim Yanitskiy | 94fe83e | 2020-07-20 04:03:13 +0700 | [diff] [blame] | 3598 | |
| 3599 | var template PacketChannelDescription tr_pkt_chan_desc := { |
| 3600 | channel_Type_spare := ?, |
| 3601 | tn := ?, |
| 3602 | tsc := ts.tsc, |
| 3603 | presence := '1'B, |
| 3604 | zero := omit, |
| 3605 | one := { |
| 3606 | maio := ts.maio, |
| 3607 | hsn := ts.hsn |
| 3608 | } |
| 3609 | }; |
| 3610 | |
| 3611 | if (not match(ia.pkt_chan_desc, tr_pkt_chan_desc)) { |
| 3612 | setverdict(fail, "Packet Channel Description does not match: ", |
| 3613 | ia.pkt_chan_desc, " vs ", tr_pkt_chan_desc); |
| 3614 | } |
| 3615 | |
Vadim Yanitskiy | 43ccaf5 | 2020-09-05 21:35:13 +0700 | [diff] [blame] | 3616 | /* Mobile Allocation is expected to be octet-aligned */ |
| 3617 | var uint8_t ma_oct_len := (ts.ma_bit_len + 8 - 1) / 8; |
| 3618 | var template MobileAllocationLV tr_ma := { |
| 3619 | len := ma_oct_len, /* in bytes */ |
| 3620 | ma := substr(ts.ma, 0, ma_oct_len * 8) |
| 3621 | }; |
Vadim Yanitskiy | 94fe83e | 2020-07-20 04:03:13 +0700 | [diff] [blame] | 3622 | |
| 3623 | if (not match(ia.mobile_allocation, tr_ma)) { |
| 3624 | setverdict(fail, "Mobile Allocation does not match: ", |
| 3625 | ia.mobile_allocation, " vs ", tr_ma); |
| 3626 | } |
| 3627 | |
| 3628 | setverdict(pass); |
| 3629 | } |
| 3630 | |
| 3631 | /* Make sure that Immediate (UL EGPRS TBF) Assignment contains hopping parameters */ |
| 3632 | testcase TC_pcuif_fh_imm_ass_ul_egprs() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | fa64e28 | 2021-02-05 17:56:52 +0100 | [diff] [blame] | 3633 | var template (value) PCUIF_info_ind info_ind := ts_PCUIF_INFO_default; |
Vadim Yanitskiy | 94fe83e | 2020-07-20 04:03:13 +0700 | [diff] [blame] | 3634 | var GprsMS ms := valueof(t_GprsMS_def); |
| 3635 | |
Vadim Yanitskiy | ef0c1b5 | 2020-09-05 21:32:18 +0700 | [diff] [blame] | 3636 | /* Enable frequency hopping on TRX0/TS7 */ |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 3637 | info_ind.trx[0].ts[7] := f_TC_pcuif_fh_params_gen(32); |
Vadim Yanitskiy | 94fe83e | 2020-07-20 04:03:13 +0700 | [diff] [blame] | 3638 | |
| 3639 | /* Initialize the PCU interface abstraction */ |
| 3640 | f_init_raw(testcasename(), info_ind); |
| 3641 | |
| 3642 | /* EGPRS Packet Channel Request (cause=Signalling) */ |
| 3643 | f_ms_use_ra(ms, bit2int('11001101010'B), ra_is_11bit := 1); |
| 3644 | |
| 3645 | /* Establish an Uplink EGPRS TBF */ |
| 3646 | f_ms_establish_ul_tbf(ms); |
| 3647 | |
| 3648 | f_TC_pcuif_fh_check_imm_ass(valueof(info_ind), ms.ul_tbf.rr_imm_ass); |
| 3649 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 3650 | } |
| 3651 | |
| 3652 | /* Make sure that Immediate (UL TBF) Assignment contains hopping parameters */ |
| 3653 | testcase TC_pcuif_fh_imm_ass_ul() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | fa64e28 | 2021-02-05 17:56:52 +0100 | [diff] [blame] | 3654 | var template (value) PCUIF_info_ind info_ind := ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS); |
Vadim Yanitskiy | 94fe83e | 2020-07-20 04:03:13 +0700 | [diff] [blame] | 3655 | var GprsMS ms := valueof(t_GprsMS_def); |
| 3656 | |
Vadim Yanitskiy | ef0c1b5 | 2020-09-05 21:32:18 +0700 | [diff] [blame] | 3657 | /* Enable frequency hopping on TRX0/TS7 */ |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 3658 | info_ind.trx[0].ts[7] := f_TC_pcuif_fh_params_gen(32); |
Vadim Yanitskiy | 94fe83e | 2020-07-20 04:03:13 +0700 | [diff] [blame] | 3659 | |
| 3660 | /* Initialize the PCU interface abstraction */ |
| 3661 | f_init_raw(testcasename(), info_ind); |
| 3662 | |
| 3663 | /* Establish an Uplink TBF */ |
| 3664 | f_ms_establish_ul_tbf(ms); |
| 3665 | |
| 3666 | f_TC_pcuif_fh_check_imm_ass(valueof(info_ind), ms.ul_tbf.rr_imm_ass); |
| 3667 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 3668 | } |
| 3669 | |
| 3670 | /* Make sure that Immediate (DL TBF) Assignment contains hopping parameters */ |
| 3671 | testcase TC_pcuif_fh_imm_ass_dl() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | fa64e28 | 2021-02-05 17:56:52 +0100 | [diff] [blame] | 3672 | var template (value) PCUIF_info_ind info_ind := ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS); |
Vadim Yanitskiy | 94fe83e | 2020-07-20 04:03:13 +0700 | [diff] [blame] | 3673 | var GprsMS ms := valueof(t_GprsMS_def); |
| 3674 | |
Vadim Yanitskiy | ef0c1b5 | 2020-09-05 21:32:18 +0700 | [diff] [blame] | 3675 | /* Enable frequency hopping on TRX0/TS7 */ |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 3676 | info_ind.trx[0].ts[7] := f_TC_pcuif_fh_params_gen(16); |
Vadim Yanitskiy | 94fe83e | 2020-07-20 04:03:13 +0700 | [diff] [blame] | 3677 | |
| 3678 | /* Initialize NS/BSSGP side */ |
| 3679 | f_init_bssgp(); |
| 3680 | |
| 3681 | /* Initialize the PCU interface abstraction */ |
| 3682 | f_init_raw(testcasename(), info_ind); |
| 3683 | |
| 3684 | /* Establish BSSGP connection to the PCU */ |
| 3685 | f_bssgp_establish(); |
Pau Espin Pedrol | 7b761e2 | 2021-01-11 14:43:35 +0100 | [diff] [blame] | 3686 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
Vadim Yanitskiy | 94fe83e | 2020-07-20 04:03:13 +0700 | [diff] [blame] | 3687 | |
| 3688 | /* SGSN sends some DL data, PCU will page on CCCH (PCH) */ |
| 3689 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, f_rnd_octstring(12))); |
| 3690 | f_ms_exp_dl_tbf_ass_ccch(ms, PCU_IF_SAPI_PCH); |
| 3691 | |
| 3692 | f_TC_pcuif_fh_check_imm_ass(valueof(info_ind), ms.dl_tbf.rr_imm_ass); |
| 3693 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 3694 | } |
| 3695 | |
| 3696 | private function f_TC_pcuif_fh_check_pkt_ass(in PCUIF_info_ind info_ind, |
| 3697 | in FrequencyParameters fp) |
| 3698 | { |
| 3699 | /* FIXME: TRX0/TS7 is a hard-coded expectation, make it configurable */ |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 3700 | var PCUIF_InfoTrxTs ts := info_ind.trx[0].ts[7]; |
Vadim Yanitskiy | 94fe83e | 2020-07-20 04:03:13 +0700 | [diff] [blame] | 3701 | |
| 3702 | /* Table 12.8.1: Frequency Parameters information elements */ |
| 3703 | var template FrequencyParameters tr_fp := { |
| 3704 | tsc := ts.tsc, |
| 3705 | presence := '10'B, /* Direct encoding 1 */ |
| 3706 | arfcn := omit, |
| 3707 | indirect := omit, |
| 3708 | direct1 := { |
| 3709 | maio := ts.maio, |
| 3710 | /* Table 12.10a.1: GPRS Mobile Allocation information elements */ |
| 3711 | mobile_allocation := { |
| 3712 | hsn := ts.hsn, |
| 3713 | rfl_number_list_present := '0'B, |
| 3714 | rfl_number_list := omit, |
| 3715 | ma_present := '0'B, /* inverted logic */ |
Vadim Yanitskiy | 43ccaf5 | 2020-09-05 21:35:13 +0700 | [diff] [blame] | 3716 | ma_length := ts.ma_bit_len, |
| 3717 | ma_bitmap := substr(ts.ma, 0, ts.ma_bit_len) |
Vadim Yanitskiy | 94fe83e | 2020-07-20 04:03:13 +0700 | [diff] [blame] | 3718 | } |
| 3719 | }, |
| 3720 | direct2 := omit |
| 3721 | }; |
| 3722 | |
| 3723 | if (not match(fp, tr_fp)) { |
| 3724 | setverdict(fail, "Frequency Parameters IE does not match: ", |
| 3725 | fp, " vs ", tr_fp); |
| 3726 | } |
| 3727 | |
| 3728 | setverdict(pass); |
| 3729 | } |
| 3730 | |
| 3731 | /* Make sure that Packet Uplink Assignment contains hopping parameters */ |
| 3732 | testcase TC_pcuif_fh_pkt_ass_ul() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | fa64e28 | 2021-02-05 17:56:52 +0100 | [diff] [blame] | 3733 | var template (value) PCUIF_info_ind info_ind := ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS); |
Vadim Yanitskiy | 94fe83e | 2020-07-20 04:03:13 +0700 | [diff] [blame] | 3734 | var GprsMS ms := valueof(t_GprsMS_def); |
| 3735 | var uint32_t poll_fn; |
| 3736 | |
Vadim Yanitskiy | ef0c1b5 | 2020-09-05 21:32:18 +0700 | [diff] [blame] | 3737 | /* Enable frequency hopping on TRX0/TS7 */ |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 3738 | info_ind.trx[0].ts[7] := f_TC_pcuif_fh_params_gen(33); |
Vadim Yanitskiy | 94fe83e | 2020-07-20 04:03:13 +0700 | [diff] [blame] | 3739 | |
| 3740 | /* Initialize the PCU interface abstraction */ |
| 3741 | f_init_raw(testcasename(), info_ind); |
| 3742 | |
Pau Espin Pedrol | dee5570 | 2021-04-23 21:08:22 +0200 | [diff] [blame] | 3743 | /* Single block (two phase) packet access */ |
| 3744 | var uint16_t ra := bit2int(chan_req_sb); |
| 3745 | f_ms_use_ra(ms, ra, ra_is_11bit := 0); |
| 3746 | |
Vadim Yanitskiy | 94fe83e | 2020-07-20 04:03:13 +0700 | [diff] [blame] | 3747 | /* Establish an Uplink TBF */ |
| 3748 | f_ms_establish_ul_tbf(ms); |
| 3749 | |
| 3750 | /* Send Packet Resource Request, so the network will allocate an Uplink resource */ |
Pau Espin Pedrol | dee5570 | 2021-04-23 21:08:22 +0200 | [diff] [blame] | 3751 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, omit)), |
| 3752 | fn := ms.ul_tbf.start_time_fn); |
Vadim Yanitskiy | 94fe83e | 2020-07-20 04:03:13 +0700 | [diff] [blame] | 3753 | |
| 3754 | /* Expect an RLC/MAC block with Packet Uplink Assignment on PACCH (see 11.2.29) */ |
Pau Espin Pedrol | 46e3604 | 2020-10-29 21:27:43 +0100 | [diff] [blame] | 3755 | f_ms_rx_pkt_ass_pacch(ms, poll_fn, tr_RLCMAC_UL_PACKET_ASS); |
| 3756 | var PacketUlAssignment ua := ms.ul_tbf.ass.pacch; |
Vadim Yanitskiy | 94fe83e | 2020-07-20 04:03:13 +0700 | [diff] [blame] | 3757 | |
| 3758 | /* 3GPP TS 44.060, section 12.8 "Frequency Parameters" */ |
| 3759 | var template (omit) FrequencyParameters fp; |
| 3760 | if (ua.is_egprs == '1'B) { |
| 3761 | fp := ua.egprs.freq_par; |
| 3762 | } else { |
| 3763 | fp := ua.gprs.freq_par; |
| 3764 | } |
| 3765 | |
| 3766 | /* This is an optional IE, so it's worth to check its presence */ |
| 3767 | if (istemplatekind(fp, "omit")) { |
| 3768 | setverdict(fail, "Frequency Parameters IE is not present"); |
| 3769 | f_shutdown(__BFILE__, __LINE__); |
| 3770 | } |
| 3771 | |
| 3772 | f_TC_pcuif_fh_check_pkt_ass(valueof(info_ind), valueof(fp)); |
| 3773 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 3774 | } |
| 3775 | |
| 3776 | /* Make sure that Packet Downlink Assignment contains hopping parameters */ |
| 3777 | testcase TC_pcuif_fh_pkt_ass_dl() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | fa64e28 | 2021-02-05 17:56:52 +0100 | [diff] [blame] | 3778 | var template (value) PCUIF_info_ind info_ind := ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS); |
Vadim Yanitskiy | 94fe83e | 2020-07-20 04:03:13 +0700 | [diff] [blame] | 3779 | var octetstring data := f_rnd_octstring(10); |
| 3780 | var GprsMS ms := valueof(t_GprsMS_def); |
| 3781 | var RlcmacDlBlock dl_block; |
| 3782 | var uint32_t poll_fn; |
| 3783 | |
Vadim Yanitskiy | ef0c1b5 | 2020-09-05 21:32:18 +0700 | [diff] [blame] | 3784 | /* Enable frequency hopping on TRX0/TS7 */ |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 3785 | info_ind.trx[0].ts[7] := f_TC_pcuif_fh_params_gen(33); |
Vadim Yanitskiy | 94fe83e | 2020-07-20 04:03:13 +0700 | [diff] [blame] | 3786 | |
| 3787 | /* Initialize NS/BSSGP side */ |
| 3788 | f_init_bssgp(); |
| 3789 | |
| 3790 | /* Initialize the PCU interface abstraction */ |
| 3791 | f_init_raw(testcasename(), info_ind); |
| 3792 | |
| 3793 | /* Establish BSSGP connection to the PCU */ |
| 3794 | f_bssgp_establish(); |
Pau Espin Pedrol | 7b761e2 | 2021-01-11 14:43:35 +0100 | [diff] [blame] | 3795 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
Vadim Yanitskiy | 94fe83e | 2020-07-20 04:03:13 +0700 | [diff] [blame] | 3796 | |
| 3797 | /* Establish an Uplink TBF */ |
| 3798 | f_ms_establish_ul_tbf(ms); |
| 3799 | |
| 3800 | /* Send an Uplink block, so this TBF becomes "active" */ |
Pau Espin Pedrol | dee5570 | 2021-04-23 21:08:22 +0200 | [diff] [blame] | 3801 | f_ms_tx_ul_data_block(ms, data, with_tlli := true, fn := ms.ul_tbf.start_time_fn); |
Vadim Yanitskiy | 94fe83e | 2020-07-20 04:03:13 +0700 | [diff] [blame] | 3802 | |
| 3803 | /* DL ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 3804 | f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, poll_fn); |
| 3805 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), poll_fn); |
| 3806 | |
| 3807 | /* SGSN sends some DL data, PCU will assign Downlink resource on PACCH */ |
| 3808 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data)); |
| 3809 | |
| 3810 | /* Expect an RLC/MAC block with Packet Downlink Assignment on PACCH (see 11.2.29) */ |
Pau Espin Pedrol | 46e3604 | 2020-10-29 21:27:43 +0100 | [diff] [blame] | 3811 | f_ms_rx_pkt_ass_pacch(ms, poll_fn, tr_RLCMAC_DL_PACKET_ASS); |
| 3812 | var PacketDlAssignment da := ms.dl_tbf.ass.pacch; |
Vadim Yanitskiy | 94fe83e | 2020-07-20 04:03:13 +0700 | [diff] [blame] | 3813 | |
| 3814 | /* This is an optional IE, so it's worth to check its presence */ |
| 3815 | if (not ispresent(da.freq_par)) { |
| 3816 | setverdict(fail, "Frequency Parameters IE is not present"); |
| 3817 | f_shutdown(__BFILE__, __LINE__); |
| 3818 | } |
| 3819 | |
| 3820 | f_TC_pcuif_fh_check_pkt_ass(valueof(info_ind), da.freq_par); |
| 3821 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 3822 | } |
| 3823 | |
Vadim Yanitskiy | d53fb67 | 2020-10-09 16:41:02 +0700 | [diff] [blame] | 3824 | /* Check if the IUT handles subsequent INFO.ind messages */ |
| 3825 | testcase TC_pcuif_info_ind_subsequent() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | fa64e28 | 2021-02-05 17:56:52 +0100 | [diff] [blame] | 3826 | var template (value) PCUIF_info_ind info_ind := ts_PCUIF_INFO_default; |
Pau Espin Pedrol | b34bb06 | 2021-01-19 18:58:07 +0100 | [diff] [blame] | 3827 | var BTS_PDTCH_Block data_msg; |
Vadim Yanitskiy | d53fb67 | 2020-10-09 16:41:02 +0700 | [diff] [blame] | 3828 | |
| 3829 | /* Initialize the PCU interface abstraction */ |
| 3830 | f_init_raw(testcasename(), info_ind); |
| 3831 | |
| 3832 | /* Send 16 conseqtive INFO.ind messages and check that the IUT stays alive */ |
| 3833 | for (var integer i := 0; i < 16; i := i + 1) { |
| 3834 | BTS.send(ts_PCUIF_INFO_IND(0, info_ind)); |
Pau Espin Pedrol | b34bb06 | 2021-01-19 18:58:07 +0100 | [diff] [blame] | 3835 | f_pcuif_rx_data_req_pdtch(data_msg); |
Vadim Yanitskiy | d53fb67 | 2020-10-09 16:41:02 +0700 | [diff] [blame] | 3836 | } |
| 3837 | |
| 3838 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 3839 | } |
| 3840 | |
Pau Espin Pedrol | bfd69f6 | 2020-10-22 18:06:07 +0200 | [diff] [blame] | 3841 | /* Verify allocation of several MS along PDCH ts of several TRX. See OS#1775, SYS#5030 */ |
| 3842 | testcase TC_multitrx_multims_alloc() runs on RAW_PCU_Test_CT { |
| 3843 | var PCUIF_info_ind info_ind; |
| 3844 | var integer i; |
| 3845 | const integer num_ms := 8; |
| 3846 | |
| 3847 | /* Initialize NS/BSSGP side */ |
| 3848 | f_init_bssgp(); |
| 3849 | /* Initialize GPRS MS side */ |
| 3850 | f_init_gprs_ms(num_ms); |
| 3851 | |
Pau Espin Pedrol | 745a48b | 2020-10-30 15:31:07 +0100 | [diff] [blame] | 3852 | info_ind := valueof(ts_PCUIF_INFO_default(c_PCUIF_Flags_noMCS)); |
Pau Espin Pedrol | bfd69f6 | 2020-10-22 18:06:07 +0200 | [diff] [blame] | 3853 | /* Only the 3 first TRX are enabled. The enabled ones all have same |
| 3854 | amount of resources, hence same amount of initial resources. */ |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 3855 | f_PCUIF_PDCHMask_set(info_ind, '00000000'B, (3 .. 7)); |
| 3856 | f_PCUIF_PDCHMask_set(info_ind, '00000011'B, 0); |
| 3857 | f_PCUIF_PDCHMask_set(info_ind, '00001100'B, 1); |
| 3858 | f_PCUIF_PDCHMask_set(info_ind, '11000000'B, 2); |
Pau Espin Pedrol | bfd69f6 | 2020-10-22 18:06:07 +0200 | [diff] [blame] | 3859 | |
| 3860 | /* Initialize the PCU interface abstraction */ |
| 3861 | f_init_raw(testcasename(), info_ind); |
| 3862 | |
| 3863 | /* Establish BSSGP connection to the PCU */ |
| 3864 | f_bssgp_establish(); |
Vadim Yanitskiy | 8a02b92 | 2020-10-31 21:57:10 +0700 | [diff] [blame] | 3865 | f_multi_ms_bssgp_register(); |
Pau Espin Pedrol | bfd69f6 | 2020-10-22 18:06:07 +0200 | [diff] [blame] | 3866 | |
Vadim Yanitskiy | 8a02b92 | 2020-10-31 21:57:10 +0700 | [diff] [blame] | 3867 | /* Establish an Uplink TBF for each GprsMS instance */ |
| 3868 | f_multi_ms_establish_tbf(do_activate := false); |
| 3869 | |
| 3870 | /* Check if all TBFs are allocated on different TRX in an uniform way */ |
Pau Espin Pedrol | bfd69f6 | 2020-10-22 18:06:07 +0200 | [diff] [blame] | 3871 | for (i := 0; i < num_ms; i := i + 1) { |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 3872 | if (g_ms[i].ul_tbf.arfcn != info_ind.trx[i mod 3].arfcn) { |
Pau Espin Pedrol | b20b7e5 | 2020-10-28 21:28:45 +0100 | [diff] [blame] | 3873 | setverdict(fail, "Got assigned ARFCN ", g_ms[i].ul_tbf.arfcn, |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 3874 | " vs exp ", info_ind.trx[i mod 3].arfcn); |
Pau Espin Pedrol | bfd69f6 | 2020-10-22 18:06:07 +0200 | [diff] [blame] | 3875 | f_shutdown(__BFILE__, __LINE__); |
| 3876 | } |
| 3877 | } |
| 3878 | |
| 3879 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 3880 | } |
| 3881 | |
Pau Espin Pedrol | e130305 | 2020-11-16 11:13:51 +0100 | [diff] [blame] | 3882 | /* Verify concurrent PDCH use of EGPRS and GPRS (EGPRS dl rlcmac blk is |
| 3883 | * downgraded to CS1-4 so that GPRS can read the USF). |
| 3884 | * See 3GPP TS 44.060 5.2.4a "Multiplexing of GPRS, EGPRS and EGPRS2 capable mobile stations" |
| 3885 | */ |
| 3886 | testcase TC_multiplex_dl_gprs_egprs() runs on RAW_PCU_Test_CT { |
| 3887 | var PCUIF_info_ind info_ind; |
| 3888 | const integer num_ms := 2; /* 2 MS, first one is GPRS-only, second one is EGPRS */ |
| 3889 | var PollFnCtx pollctx; |
Pau Espin Pedrol | e130305 | 2020-11-16 11:13:51 +0100 | [diff] [blame] | 3890 | var uint32_t sched_fn, dl_fn, ack_fn; |
| 3891 | var octetstring data := f_rnd_octstring(10); |
| 3892 | var RlcmacDlBlock dl_block; |
| 3893 | var integer tx_data_remain := 5; |
Pau Espin Pedrol | 4ceb61c | 2021-03-24 18:03:42 +0100 | [diff] [blame] | 3894 | var integer tgt_ms, usf_ms; |
Pau Espin Pedrol | e130305 | 2020-11-16 11:13:51 +0100 | [diff] [blame] | 3895 | var integer ms_gprs_usf_count[num_ms] := { 0, 0 }; |
| 3896 | var integer ms_egprs_usf_count[num_ms] := { 0, 0 }; |
| 3897 | |
| 3898 | /* Initialize NS/BSSGP side */ |
| 3899 | f_init_bssgp(); |
| 3900 | /* Initialize GPRS MS side */ |
| 3901 | f_init_gprs_ms(num_ms); |
| 3902 | |
| 3903 | info_ind := valueof(ts_PCUIF_INFO_default); |
| 3904 | /* Only use 1 PDCH to make sure both end up in the same slot: */ |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 3905 | f_PCUIF_PDCHMask_set(info_ind, '00000001'B, 0); |
| 3906 | f_PCUIF_PDCHMask_set(info_ind, '00000000'B, (1 .. 7)); |
Pau Espin Pedrol | e130305 | 2020-11-16 11:13:51 +0100 | [diff] [blame] | 3907 | |
| 3908 | /* Initialize the PCU interface abstraction */ |
| 3909 | f_init_raw(testcasename(), info_ind); |
| 3910 | |
| 3911 | /* Set Initial MCS > 4 and maintain it non-variable to simplify test */ |
| 3912 | g_mcs_initial_dl := 5; |
| 3913 | g_mcs_max_dl := 5; |
| 3914 | f_pcuvty_set_allowed_cs_mcs(); |
| 3915 | |
| 3916 | /* Establish BSSGP connection to the PCU */ |
| 3917 | f_bssgp_establish(); |
| 3918 | f_multi_ms_bssgp_register(); |
| 3919 | |
Pau Espin Pedrol | e130305 | 2020-11-16 11:13:51 +0100 | [diff] [blame] | 3920 | /* Establish UL TBF for MS0 (GPRS-only) */ |
Pau Espin Pedrol | 13ab5ea | 2021-02-05 11:56:15 +0100 | [diff] [blame] | 3921 | pollctx := f_ms_establish_ul_tbf_2phase_access(g_ms[0], ts_RlcMacUlCtrl_PKT_RES_REQ(g_ms[0].tlli, ms_racap_gprs_def)); |
Pau Espin Pedrol | e130305 | 2020-11-16 11:13:51 +0100 | [diff] [blame] | 3922 | if (not match(g_ms[0].ul_tbf.tx_cs_mcs, cs_gprs_any)) { |
| 3923 | setverdict(fail, "Wrong CS_MCS ", g_ms[0].ul_tbf.tx_cs_mcs, " received vs exp ", cs_gprs_any); |
| 3924 | f_shutdown(__BFILE__, __LINE__); |
| 3925 | } |
| 3926 | /* Pkt Uplink Assignment above sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 3927 | f_ms_tx_ul_block(g_ms[0], ts_RLCMAC_CTRL_ACK(g_ms[0].tlli), pollctx.fn, nr := pollctx.tstrxbts); |
| 3928 | |
| 3929 | /* Establish UL TBF for MS1 (EGPRS) */ |
Pau Espin Pedrol | 13ab5ea | 2021-02-05 11:56:15 +0100 | [diff] [blame] | 3930 | pollctx := f_ms_establish_ul_tbf_2phase_access(g_ms[1], ts_RlcMacUlCtrl_PKT_RES_REQ(g_ms[1].tlli, ms_racap_egprs_def)); |
Pau Espin Pedrol | e130305 | 2020-11-16 11:13:51 +0100 | [diff] [blame] | 3931 | if (not match(g_ms[1].ul_tbf.tx_cs_mcs, mcs_egprs_any)) { |
| 3932 | setverdict(fail, "Wrong CS_MCS ", g_ms[1].ul_tbf.tx_cs_mcs, " received vs exp ", mcs_egprs_any); |
| 3933 | f_shutdown(__BFILE__, __LINE__); |
| 3934 | } |
| 3935 | /* Pkt Uplink Assignment above sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 3936 | f_ms_tx_ul_block(g_ms[1], ts_RLCMAC_CTRL_ACK(g_ms[1].tlli), pollctx.fn, nr := pollctx.tstrxbts); |
| 3937 | |
| 3938 | /* Now SGSN sends some DL data to MS0, PCU will assign a GPRS DL TBF on PACCH */ |
| 3939 | BSSGP[0].send(ts_BSSGP_DL_UD(g_ms[0].tlli, data)); |
| 3940 | f_sleep(0.1); |
| 3941 | f_ms_rx_pkt_ass_pacch(g_ms[0], sched_fn, tr_RLCMAC_DL_PACKET_ASS); |
| 3942 | /* DL Ass sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 3943 | f_ms_tx_ul_block(g_ms[0], ts_RLCMAC_CTRL_ACK(g_ms[0].tlli), sched_fn); |
| 3944 | /* After acking the dl assignment, dl tbf goes into FLOW state and PCU will provide DL data when BTS asks for it */ |
| 3945 | f_rx_rlcmac_dl_block_exp_data(dl_block, dl_fn, data, 0, cs_gprs_any); |
| 3946 | /* ACK the DL block */ |
| 3947 | f_dltbf_ack_block(g_ms[0].dl_tbf, dl_block, '0'B); |
| 3948 | f_ms_tx_ul_block(g_ms[0], f_dltbf_ts_RLCMAC_DL_ACK_NACK(g_ms[0].dl_tbf, false), |
| 3949 | f_dl_block_ack_fn(dl_block, dl_fn)); |
| 3950 | |
| 3951 | /* Now SGSN sends some DL data to MS1, PCU will assign a EGPRS DL TBF on PACCH */ |
| 3952 | BSSGP[0].send(ts_BSSGP_DL_UD(g_ms[1].tlli, data)); |
| 3953 | f_sleep(0.1); |
| 3954 | f_ms_rx_pkt_ass_pacch(g_ms[1], sched_fn, tr_RLCMAC_DL_PACKET_ASS); |
| 3955 | /* DL Ass sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 3956 | f_ms_tx_ul_block(g_ms[1], ts_RLCMAC_CTRL_ACK(g_ms[1].tlli), sched_fn); |
| 3957 | /* After acking the dl assignment, dl tbf goes into FLOW state and PCU will provide DL data when BTS asks for it */ |
| 3958 | f_rx_rlcmac_dl_block_exp_data(dl_block, dl_fn, data, 0, mcs_egprs_any); |
| 3959 | /* ACK the DL block */ |
| 3960 | f_dltbf_ack_block(g_ms[1].dl_tbf, dl_block, '0'B); |
| 3961 | f_ms_tx_ul_block(g_ms[1], f_dltbf_ts_RLCMAC_DL_ACK_NACK(g_ms[1].dl_tbf, true), |
| 3962 | f_dl_block_ack_fn(dl_block, dl_fn)); |
| 3963 | |
| 3964 | data := f_rnd_octstring(1400); |
| 3965 | BSSGP[0].send(ts_BSSGP_DL_UD(g_ms[0].tlli, data)); |
| 3966 | BSSGP[0].send(ts_BSSGP_DL_UD(g_ms[1].tlli, data)); |
| 3967 | |
| 3968 | for (var integer i := 0; i < 800; i := i + 1) { |
| 3969 | f_rx_rlcmac_dl_block(dl_block, dl_fn); |
| 3970 | |
| 3971 | if (match(dl_block, tr_RLCMAC_DUMMY_CTRL)) { |
| 3972 | /* No more data to receive, done */ |
| 3973 | break; |
| 3974 | } |
| 3975 | |
Pau Espin Pedrol | 4ceb61c | 2021-03-24 18:03:42 +0100 | [diff] [blame] | 3976 | usf_ms := -1; |
| 3977 | |
Pau Espin Pedrol | e130305 | 2020-11-16 11:13:51 +0100 | [diff] [blame] | 3978 | if (ischosen(dl_block.ctrl)) { |
| 3979 | setverdict(fail, "Unexpected DL CTRL block ", dl_block); |
| 3980 | f_shutdown(__BFILE__, __LINE__); |
| 3981 | } else if (ischosen(dl_block.data_egprs)) { |
| 3982 | if (not match(dl_block.data_egprs.mac_hdr.tfi, g_ms[1].dl_tbf.tfi)) { |
| 3983 | setverdict(fail, "EGPRS DL DATA not matching EGPRS MS TFI (", g_ms[1].dl_tbf.tfi, "): ", dl_block.data_egprs.mac_hdr.tfi); |
| 3984 | f_shutdown(__BFILE__, __LINE__); |
| 3985 | } |
| 3986 | tgt_ms := 1; |
| 3987 | if (match(dl_block.data_egprs.mac_hdr.usf, g_ms[0].ul_tbf.usf[7])) { |
| 3988 | if (dl_block.data_egprs.mcs > MCS_4) { |
| 3989 | setverdict(fail, "Signalling USF ", dl_block.data_egprs.mac_hdr.usf, " for GPRS-only MS using MCS > 4: ", dl_block); |
| 3990 | f_shutdown(__BFILE__, __LINE__); |
| 3991 | } |
Pau Espin Pedrol | 4ceb61c | 2021-03-24 18:03:42 +0100 | [diff] [blame] | 3992 | usf_ms := 0; |
| 3993 | ms_egprs_usf_count[usf_ms] := ms_egprs_usf_count[usf_ms] + 1; |
Pau Espin Pedrol | e130305 | 2020-11-16 11:13:51 +0100 | [diff] [blame] | 3994 | } else { |
| 3995 | if (dl_block.data_egprs.mcs <= MCS_4) { |
| 3996 | setverdict(fail, "Using too-low MCS for EGPRS MS: ", dl_block.data_egprs.mcs); |
| 3997 | f_shutdown(__BFILE__, __LINE__); |
| 3998 | } |
| 3999 | if (match(dl_block.data_egprs.mac_hdr.usf, g_ms[1].ul_tbf.usf[7])) { |
Pau Espin Pedrol | 4ceb61c | 2021-03-24 18:03:42 +0100 | [diff] [blame] | 4000 | usf_ms := 1; |
| 4001 | ms_egprs_usf_count[usf_ms] := ms_egprs_usf_count[usf_ms] + 1; |
Pau Espin Pedrol | e130305 | 2020-11-16 11:13:51 +0100 | [diff] [blame] | 4002 | } |
| 4003 | } |
| 4004 | } else { |
| 4005 | if (not match(dl_block.data.mac_hdr.hdr_ext.tfi, g_ms[0].dl_tbf.tfi)) { |
| 4006 | setverdict(fail, "GPRS DL DATA not matching GPRS MS TFI (", g_ms[0].dl_tbf.tfi, "): ", dl_block.data.mac_hdr.hdr_ext.tfi); |
| 4007 | f_shutdown(__BFILE__, __LINE__); |
| 4008 | } |
| 4009 | tgt_ms := 0; |
| 4010 | if (match(dl_block.data.mac_hdr.mac_hdr.usf, g_ms[0].ul_tbf.usf[7])) { |
Pau Espin Pedrol | 4ceb61c | 2021-03-24 18:03:42 +0100 | [diff] [blame] | 4011 | usf_ms := 0; |
| 4012 | ms_gprs_usf_count[usf_ms] := ms_gprs_usf_count[usf_ms] + 1; |
Pau Espin Pedrol | e130305 | 2020-11-16 11:13:51 +0100 | [diff] [blame] | 4013 | } else if (match(dl_block.data.mac_hdr.mac_hdr.usf, g_ms[1].ul_tbf.usf[7])) { |
Pau Espin Pedrol | 4ceb61c | 2021-03-24 18:03:42 +0100 | [diff] [blame] | 4014 | usf_ms := 1; |
| 4015 | ms_gprs_usf_count[usf_ms] := ms_gprs_usf_count[usf_ms] + 1; |
Pau Espin Pedrol | e130305 | 2020-11-16 11:13:51 +0100 | [diff] [blame] | 4016 | } |
| 4017 | } |
| 4018 | |
| 4019 | /* Keep Ack/Nack description updated */ |
| 4020 | f_dltbf_ack_block(g_ms[tgt_ms].dl_tbf, dl_block); |
| 4021 | |
| 4022 | /* TDMA frame number on which we are supposed to send the ACK */ |
| 4023 | if (f_dl_block_rrbp_valid(dl_block)) { |
| 4024 | ack_fn := f_dl_block_ack_fn(dl_block, dl_fn); |
| 4025 | f_ms_tx_ul_block(g_ms[tgt_ms], f_dltbf_ts_RLCMAC_DL_ACK_NACK(g_ms[tgt_ms].dl_tbf, ischosen(dl_block.data_egprs)), ack_fn); |
| 4026 | if (tx_data_remain != 0) { |
| 4027 | /* Submit more data from time to time to keep the TBF ongoing */ |
| 4028 | BSSGP[0].send(ts_BSSGP_DL_UD(g_ms[0].tlli, data)); |
| 4029 | BSSGP[0].send(ts_BSSGP_DL_UD(g_ms[1].tlli, data)); |
| 4030 | tx_data_remain := tx_data_remain - 1; |
| 4031 | } |
Pau Espin Pedrol | 4ceb61c | 2021-03-24 18:03:42 +0100 | [diff] [blame] | 4032 | } else if (tx_data_remain != 0) { |
| 4033 | /* keep sending UL blocks when requested by USF to avoid |
| 4034 | * UL TBF timeout and hence stop receival of USFs */ |
| 4035 | if (usf_ms != -1) { |
| 4036 | f_ms_tx_ul_data_block(g_ms[usf_ms], f_rnd_octstring(10), cv := 15); |
| 4037 | } |
Pau Espin Pedrol | e130305 | 2020-11-16 11:13:51 +0100 | [diff] [blame] | 4038 | } |
| 4039 | } |
| 4040 | |
| 4041 | log("results: ms_gprs_usf_count=", ms_gprs_usf_count, " / ms_egprs_usf_count=", ms_egprs_usf_count); |
Pau Espin Pedrol | 4ceb61c | 2021-03-24 18:03:42 +0100 | [diff] [blame] | 4042 | /* He we check that DL blocks scheduled at GPRS can still request UL |
| 4043 | * blocks for EGPRS MS, and the other way around. Furthermore, the 2nd |
| 4044 | * condition also ensures the downgrade to <=MCS4 condition is tested |
| 4045 | * above */ |
| 4046 | if (ms_gprs_usf_count[1] == 0 or ms_egprs_usf_count[0] == 0) { |
| 4047 | setverdict(fail, "USF exchange thresholds not met!"); |
Pau Espin Pedrol | e130305 | 2020-11-16 11:13:51 +0100 | [diff] [blame] | 4048 | f_shutdown(__BFILE__, __LINE__); |
| 4049 | } |
Pau Espin Pedrol | 4ceb61c | 2021-03-24 18:03:42 +0100 | [diff] [blame] | 4050 | /* Here check for some level of fairness between them (at least ~40%): */ |
| 4051 | var integer gprs_usf_cnt := ms_gprs_usf_count[0] + ms_egprs_usf_count[0]; |
| 4052 | var integer egprs_usf_cnt := ms_gprs_usf_count[1] + ms_egprs_usf_count[1]; |
| 4053 | var integer total_usf_cnt := gprs_usf_cnt + egprs_usf_cnt; |
| 4054 | if (gprs_usf_cnt < total_usf_cnt * 4 / 10) { |
| 4055 | setverdict(fail, "USF GPRS-only MS ", gprs_usf_cnt, " < ", total_usf_cnt * 4 / 10); |
| 4056 | f_shutdown(__BFILE__, __LINE__); |
| 4057 | } |
| 4058 | if (egprs_usf_cnt < total_usf_cnt * 4 / 10) { |
| 4059 | setverdict(fail, "USF EGPRS MS ", egprs_usf_cnt, " < ", total_usf_cnt * 4 / 10); |
| 4060 | f_shutdown(__BFILE__, __LINE__); |
| 4061 | } |
Pau Espin Pedrol | e130305 | 2020-11-16 11:13:51 +0100 | [diff] [blame] | 4062 | |
| 4063 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 4064 | } |
| 4065 | |
| 4066 | |
Vadim Yanitskiy | dbd4b24 | 2020-10-31 05:44:58 +0700 | [diff] [blame] | 4067 | private function f_TC_paging_cs_multi_ms(template (value) TsTrxBtsNum nr, |
| 4068 | boolean exp_imsi, boolean exp_tmsi) |
| 4069 | runs on RAW_PCU_Test_CT { |
| 4070 | var bitstring mask := f_pad_bit(''B, lengthof(g_ms), '0'B); |
| 4071 | var integer pending := lengthof(g_ms); |
| 4072 | var RlcmacDlBlock dl_block; |
| 4073 | var boolean f1, f2; |
| 4074 | |
| 4075 | while (pending > 0) { |
| 4076 | var uint32_t poll_fn; |
| 4077 | |
| 4078 | /* Obtain a Downlink block and make sure it is a paging request */ |
| 4079 | f_rx_rlcmac_dl_block(dl_block, poll_fn, nr := nr); |
| 4080 | if (not match(dl_block, tr_RLCMAC_PACKET_PAG_REQ)) { |
| 4081 | setverdict(fail, "Rx unexpected DL block: ", dl_block); |
| 4082 | break; |
| 4083 | } |
| 4084 | |
| 4085 | /* This should not happen in general, but who knows... */ |
| 4086 | var PacketPagingReq req := dl_block.ctrl.payload.u.paging; |
| 4087 | if (not ispresent(req.repeated_pageinfo)) { |
| 4088 | setverdict(fail, "Repeated Page Info IE is absent?!?"); |
| 4089 | break; |
| 4090 | } |
| 4091 | |
| 4092 | /* A single message may contain several MIs depending on their type */ |
| 4093 | for (var integer i := 0; i < lengthof(g_ms); i := i + 1) { |
| 4094 | f1 := exp_imsi and f_pkt_paging_match_imsi(req, g_ms[i].imsi, |
| 4095 | ps_domain := false); |
| 4096 | f2 := exp_tmsi and f_pkt_paging_match_tmsi(req, oct2int(g_ms[i].tlli), |
| 4097 | ps_domain := false); |
| 4098 | if (not f1 and not f2) |
| 4099 | { continue; } |
| 4100 | |
| 4101 | /* Detect duplicate MIs */ |
| 4102 | if (mask[i] == '1'B) { |
| 4103 | setverdict(fail, "MS is paged twice: ", g_ms[i].imsi); |
| 4104 | continue; |
| 4105 | } |
| 4106 | |
| 4107 | mask[i] := '1'B; |
| 4108 | } |
| 4109 | |
| 4110 | pending := pending - lengthof(req.repeated_pageinfo); |
| 4111 | } |
| 4112 | |
| 4113 | for (var integer i := 0; i < lengthof(mask); i := i + 1) { |
| 4114 | if (mask[i] != '1'B) { |
| 4115 | setverdict(fail, "MS was not paged at all: ", g_ms[i].imsi); |
| 4116 | log("===== mask := ", mask); |
| 4117 | } |
| 4118 | } |
| 4119 | |
| 4120 | /* All messages must have been received by now, expect a dummy block */ |
| 4121 | f_rx_rlcmac_dl_block_exp_dummy(dl_block, nr := nr); |
| 4122 | } |
| 4123 | |
| 4124 | private function f_TC_paging_cs_multi_ms_init(BIT8 pdch_mask) |
| 4125 | runs on RAW_PCU_Test_CT { |
| 4126 | var PCUIF_info_ind info_ind := valueof(ts_PCUIF_INFO_default); |
| 4127 | const BssgpBvci bvci := mp_gb_cfg.bvc[0].bvci; |
| 4128 | |
| 4129 | /* Initialize NS/BSSGP side */ |
| 4130 | f_init_bssgp(); |
| 4131 | |
| 4132 | /* Explicitly set the given PDCH slot-mask to all transceivers */ |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 4133 | f_PCUIF_PDCHMask_set(info_ind, pdch_mask); |
Vadim Yanitskiy | dbd4b24 | 2020-10-31 05:44:58 +0700 | [diff] [blame] | 4134 | |
| 4135 | /* Allocate 56 GprsMS instances (maximum for 8 PDCH slots) */ |
| 4136 | f_init_gprs_ms(7 * 8); |
| 4137 | |
| 4138 | /* Initialize the PCU interface abstraction */ |
| 4139 | f_init_raw(testcasename(), info_ind); |
| 4140 | |
| 4141 | /* Establish BSSGP connection to the PCU */ |
| 4142 | f_bssgp_establish(); |
| 4143 | f_multi_ms_bssgp_register(); |
| 4144 | |
| 4145 | /* Establish an Uplink TBF for each GprsMS instance */ |
| 4146 | f_multi_ms_establish_tbf(do_activate := true); |
| 4147 | } |
| 4148 | |
| 4149 | testcase TC_paging_cs_multi_ms_imsi() runs on RAW_PCU_Test_CT { |
| 4150 | const BssgpBvci bvci := mp_gb_cfg.bvc[0].bvci; |
| 4151 | |
| 4152 | /* Common part: send INFO.ind, establish TBFs... */ |
| 4153 | f_TC_paging_cs_multi_ms_init(pdch_mask := '00000001'B); |
| 4154 | |
| 4155 | /* Enqueue multiple CS PAGING requests at a time (IMSI only) */ |
| 4156 | for (var integer i := 0; i < lengthof(g_ms); i := i + 1) { |
| 4157 | BSSGP[0].send(ts_BSSGP_CS_PAGING_IMSI(bvci, g_ms[i].imsi)); |
| 4158 | } |
| 4159 | |
| 4160 | /* FIXME: work around a race condition between PCUIF and BSSGP */ |
| 4161 | f_sleep(0.2); /* i.e. give the IUT some time to process everything */ |
| 4162 | |
| 4163 | /* Check what the IUT sends on PACCH, all GprsMS instances must be paged. |
| 4164 | * The IUT is expected to page on all PDCH slots of all transceivers. */ |
| 4165 | for (var integer trx_nr := 0; trx_nr < 8; trx_nr := trx_nr + 1) { |
| 4166 | var template (value) TsTrxBtsNum nr := ts_TsTrxBtsNum(7, trx_nr); |
| 4167 | f_TC_paging_cs_multi_ms(nr, exp_imsi := true, exp_tmsi := false); |
| 4168 | } |
| 4169 | |
| 4170 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 4171 | } |
| 4172 | |
| 4173 | testcase TC_paging_cs_multi_ms_tmsi() runs on RAW_PCU_Test_CT { |
| 4174 | const BssgpBvci bvci := mp_gb_cfg.bvc[0].bvci; |
| 4175 | |
| 4176 | /* Common part: send INFO.ind, establish TBFs... */ |
| 4177 | f_TC_paging_cs_multi_ms_init(pdch_mask := '00000001'B); |
| 4178 | |
| 4179 | /* Enqueue multiple CS PAGING requests at a time (P-TMSI only) */ |
| 4180 | for (var integer i := 0; i < lengthof(g_ms); i := i + 1) { |
| 4181 | var GsmTmsi tmsi := oct2int(g_ms[i].tlli); /* P-TMSI == TLLI */ |
| 4182 | BSSGP[0].send(ts_BSSGP_CS_PAGING_PTMSI(bvci, g_ms[i].imsi, tmsi)); |
| 4183 | } |
| 4184 | |
| 4185 | /* FIXME: work around a race condition between PCUIF and BSSGP */ |
| 4186 | f_sleep(0.2); /* i.e. give the IUT some time to process everything */ |
| 4187 | |
| 4188 | /* Check what the IUT sends on PACCH, all GprsMS instances must be paged. |
| 4189 | * The IUT is expected to page on all PDCH slots of all transceivers. */ |
| 4190 | for (var integer trx_nr := 0; trx_nr < 8; trx_nr := trx_nr + 1) { |
| 4191 | var template (value) TsTrxBtsNum nr := ts_TsTrxBtsNum(7, trx_nr); |
| 4192 | f_TC_paging_cs_multi_ms(nr, exp_imsi := false, exp_tmsi := true); |
| 4193 | } |
| 4194 | |
| 4195 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 4196 | } |
| 4197 | |
| 4198 | testcase TC_paging_cs_multi_ms_imsi_tmsi() runs on RAW_PCU_Test_CT { |
| 4199 | const BssgpBvci bvci := mp_gb_cfg.bvc[0].bvci; |
| 4200 | |
| 4201 | /* Common part: send INFO.ind, establish TBFs... */ |
| 4202 | f_TC_paging_cs_multi_ms_init(pdch_mask := '00000001'B); |
| 4203 | |
| 4204 | /* Enqueue multiple CS PAGING requests at a time (IMSI & P-TMSI) */ |
| 4205 | for (var integer i := 0; i < lengthof(g_ms); i := i + 1) { |
| 4206 | var GsmTmsi tmsi := oct2int(g_ms[i].tlli); /* P-TMSI == TLLI */ |
| 4207 | if (i mod 3 == 0) { /* One PDU fits: 1 IMSI and 2 P-TMSI MIs */ |
| 4208 | BSSGP[0].send(ts_BSSGP_CS_PAGING_PTMSI(bvci, g_ms[i].imsi, tmsi)); |
| 4209 | } else { |
| 4210 | BSSGP[0].send(ts_BSSGP_CS_PAGING_IMSI(bvci, g_ms[i].imsi)); |
| 4211 | } |
| 4212 | } |
| 4213 | |
| 4214 | /* FIXME: work around a race condition between PCUIF and BSSGP */ |
| 4215 | f_sleep(0.2); /* i.e. give the IUT some time to process everything */ |
| 4216 | |
| 4217 | /* Check what the IUT sends on PACCH, all GprsMS instances must be paged. |
| 4218 | * The IUT is expected to page on all PDCH slots of all transceivers. */ |
| 4219 | for (var integer trx_nr := 0; trx_nr < 8; trx_nr := trx_nr + 1) { |
| 4220 | var template (value) TsTrxBtsNum nr := ts_TsTrxBtsNum(7, trx_nr); |
| 4221 | f_TC_paging_cs_multi_ms(nr, exp_imsi := true, exp_tmsi := true); |
| 4222 | } |
| 4223 | |
| 4224 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 4225 | } |
| 4226 | |
Pau Espin Pedrol | a846e61 | 2021-02-01 19:25:25 +0100 | [diff] [blame] | 4227 | private function f_skip_dummy(integer max_num_iter, out uint32_t sched_fn) |
Pau Espin Pedrol | 0637ba0 | 2021-01-22 18:36:12 +0100 | [diff] [blame] | 4228 | runs on RAW_PCU_Test_CT return RlcmacDlBlock { |
| 4229 | var RlcmacDlBlock dl_block; |
Pau Espin Pedrol | 0637ba0 | 2021-01-22 18:36:12 +0100 | [diff] [blame] | 4230 | var integer i := 0; |
| 4231 | while (true) { |
| 4232 | f_rx_rlcmac_dl_block(dl_block, sched_fn); |
| 4233 | if (not match(dl_block, tr_RLCMAC_DUMMY_CTRL())) { |
| 4234 | break; |
| 4235 | } |
Pau Espin Pedrol | 31e3064 | 2021-01-26 19:25:16 +0100 | [diff] [blame] | 4236 | if (max_num_iter > 0 and i > max_num_iter) { |
Pau Espin Pedrol | 0637ba0 | 2021-01-22 18:36:12 +0100 | [diff] [blame] | 4237 | setverdict(fail, "Rx unexpected DL block: ", dl_block); |
| 4238 | f_shutdown(__BFILE__, __LINE__); |
| 4239 | } |
| 4240 | i := i + 1; |
| 4241 | } |
| 4242 | return dl_block; |
| 4243 | } |
| 4244 | |
Pau Espin Pedrol | 6a71548 | 2021-02-10 18:40:46 +0100 | [diff] [blame] | 4245 | private function f_outbound_nacc_rim_tx_resp(PCUIF_info_ind info_ind) |
| 4246 | runs on RAW_PCU_Test_CT { |
| 4247 | var BssgpCellId src := valueof(ts_BssgpCellId(ts_RAI(ts_LAI(f_enc_BcdMccMnc(info_ind.mcc, info_ind.mnc, info_ind.mnc_3_digits == 1), |
| 4248 | info_ind.lac), |
| 4249 | info_ind.rac), |
| 4250 | info_ind.cell_id)); |
| 4251 | var BssgpCellId dst := valueof(ts_BssgpCellId(ts_RAI(ts_LAI('023F43'H, /* Decided by test itself (emulating BSC) */ |
| 4252 | 423), |
| 4253 | 2), |
| 4254 | 5)); |
| 4255 | var RIM_Routing_Address src_addr := valueof(t_RIM_Routing_Address_cid(src)); |
| 4256 | var RIM_Routing_Address dst_addr := valueof(t_RIM_Routing_Address_cid(dst)); |
| 4257 | var template (value) RAN_Information_RIM_Container res_cont := |
| 4258 | ts_RAN_Information_RIM_Container(ts_RIM_Application_Identity(RIM_APP_ID_NACC), |
| 4259 | ts_RIM_Sequence_Number(2), |
| 4260 | ts_RIM_PDU_Indications(false, RIM_PDU_TYPE_SING_REP), |
| 4261 | ts_RIM_Protocol_Version_Number(1), |
| 4262 | tsu_ApplContainer_or_ApplErrContainer_NACC(tsu_ApplContainer_NACC(dst, false, 3, si_default)), |
| 4263 | omit); |
| 4264 | RIM.send(ts_PDU_BSSGP_RAN_INFORMATION(ts_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, src_addr), |
| 4265 | ts_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, dst_addr), |
| 4266 | res_cont)); |
| 4267 | } |
| 4268 | |
| 4269 | altstep as_outbound_nacc_rim_resolve(PCUIF_info_ind info_ind, boolean do_answer := true, boolean do_repeat := false) |
| 4270 | runs on RAW_PCU_Test_CT { |
| 4271 | /* RIM procedure: */ |
| 4272 | var BssgpCellId src := valueof(ts_BssgpCellId(ts_RAI(ts_LAI(f_enc_BcdMccMnc(info_ind.mcc, info_ind.mnc, info_ind.mnc_3_digits == 1), |
| 4273 | info_ind.lac), |
| 4274 | info_ind.rac), |
| 4275 | info_ind.cell_id)); |
| 4276 | var BssgpCellId dst := valueof(ts_BssgpCellId(ts_RAI(ts_LAI('023F43'H, /* Decided by test itself (emulating BSC) */ |
| 4277 | 423), |
| 4278 | 2), |
| 4279 | 5)); |
| 4280 | var RIM_Routing_Address src_addr := valueof(t_RIM_Routing_Address_cid(src)); |
| 4281 | var RIM_Routing_Address dst_addr := valueof(t_RIM_Routing_Address_cid(dst)); |
| 4282 | [] RIM.receive(tr_RAN_INFORMATION_REQUEST(tr_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, dst_addr), |
| 4283 | tr_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, src_addr), |
| 4284 | tr_RAN_Information_Request_RIM_Container)) { |
| 4285 | if (do_answer) { |
| 4286 | f_outbound_nacc_rim_tx_resp(info_ind); |
| 4287 | } |
| 4288 | if (do_repeat) { |
| 4289 | repeat; |
| 4290 | } |
| 4291 | } |
| 4292 | } |
| 4293 | |
Pau Espin Pedrol | 43be425 | 2021-01-27 16:40:54 +0100 | [diff] [blame] | 4294 | /* Start NACC from MS side */ |
| 4295 | private function f_outbound_nacc_success(inout GprsMS ms, PCUIF_info_ind info_ind, |
Pau Espin Pedrol | 2abbba9 | 2021-02-02 11:52:57 +0100 | [diff] [blame] | 4296 | boolean exp_rac_ci_query := true, boolean exp_si_query := true, |
| 4297 | boolean skip_final_ctrl_ack := false) |
Pau Espin Pedrol | 43be425 | 2021-01-27 16:40:54 +0100 | [diff] [blame] | 4298 | runs on RAW_PCU_Test_CT { |
| 4299 | var template (value) RlcmacUlCtrlMsg cell_chf_notif; |
| 4300 | var RlcmacDlBlock dl_block; |
| 4301 | var uint32_t sched_fn; |
| 4302 | var GsmArfcn req_arfcn := 862; |
| 4303 | var uint6_t req_bsic := 43; |
| 4304 | |
| 4305 | /* Start NACC from MS side */ |
| 4306 | cell_chf_notif := ts_RlcMacUlCtrl_PKT_CELL_CHG_NOTIF(ms.ul_tbf.tfi, req_arfcn, req_bsic); |
| 4307 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(cell_chf_notif), 0, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 4308 | |
| 4309 | if (exp_rac_ci_query == true) { |
| 4310 | /* osmo-pcu should now ask for resolution: */ |
| 4311 | f_ipa_ctrl_wait_link_up(); |
| 4312 | var charstring ctrl_var := "neighbor_resolve_cgi_ps_from_lac_ci." & |
| 4313 | int2str(info_ind.lac) & "." & |
| 4314 | int2str(info_ind.cell_id) & "." & |
| 4315 | int2str(req_arfcn) & "." & |
| 4316 | int2str(req_bsic); |
| 4317 | f_ctrl_exp_get(IPA_CTRL, ctrl_var, "023-43-423-2-5"); |
| 4318 | } |
| 4319 | |
| 4320 | if (exp_si_query == true) { |
| 4321 | /* RIM procedure: */ |
Pau Espin Pedrol | 6a71548 | 2021-02-10 18:40:46 +0100 | [diff] [blame] | 4322 | as_outbound_nacc_rim_resolve(info_ind); |
Pau Espin Pedrol | 43be425 | 2021-01-27 16:40:54 +0100 | [diff] [blame] | 4323 | } |
| 4324 | |
| 4325 | /* Announce SI back to MS, continue NACC procedure */ |
Pau Espin Pedrol | 6cb71cc | 2021-02-11 13:54:01 +0100 | [diff] [blame] | 4326 | f_ms_handle_pkt_neighbor_cell_data(ms, si_default); |
Pau Espin Pedrol | 43be425 | 2021-01-27 16:40:54 +0100 | [diff] [blame] | 4327 | |
| 4328 | /* Obtain a Downlink block and make sure it is a Pkt Cell Chg Continue */ |
| 4329 | f_rx_rlcmac_dl_block(dl_block, sched_fn); |
| 4330 | if (not match(dl_block, tr_RLCMAC_DL_CTRL(?, tr_RlcMacDlCtrl_PKT_CELL_CHG_CONTINUE))) { |
| 4331 | setverdict(fail, "Rx unexpected DL block: ", dl_block); |
| 4332 | f_shutdown(__BFILE__, __LINE__); |
| 4333 | } |
Pau Espin Pedrol | a846e61 | 2021-02-01 19:25:25 +0100 | [diff] [blame] | 4334 | /* PKT CELL CHG CONTINUE ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
Pau Espin Pedrol | 2abbba9 | 2021-02-02 11:52:57 +0100 | [diff] [blame] | 4335 | if (not skip_final_ctrl_ack and dl_block.ctrl.mac_hdr.rrbp_valid) { |
Pau Espin Pedrol | a846e61 | 2021-02-01 19:25:25 +0100 | [diff] [blame] | 4336 | sched_fn := f_rrbp_ack_fn(sched_fn, dl_block.ctrl.mac_hdr.rrbp); |
| 4337 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
| 4338 | } |
Pau Espin Pedrol | 43be425 | 2021-01-27 16:40:54 +0100 | [diff] [blame] | 4339 | } |
| 4340 | |
Pau Espin Pedrol | 0637ba0 | 2021-01-22 18:36:12 +0100 | [diff] [blame] | 4341 | /* Verify PCU handles outbound Network Assisted Cell Change Cell Change (NACC, TS 44.060 sec 8.8). */ |
| 4342 | testcase TC_nacc_outbound_success() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | 0637ba0 | 2021-01-22 18:36:12 +0100 | [diff] [blame] | 4343 | var PollFnCtx pollctx; |
Pau Espin Pedrol | 0637ba0 | 2021-01-22 18:36:12 +0100 | [diff] [blame] | 4344 | var GprsMS ms; |
Pau Espin Pedrol | 0637ba0 | 2021-01-22 18:36:12 +0100 | [diff] [blame] | 4345 | var PCUIF_info_ind info_ind := valueof(ts_PCUIF_INFO_default); |
Pau Espin Pedrol | 0637ba0 | 2021-01-22 18:36:12 +0100 | [diff] [blame] | 4346 | |
| 4347 | /* Initialize osmo-bsc emulation neighbor resolution CTRL port */ |
| 4348 | f_ipa_ctrl_start_server(mp_ctrl_neigh_ip, mp_ctrl_neigh_port); |
| 4349 | |
| 4350 | /* Initialize NS/BSSGP side */ |
| 4351 | f_init_bssgp(); |
| 4352 | /* Initialize GPRS MS side */ |
| 4353 | f_init_gprs_ms(); |
| 4354 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 4355 | |
| 4356 | /* Initialize the PCU interface abstraction */ |
| 4357 | f_init_raw(testcasename(), info_ind); |
| 4358 | |
Pau Espin Pedrol | 43be425 | 2021-01-27 16:40:54 +0100 | [diff] [blame] | 4359 | /* Make sure we are not affected by full cache from previous tests */ |
| 4360 | f_pcuvty_flush_neigh_caches(); |
| 4361 | |
Pau Espin Pedrol | 0637ba0 | 2021-01-22 18:36:12 +0100 | [diff] [blame] | 4362 | /* Establish BSSGP connection to the PCU */ |
| 4363 | f_bssgp_establish(); |
| 4364 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 4365 | |
| 4366 | /* Send PACKET RESOURCE REQUEST */ |
Pau Espin Pedrol | 13ab5ea | 2021-02-05 11:56:15 +0100 | [diff] [blame] | 4367 | pollctx := f_ms_establish_ul_tbf_2phase_access(ms, ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, ms_racap_gprs_def)); |
Pau Espin Pedrol | 0637ba0 | 2021-01-22 18:36:12 +0100 | [diff] [blame] | 4368 | /* Pkt Uplink Assignment above sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 4369 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), pollctx.fn, nr := pollctx.tstrxbts); |
| 4370 | |
| 4371 | /* Start NACC from MS side */ |
Pau Espin Pedrol | 43be425 | 2021-01-27 16:40:54 +0100 | [diff] [blame] | 4372 | f_outbound_nacc_success(ms, info_ind); |
Pau Espin Pedrol | 0637ba0 | 2021-01-22 18:36:12 +0100 | [diff] [blame] | 4373 | |
Pau Espin Pedrol | 43be425 | 2021-01-27 16:40:54 +0100 | [diff] [blame] | 4374 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 4375 | } |
Pau Espin Pedrol | 0637ba0 | 2021-01-22 18:36:12 +0100 | [diff] [blame] | 4376 | |
Pau Espin Pedrol | 2abbba9 | 2021-02-02 11:52:57 +0100 | [diff] [blame] | 4377 | /* Verify Pkt Cell Change Continue is retransmitted if not CTRL ACKed */ |
| 4378 | testcase TC_nacc_outbound_success_no_ctrl_ack() runs on RAW_PCU_Test_CT { |
| 4379 | var PollFnCtx pollctx; |
| 4380 | var GprsMS ms; |
| 4381 | var RlcmacDlBlock dl_block; |
| 4382 | var uint32_t sched_fn; |
| 4383 | var PCUIF_info_ind info_ind := valueof(ts_PCUIF_INFO_default); |
Pau Espin Pedrol | 2abbba9 | 2021-02-02 11:52:57 +0100 | [diff] [blame] | 4384 | |
| 4385 | /* Initialize osmo-bsc emulation neighbor resolution CTRL port */ |
| 4386 | f_ipa_ctrl_start_server(mp_ctrl_neigh_ip, mp_ctrl_neigh_port); |
| 4387 | |
| 4388 | /* Initialize NS/BSSGP side */ |
| 4389 | f_init_bssgp(); |
| 4390 | /* Initialize GPRS MS side */ |
| 4391 | f_init_gprs_ms(); |
| 4392 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 4393 | |
| 4394 | /* Initialize the PCU interface abstraction */ |
| 4395 | f_init_raw(testcasename(), info_ind); |
| 4396 | |
| 4397 | /* Make sure we are not affected by full cache from previous tests */ |
| 4398 | f_pcuvty_flush_neigh_caches(); |
| 4399 | |
| 4400 | /* Establish BSSGP connection to the PCU */ |
| 4401 | f_bssgp_establish(); |
| 4402 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 4403 | |
| 4404 | /* Send PACKET RESOURCE REQUEST */ |
Pau Espin Pedrol | 13ab5ea | 2021-02-05 11:56:15 +0100 | [diff] [blame] | 4405 | pollctx := f_ms_establish_ul_tbf_2phase_access(ms, ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, ms_racap_gprs_def)); |
Pau Espin Pedrol | 2abbba9 | 2021-02-02 11:52:57 +0100 | [diff] [blame] | 4406 | /* Pkt Uplink Assignment above sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 4407 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), pollctx.fn, nr := pollctx.tstrxbts); |
| 4408 | |
| 4409 | /* Start NACC from MS side, avoid sending final CTRL ACK */ |
| 4410 | f_outbound_nacc_success(ms, info_ind, skip_final_ctrl_ack := true); |
| 4411 | |
| 4412 | /* Wait until we receive something non-dummy */ |
| 4413 | dl_block := f_skip_dummy(0, sched_fn); |
| 4414 | /* Make sure it is a Pkt Cell Chg Continue (retransmitted)*/ |
| 4415 | if (not match(dl_block, tr_RLCMAC_DL_CTRL(?, tr_RlcMacDlCtrl_PKT_CELL_CHG_CONTINUE))) { |
| 4416 | setverdict(fail, "Rx unexpected DL block: ", dl_block); |
| 4417 | } |
| 4418 | /* PKT CELL CHG CONTINUE ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 4419 | if (dl_block.ctrl.mac_hdr.rrbp_valid) { |
| 4420 | sched_fn := f_rrbp_ack_fn(sched_fn, dl_block.ctrl.mac_hdr.rrbp); |
| 4421 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
| 4422 | } |
| 4423 | |
| 4424 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 4425 | } |
| 4426 | |
Pau Espin Pedrol | 43be425 | 2021-01-27 16:40:54 +0100 | [diff] [blame] | 4427 | /* Verify PCU handles outbound Network Assisted Cell Change Cell Change (NACC, TS 44.060 sec 8.8) twice, the second time using the caches */ |
| 4428 | testcase TC_nacc_outbound_success_twice() runs on RAW_PCU_Test_CT { |
| 4429 | var PollFnCtx pollctx; |
| 4430 | var GprsMS ms; |
| 4431 | var PCUIF_info_ind info_ind := valueof(ts_PCUIF_INFO_default); |
Pau Espin Pedrol | 43be425 | 2021-01-27 16:40:54 +0100 | [diff] [blame] | 4432 | var template (value) RlcmacUlCtrlMsg cell_chf_notif; |
Pau Espin Pedrol | 0637ba0 | 2021-01-22 18:36:12 +0100 | [diff] [blame] | 4433 | |
Pau Espin Pedrol | 43be425 | 2021-01-27 16:40:54 +0100 | [diff] [blame] | 4434 | /* Initialize osmo-bsc emulation neighbor resolution CTRL port */ |
| 4435 | f_ipa_ctrl_start_server(mp_ctrl_neigh_ip, mp_ctrl_neigh_port); |
Pau Espin Pedrol | 0637ba0 | 2021-01-22 18:36:12 +0100 | [diff] [blame] | 4436 | |
Pau Espin Pedrol | 43be425 | 2021-01-27 16:40:54 +0100 | [diff] [blame] | 4437 | /* Initialize NS/BSSGP side */ |
| 4438 | f_init_bssgp(); |
| 4439 | /* Initialize GPRS MS side */ |
| 4440 | f_init_gprs_ms(); |
| 4441 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 4442 | |
| 4443 | /* Initialize the PCU interface abstraction */ |
| 4444 | f_init_raw(testcasename(), info_ind); |
| 4445 | |
| 4446 | /* Make sure we are not affected by full cache from previous tests */ |
| 4447 | f_pcuvty_flush_neigh_caches(); |
| 4448 | /* Set timeout values for caches so that entries will be in cache during second try */ |
| 4449 | f_pcuvty_set_neigh_caches(10, 10); |
| 4450 | |
| 4451 | /* Establish BSSGP connection to the PCU */ |
| 4452 | f_bssgp_establish(); |
| 4453 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 4454 | |
| 4455 | /* Send PACKET RESOURCE REQUEST */ |
Pau Espin Pedrol | 13ab5ea | 2021-02-05 11:56:15 +0100 | [diff] [blame] | 4456 | pollctx := f_ms_establish_ul_tbf_2phase_access(ms, ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, ms_racap_gprs_def)); |
Pau Espin Pedrol | 43be425 | 2021-01-27 16:40:54 +0100 | [diff] [blame] | 4457 | /* Pkt Uplink Assignment above sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 4458 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), pollctx.fn, nr := pollctx.tstrxbts); |
| 4459 | |
| 4460 | /* Start NACC from MS side */ |
| 4461 | f_outbound_nacc_success(ms, info_ind); |
| 4462 | |
| 4463 | /* First NACC procedure is done, let's try to start a new one now that previous queries are cached: */ |
| 4464 | f_outbound_nacc_success(ms, info_ind, false, false); |
Pau Espin Pedrol | 0637ba0 | 2021-01-22 18:36:12 +0100 | [diff] [blame] | 4465 | |
| 4466 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 4467 | } |
| 4468 | |
Pau Espin Pedrol | 8536668 | 2021-01-27 19:04:54 +0100 | [diff] [blame] | 4469 | /* Verify PCU handles outbound Network Assisted Cell Change Cell Change (NACC, |
| 4470 | * TS 44.060 sec 8.8) twice, the second time after caches timed out |
| 4471 | */ |
| 4472 | testcase TC_nacc_outbound_success_twice_nocache() runs on RAW_PCU_Test_CT { |
| 4473 | var PollFnCtx pollctx; |
| 4474 | var GprsMS ms; |
| 4475 | var PCUIF_info_ind info_ind := valueof(ts_PCUIF_INFO_default); |
Pau Espin Pedrol | 8536668 | 2021-01-27 19:04:54 +0100 | [diff] [blame] | 4476 | var template (value) RlcmacUlCtrlMsg cell_chf_notif; |
| 4477 | |
| 4478 | /* Initialize osmo-bsc emulation neighbor resolution CTRL port */ |
| 4479 | f_ipa_ctrl_start_server(mp_ctrl_neigh_ip, mp_ctrl_neigh_port); |
| 4480 | |
| 4481 | /* Initialize NS/BSSGP side */ |
| 4482 | f_init_bssgp(); |
| 4483 | /* Initialize GPRS MS side */ |
| 4484 | f_init_gprs_ms(); |
| 4485 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 4486 | |
| 4487 | /* Initialize the PCU interface abstraction */ |
| 4488 | f_init_raw(testcasename(), info_ind); |
| 4489 | |
| 4490 | /* Make sure we are not affected by full cache from previous tests */ |
| 4491 | f_pcuvty_flush_neigh_caches(); |
| 4492 | /* Set timeout values for caches so that entries will be erased before the second try */ |
| 4493 | f_pcuvty_set_neigh_caches(1, 1); |
| 4494 | |
| 4495 | /* Establish BSSGP connection to the PCU */ |
| 4496 | f_bssgp_establish(); |
| 4497 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 4498 | |
| 4499 | /* Send PACKET RESOURCE REQUEST */ |
Pau Espin Pedrol | 13ab5ea | 2021-02-05 11:56:15 +0100 | [diff] [blame] | 4500 | pollctx := f_ms_establish_ul_tbf_2phase_access(ms, ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, ms_racap_gprs_def)); |
Pau Espin Pedrol | 8536668 | 2021-01-27 19:04:54 +0100 | [diff] [blame] | 4501 | /* Pkt Uplink Assignment above sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 4502 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), pollctx.fn, nr := pollctx.tstrxbts); |
| 4503 | |
| 4504 | /* Start NACC from MS side */ |
| 4505 | f_outbound_nacc_success(ms, info_ind); |
| 4506 | |
| 4507 | /* CTRL client should have disconnected from us */ |
| 4508 | f_ipa_ctrl_wait_link_down(); |
| 4509 | /* wait for cache entries to time out */ |
| 4510 | f_sleep(2.0); |
| 4511 | /* First NACC procedure is done, let's try to start a new one now that previous queries have timed out: */ |
| 4512 | f_outbound_nacc_success(ms, info_ind); |
| 4513 | |
| 4514 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 4515 | } |
| 4516 | |
Pau Espin Pedrol | 31e3064 | 2021-01-26 19:25:16 +0100 | [diff] [blame] | 4517 | /* Verify PCU transmits Pkt Cell Change Continue if RAC+CI resolution fails during outbound NACC procedure */ |
Pau Espin Pedrol | e51c17a | 2021-01-27 18:29:22 +0100 | [diff] [blame] | 4518 | testcase TC_nacc_outbound_rac_ci_resolve_conn_refused() runs on RAW_PCU_Test_CT { |
| 4519 | var RlcmacDlBlock dl_block; |
| 4520 | var PollFnCtx pollctx; |
| 4521 | var uint32_t sched_fn; |
| 4522 | var GprsMS ms; |
| 4523 | var template (value) RlcmacUlCtrlMsg cell_chf_notif; |
| 4524 | var PCUIF_info_ind info_ind := valueof(ts_PCUIF_INFO_default); |
Pau Espin Pedrol | e51c17a | 2021-01-27 18:29:22 +0100 | [diff] [blame] | 4525 | var GsmArfcn req_arfcn := 862; |
| 4526 | var uint6_t req_bsic := 43; |
| 4527 | |
| 4528 | /* In here we explicitly avoid starting osmo-bsc emulation neighbor |
| 4529 | * resolution CTRL port, to trigger Conn Refused by socket: |
| 4530 | * f_ipa_ctrl_start_server(mp_ctrl_neigh_ip, mp_ctrl_neigh_port); |
| 4531 | */ |
| 4532 | |
| 4533 | /* Initialize NS/BSSGP side */ |
| 4534 | f_init_bssgp(); |
| 4535 | /* Initialize GPRS MS side */ |
| 4536 | f_init_gprs_ms(); |
| 4537 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 4538 | |
| 4539 | /* Initialize the PCU interface abstraction */ |
| 4540 | f_init_raw(testcasename(), info_ind); |
| 4541 | |
| 4542 | /* Make sure we are not affected by full cache from previous tests */ |
| 4543 | f_pcuvty_flush_neigh_caches(); |
| 4544 | |
| 4545 | /* Establish BSSGP connection to the PCU */ |
| 4546 | f_bssgp_establish(); |
| 4547 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 4548 | |
| 4549 | /* Send PACKET RESOURCE REQUEST */ |
Pau Espin Pedrol | 13ab5ea | 2021-02-05 11:56:15 +0100 | [diff] [blame] | 4550 | pollctx := f_ms_establish_ul_tbf_2phase_access(ms, ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, ms_racap_gprs_def)); |
Pau Espin Pedrol | e51c17a | 2021-01-27 18:29:22 +0100 | [diff] [blame] | 4551 | /* Pkt Uplink Assignment above sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 4552 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), pollctx.fn, nr := pollctx.tstrxbts); |
| 4553 | |
| 4554 | /* Start NACC from MS side */ |
| 4555 | cell_chf_notif := ts_RlcMacUlCtrl_PKT_CELL_CHG_NOTIF(ms.ul_tbf.tfi, req_arfcn, req_bsic); |
| 4556 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(cell_chf_notif), 0, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 4557 | |
| 4558 | /* Wait until we receive something non-dummy */ |
Pau Espin Pedrol | a846e61 | 2021-02-01 19:25:25 +0100 | [diff] [blame] | 4559 | dl_block := f_skip_dummy(0, sched_fn); |
Pau Espin Pedrol | e51c17a | 2021-01-27 18:29:22 +0100 | [diff] [blame] | 4560 | /* Make sure it is a Pkt Cell Chg Continue */ |
| 4561 | if (not match(dl_block, tr_RLCMAC_DL_CTRL(?, tr_RlcMacDlCtrl_PKT_CELL_CHG_CONTINUE))) { |
| 4562 | setverdict(fail, "Rx unexpected DL block: ", dl_block); |
| 4563 | } |
Pau Espin Pedrol | a846e61 | 2021-02-01 19:25:25 +0100 | [diff] [blame] | 4564 | /* PKT CELL CHG CONTINUE ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 4565 | if (dl_block.ctrl.mac_hdr.rrbp_valid) { |
| 4566 | sched_fn := f_rrbp_ack_fn(sched_fn, dl_block.ctrl.mac_hdr.rrbp); |
| 4567 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
| 4568 | } |
Pau Espin Pedrol | e51c17a | 2021-01-27 18:29:22 +0100 | [diff] [blame] | 4569 | |
| 4570 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 4571 | } |
| 4572 | |
| 4573 | /* Verify PCU transmits Pkt Cell Change Continue if RAC+CI resolution fails during outbound NACC procedure */ |
Pau Espin Pedrol | 31e3064 | 2021-01-26 19:25:16 +0100 | [diff] [blame] | 4574 | testcase TC_nacc_outbound_rac_ci_resolve_timeout() runs on RAW_PCU_Test_CT { |
| 4575 | var RlcmacDlBlock dl_block; |
| 4576 | var PollFnCtx pollctx; |
| 4577 | var uint32_t sched_fn; |
| 4578 | var GprsMS ms; |
| 4579 | var template (value) RlcmacUlCtrlMsg cell_chf_notif; |
| 4580 | var PCUIF_info_ind info_ind := valueof(ts_PCUIF_INFO_default); |
Pau Espin Pedrol | 31e3064 | 2021-01-26 19:25:16 +0100 | [diff] [blame] | 4581 | var GsmArfcn req_arfcn := 862; |
| 4582 | var uint6_t req_bsic := 43; |
| 4583 | |
| 4584 | /* Initialize osmo-bsc emulation neighbor resolution CTRL port */ |
| 4585 | f_ipa_ctrl_start_server(mp_ctrl_neigh_ip, mp_ctrl_neigh_port); |
| 4586 | |
| 4587 | /* Initialize NS/BSSGP side */ |
| 4588 | f_init_bssgp(); |
| 4589 | /* Initialize GPRS MS side */ |
| 4590 | f_init_gprs_ms(); |
| 4591 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 4592 | |
| 4593 | /* Initialize the PCU interface abstraction */ |
| 4594 | f_init_raw(testcasename(), info_ind); |
| 4595 | |
Pau Espin Pedrol | 43be425 | 2021-01-27 16:40:54 +0100 | [diff] [blame] | 4596 | /* Make sure we are not affected by full cache from previous tests */ |
| 4597 | f_pcuvty_flush_neigh_caches(); |
| 4598 | |
Pau Espin Pedrol | 31e3064 | 2021-01-26 19:25:16 +0100 | [diff] [blame] | 4599 | /* Establish BSSGP connection to the PCU */ |
| 4600 | f_bssgp_establish(); |
| 4601 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 4602 | |
| 4603 | /* Send PACKET RESOURCE REQUEST */ |
Pau Espin Pedrol | 13ab5ea | 2021-02-05 11:56:15 +0100 | [diff] [blame] | 4604 | pollctx := f_ms_establish_ul_tbf_2phase_access(ms, ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, ms_racap_gprs_def)); |
Pau Espin Pedrol | 31e3064 | 2021-01-26 19:25:16 +0100 | [diff] [blame] | 4605 | /* Pkt Uplink Assignment above sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 4606 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), pollctx.fn, nr := pollctx.tstrxbts); |
| 4607 | |
| 4608 | /* Start NACC from MS side */ |
| 4609 | cell_chf_notif := ts_RlcMacUlCtrl_PKT_CELL_CHG_NOTIF(ms.ul_tbf.tfi, req_arfcn, req_bsic); |
| 4610 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(cell_chf_notif), 0, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 4611 | |
| 4612 | /* osmo-pcu should now ask for resolution: */ |
| 4613 | f_ipa_ctrl_wait_link_up(); |
| 4614 | var charstring ctrl_var := "neighbor_resolve_cgi_ps_from_lac_ci." & |
| 4615 | int2str(info_ind.lac) & "." & |
| 4616 | int2str(info_ind.cell_id) & "." & |
| 4617 | int2str(req_arfcn) & "." & |
| 4618 | int2str(req_bsic); |
| 4619 | /* we receive RAC+CI resolution request, but we never answer to it, timeout should occur */ |
| 4620 | f_ctrl_exp_get(IPA_CTRL, ctrl_var, omit); |
| 4621 | |
| 4622 | /* Wait until we receive something non-dummy */ |
Pau Espin Pedrol | a846e61 | 2021-02-01 19:25:25 +0100 | [diff] [blame] | 4623 | dl_block := f_skip_dummy(0, sched_fn); |
Pau Espin Pedrol | 31e3064 | 2021-01-26 19:25:16 +0100 | [diff] [blame] | 4624 | /* Make sure it is a Pkt Cell Chg Continue */ |
| 4625 | if (not match(dl_block, tr_RLCMAC_DL_CTRL(?, tr_RlcMacDlCtrl_PKT_CELL_CHG_CONTINUE))) { |
| 4626 | setverdict(fail, "Rx unexpected DL block: ", dl_block); |
| 4627 | } |
Pau Espin Pedrol | a846e61 | 2021-02-01 19:25:25 +0100 | [diff] [blame] | 4628 | /* PKT CELL CHG CONTINUE ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 4629 | if (dl_block.ctrl.mac_hdr.rrbp_valid) { |
| 4630 | sched_fn := f_rrbp_ack_fn(sched_fn, dl_block.ctrl.mac_hdr.rrbp); |
| 4631 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
| 4632 | } |
Pau Espin Pedrol | 31e3064 | 2021-01-26 19:25:16 +0100 | [diff] [blame] | 4633 | |
| 4634 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 4635 | } |
| 4636 | |
Pau Espin Pedrol | 4b5227c | 2021-01-26 20:03:01 +0100 | [diff] [blame] | 4637 | /* Verify PCU transmits Pkt Cell Change Continue if RAC+CI resolution fails during outbound NACC procedure */ |
| 4638 | testcase TC_nacc_outbound_rac_ci_resolve_fail_parse_response() runs on RAW_PCU_Test_CT { |
| 4639 | var RlcmacDlBlock dl_block; |
| 4640 | var PollFnCtx pollctx; |
| 4641 | var uint32_t sched_fn; |
| 4642 | var GprsMS ms; |
| 4643 | var template (value) RlcmacUlCtrlMsg cell_chf_notif; |
| 4644 | var PCUIF_info_ind info_ind := valueof(ts_PCUIF_INFO_default); |
Pau Espin Pedrol | 4b5227c | 2021-01-26 20:03:01 +0100 | [diff] [blame] | 4645 | var GsmArfcn req_arfcn := 862; |
| 4646 | var uint6_t req_bsic := 43; |
| 4647 | |
| 4648 | /* Initialize osmo-bsc emulation neighbor resolution CTRL port */ |
| 4649 | f_ipa_ctrl_start_server(mp_ctrl_neigh_ip, mp_ctrl_neigh_port); |
| 4650 | |
| 4651 | /* Initialize NS/BSSGP side */ |
| 4652 | f_init_bssgp(); |
| 4653 | /* Initialize GPRS MS side */ |
| 4654 | f_init_gprs_ms(); |
| 4655 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 4656 | |
| 4657 | /* Initialize the PCU interface abstraction */ |
| 4658 | f_init_raw(testcasename(), info_ind); |
| 4659 | |
Pau Espin Pedrol | 43be425 | 2021-01-27 16:40:54 +0100 | [diff] [blame] | 4660 | /* Make sure we are not affected by full cache from previous tests */ |
| 4661 | f_pcuvty_flush_neigh_caches(); |
| 4662 | |
Pau Espin Pedrol | 4b5227c | 2021-01-26 20:03:01 +0100 | [diff] [blame] | 4663 | /* Establish BSSGP connection to the PCU */ |
| 4664 | f_bssgp_establish(); |
| 4665 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 4666 | |
| 4667 | /* Send PACKET RESOURCE REQUEST */ |
Pau Espin Pedrol | 13ab5ea | 2021-02-05 11:56:15 +0100 | [diff] [blame] | 4668 | pollctx := f_ms_establish_ul_tbf_2phase_access(ms, ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, ms_racap_gprs_def)); |
Pau Espin Pedrol | 4b5227c | 2021-01-26 20:03:01 +0100 | [diff] [blame] | 4669 | /* Pkt Uplink Assignment above sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 4670 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), pollctx.fn, nr := pollctx.tstrxbts); |
| 4671 | |
| 4672 | /* Start NACC from MS side */ |
| 4673 | cell_chf_notif := ts_RlcMacUlCtrl_PKT_CELL_CHG_NOTIF(ms.ul_tbf.tfi, req_arfcn, req_bsic); |
| 4674 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(cell_chf_notif), 0, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 4675 | |
| 4676 | /* osmo-pcu should now ask for resolution: */ |
| 4677 | f_ipa_ctrl_wait_link_up(); |
| 4678 | var charstring ctrl_var := "neighbor_resolve_cgi_ps_from_lac_ci." & |
| 4679 | int2str(info_ind.lac) & "." & |
| 4680 | int2str(info_ind.cell_id) & "." & |
| 4681 | int2str(req_arfcn) & "." & |
| 4682 | int2str(req_bsic); |
| 4683 | /* we receive RAC+CI resolution request and we send incorrectlt formated response */ |
| 4684 | f_ctrl_exp_get(IPA_CTRL, ctrl_var, "foobar-error"); |
| 4685 | |
| 4686 | /* Wait until we receive something non-dummy */ |
Pau Espin Pedrol | a846e61 | 2021-02-01 19:25:25 +0100 | [diff] [blame] | 4687 | dl_block := f_skip_dummy(0, sched_fn); |
Pau Espin Pedrol | 4b5227c | 2021-01-26 20:03:01 +0100 | [diff] [blame] | 4688 | /* Make sure it is a Pkt Cell Chg Continue */ |
| 4689 | if (not match(dl_block, tr_RLCMAC_DL_CTRL(?, tr_RlcMacDlCtrl_PKT_CELL_CHG_CONTINUE))) { |
| 4690 | setverdict(fail, "Rx unexpected DL block: ", dl_block); |
| 4691 | } |
Pau Espin Pedrol | a846e61 | 2021-02-01 19:25:25 +0100 | [diff] [blame] | 4692 | /* PKT CELL CHG CONTINUE ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 4693 | if (dl_block.ctrl.mac_hdr.rrbp_valid) { |
| 4694 | sched_fn := f_rrbp_ack_fn(sched_fn, dl_block.ctrl.mac_hdr.rrbp); |
| 4695 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
| 4696 | } |
Pau Espin Pedrol | 4b5227c | 2021-01-26 20:03:01 +0100 | [diff] [blame] | 4697 | |
| 4698 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 4699 | } |
| 4700 | |
Pau Espin Pedrol | 9076ee7 | 2021-01-26 19:38:26 +0100 | [diff] [blame] | 4701 | /* Verify PCU transmits Pkt Cell Change Continue if SI resolution fails during outbound NACC procedure */ |
| 4702 | testcase TC_nacc_outbound_si_resolve_timeout() runs on RAW_PCU_Test_CT { |
| 4703 | var RlcmacDlBlock dl_block; |
| 4704 | var PollFnCtx pollctx; |
| 4705 | var uint32_t sched_fn; |
| 4706 | var GprsMS ms; |
| 4707 | var template (value) RlcmacUlCtrlMsg cell_chf_notif; |
| 4708 | var PCUIF_info_ind info_ind := valueof(ts_PCUIF_INFO_default); |
Pau Espin Pedrol | 9076ee7 | 2021-01-26 19:38:26 +0100 | [diff] [blame] | 4709 | var GsmArfcn req_arfcn := 862; |
| 4710 | var uint6_t req_bsic := 43; |
| 4711 | var BssgpCellId src := valueof(ts_BssgpCellId(ts_RAI(ts_LAI(f_enc_BcdMccMnc(info_ind.mcc, info_ind.mnc, info_ind.mnc_3_digits == 1), /* '262F42'H */ |
| 4712 | info_ind.lac), |
| 4713 | info_ind.rac), |
| 4714 | info_ind.cell_id)); |
| 4715 | var BssgpCellId dst := valueof(ts_BssgpCellId(ts_RAI(ts_LAI('023F43'H, /* Decided by test itself (emulating BSC) */ |
| 4716 | 423), |
| 4717 | 2), |
| 4718 | 5)); |
| 4719 | var template RIM_Routing_Address src_addr := t_RIM_Routing_Address_cid(src); |
| 4720 | var template RIM_Routing_Address dst_addr := t_RIM_Routing_Address_cid(dst); |
| 4721 | |
| 4722 | /* Initialize osmo-bsc emulation neighbor resolution CTRL port */ |
| 4723 | f_ipa_ctrl_start_server(mp_ctrl_neigh_ip, mp_ctrl_neigh_port); |
| 4724 | |
| 4725 | /* Initialize NS/BSSGP side */ |
| 4726 | f_init_bssgp(); |
| 4727 | /* Initialize GPRS MS side */ |
| 4728 | f_init_gprs_ms(); |
| 4729 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 4730 | |
| 4731 | /* Initialize the PCU interface abstraction */ |
| 4732 | f_init_raw(testcasename(), info_ind); |
| 4733 | |
Pau Espin Pedrol | 43be425 | 2021-01-27 16:40:54 +0100 | [diff] [blame] | 4734 | /* Make sure we are not affected by full cache from previous tests */ |
| 4735 | f_pcuvty_flush_neigh_caches(); |
| 4736 | |
Pau Espin Pedrol | 9076ee7 | 2021-01-26 19:38:26 +0100 | [diff] [blame] | 4737 | /* Establish BSSGP connection to the PCU */ |
| 4738 | f_bssgp_establish(); |
| 4739 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 4740 | |
| 4741 | /* Send PACKET RESOURCE REQUEST */ |
Pau Espin Pedrol | 13ab5ea | 2021-02-05 11:56:15 +0100 | [diff] [blame] | 4742 | pollctx := f_ms_establish_ul_tbf_2phase_access(ms, ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, ms_racap_gprs_def)); |
Pau Espin Pedrol | 9076ee7 | 2021-01-26 19:38:26 +0100 | [diff] [blame] | 4743 | /* Pkt Uplink Assignment above sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 4744 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), pollctx.fn, nr := pollctx.tstrxbts); |
| 4745 | |
| 4746 | /* Start NACC from MS side */ |
| 4747 | cell_chf_notif := ts_RlcMacUlCtrl_PKT_CELL_CHG_NOTIF(ms.ul_tbf.tfi, req_arfcn, req_bsic); |
| 4748 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(cell_chf_notif), 0, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 4749 | |
| 4750 | /* osmo-pcu should now ask for resolution: */ |
| 4751 | f_ipa_ctrl_wait_link_up(); |
| 4752 | var charstring ctrl_var := "neighbor_resolve_cgi_ps_from_lac_ci." & |
| 4753 | int2str(info_ind.lac) & "." & |
| 4754 | int2str(info_ind.cell_id) & "." & |
| 4755 | int2str(req_arfcn) & "." & |
| 4756 | int2str(req_bsic); |
| 4757 | f_ctrl_exp_get(IPA_CTRL, ctrl_var, "023-43-423-2-5"); |
| 4758 | |
| 4759 | /* RIM procedure: */ |
| 4760 | RIM.receive(tr_RAN_INFORMATION_REQUEST(tr_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, dst_addr), |
| 4761 | tr_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, src_addr), |
| 4762 | tr_RAN_Information_Request_RIM_Container)); |
| 4763 | /* We never answer the RIM procude -> PCU timeouts and should send Pkt Cell Chg continue */ |
| 4764 | |
| 4765 | /* Wait until we receive something non-dummy */ |
Pau Espin Pedrol | a846e61 | 2021-02-01 19:25:25 +0100 | [diff] [blame] | 4766 | dl_block := f_skip_dummy(0, sched_fn); |
Pau Espin Pedrol | 9076ee7 | 2021-01-26 19:38:26 +0100 | [diff] [blame] | 4767 | /* Make sure it is a Pkt Cell Chg Continue */ |
| 4768 | if (not match(dl_block, tr_RLCMAC_DL_CTRL(?, tr_RlcMacDlCtrl_PKT_CELL_CHG_CONTINUE))) { |
| 4769 | setverdict(fail, "Rx unexpected DL block: ", dl_block); |
| 4770 | } |
Pau Espin Pedrol | a846e61 | 2021-02-01 19:25:25 +0100 | [diff] [blame] | 4771 | /* PKT CELL CHG CONTINUE ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 4772 | if (dl_block.ctrl.mac_hdr.rrbp_valid) { |
| 4773 | sched_fn := f_rrbp_ack_fn(sched_fn, dl_block.ctrl.mac_hdr.rrbp); |
| 4774 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
| 4775 | } |
Pau Espin Pedrol | 9076ee7 | 2021-01-26 19:38:26 +0100 | [diff] [blame] | 4776 | |
| 4777 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 4778 | } |
| 4779 | |
Pau Espin Pedrol | 6a71548 | 2021-02-10 18:40:46 +0100 | [diff] [blame] | 4780 | /* Test MS sending Pkt Cell Change Notify twice (duplicate msg) while waiting for CTRL resolution */ |
| 4781 | testcase TC_nacc_outbound_pkt_cell_chg_notif_dup() runs on RAW_PCU_Test_CT { |
| 4782 | var PollFnCtx pollctx; |
| 4783 | var GprsMS ms; |
| 4784 | var PCUIF_info_ind info_ind := valueof(ts_PCUIF_INFO_default); |
| 4785 | var template (value) RlcmacUlCtrlMsg cell_chf_notif; |
| 4786 | var RlcmacDlBlock dl_block; |
| 4787 | var uint32_t sched_fn; |
| 4788 | var CtrlMessage rx_ctrl; |
| 4789 | var GsmArfcn req_arfcn := 862; |
| 4790 | var uint6_t req_bsic := 43; |
| 4791 | |
| 4792 | /* Initialize osmo-bsc emulation neighbor resolution CTRL port */ |
| 4793 | f_ipa_ctrl_start_server(mp_ctrl_neigh_ip, mp_ctrl_neigh_port); |
| 4794 | |
| 4795 | /* Initialize NS/BSSGP side */ |
| 4796 | f_init_bssgp(); |
| 4797 | /* Initialize GPRS MS side */ |
| 4798 | f_init_gprs_ms(); |
| 4799 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 4800 | |
| 4801 | /* Initialize the PCU interface abstraction */ |
| 4802 | f_init_raw(testcasename(), info_ind); |
| 4803 | |
| 4804 | /* Make sure we are not affected by full cache from previous tests */ |
| 4805 | f_pcuvty_flush_neigh_caches(); |
| 4806 | |
| 4807 | /* Establish BSSGP connection to the PCU */ |
| 4808 | f_bssgp_establish(); |
| 4809 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 4810 | |
| 4811 | /* Send PACKET RESOURCE REQUEST */ |
| 4812 | pollctx := f_ms_establish_ul_tbf_2phase_access(ms, ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, ms_racap_gprs_def)); |
| 4813 | /* Pkt Uplink Assignment above sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 4814 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), pollctx.fn, nr := pollctx.tstrxbts); |
| 4815 | |
| 4816 | /* Start NACC from MS side */ |
| 4817 | cell_chf_notif := ts_RlcMacUlCtrl_PKT_CELL_CHG_NOTIF(ms.ul_tbf.tfi, req_arfcn, req_bsic); |
| 4818 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(cell_chf_notif), 0, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 4819 | |
| 4820 | /* osmo-pcu should now ask for resolution: */ |
| 4821 | f_ipa_ctrl_wait_link_up(); |
| 4822 | var charstring ctrl_var := "neighbor_resolve_cgi_ps_from_lac_ci." & |
| 4823 | int2str(info_ind.lac) & "." & |
| 4824 | int2str(info_ind.cell_id) & "." & |
| 4825 | int2str(req_arfcn) & "." & |
| 4826 | int2str(req_bsic); |
| 4827 | IPA_CTRL.receive(tr_CtrlMsgGet(?, ctrl_var)) -> value rx_ctrl; |
| 4828 | /* Before receiving CTRL response, MS retransmits Pkt cell Chg Notif */ |
| 4829 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(cell_chf_notif), 0, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 4830 | f_sleep(0.2); /* let some time to avoid race conditons between CTRL and RLCMAC */ |
| 4831 | IPA_CTRL.send(ts_CtrlMsgGetRepl(rx_ctrl.cmd.id, valueof(ctrl_var), valueof("023-43-423-2-5"))); |
| 4832 | timer T := 2.0; |
| 4833 | T.start; |
| 4834 | alt { |
| 4835 | [] as_outbound_nacc_rim_resolve(info_ind, do_repeat := true); |
| 4836 | [] IPA_CTRL.receive(tr_CtrlMsgGet(?, ctrl_var)) -> value rx_ctrl { |
| 4837 | setverdict(fail, "Received unexpected CTRL resolution after duplicate Pkt Cell Change Notification:", rx_ctrl); |
| 4838 | f_shutdown(__BFILE__, __LINE__); |
| 4839 | } |
| 4840 | [] T.timeout { |
| 4841 | setverdict(pass); |
| 4842 | } |
| 4843 | } |
| 4844 | |
| 4845 | /* Announce SI back to MS, continue NACC procedure */ |
Pau Espin Pedrol | 6cb71cc | 2021-02-11 13:54:01 +0100 | [diff] [blame] | 4846 | f_ms_handle_pkt_neighbor_cell_data(ms, si_default); |
Pau Espin Pedrol | 6a71548 | 2021-02-10 18:40:46 +0100 | [diff] [blame] | 4847 | |
| 4848 | /* Obtain a Downlink block and make sure it is a Pkt Cell Chg Continue */ |
| 4849 | f_rx_rlcmac_dl_block(dl_block, sched_fn); |
| 4850 | if (not match(dl_block, tr_RLCMAC_DL_CTRL(?, tr_RlcMacDlCtrl_PKT_CELL_CHG_CONTINUE))) { |
| 4851 | setverdict(fail, "Rx unexpected DL block: ", dl_block); |
| 4852 | f_shutdown(__BFILE__, __LINE__); |
| 4853 | } |
| 4854 | /* PKT CELL CHG CONTINUE ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 4855 | if (dl_block.ctrl.mac_hdr.rrbp_valid) { |
| 4856 | sched_fn := f_rrbp_ack_fn(sched_fn, dl_block.ctrl.mac_hdr.rrbp); |
| 4857 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
| 4858 | } |
| 4859 | |
| 4860 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 4861 | } |
| 4862 | |
| 4863 | /* Test MS sending Pkt Cell Change Notify twice (duplicate msg) while waiting for SI resolution */ |
| 4864 | testcase TC_nacc_outbound_pkt_cell_chg_notif_dup2() runs on RAW_PCU_Test_CT { |
| 4865 | var PollFnCtx pollctx; |
| 4866 | var GprsMS ms; |
| 4867 | var PCUIF_info_ind info_ind := valueof(ts_PCUIF_INFO_default); |
| 4868 | var template (value) RlcmacUlCtrlMsg cell_chf_notif; |
| 4869 | var RlcmacDlBlock dl_block; |
| 4870 | var uint32_t sched_fn; |
| 4871 | var CtrlMessage rx_ctrl; |
| 4872 | var GsmArfcn req_arfcn := 862; |
| 4873 | var uint6_t req_bsic := 43; |
| 4874 | |
| 4875 | /* Initialize osmo-bsc emulation neighbor resolution CTRL port */ |
| 4876 | f_ipa_ctrl_start_server(mp_ctrl_neigh_ip, mp_ctrl_neigh_port); |
| 4877 | |
| 4878 | /* Initialize NS/BSSGP side */ |
| 4879 | f_init_bssgp(); |
| 4880 | /* Initialize GPRS MS side */ |
| 4881 | f_init_gprs_ms(); |
| 4882 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 4883 | |
| 4884 | /* Initialize the PCU interface abstraction */ |
| 4885 | f_init_raw(testcasename(), info_ind); |
| 4886 | |
| 4887 | /* Make sure we are not affected by full cache from previous tests */ |
| 4888 | f_pcuvty_flush_neigh_caches(); |
| 4889 | |
| 4890 | /* Establish BSSGP connection to the PCU */ |
| 4891 | f_bssgp_establish(); |
| 4892 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 4893 | |
| 4894 | /* Send PACKET RESOURCE REQUEST */ |
| 4895 | pollctx := f_ms_establish_ul_tbf_2phase_access(ms, ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, ms_racap_gprs_def)); |
| 4896 | /* Pkt Uplink Assignment above sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 4897 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), pollctx.fn, nr := pollctx.tstrxbts); |
| 4898 | |
| 4899 | /* Start NACC from MS side */ |
| 4900 | cell_chf_notif := ts_RlcMacUlCtrl_PKT_CELL_CHG_NOTIF(ms.ul_tbf.tfi, req_arfcn, req_bsic); |
| 4901 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(cell_chf_notif), 0, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 4902 | |
| 4903 | /* osmo-pcu should now ask for resolution: */ |
| 4904 | f_ipa_ctrl_wait_link_up(); |
| 4905 | var charstring ctrl_var := "neighbor_resolve_cgi_ps_from_lac_ci." & |
| 4906 | int2str(info_ind.lac) & "." & |
| 4907 | int2str(info_ind.cell_id) & "." & |
| 4908 | int2str(req_arfcn) & "." & |
| 4909 | int2str(req_bsic); |
| 4910 | f_ctrl_exp_get(IPA_CTRL, ctrl_var, "023-43-423-2-5"); |
| 4911 | as_outbound_nacc_rim_resolve(info_ind, do_answer := false); |
| 4912 | /* Before receiving RIM response, MS retransmits Pkt cell Chg Notif */ |
| 4913 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(cell_chf_notif), 0, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 4914 | f_sleep(0.2); /* let some time to avoid race conditons between CTRL and RLCMAC */ |
| 4915 | f_outbound_nacc_rim_tx_resp(info_ind); |
| 4916 | timer T := 1.0; |
| 4917 | T.start; |
| 4918 | alt { |
| 4919 | [] RIM.receive { |
| 4920 | setverdict(fail, "Received unexpected RIM message"); |
| 4921 | f_shutdown(__BFILE__, __LINE__); |
| 4922 | } |
| 4923 | [] T.timeout { |
| 4924 | setverdict(pass); |
| 4925 | } |
| 4926 | } |
| 4927 | |
| 4928 | /* Announce SI back to MS, continue NACC procedure */ |
Pau Espin Pedrol | 6cb71cc | 2021-02-11 13:54:01 +0100 | [diff] [blame] | 4929 | f_ms_handle_pkt_neighbor_cell_data(ms, si_default); |
Pau Espin Pedrol | 6a71548 | 2021-02-10 18:40:46 +0100 | [diff] [blame] | 4930 | |
| 4931 | /* Obtain a Downlink block and make sure it is a Pkt Cell Chg Continue */ |
| 4932 | f_rx_rlcmac_dl_block(dl_block, sched_fn); |
| 4933 | if (not match(dl_block, tr_RLCMAC_DL_CTRL(?, tr_RlcMacDlCtrl_PKT_CELL_CHG_CONTINUE))) { |
| 4934 | setverdict(fail, "Rx unexpected DL block: ", dl_block); |
| 4935 | f_shutdown(__BFILE__, __LINE__); |
| 4936 | } |
| 4937 | /* PKT CELL CHG CONTINUE ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 4938 | if (dl_block.ctrl.mac_hdr.rrbp_valid) { |
| 4939 | sched_fn := f_rrbp_ack_fn(sched_fn, dl_block.ctrl.mac_hdr.rrbp); |
| 4940 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
| 4941 | } |
| 4942 | |
| 4943 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 4944 | } |
| 4945 | |
Pau Espin Pedrol | 0d6ebb7 | 2021-02-11 14:53:24 +0100 | [diff] [blame] | 4946 | /* Test MS sending Pkt Cell Change Notification twice (duplicate msg) while sending Pkt Neigh Data Change */ |
| 4947 | testcase TC_nacc_outbound_pkt_cell_chg_notif_dup3() runs on RAW_PCU_Test_CT { |
| 4948 | var PollFnCtx pollctx; |
| 4949 | var GprsMS ms; |
| 4950 | var PCUIF_info_ind info_ind := valueof(ts_PCUIF_INFO_default); |
| 4951 | var template (value) RlcmacUlCtrlMsg cell_chf_notif; |
| 4952 | var RlcmacDlBlock dl_block; |
| 4953 | var uint32_t sched_fn; |
| 4954 | var CtrlMessage rx_ctrl; |
| 4955 | var GsmArfcn req_arfcn := 862; |
| 4956 | var uint6_t req_bsic := 43; |
| 4957 | |
| 4958 | /* Initialize osmo-bsc emulation neighbor resolution CTRL port */ |
| 4959 | f_ipa_ctrl_start_server(mp_ctrl_neigh_ip, mp_ctrl_neigh_port); |
| 4960 | |
| 4961 | /* Initialize NS/BSSGP side */ |
| 4962 | f_init_bssgp(); |
| 4963 | /* Initialize GPRS MS side */ |
| 4964 | f_init_gprs_ms(); |
| 4965 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 4966 | |
| 4967 | /* Initialize the PCU interface abstraction */ |
| 4968 | f_init_raw(testcasename(), info_ind); |
| 4969 | |
| 4970 | /* Make sure we are not affected by full cache from previous tests */ |
| 4971 | f_pcuvty_flush_neigh_caches(); |
| 4972 | |
| 4973 | /* Establish BSSGP connection to the PCU */ |
| 4974 | f_bssgp_establish(); |
| 4975 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 4976 | |
| 4977 | /* Send PACKET RESOURCE REQUEST */ |
| 4978 | pollctx := f_ms_establish_ul_tbf_2phase_access(ms, ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, ms_racap_gprs_def)); |
| 4979 | /* Pkt Uplink Assignment above sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 4980 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), pollctx.fn, nr := pollctx.tstrxbts); |
| 4981 | |
| 4982 | /* Start NACC from MS side */ |
| 4983 | cell_chf_notif := ts_RlcMacUlCtrl_PKT_CELL_CHG_NOTIF(ms.ul_tbf.tfi, req_arfcn, req_bsic); |
| 4984 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(cell_chf_notif), 0, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 4985 | |
| 4986 | /* osmo-pcu should now ask for resolution: */ |
| 4987 | f_ipa_ctrl_wait_link_up(); |
| 4988 | var charstring ctrl_var := "neighbor_resolve_cgi_ps_from_lac_ci." & |
| 4989 | int2str(info_ind.lac) & "." & |
| 4990 | int2str(info_ind.cell_id) & "." & |
| 4991 | int2str(req_arfcn) & "." & |
| 4992 | int2str(req_bsic); |
| 4993 | f_ctrl_exp_get(IPA_CTRL, ctrl_var, "023-43-423-2-5"); |
| 4994 | /* RIM procedure: */ |
| 4995 | as_outbound_nacc_rim_resolve(info_ind); |
| 4996 | |
| 4997 | /* Receive first Pkt Neigh data Change, then trigger a new Pkt Cell Change Notif: */ |
| 4998 | f_ms_handle_pkt_neighbor_cell_data(ms, si_default, single_step := true); |
| 4999 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(cell_chf_notif), 0, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 5000 | |
| 5001 | /* It should be ignored, let's continue fetching Pkt Neigh Data Change */ |
| 5002 | f_ms_handle_pkt_neighbor_cell_data(ms, si_default, f_ms_tx_TsTrxBtsNum(ms), 1, 16); |
| 5003 | |
| 5004 | /* Obtain a Downlink block and make sure it is a Pkt Cell Chg Continue */ |
| 5005 | f_rx_rlcmac_dl_block(dl_block, sched_fn); |
| 5006 | if (not match(dl_block, tr_RLCMAC_DL_CTRL(?, tr_RlcMacDlCtrl_PKT_CELL_CHG_CONTINUE))) { |
| 5007 | setverdict(fail, "Rx unexpected DL block: ", dl_block); |
| 5008 | f_shutdown(__BFILE__, __LINE__); |
| 5009 | } |
| 5010 | /* PKT CELL CHG CONTINUE ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 5011 | if (dl_block.ctrl.mac_hdr.rrbp_valid) { |
| 5012 | sched_fn := f_rrbp_ack_fn(sched_fn, dl_block.ctrl.mac_hdr.rrbp); |
| 5013 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
| 5014 | } |
| 5015 | } |
| 5016 | |
| 5017 | /* Test MS sending Pkt Cell Change Notification twice (duplicate msg) while sending Pkt Cell Change Continue */ |
| 5018 | testcase TC_nacc_outbound_pkt_cell_chg_notif_dup4() runs on RAW_PCU_Test_CT { |
| 5019 | var PollFnCtx pollctx; |
| 5020 | var GprsMS ms; |
| 5021 | var PCUIF_info_ind info_ind := valueof(ts_PCUIF_INFO_default); |
| 5022 | var template (value) RlcmacUlCtrlMsg cell_chf_notif; |
| 5023 | var RlcmacDlBlock dl_block; |
| 5024 | var uint32_t sched_fn; |
| 5025 | var CtrlMessage rx_ctrl; |
| 5026 | var GsmArfcn req_arfcn := 862; |
| 5027 | var uint6_t req_bsic := 43; |
| 5028 | |
| 5029 | /* Initialize osmo-bsc emulation neighbor resolution CTRL port */ |
| 5030 | f_ipa_ctrl_start_server(mp_ctrl_neigh_ip, mp_ctrl_neigh_port); |
| 5031 | |
| 5032 | /* Initialize NS/BSSGP side */ |
| 5033 | f_init_bssgp(); |
| 5034 | /* Initialize GPRS MS side */ |
| 5035 | f_init_gprs_ms(); |
| 5036 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 5037 | |
| 5038 | /* Initialize the PCU interface abstraction */ |
| 5039 | f_init_raw(testcasename(), info_ind); |
| 5040 | |
| 5041 | /* Make sure we are not affected by full cache from previous tests */ |
| 5042 | f_pcuvty_flush_neigh_caches(); |
| 5043 | |
| 5044 | /* Establish BSSGP connection to the PCU */ |
| 5045 | f_bssgp_establish(); |
| 5046 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 5047 | |
| 5048 | /* Send PACKET RESOURCE REQUEST */ |
| 5049 | pollctx := f_ms_establish_ul_tbf_2phase_access(ms, ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, ms_racap_gprs_def)); |
| 5050 | /* Pkt Uplink Assignment above sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 5051 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), pollctx.fn, nr := pollctx.tstrxbts); |
| 5052 | |
| 5053 | /* Start NACC from MS side */ |
| 5054 | cell_chf_notif := ts_RlcMacUlCtrl_PKT_CELL_CHG_NOTIF(ms.ul_tbf.tfi, req_arfcn, req_bsic); |
| 5055 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(cell_chf_notif), 0, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 5056 | |
| 5057 | /* osmo-pcu should now ask for resolution: */ |
| 5058 | f_ipa_ctrl_wait_link_up(); |
| 5059 | var charstring ctrl_var := "neighbor_resolve_cgi_ps_from_lac_ci." & |
| 5060 | int2str(info_ind.lac) & "." & |
| 5061 | int2str(info_ind.cell_id) & "." & |
| 5062 | int2str(req_arfcn) & "." & |
| 5063 | int2str(req_bsic); |
| 5064 | f_ctrl_exp_get(IPA_CTRL, ctrl_var, "023-43-423-2-5"); |
| 5065 | /* RIM procedure: */ |
| 5066 | as_outbound_nacc_rim_resolve(info_ind); |
| 5067 | |
| 5068 | /* Announce SI back to MS, continue NACC procedure */ |
| 5069 | f_ms_handle_pkt_neighbor_cell_data(ms, si_default); |
| 5070 | |
| 5071 | /* trigger a dup Pkt Cell Change Notif, it should be ignored: */ |
| 5072 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(cell_chf_notif), 0, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 5073 | |
| 5074 | /* Obtain a Downlink block and make sure it is a Pkt Cell Chg Continue */ |
| 5075 | f_rx_rlcmac_dl_block(dl_block, sched_fn); |
| 5076 | if (not match(dl_block, tr_RLCMAC_DL_CTRL(?, tr_RlcMacDlCtrl_PKT_CELL_CHG_CONTINUE))) { |
| 5077 | setverdict(fail, "Rx unexpected DL block: ", dl_block); |
| 5078 | f_shutdown(__BFILE__, __LINE__); |
| 5079 | } |
| 5080 | /* PKT CELL CHG CONTINUE ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 5081 | if (dl_block.ctrl.mac_hdr.rrbp_valid) { |
| 5082 | sched_fn := f_rrbp_ack_fn(sched_fn, dl_block.ctrl.mac_hdr.rrbp); |
| 5083 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
| 5084 | } |
| 5085 | } |
| 5086 | |
| 5087 | /* Test MS sending Pkt Cell Change Notification twice (duplicate msg) while waiting for Pkt Cell Change Continue CTRL ACK */ |
| 5088 | testcase TC_nacc_outbound_pkt_cell_chg_notif_dup5() runs on RAW_PCU_Test_CT { |
| 5089 | var PollFnCtx pollctx; |
| 5090 | var GprsMS ms; |
| 5091 | var PCUIF_info_ind info_ind := valueof(ts_PCUIF_INFO_default); |
| 5092 | var template (value) RlcmacUlCtrlMsg cell_chf_notif; |
| 5093 | var RlcmacDlBlock dl_block; |
| 5094 | var uint32_t sched_fn; |
| 5095 | var CtrlMessage rx_ctrl; |
| 5096 | var GsmArfcn req_arfcn := 862; |
| 5097 | var uint6_t req_bsic := 43; |
| 5098 | |
| 5099 | /* Initialize osmo-bsc emulation neighbor resolution CTRL port */ |
| 5100 | f_ipa_ctrl_start_server(mp_ctrl_neigh_ip, mp_ctrl_neigh_port); |
| 5101 | |
| 5102 | /* Initialize NS/BSSGP side */ |
| 5103 | f_init_bssgp(); |
| 5104 | /* Initialize GPRS MS side */ |
| 5105 | f_init_gprs_ms(); |
| 5106 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 5107 | |
| 5108 | /* Initialize the PCU interface abstraction */ |
| 5109 | f_init_raw(testcasename(), info_ind); |
| 5110 | |
| 5111 | /* Make sure we are not affected by full cache from previous tests */ |
| 5112 | f_pcuvty_flush_neigh_caches(); |
| 5113 | |
| 5114 | /* Establish BSSGP connection to the PCU */ |
| 5115 | f_bssgp_establish(); |
| 5116 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 5117 | |
| 5118 | /* Send PACKET RESOURCE REQUEST */ |
| 5119 | pollctx := f_ms_establish_ul_tbf_2phase_access(ms, ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, ms_racap_gprs_def)); |
| 5120 | /* Pkt Uplink Assignment above sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 5121 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), pollctx.fn, nr := pollctx.tstrxbts); |
| 5122 | |
| 5123 | /* Start NACC from MS side */ |
| 5124 | cell_chf_notif := ts_RlcMacUlCtrl_PKT_CELL_CHG_NOTIF(ms.ul_tbf.tfi, req_arfcn, req_bsic); |
| 5125 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(cell_chf_notif), 0, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 5126 | |
| 5127 | /* osmo-pcu should now ask for resolution: */ |
| 5128 | f_ipa_ctrl_wait_link_up(); |
| 5129 | var charstring ctrl_var := "neighbor_resolve_cgi_ps_from_lac_ci." & |
| 5130 | int2str(info_ind.lac) & "." & |
| 5131 | int2str(info_ind.cell_id) & "." & |
| 5132 | int2str(req_arfcn) & "." & |
| 5133 | int2str(req_bsic); |
| 5134 | f_ctrl_exp_get(IPA_CTRL, ctrl_var, "023-43-423-2-5"); |
| 5135 | /* RIM procedure: */ |
| 5136 | as_outbound_nacc_rim_resolve(info_ind); |
| 5137 | |
| 5138 | /* Announce SI back to MS, continue NACC procedure */ |
| 5139 | f_ms_handle_pkt_neighbor_cell_data(ms, si_default); |
| 5140 | |
| 5141 | /* Obtain a Downlink block and make sure it is a Pkt Cell Chg Continue */ |
| 5142 | f_rx_rlcmac_dl_block(dl_block, sched_fn); |
| 5143 | if (not match(dl_block, tr_RLCMAC_DL_CTRL(?, tr_RlcMacDlCtrl_PKT_CELL_CHG_CONTINUE))) { |
| 5144 | setverdict(fail, "Rx unexpected DL block: ", dl_block); |
| 5145 | f_shutdown(__BFILE__, __LINE__); |
| 5146 | } |
| 5147 | /* trigger a dup Pkt Cell Change Notif, it should be ignored: */ |
| 5148 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(cell_chf_notif), 0, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 5149 | |
| 5150 | /* PKT CELL CHG CONTINUE ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 5151 | if (dl_block.ctrl.mac_hdr.rrbp_valid) { |
| 5152 | sched_fn := f_rrbp_ack_fn(sched_fn, dl_block.ctrl.mac_hdr.rrbp); |
| 5153 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
| 5154 | } |
| 5155 | } |
| 5156 | |
Pau Espin Pedrol | d4ed360 | 2021-02-11 12:37:22 +0100 | [diff] [blame] | 5157 | /* Test MS sending Pkt Cell Change Notify twice (different tgt cell each time) |
| 5158 | * while waiting for CTRL resolution */ |
| 5159 | testcase TC_nacc_outbound_pkt_cell_chg_notif_twice() runs on RAW_PCU_Test_CT { |
| 5160 | var PollFnCtx pollctx; |
| 5161 | var GprsMS ms; |
| 5162 | var PCUIF_info_ind info_ind := valueof(ts_PCUIF_INFO_default); |
| 5163 | var template (value) RlcmacUlCtrlMsg cell_chf_notif; |
| 5164 | var RlcmacDlBlock dl_block; |
| 5165 | var uint32_t sched_fn; |
| 5166 | var CtrlMessage rx_ctrl; |
| 5167 | var GsmArfcn req_arfcn := 862; |
| 5168 | var uint6_t req_bsic := 43; |
| 5169 | |
| 5170 | /* Initialize osmo-bsc emulation neighbor resolution CTRL port */ |
| 5171 | f_ipa_ctrl_start_server(mp_ctrl_neigh_ip, mp_ctrl_neigh_port); |
| 5172 | |
| 5173 | /* Initialize NS/BSSGP side */ |
| 5174 | f_init_bssgp(); |
| 5175 | /* Initialize GPRS MS side */ |
| 5176 | f_init_gprs_ms(); |
| 5177 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 5178 | |
| 5179 | /* Initialize the PCU interface abstraction */ |
| 5180 | f_init_raw(testcasename(), info_ind); |
| 5181 | |
| 5182 | /* Make sure we are not affected by full cache from previous tests */ |
| 5183 | f_pcuvty_flush_neigh_caches(); |
| 5184 | |
| 5185 | /* Establish BSSGP connection to the PCU */ |
| 5186 | f_bssgp_establish(); |
| 5187 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 5188 | |
| 5189 | /* Send PACKET RESOURCE REQUEST */ |
| 5190 | pollctx := f_ms_establish_ul_tbf_2phase_access(ms, ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, ms_racap_gprs_def)); |
| 5191 | /* Pkt Uplink Assignment above sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 5192 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), pollctx.fn, nr := pollctx.tstrxbts); |
| 5193 | |
| 5194 | /* Start NACC from MS side */ |
| 5195 | cell_chf_notif := ts_RlcMacUlCtrl_PKT_CELL_CHG_NOTIF(ms.ul_tbf.tfi, req_arfcn, req_bsic); |
| 5196 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(cell_chf_notif), 0, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 5197 | |
| 5198 | /* osmo-pcu should now ask for resolution: */ |
| 5199 | f_ipa_ctrl_wait_link_up(); |
| 5200 | var charstring ctrl_var := "neighbor_resolve_cgi_ps_from_lac_ci." & |
| 5201 | int2str(info_ind.lac) & "." & |
| 5202 | int2str(info_ind.cell_id) & "." & |
| 5203 | int2str(req_arfcn) & "." & |
| 5204 | int2str(req_bsic); |
| 5205 | IPA_CTRL.receive(tr_CtrlMsgGet(?, ctrl_var)) -> value rx_ctrl; |
| 5206 | /* Before receiving CTRL response, MS retransmits Pkt cell Chg Notif with different tgt arfcn */ |
| 5207 | cell_chf_notif := ts_RlcMacUlCtrl_PKT_CELL_CHG_NOTIF(ms.ul_tbf.tfi, req_arfcn + 1, req_bsic + 1); |
| 5208 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(cell_chf_notif), 0, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 5209 | f_sleep(0.2); /* let some time to avoid race conditons between CTRL and RLCMAC */ |
| 5210 | IPA_CTRL.send(ts_CtrlMsgGetRepl(rx_ctrl.cmd.id, valueof(ctrl_var), valueof("023-43-423-2-5"))); |
| 5211 | /* We should now receive a 2nd CTRL request with the new ARFCN+BSIC */ |
| 5212 | ctrl_var := "neighbor_resolve_cgi_ps_from_lac_ci." & |
| 5213 | int2str(info_ind.lac) & "." & |
| 5214 | int2str(info_ind.cell_id) & "." & |
| 5215 | int2str(req_arfcn + 1) & "." & |
| 5216 | int2str(req_bsic + 1); |
| 5217 | f_ctrl_exp_get(IPA_CTRL, ctrl_var, "023-43-423-2-5"); |
| 5218 | |
| 5219 | /* And finally everything continues as usual with RIN procedure */ |
| 5220 | as_outbound_nacc_rim_resolve(info_ind); |
| 5221 | |
| 5222 | /* Announce SI back to MS, continue NACC procedure */ |
Pau Espin Pedrol | 6cb71cc | 2021-02-11 13:54:01 +0100 | [diff] [blame] | 5223 | f_ms_handle_pkt_neighbor_cell_data(ms, si_default); |
Pau Espin Pedrol | d4ed360 | 2021-02-11 12:37:22 +0100 | [diff] [blame] | 5224 | |
| 5225 | /* Obtain a Downlink block and make sure it is a Pkt Cell Chg Continue */ |
| 5226 | f_rx_rlcmac_dl_block(dl_block, sched_fn); |
| 5227 | if (not match(dl_block, tr_RLCMAC_DL_CTRL(?, tr_RlcMacDlCtrl_PKT_CELL_CHG_CONTINUE))) { |
| 5228 | setverdict(fail, "Rx unexpected DL block: ", dl_block); |
| 5229 | f_shutdown(__BFILE__, __LINE__); |
| 5230 | } |
| 5231 | /* PKT CELL CHG CONTINUE ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 5232 | if (dl_block.ctrl.mac_hdr.rrbp_valid) { |
| 5233 | sched_fn := f_rrbp_ack_fn(sched_fn, dl_block.ctrl.mac_hdr.rrbp); |
| 5234 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
| 5235 | } |
| 5236 | |
| 5237 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 5238 | } |
| 5239 | |
| 5240 | /* Test MS sending Pkt Cell Change Notify twice (different tgt cell each time) |
| 5241 | * while waiting for SI resolution */ |
| 5242 | testcase TC_nacc_outbound_pkt_cell_chg_notif_twice2() runs on RAW_PCU_Test_CT { |
| 5243 | var PollFnCtx pollctx; |
| 5244 | var GprsMS ms; |
| 5245 | var PCUIF_info_ind info_ind := valueof(ts_PCUIF_INFO_default); |
| 5246 | var template (value) RlcmacUlCtrlMsg cell_chf_notif; |
| 5247 | var RlcmacDlBlock dl_block; |
| 5248 | var uint32_t sched_fn; |
| 5249 | var CtrlMessage rx_ctrl; |
| 5250 | var GsmArfcn req_arfcn := 862; |
| 5251 | var uint6_t req_bsic := 43; |
| 5252 | |
| 5253 | /* Initialize osmo-bsc emulation neighbor resolution CTRL port */ |
| 5254 | f_ipa_ctrl_start_server(mp_ctrl_neigh_ip, mp_ctrl_neigh_port); |
| 5255 | |
| 5256 | /* Initialize NS/BSSGP side */ |
| 5257 | f_init_bssgp(); |
| 5258 | /* Initialize GPRS MS side */ |
| 5259 | f_init_gprs_ms(); |
| 5260 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 5261 | |
| 5262 | /* Initialize the PCU interface abstraction */ |
| 5263 | f_init_raw(testcasename(), info_ind); |
| 5264 | |
| 5265 | /* Make sure we are not affected by full cache from previous tests */ |
| 5266 | f_pcuvty_flush_neigh_caches(); |
| 5267 | |
| 5268 | /* Establish BSSGP connection to the PCU */ |
| 5269 | f_bssgp_establish(); |
| 5270 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 5271 | |
| 5272 | /* Send PACKET RESOURCE REQUEST */ |
| 5273 | pollctx := f_ms_establish_ul_tbf_2phase_access(ms, ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, ms_racap_gprs_def)); |
| 5274 | /* Pkt Uplink Assignment above sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 5275 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), pollctx.fn, nr := pollctx.tstrxbts); |
| 5276 | |
| 5277 | /* Start NACC from MS side */ |
| 5278 | cell_chf_notif := ts_RlcMacUlCtrl_PKT_CELL_CHG_NOTIF(ms.ul_tbf.tfi, req_arfcn, req_bsic); |
| 5279 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(cell_chf_notif), 0, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 5280 | |
| 5281 | /* osmo-pcu should now ask for resolution: */ |
| 5282 | f_ipa_ctrl_wait_link_up(); |
| 5283 | var charstring ctrl_var := "neighbor_resolve_cgi_ps_from_lac_ci." & |
| 5284 | int2str(info_ind.lac) & "." & |
| 5285 | int2str(info_ind.cell_id) & "." & |
| 5286 | int2str(req_arfcn) & "." & |
| 5287 | int2str(req_bsic); |
| 5288 | f_ctrl_exp_get(IPA_CTRL, ctrl_var, "023-43-423-2-5"); |
| 5289 | as_outbound_nacc_rim_resolve(info_ind, do_answer := false); |
| 5290 | /* Before receiving RIM response, MS retransmits Pkt cell Chg Notif with different tgt cell: */ |
| 5291 | cell_chf_notif := ts_RlcMacUlCtrl_PKT_CELL_CHG_NOTIF(ms.ul_tbf.tfi, req_arfcn + 1, req_bsic + 1); |
| 5292 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(cell_chf_notif), 0, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 5293 | f_sleep(0.2); /* let some time to avoid race conditons between CTRL and RLCMAC */ |
| 5294 | f_outbound_nacc_rim_tx_resp(info_ind); |
| 5295 | |
| 5296 | /* As a result, CTRL + RIM resolution for new tgt cell should now be done: */ |
| 5297 | ctrl_var := "neighbor_resolve_cgi_ps_from_lac_ci." & |
| 5298 | int2str(info_ind.lac) & "." & |
| 5299 | int2str(info_ind.cell_id) & "." & |
| 5300 | int2str(req_arfcn + 1) & "." & |
| 5301 | int2str(req_bsic + 1); |
| 5302 | f_ctrl_exp_get(IPA_CTRL, ctrl_var, "023-43-423-2-5"); |
| 5303 | |
| 5304 | /* And finally everything continues as usual with RIN procedure */ |
| 5305 | as_outbound_nacc_rim_resolve(info_ind); |
| 5306 | |
| 5307 | /* Announce SI back to MS, continue NACC procedure */ |
Pau Espin Pedrol | 6cb71cc | 2021-02-11 13:54:01 +0100 | [diff] [blame] | 5308 | f_ms_handle_pkt_neighbor_cell_data(ms, si_default); |
Pau Espin Pedrol | d4ed360 | 2021-02-11 12:37:22 +0100 | [diff] [blame] | 5309 | |
| 5310 | /* Obtain a Downlink block and make sure it is a Pkt Cell Chg Continue */ |
| 5311 | f_rx_rlcmac_dl_block(dl_block, sched_fn); |
| 5312 | if (not match(dl_block, tr_RLCMAC_DL_CTRL(?, tr_RlcMacDlCtrl_PKT_CELL_CHG_CONTINUE))) { |
| 5313 | setverdict(fail, "Rx unexpected DL block: ", dl_block); |
| 5314 | f_shutdown(__BFILE__, __LINE__); |
| 5315 | } |
| 5316 | /* PKT CELL CHG CONTINUE ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 5317 | if (dl_block.ctrl.mac_hdr.rrbp_valid) { |
| 5318 | sched_fn := f_rrbp_ack_fn(sched_fn, dl_block.ctrl.mac_hdr.rrbp); |
| 5319 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
| 5320 | } |
| 5321 | |
| 5322 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 5323 | } |
| 5324 | |
Pau Espin Pedrol | 179ddef | 2021-02-11 16:03:46 +0100 | [diff] [blame] | 5325 | /* Test MS sending Pkt Cell Change Notify twice (different tgt cell each time) |
| 5326 | * while sending Pkt Neigh Data Change */ |
| 5327 | testcase TC_nacc_outbound_pkt_cell_chg_notif_twice3() runs on RAW_PCU_Test_CT { |
| 5328 | var PollFnCtx pollctx; |
| 5329 | var GprsMS ms; |
| 5330 | var PCUIF_info_ind info_ind := valueof(ts_PCUIF_INFO_default); |
| 5331 | var template (value) RlcmacUlCtrlMsg cell_chf_notif; |
| 5332 | var RlcmacDlBlock dl_block; |
| 5333 | var uint32_t sched_fn; |
| 5334 | var CtrlMessage rx_ctrl; |
| 5335 | var GsmArfcn req_arfcn := 862; |
| 5336 | var uint6_t req_bsic := 43; |
| 5337 | |
| 5338 | /* Initialize osmo-bsc emulation neighbor resolution CTRL port */ |
| 5339 | f_ipa_ctrl_start_server(mp_ctrl_neigh_ip, mp_ctrl_neigh_port); |
| 5340 | |
| 5341 | /* Initialize NS/BSSGP side */ |
| 5342 | f_init_bssgp(); |
| 5343 | /* Initialize GPRS MS side */ |
| 5344 | f_init_gprs_ms(); |
| 5345 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 5346 | |
| 5347 | /* Initialize the PCU interface abstraction */ |
| 5348 | f_init_raw(testcasename(), info_ind); |
| 5349 | |
| 5350 | /* Make sure we are not affected by full cache from previous tests */ |
| 5351 | f_pcuvty_flush_neigh_caches(); |
| 5352 | |
| 5353 | /* Establish BSSGP connection to the PCU */ |
| 5354 | f_bssgp_establish(); |
| 5355 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 5356 | |
| 5357 | /* Send PACKET RESOURCE REQUEST */ |
| 5358 | pollctx := f_ms_establish_ul_tbf_2phase_access(ms, ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, ms_racap_gprs_def)); |
| 5359 | /* Pkt Uplink Assignment above sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 5360 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), pollctx.fn, nr := pollctx.tstrxbts); |
| 5361 | |
| 5362 | /* Start NACC from MS side */ |
| 5363 | cell_chf_notif := ts_RlcMacUlCtrl_PKT_CELL_CHG_NOTIF(ms.ul_tbf.tfi, req_arfcn, req_bsic); |
| 5364 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(cell_chf_notif), 0, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 5365 | |
| 5366 | /* osmo-pcu should now ask for resolution: */ |
| 5367 | f_ipa_ctrl_wait_link_up(); |
| 5368 | var charstring ctrl_var := "neighbor_resolve_cgi_ps_from_lac_ci." & |
| 5369 | int2str(info_ind.lac) & "." & |
| 5370 | int2str(info_ind.cell_id) & "." & |
| 5371 | int2str(req_arfcn) & "." & |
| 5372 | int2str(req_bsic); |
| 5373 | f_ctrl_exp_get(IPA_CTRL, ctrl_var, "023-43-423-2-5"); |
| 5374 | /* RIM procedure: */ |
| 5375 | as_outbound_nacc_rim_resolve(info_ind); |
| 5376 | |
| 5377 | /* Receive first Pkt Neigh data Change, then trigger a new Pkt Cell Change Notif (different ARFCN+BSIC): */ |
| 5378 | f_ms_handle_pkt_neighbor_cell_data(ms, si_default, single_step := true); |
| 5379 | cell_chf_notif := ts_RlcMacUlCtrl_PKT_CELL_CHG_NOTIF(ms.ul_tbf.tfi, req_arfcn + 1, req_bsic + 1); |
| 5380 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(cell_chf_notif), 0, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 5381 | |
| 5382 | /* It should trigger RAC_CI resolution to start again: */ |
| 5383 | ctrl_var := "neighbor_resolve_cgi_ps_from_lac_ci." & |
| 5384 | int2str(info_ind.lac) & "." & |
| 5385 | int2str(info_ind.cell_id) & "." & |
| 5386 | int2str(req_arfcn + 1) & "." & |
| 5387 | int2str(req_bsic + 1); |
| 5388 | f_ctrl_exp_get(IPA_CTRL, ctrl_var, "023-43-423-2-5"); |
| 5389 | /* RIM procedure: */ |
| 5390 | as_outbound_nacc_rim_resolve(info_ind); |
| 5391 | /* Transmit SI back to MS */ |
| 5392 | f_ms_handle_pkt_neighbor_cell_data(ms, si_default); |
| 5393 | |
| 5394 | /* Obtain a Downlink block and make sure it is a Pkt Cell Chg Continue */ |
| 5395 | f_rx_rlcmac_dl_block(dl_block, sched_fn); |
| 5396 | if (not match(dl_block, tr_RLCMAC_DL_CTRL(?, tr_RlcMacDlCtrl_PKT_CELL_CHG_CONTINUE))) { |
| 5397 | setverdict(fail, "Rx unexpected DL block: ", dl_block); |
| 5398 | f_shutdown(__BFILE__, __LINE__); |
| 5399 | } |
| 5400 | /* PKT CELL CHG CONTINUE ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 5401 | if (dl_block.ctrl.mac_hdr.rrbp_valid) { |
| 5402 | sched_fn := f_rrbp_ack_fn(sched_fn, dl_block.ctrl.mac_hdr.rrbp); |
| 5403 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
| 5404 | } |
| 5405 | } |
| 5406 | |
| 5407 | /* Test MS sending Pkt Cell Change Notification twice (different tgt cell) while sending Pkt Cell Change Continue */ |
| 5408 | testcase TC_nacc_outbound_pkt_cell_chg_notif_twice4() runs on RAW_PCU_Test_CT { |
| 5409 | var PollFnCtx pollctx; |
| 5410 | var GprsMS ms; |
| 5411 | var PCUIF_info_ind info_ind := valueof(ts_PCUIF_INFO_default); |
| 5412 | var template (value) RlcmacUlCtrlMsg cell_chf_notif; |
| 5413 | var RlcmacDlBlock dl_block; |
| 5414 | var uint32_t sched_fn; |
| 5415 | var CtrlMessage rx_ctrl; |
| 5416 | var GsmArfcn req_arfcn := 862; |
| 5417 | var uint6_t req_bsic := 43; |
| 5418 | |
| 5419 | /* Initialize osmo-bsc emulation neighbor resolution CTRL port */ |
| 5420 | f_ipa_ctrl_start_server(mp_ctrl_neigh_ip, mp_ctrl_neigh_port); |
| 5421 | |
| 5422 | /* Initialize NS/BSSGP side */ |
| 5423 | f_init_bssgp(); |
| 5424 | /* Initialize GPRS MS side */ |
| 5425 | f_init_gprs_ms(); |
| 5426 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 5427 | |
| 5428 | /* Initialize the PCU interface abstraction */ |
| 5429 | f_init_raw(testcasename(), info_ind); |
| 5430 | |
| 5431 | /* Make sure we are not affected by full cache from previous tests */ |
| 5432 | f_pcuvty_flush_neigh_caches(); |
| 5433 | |
| 5434 | /* Establish BSSGP connection to the PCU */ |
| 5435 | f_bssgp_establish(); |
| 5436 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 5437 | |
| 5438 | /* Send PACKET RESOURCE REQUEST */ |
| 5439 | pollctx := f_ms_establish_ul_tbf_2phase_access(ms, ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, ms_racap_gprs_def)); |
| 5440 | /* Pkt Uplink Assignment above sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 5441 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), pollctx.fn, nr := pollctx.tstrxbts); |
| 5442 | |
| 5443 | /* Start NACC from MS side */ |
| 5444 | cell_chf_notif := ts_RlcMacUlCtrl_PKT_CELL_CHG_NOTIF(ms.ul_tbf.tfi, req_arfcn, req_bsic); |
| 5445 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(cell_chf_notif), 0, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 5446 | |
| 5447 | /* osmo-pcu should now ask for resolution: */ |
| 5448 | f_ipa_ctrl_wait_link_up(); |
| 5449 | var charstring ctrl_var := "neighbor_resolve_cgi_ps_from_lac_ci." & |
| 5450 | int2str(info_ind.lac) & "." & |
| 5451 | int2str(info_ind.cell_id) & "." & |
| 5452 | int2str(req_arfcn) & "." & |
| 5453 | int2str(req_bsic); |
| 5454 | f_ctrl_exp_get(IPA_CTRL, ctrl_var, "023-43-423-2-5"); |
| 5455 | /* RIM procedure: */ |
| 5456 | as_outbound_nacc_rim_resolve(info_ind); |
| 5457 | |
| 5458 | /* Announce SI back to MS, continue NACC procedure */ |
| 5459 | f_ms_handle_pkt_neighbor_cell_data(ms, si_default); |
| 5460 | |
| 5461 | /* trigger a Pkt Cell Change Notif with different tgt cell */ |
| 5462 | cell_chf_notif := ts_RlcMacUlCtrl_PKT_CELL_CHG_NOTIF(ms.ul_tbf.tfi, req_arfcn + 1, req_bsic + 1); |
| 5463 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(cell_chf_notif), 0, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 5464 | |
| 5465 | /* PCU TBF NACC state changed, so we should next receive a dummy block: */ |
| 5466 | f_rx_rlcmac_dl_block_exp_dummy(dl_block, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 5467 | |
| 5468 | /* It should trigger RAC_CI resolution to start again: */ |
| 5469 | ctrl_var := "neighbor_resolve_cgi_ps_from_lac_ci." & |
| 5470 | int2str(info_ind.lac) & "." & |
| 5471 | int2str(info_ind.cell_id) & "." & |
| 5472 | int2str(req_arfcn + 1) & "." & |
| 5473 | int2str(req_bsic + 1); |
| 5474 | f_ctrl_exp_get(IPA_CTRL, ctrl_var, "023-43-423-2-5"); |
| 5475 | /* RIM procedure: */ |
| 5476 | as_outbound_nacc_rim_resolve(info_ind); |
| 5477 | /* Transmit SI back to MS */ |
| 5478 | f_ms_handle_pkt_neighbor_cell_data(ms, si_default); |
| 5479 | |
| 5480 | /* Obtain a Downlink block and make sure it is a Pkt Cell Chg Continue */ |
| 5481 | f_rx_rlcmac_dl_block(dl_block, sched_fn); |
| 5482 | if (not match(dl_block, tr_RLCMAC_DL_CTRL(?, tr_RlcMacDlCtrl_PKT_CELL_CHG_CONTINUE))) { |
| 5483 | setverdict(fail, "Rx unexpected DL block: ", dl_block); |
| 5484 | f_shutdown(__BFILE__, __LINE__); |
| 5485 | } |
| 5486 | /* PKT CELL CHG CONTINUE ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 5487 | if (dl_block.ctrl.mac_hdr.rrbp_valid) { |
| 5488 | sched_fn := f_rrbp_ack_fn(sched_fn, dl_block.ctrl.mac_hdr.rrbp); |
| 5489 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
| 5490 | } |
| 5491 | } |
| 5492 | |
| 5493 | /* Test MS sending Pkt Cell Change Notification twice (different tgt cell) while waiting for Pkt Cell Change Continue CTRL ACK*/ |
| 5494 | testcase TC_nacc_outbound_pkt_cell_chg_notif_twice5() runs on RAW_PCU_Test_CT { |
| 5495 | var PollFnCtx pollctx; |
| 5496 | var GprsMS ms; |
| 5497 | var PCUIF_info_ind info_ind := valueof(ts_PCUIF_INFO_default); |
| 5498 | var template (value) RlcmacUlCtrlMsg cell_chf_notif; |
| 5499 | var RlcmacDlBlock dl_block; |
| 5500 | var uint32_t sched_fn; |
| 5501 | var CtrlMessage rx_ctrl; |
| 5502 | var GsmArfcn req_arfcn := 862; |
| 5503 | var uint6_t req_bsic := 43; |
| 5504 | |
| 5505 | /* Initialize osmo-bsc emulation neighbor resolution CTRL port */ |
| 5506 | f_ipa_ctrl_start_server(mp_ctrl_neigh_ip, mp_ctrl_neigh_port); |
| 5507 | |
| 5508 | /* Initialize NS/BSSGP side */ |
| 5509 | f_init_bssgp(); |
| 5510 | /* Initialize GPRS MS side */ |
| 5511 | f_init_gprs_ms(); |
| 5512 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 5513 | |
| 5514 | /* Initialize the PCU interface abstraction */ |
| 5515 | f_init_raw(testcasename(), info_ind); |
| 5516 | |
| 5517 | /* Make sure we are not affected by full cache from previous tests */ |
| 5518 | f_pcuvty_flush_neigh_caches(); |
| 5519 | |
| 5520 | /* Establish BSSGP connection to the PCU */ |
| 5521 | f_bssgp_establish(); |
| 5522 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 5523 | |
| 5524 | /* Send PACKET RESOURCE REQUEST */ |
| 5525 | pollctx := f_ms_establish_ul_tbf_2phase_access(ms, ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, ms_racap_gprs_def)); |
| 5526 | /* Pkt Uplink Assignment above sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 5527 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), pollctx.fn, nr := pollctx.tstrxbts); |
| 5528 | |
| 5529 | /* Start NACC from MS side */ |
| 5530 | cell_chf_notif := ts_RlcMacUlCtrl_PKT_CELL_CHG_NOTIF(ms.ul_tbf.tfi, req_arfcn, req_bsic); |
| 5531 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(cell_chf_notif), 0, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 5532 | |
| 5533 | /* osmo-pcu should now ask for resolution: */ |
| 5534 | f_ipa_ctrl_wait_link_up(); |
| 5535 | var charstring ctrl_var := "neighbor_resolve_cgi_ps_from_lac_ci." & |
| 5536 | int2str(info_ind.lac) & "." & |
| 5537 | int2str(info_ind.cell_id) & "." & |
| 5538 | int2str(req_arfcn) & "." & |
| 5539 | int2str(req_bsic); |
| 5540 | f_ctrl_exp_get(IPA_CTRL, ctrl_var, "023-43-423-2-5"); |
| 5541 | /* RIM procedure: */ |
| 5542 | as_outbound_nacc_rim_resolve(info_ind); |
| 5543 | |
| 5544 | /* Announce SI back to MS, continue NACC procedure */ |
| 5545 | f_ms_handle_pkt_neighbor_cell_data(ms, si_default); |
| 5546 | |
| 5547 | /* Obtain a Downlink block and make sure it is a Pkt Cell Chg Continue */ |
| 5548 | f_rx_rlcmac_dl_block(dl_block, sched_fn); |
| 5549 | if (not match(dl_block, tr_RLCMAC_DL_CTRL(?, tr_RlcMacDlCtrl_PKT_CELL_CHG_CONTINUE))) { |
| 5550 | setverdict(fail, "Rx unexpected DL block: ", dl_block); |
| 5551 | f_shutdown(__BFILE__, __LINE__); |
| 5552 | } |
| 5553 | |
| 5554 | /* trigger a Pkt Cell Change Notif with different tgt cell */ |
| 5555 | cell_chf_notif := ts_RlcMacUlCtrl_PKT_CELL_CHG_NOTIF(ms.ul_tbf.tfi, req_arfcn + 1, req_bsic + 1); |
| 5556 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(cell_chf_notif), 0, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 5557 | |
| 5558 | /* PKT CELL CHG CONTINUE ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 5559 | if (dl_block.ctrl.mac_hdr.rrbp_valid) { |
| 5560 | sched_fn := f_rrbp_ack_fn(sched_fn, dl_block.ctrl.mac_hdr.rrbp); |
| 5561 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
| 5562 | } |
| 5563 | /* PCU TBF NACC state changed, so we should next receive a dummy block: */ |
| 5564 | f_rx_rlcmac_dl_block_exp_dummy(dl_block); |
| 5565 | |
| 5566 | /* It should trigger RAC_CI resolution to start again: */ |
| 5567 | ctrl_var := "neighbor_resolve_cgi_ps_from_lac_ci." & |
| 5568 | int2str(info_ind.lac) & "." & |
| 5569 | int2str(info_ind.cell_id) & "." & |
| 5570 | int2str(req_arfcn + 1) & "." & |
| 5571 | int2str(req_bsic + 1); |
| 5572 | f_ctrl_exp_get(IPA_CTRL, ctrl_var, "023-43-423-2-5"); |
| 5573 | /* RIM procedure: */ |
| 5574 | as_outbound_nacc_rim_resolve(info_ind); |
| 5575 | /* Transmit SI back to MS */ |
| 5576 | f_ms_handle_pkt_neighbor_cell_data(ms, si_default); |
| 5577 | |
| 5578 | /* Obtain a Downlink block and make sure it is a Pkt Cell Chg Continue */ |
| 5579 | f_rx_rlcmac_dl_block(dl_block, sched_fn); |
| 5580 | if (not match(dl_block, tr_RLCMAC_DL_CTRL(?, tr_RlcMacDlCtrl_PKT_CELL_CHG_CONTINUE))) { |
| 5581 | setverdict(fail, "Rx unexpected DL block: ", dl_block); |
| 5582 | f_shutdown(__BFILE__, __LINE__); |
| 5583 | } |
| 5584 | /* PKT CELL CHG CONTINUE ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 5585 | if (dl_block.ctrl.mac_hdr.rrbp_valid) { |
| 5586 | sched_fn := f_rrbp_ack_fn(sched_fn, dl_block.ctrl.mac_hdr.rrbp); |
| 5587 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
| 5588 | } |
| 5589 | } |
| 5590 | |
Pau Espin Pedrol | 1303577 | 2021-02-18 16:07:06 +0100 | [diff] [blame] | 5591 | /* Test MS sending Pkt Cell Change Notification on an MS with an existing but unassigned (no TFI) DL TBF */ |
| 5592 | testcase TC_nacc_outbound_pkt_cell_chg_notif_unassigned_dl_tbf() runs on RAW_PCU_Test_CT { |
| 5593 | var PollFnCtx pollctx; |
| 5594 | var GprsMS ms; |
| 5595 | var PCUIF_info_ind info_ind := valueof(ts_PCUIF_INFO_default); |
| 5596 | var template (value) RlcmacUlCtrlMsg cell_chf_notif; |
| 5597 | var RlcmacDlBlock dl_block; |
| 5598 | var uint32_t sched_fn, dl_fn; |
| 5599 | var CtrlMessage rx_ctrl; |
| 5600 | var GsmArfcn req_arfcn := 862; |
| 5601 | var uint6_t req_bsic := 43; |
| 5602 | var octetstring data := f_rnd_octstring(10); |
| 5603 | |
| 5604 | /* Initialize osmo-bsc emulation neighbor resolution CTRL port */ |
| 5605 | f_ipa_ctrl_start_server(mp_ctrl_neigh_ip, mp_ctrl_neigh_port); |
| 5606 | |
| 5607 | /* Initialize NS/BSSGP side */ |
| 5608 | f_init_bssgp(); |
| 5609 | /* Initialize GPRS MS side */ |
| 5610 | f_init_gprs_ms(); |
| 5611 | ms := g_ms[0]; /* We only use first MS in this test */ |
| 5612 | |
| 5613 | /* Initialize the PCU interface abstraction */ |
| 5614 | f_init_raw(testcasename(), info_ind); |
| 5615 | |
| 5616 | /* Make sure we are not affected by full cache from previous tests */ |
| 5617 | f_pcuvty_flush_neigh_caches(); |
| 5618 | |
| 5619 | /* Establish BSSGP connection to the PCU */ |
| 5620 | f_bssgp_establish(); |
| 5621 | f_bssgp_client_llgmm_assign(TLLI_UNUSED, ms.tlli); |
| 5622 | |
| 5623 | /* Send PACKET RESOURCE REQUEST */ |
| 5624 | pollctx := f_ms_establish_ul_tbf_2phase_access(ms, ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, ms_racap_gprs_def)); |
| 5625 | /* Pkt Uplink Assignment above sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 5626 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), pollctx.fn, nr := pollctx.tstrxbts); |
| 5627 | |
| 5628 | /* Start NACC from MS side */ |
| 5629 | cell_chf_notif := ts_RlcMacUlCtrl_PKT_CELL_CHG_NOTIF(ms.ul_tbf.tfi, req_arfcn, req_bsic); |
| 5630 | f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(cell_chf_notif), 0, nr := f_ms_tx_TsTrxBtsNum(ms)); |
| 5631 | |
| 5632 | /* osmo-pcu should now ask for resolution: */ |
| 5633 | f_ipa_ctrl_wait_link_up(); |
| 5634 | var charstring ctrl_var := "neighbor_resolve_cgi_ps_from_lac_ci." & |
| 5635 | int2str(info_ind.lac) & "." & |
| 5636 | int2str(info_ind.cell_id) & "." & |
| 5637 | int2str(req_arfcn) & "." & |
| 5638 | int2str(req_bsic); |
| 5639 | f_ctrl_exp_get(IPA_CTRL, ctrl_var, "023-43-423-2-5"); |
| 5640 | /* RIM procedure: */ |
| 5641 | as_outbound_nacc_rim_resolve(info_ind); |
| 5642 | |
| 5643 | BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data)); |
| 5644 | /* Make sure we leave some time for SGSN->PCU data to arrive to PCU */ |
| 5645 | f_sleep(0.1); |
| 5646 | /* rx DL assignment, don't ack it yet (keep TBF in state ASSIGN): */ |
| 5647 | f_ms_rx_pkt_ass_pacch(ms, sched_fn, tr_RLCMAC_DL_PACKET_ASS); |
| 5648 | |
| 5649 | /* NACC: scheduler selects tx Pkt Cell Neighbor Data. Receive first one: */ |
| 5650 | f_ms_handle_pkt_neighbor_cell_data(ms, si_default, single_step := true); |
| 5651 | /* ACK DL assignment (we do it here on purpose to test tx Pkt Neigh Cell |
| 5652 | * Data with unassigned DL TBF in line above): */ |
| 5653 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
| 5654 | /* Continue receiving Pkt Cell Neighbor Data */ |
| 5655 | f_ms_handle_pkt_neighbor_cell_data(ms, si_default, f_ms_tx_TsTrxBtsNum(ms), 1, 16); |
| 5656 | |
| 5657 | /* Obtain a Downlink block and make sure it is a Pkt Cell Chg Continue */ |
| 5658 | f_rx_rlcmac_dl_block(dl_block, sched_fn); |
| 5659 | if (not match(dl_block, tr_RLCMAC_DL_CTRL(?, tr_RlcMacDlCtrl_PKT_CELL_CHG_CONTINUE))) { |
| 5660 | setverdict(fail, "Rx unexpected DL block: ", dl_block); |
| 5661 | f_shutdown(__BFILE__, __LINE__); |
| 5662 | } |
| 5663 | /* PKT CELL CHG CONTINUE ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */ |
| 5664 | if (dl_block.ctrl.mac_hdr.rrbp_valid) { |
| 5665 | sched_fn := f_rrbp_ack_fn(sched_fn, dl_block.ctrl.mac_hdr.rrbp); |
| 5666 | f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn); |
| 5667 | } |
| 5668 | |
| 5669 | /* Now that we confirmed the new assignment in the dl-tbf, lets receive the data and ack it */ |
| 5670 | f_rx_rlcmac_dl_block_exp_data(dl_block, dl_fn, data, 0); |
| 5671 | f_acknackdesc_ack_block(ms.dl_tbf.acknack_desc, dl_block, '1'B); |
| 5672 | f_ms_tx_ul_block(ms, ts_RLCMAC_DL_ACK_NACK(ms.dl_tbf.tfi, ms.dl_tbf.acknack_desc), |
| 5673 | f_dl_block_ack_fn(dl_block, dl_fn)); |
| 5674 | } |
| 5675 | |
Philipp Maier | d55fe7e | 2021-02-01 17:23:40 +0100 | [diff] [blame] | 5676 | |
Pau Espin Pedrol | 436e2bd | 2021-05-06 20:07:08 +0200 | [diff] [blame] | 5677 | function f_do_inbound_nacc(template (value) RIM_Routing_Information tx_src_addr, template RIM_Routing_Information rx_dst_addr) |
| 5678 | runs on RAW_PCU_Test_CT |
| 5679 | { |
| 5680 | var template (value) RAN_Information_Request_RIM_Container req_cont; |
| 5681 | var template (value) PDU_BSSGP bssgp_rim_pdu; |
| 5682 | var template PDU_BSSGP bssgp_rim_pdu_expect; |
| 5683 | var template RAN_Information_RIM_Container rim_cont_expect; |
| 5684 | var RIM_Routing_Address bts_addr; |
Philipp Maier | d55fe7e | 2021-02-01 17:23:40 +0100 | [diff] [blame] | 5685 | |
| 5686 | /* Send sysinfo to the PCU */ |
Pau Espin Pedrol | 0af478e | 2021-02-05 18:00:58 +0100 | [diff] [blame] | 5687 | var template PCUIF_Message si1_data_ind := ts_PCUIF_DATA_IND(0, 0, 0, 0, PCU_IF_SAPI_BCCH, '5506'O & si1_default, 0, 0, 0, 0, 32767); |
Philipp Maier | d55fe7e | 2021-02-01 17:23:40 +0100 | [diff] [blame] | 5688 | BTS.send(si1_data_ind); |
Pau Espin Pedrol | 0af478e | 2021-02-05 18:00:58 +0100 | [diff] [blame] | 5689 | var template PCUIF_Message si3_data_ind := ts_PCUIF_DATA_IND(0, 0, 0, 0, PCU_IF_SAPI_BCCH, '4906'O & si3_default, 0, 0, 0, 0, 32767); |
Philipp Maier | d55fe7e | 2021-02-01 17:23:40 +0100 | [diff] [blame] | 5690 | BTS.send(si3_data_ind); |
Pau Espin Pedrol | 02a6d0c | 2021-04-19 17:11:07 +0200 | [diff] [blame] | 5691 | var template PCUIF_Message si13_data_ind := ts_PCUIF_DATA_IND(0, 0, 0, 0, PCU_IF_SAPI_BCCH, '0106'O & si13_default, 0, 0, 0, 0, 32767); |
| 5692 | BTS.send(si13_data_ind); |
Philipp Maier | d55fe7e | 2021-02-01 17:23:40 +0100 | [diff] [blame] | 5693 | f_sleep(1.0); |
| 5694 | |
Pau Espin Pedrol | 436e2bd | 2021-05-06 20:07:08 +0200 | [diff] [blame] | 5695 | bts_addr := valueof(t_RIM_Routing_Address_cid(mp_gb_cfg.bvc[0].cell_id)); |
Philipp Maier | d55fe7e | 2021-02-01 17:23:40 +0100 | [diff] [blame] | 5696 | |
Philipp Maier | d55fe7e | 2021-02-01 17:23:40 +0100 | [diff] [blame] | 5697 | req_cont := ts_RAN_Information_Request_RIM_Container(ts_RIM_Application_Identity(RIM_APP_ID_NACC), |
| 5698 | ts_RIM_Sequence_Number(1), |
| 5699 | ts_RIM_PDU_Indications(false, RIM_PDU_TYPE_SING_REP), |
| 5700 | ts_RIM_Protocol_Version_Number(1), |
| 5701 | tsu_RAN_Information_Request_Application_Container_NACC(mp_gb_cfg.bvc[0].cell_id), |
| 5702 | omit); |
Pau Espin Pedrol | 436e2bd | 2021-05-06 20:07:08 +0200 | [diff] [blame] | 5703 | bssgp_rim_pdu := ts_RAN_INFORMATION_REQUEST(ts_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, bts_addr), |
| 5704 | tx_src_addr, req_cont); |
Philipp Maier | d55fe7e | 2021-02-01 17:23:40 +0100 | [diff] [blame] | 5705 | |
| 5706 | rim_cont_expect := tr_RAN_Information_RIM_Container(tr_RIM_Application_Identity(RIM_APP_ID_NACC), |
| 5707 | tr_RIM_Sequence_Number(1), |
| 5708 | tr_RIM_PDU_Indications(false, RIM_PDU_TYPE_SING_REP), |
| 5709 | tr_RIM_Protocol_Version_Number(1), |
Pau Espin Pedrol | 0af478e | 2021-02-05 18:00:58 +0100 | [diff] [blame] | 5710 | tru_ApplContainer_or_ApplErrContainer_NACC(tru_ApplContainer_NACC(mp_gb_cfg.bvc[0].cell_id, false, 3, si_default)), |
Philipp Maier | d55fe7e | 2021-02-01 17:23:40 +0100 | [diff] [blame] | 5711 | omit); |
| 5712 | |
Pau Espin Pedrol | 436e2bd | 2021-05-06 20:07:08 +0200 | [diff] [blame] | 5713 | bssgp_rim_pdu_expect := tr_PDU_BSSGP_RAN_INFORMATION(rx_dst_addr, |
| 5714 | tr_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, bts_addr), |
Philipp Maier | d55fe7e | 2021-02-01 17:23:40 +0100 | [diff] [blame] | 5715 | rim_cont_expect); |
| 5716 | RIM.send(bssgp_rim_pdu); |
Pau Espin Pedrol | 436e2bd | 2021-05-06 20:07:08 +0200 | [diff] [blame] | 5717 | timer T := 2.0; |
Philipp Maier | d55fe7e | 2021-02-01 17:23:40 +0100 | [diff] [blame] | 5718 | T.start; |
| 5719 | alt { |
| 5720 | [] RIM.receive(bssgp_rim_pdu_expect) { } |
| 5721 | [] RIM.receive { |
| 5722 | setverdict(fail, "Unexpected BSSGP RIM PDU received"); |
| 5723 | } |
| 5724 | [] T.timeout { |
| 5725 | setverdict(fail, "No BSSGP RIM PDU received"); |
| 5726 | mtc.stop; |
| 5727 | } |
| 5728 | } |
Pau Espin Pedrol | 436e2bd | 2021-05-06 20:07:08 +0200 | [diff] [blame] | 5729 | } |
| 5730 | /* Send a RIM RAN info request to the PCU and verify the response, we expect |
| 5731 | * getting the system information back which we have transfered to the PCU via |
| 5732 | * PCUIF on startup. */ |
| 5733 | testcase TC_rim_ran_info_req_single_rep() runs on RAW_PCU_Test_CT { |
| 5734 | /* Initialize NS/BSSGP side */ |
| 5735 | f_init_bssgp(); |
| 5736 | |
| 5737 | /* Initialize the PCU interface abstraction */ |
| 5738 | f_init_raw(testcasename()); |
| 5739 | |
| 5740 | /* Establish BSSGP connection to the PCU */ |
| 5741 | f_bssgp_establish(); |
| 5742 | |
| 5743 | var BssgpCellId src_cid := {ra_id := { lai := { mcc_mnc := '262F42'H, lac := 12345}, rac := 0 }, cell_id := 20962 }; |
| 5744 | var RIM_Routing_Address src_addr := valueof(t_RIM_Routing_Address_cid(src_cid)); |
| 5745 | |
| 5746 | f_do_inbound_nacc(ts_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, src_addr), |
| 5747 | tr_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, src_addr)); |
| 5748 | |
| 5749 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 5750 | } |
| 5751 | |
| 5752 | /* Same as TC_rim_ran_info_req_single_rep, but using an EUTRAN eNodeB ID as |
| 5753 | * Routing information, to verify PCU handles that kind of address just fine |
| 5754 | */ |
| 5755 | testcase TC_rim_ran_info_req_single_rep_eutran() runs on RAW_PCU_Test_CT { |
| 5756 | /* Initialize NS/BSSGP side */ |
| 5757 | f_init_bssgp(); |
| 5758 | |
| 5759 | /* Initialize the PCU interface abstraction */ |
| 5760 | f_init_raw(testcasename()); |
| 5761 | |
| 5762 | /* Establish BSSGP connection to the PCU */ |
| 5763 | f_bssgp_establish(); |
| 5764 | |
| 5765 | var BssgpCellId src_cid := {ra_id := { lai := { mcc_mnc := '262F42'H, lac := 12345}, rac := 0 }, cell_id := 20962 }; |
| 5766 | var RIM_Routing_Address src_addr := valueof(t_RIM_Routing_Address_enbid(src_cid, tac := 3, gnbid := '12345678123456'O)); |
| 5767 | |
| 5768 | f_do_inbound_nacc(ts_RIM_Routing_Information(RIM_ADDR_EUTRAN_NODEB_ID, src_addr), |
| 5769 | tr_RIM_Routing_Information(RIM_ADDR_EUTRAN_NODEB_ID, src_addr)); |
Philipp Maier | d55fe7e | 2021-02-01 17:23:40 +0100 | [diff] [blame] | 5770 | |
| 5771 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 5772 | } |
| 5773 | |
| 5774 | /* Same as above, but in this case we simulate the rare case in which the PCU |
| 5775 | * has no system information available. We expect getting a response back but |
| 5776 | * with no system information inside. */ |
| 5777 | testcase TC_rim_ran_info_req_single_rep_no_si() runs on RAW_PCU_Test_CT { |
Pau Espin Pedrol | fa64e28 | 2021-02-05 17:56:52 +0100 | [diff] [blame] | 5778 | var template (value) PCUIF_info_ind info_ind := ts_PCUIF_INFO_default; |
Philipp Maier | d55fe7e | 2021-02-01 17:23:40 +0100 | [diff] [blame] | 5779 | var PCUIF_Message pcu_msg; |
| 5780 | timer T := 2.0; |
| 5781 | |
| 5782 | /* Initialize NS/BSSGP side */ |
| 5783 | f_init_bssgp(); |
| 5784 | |
| 5785 | /* Initialize the PCU interface abstraction */ |
| 5786 | f_init_raw(testcasename(), info_ind); |
| 5787 | |
| 5788 | /* Establish BSSGP connection to the PCU */ |
| 5789 | f_bssgp_establish(); |
| 5790 | |
| 5791 | /* Clear sysinfo from the PCU */ |
| 5792 | var template PCUIF_Message si1_data_ind := ts_PCUIF_DATA_IND(0, 0, 0, 0, PCU_IF_SAPI_BCCH, '01'O, 0, 0, 0, 0, 32767); |
| 5793 | BTS.send(si1_data_ind); |
| 5794 | var template PCUIF_Message si3_data_ind := ts_PCUIF_DATA_IND(0, 0, 0, 0, PCU_IF_SAPI_BCCH, '03'O, 0, 0, 0, 0, 32767); |
| 5795 | BTS.send(si3_data_ind); |
| 5796 | var template PCUIF_Message si16_data_ind := ts_PCUIF_DATA_IND(0, 0, 0, 0, PCU_IF_SAPI_BCCH, '0b'O, 0, 0, 0, 0, 32767); |
| 5797 | BTS.send(si16_data_ind); |
| 5798 | f_sleep(1.0); |
| 5799 | |
Pau Espin Pedrol | fa64e28 | 2021-02-05 17:56:52 +0100 | [diff] [blame] | 5800 | var RIM_Routing_Address dst_addr; |
| 5801 | var RIM_Routing_Address src_addr; |
| 5802 | var template (value) RAN_Information_Request_RIM_Container req_cont; |
| 5803 | var template (value) PDU_BSSGP bssgp_rim_pdu; |
Philipp Maier | d55fe7e | 2021-02-01 17:23:40 +0100 | [diff] [blame] | 5804 | var template PDU_BSSGP bssgp_rim_pdu_expect; |
| 5805 | var template RAN_Information_RIM_Container rim_cont_expect; |
| 5806 | |
| 5807 | var BssgpCellId src_cid := {ra_id := { lai := { mcc_mnc := '262F42'H, lac := 12345}, rac := 0 }, cell_id := 20962 }; |
Pau Espin Pedrol | fa64e28 | 2021-02-05 17:56:52 +0100 | [diff] [blame] | 5808 | src_addr := valueof(t_RIM_Routing_Address_cid(src_cid)); |
| 5809 | dst_addr := valueof(t_RIM_Routing_Address_cid(mp_gb_cfg.bvc[0].cell_id)); |
Philipp Maier | d55fe7e | 2021-02-01 17:23:40 +0100 | [diff] [blame] | 5810 | |
| 5811 | req_cont := ts_RAN_Information_Request_RIM_Container(ts_RIM_Application_Identity(RIM_APP_ID_NACC), |
| 5812 | ts_RIM_Sequence_Number(1), |
| 5813 | ts_RIM_PDU_Indications(false, RIM_PDU_TYPE_SING_REP), |
| 5814 | ts_RIM_Protocol_Version_Number(1), |
| 5815 | tsu_RAN_Information_Request_Application_Container_NACC(mp_gb_cfg.bvc[0].cell_id), |
| 5816 | omit); |
| 5817 | bssgp_rim_pdu := ts_RAN_INFORMATION_REQUEST(ts_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, dst_addr), |
| 5818 | ts_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, src_addr), |
| 5819 | req_cont); |
| 5820 | |
| 5821 | |
| 5822 | rim_cont_expect := tr_RAN_Information_RIM_Container(tr_RIM_Application_Identity(RIM_APP_ID_NACC), |
| 5823 | tr_RIM_Sequence_Number(1), |
| 5824 | tr_RIM_PDU_Indications(false, RIM_PDU_TYPE_SING_REP), |
| 5825 | tr_RIM_Protocol_Version_Number(1), |
| 5826 | tru_ApplContainer_or_ApplErrContainer_NACC(tru_ApplContainer_NACC(mp_gb_cfg.bvc[0].cell_id, false, 0, ''O)), |
| 5827 | omit); |
| 5828 | |
| 5829 | bssgp_rim_pdu_expect := tr_PDU_BSSGP_RAN_INFORMATION(tr_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, src_addr), |
| 5830 | tr_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, dst_addr), |
| 5831 | rim_cont_expect); |
| 5832 | RIM.send(bssgp_rim_pdu); |
| 5833 | T.start; |
| 5834 | alt { |
| 5835 | [] RIM.receive(bssgp_rim_pdu_expect) { } |
| 5836 | [] RIM.receive { |
| 5837 | setverdict(fail, "Unexpected BSSGP RIM PDU received"); |
| 5838 | } |
| 5839 | [] T.timeout { |
| 5840 | setverdict(fail, "No BSSGP RIM PDU received"); |
| 5841 | mtc.stop; |
| 5842 | } |
| 5843 | } |
| 5844 | |
| 5845 | f_shutdown(__BFILE__, __LINE__, final := true); |
| 5846 | } |
| 5847 | |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 5848 | control { |
| 5849 | execute( TC_pcuif_suspend() ); |
Pau Espin Pedrol | 9e04d5e | 2021-01-11 15:03:50 +0100 | [diff] [blame] | 5850 | execute( TC_pcuif_suspend_active_tbf() ); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 5851 | execute( TC_ta_ptcch_idle() ); |
| 5852 | execute( TC_ta_rach_imm_ass() ); |
| 5853 | execute( TC_ta_idle_dl_tbf_ass() ); |
| 5854 | execute( TC_ta_ptcch_ul_multi_tbf() ); |
| 5855 | execute( TC_cs_lqual_ul_tbf() ); |
| 5856 | execute( TC_cs_initial_ul() ); |
| 5857 | execute( TC_cs_max_ul() ); |
Pau Espin Pedrol | 7512259 | 2020-11-03 15:22:59 +0100 | [diff] [blame] | 5858 | execute( TC_cs_initial_dl() ); |
Pau Espin Pedrol | 5d07ae6 | 2020-11-05 17:59:30 +0100 | [diff] [blame] | 5859 | execute( TC_cs_max_dl() ); |
| 5860 | execute( TC_dl_cs1_to_cs4() ); |
Pau Espin Pedrol | 2354d6a | 2020-11-05 18:36:59 +0100 | [diff] [blame] | 5861 | execute( TC_mcs_initial_ul() ); |
Pau Espin Pedrol | db15fa7 | 2020-11-11 12:58:34 +0100 | [diff] [blame] | 5862 | execute( TC_mcs_max_ul() ); |
Pau Espin Pedrol | e4fa45b | 2020-11-11 13:28:31 +0100 | [diff] [blame] | 5863 | execute( TC_mcs_initial_dl() ); |
Pau Espin Pedrol | 1b9aa78 | 2020-11-12 21:14:16 +0100 | [diff] [blame] | 5864 | execute( TC_mcs_max_dl() ); |
Pau Espin Pedrol | 1451f9f | 2021-05-11 11:52:37 +0200 | [diff] [blame] | 5865 | execute( TC_t3141() ); |
Pau Espin Pedrol | f30fa1d | 2021-03-03 19:55:11 +0100 | [diff] [blame] | 5866 | execute( TC_n3101_max_t3169() ); |
Pau Espin Pedrol | cc895df | 2021-04-20 12:58:32 +0200 | [diff] [blame] | 5867 | execute( TC_n3103_max_t3169() ); |
Pau Espin Pedrol | 84a8c3c | 2021-03-01 17:22:29 +0100 | [diff] [blame] | 5868 | execute( TC_x2031_t3191() ); |
| 5869 | execute( TC_zero_x2031_t3191() ); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 5870 | execute( TC_t3193() ); |
Pau Espin Pedrol | 14ca7e3 | 2021-03-01 17:41:21 +0100 | [diff] [blame] | 5871 | execute( TC_n3105_max_t3195() ); |
Pau Espin Pedrol | 487d634 | 2020-05-14 19:22:33 +0200 | [diff] [blame] | 5872 | execute( TC_countdown_procedure() ); |
Pau Espin Pedrol | fb2301e | 2020-06-30 20:46:54 +0200 | [diff] [blame] | 5873 | execute( TC_ul_all_sizes() ); |
Pau Espin Pedrol | 5e6844d | 2020-07-01 17:24:02 +0200 | [diff] [blame] | 5874 | execute( TC_ul_data_toolong_fills_padding() ); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 5875 | execute( TC_mo_ping_pong() ); |
| 5876 | execute( TC_mo_ping_pong_with_ul_racap() ); |
Pau Espin Pedrol | 0c0bf87 | 2020-05-14 15:50:49 +0200 | [diff] [blame] | 5877 | execute( TC_force_two_phase_access() ); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 5878 | execute( TC_mt_ping_pong() ); |
| 5879 | execute( TC_mt_ping_pong_with_dl_racap() ); |
Pau Espin Pedrol | e1195bb | 2020-07-07 13:27:18 +0200 | [diff] [blame] | 5880 | execute( TC_ul_intermediate_retrans() ); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 5881 | execute( TC_imm_ass_dl_block_retrans() ); |
Vadim Yanitskiy | 71238c1 | 2020-05-11 03:48:06 +0700 | [diff] [blame] | 5882 | execute( TC_dl_flow_more_blocks() ); |
Pau Espin Pedrol | e1195bb | 2020-07-07 13:27:18 +0200 | [diff] [blame] | 5883 | execute( TC_ul_flow_multiple_llc_blocks() ); |
Pau Espin Pedrol | 90fdfed | 2021-03-02 17:29:32 +0100 | [diff] [blame] | 5884 | execute( TC_dl_no_ack_retrans_imm_ass() ); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 5885 | execute( TC_paging_cs_from_bts() ); |
| 5886 | execute( TC_paging_cs_from_sgsn_sign_ptmsi() ); |
| 5887 | execute( TC_paging_cs_from_sgsn_sign() ); |
| 5888 | execute( TC_paging_cs_from_sgsn_ptp() ); |
| 5889 | execute( TC_paging_ps_from_sgsn_sign_ptmsi() ); |
| 5890 | execute( TC_paging_ps_from_sgsn_sign() ); |
| 5891 | execute( TC_paging_ps_from_sgsn_ptp() ); |
Vadim Yanitskiy | dbd4b24 | 2020-10-31 05:44:58 +0700 | [diff] [blame] | 5892 | execute( TC_paging_cs_multi_ms_imsi_tmsi() ); |
| 5893 | execute( TC_paging_cs_multi_ms_imsi() ); |
| 5894 | execute( TC_paging_cs_multi_ms_tmsi() ); |
Pau Espin Pedrol | c03eb12 | 2020-08-27 18:54:24 +0200 | [diff] [blame] | 5895 | execute( TC_bssgp_dl_unitdata_with_valid_imsi() ); |
| 5896 | execute( TC_bssgp_dl_unitdata_with_invalid_imsi() ); |
Pau Espin Pedrol | 2e459d6 | 2020-11-30 19:34:16 +0100 | [diff] [blame] | 5897 | execute( TC_dl_gprs_data_no_llc_ui_dummy() ); |
| 5898 | execute( TC_dl_egprs_data_no_llc_ui_dummy() ); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 5899 | |
| 5900 | /* EGPRS specific test cases */ |
| 5901 | execute( TC_egprs_pkt_chan_req_signalling() ); |
| 5902 | execute( TC_egprs_pkt_chan_req_one_phase() ); |
| 5903 | execute( TC_egprs_pkt_chan_req_two_phase() ); |
Vadim Yanitskiy | 4f56d32 | 2020-05-22 20:15:48 +0700 | [diff] [blame] | 5904 | execute( TC_egprs_pkt_chan_req_reject_content() ); |
Vadim Yanitskiy | 7e06c25 | 2020-05-22 20:48:53 +0700 | [diff] [blame] | 5905 | execute( TC_egprs_pkt_chan_req_reject_emergency() ); |
Vadim Yanitskiy | c4324ff | 2020-05-22 21:53:58 +0700 | [diff] [blame] | 5906 | execute( TC_egprs_pkt_chan_req_reject_exhaustion() ); |
Pau Espin Pedrol | 42acafc | 2020-05-14 15:18:38 +0200 | [diff] [blame] | 5907 | |
| 5908 | execute( TC_mo_ping_pong_with_ul_racap_egprs_only() ); |
Vadim Yanitskiy | 94fe83e | 2020-07-20 04:03:13 +0700 | [diff] [blame] | 5909 | |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 5910 | /* Immediate Assignment on AGCH/PCH */ |
| 5911 | execute( TC_pcuif_fh_imm_ass_ul_egprs() ); |
| 5912 | execute( TC_pcuif_fh_imm_ass_ul() ); |
| 5913 | execute( TC_pcuif_fh_imm_ass_dl() ); |
| 5914 | /* Packet Uplink/Downlink Assignment on PACCH */ |
| 5915 | execute( TC_pcuif_fh_pkt_ass_ul() ); |
| 5916 | execute( TC_pcuif_fh_pkt_ass_dl() ); |
| 5917 | execute( TC_multitrx_multims_alloc() ); |
| 5918 | execute( TC_dl_multislot_tbf_ms_class_from_sgsn() ); |
| 5919 | execute( TC_dl_multislot_tbf_ms_class_from_2phase() ); |
| 5920 | execute( TC_ul_multislot_tbf_ms_class_from_2phase() ); |
| 5921 | |
Pau Espin Pedrol | e130305 | 2020-11-16 11:13:51 +0100 | [diff] [blame] | 5922 | execute( TC_multiplex_dl_gprs_egprs() ); |
Vadim Yanitskiy | d53fb67 | 2020-10-09 16:41:02 +0700 | [diff] [blame] | 5923 | |
| 5924 | execute( TC_pcuif_info_ind_subsequent() ); |
Pau Espin Pedrol | 0637ba0 | 2021-01-22 18:36:12 +0100 | [diff] [blame] | 5925 | execute( TC_nacc_outbound_success() ); |
Pau Espin Pedrol | 2abbba9 | 2021-02-02 11:52:57 +0100 | [diff] [blame] | 5926 | execute( TC_nacc_outbound_success_no_ctrl_ack() ); |
Pau Espin Pedrol | 43be425 | 2021-01-27 16:40:54 +0100 | [diff] [blame] | 5927 | execute( TC_nacc_outbound_success_twice() ); |
Pau Espin Pedrol | 8536668 | 2021-01-27 19:04:54 +0100 | [diff] [blame] | 5928 | execute( TC_nacc_outbound_success_twice_nocache() ); |
Pau Espin Pedrol | e51c17a | 2021-01-27 18:29:22 +0100 | [diff] [blame] | 5929 | execute( TC_nacc_outbound_rac_ci_resolve_conn_refused() ); |
Pau Espin Pedrol | 31e3064 | 2021-01-26 19:25:16 +0100 | [diff] [blame] | 5930 | execute( TC_nacc_outbound_rac_ci_resolve_timeout() ); |
Pau Espin Pedrol | 4b5227c | 2021-01-26 20:03:01 +0100 | [diff] [blame] | 5931 | execute( TC_nacc_outbound_rac_ci_resolve_fail_parse_response() ); |
Pau Espin Pedrol | 9076ee7 | 2021-01-26 19:38:26 +0100 | [diff] [blame] | 5932 | execute( TC_nacc_outbound_si_resolve_timeout() ); |
Pau Espin Pedrol | 6a71548 | 2021-02-10 18:40:46 +0100 | [diff] [blame] | 5933 | execute( TC_nacc_outbound_pkt_cell_chg_notif_dup() ); |
| 5934 | execute( TC_nacc_outbound_pkt_cell_chg_notif_dup2() ); |
Pau Espin Pedrol | 0d6ebb7 | 2021-02-11 14:53:24 +0100 | [diff] [blame] | 5935 | execute( TC_nacc_outbound_pkt_cell_chg_notif_dup3() ); |
| 5936 | execute( TC_nacc_outbound_pkt_cell_chg_notif_dup4() ); |
| 5937 | execute( TC_nacc_outbound_pkt_cell_chg_notif_dup5() ); |
Pau Espin Pedrol | d4ed360 | 2021-02-11 12:37:22 +0100 | [diff] [blame] | 5938 | execute( TC_nacc_outbound_pkt_cell_chg_notif_twice() ); |
| 5939 | execute( TC_nacc_outbound_pkt_cell_chg_notif_twice2() ); |
Pau Espin Pedrol | 179ddef | 2021-02-11 16:03:46 +0100 | [diff] [blame] | 5940 | execute( TC_nacc_outbound_pkt_cell_chg_notif_twice3() ); |
| 5941 | execute( TC_nacc_outbound_pkt_cell_chg_notif_twice4() ); |
| 5942 | execute( TC_nacc_outbound_pkt_cell_chg_notif_twice5() ); |
Pau Espin Pedrol | 1303577 | 2021-02-18 16:07:06 +0100 | [diff] [blame] | 5943 | execute( TC_nacc_outbound_pkt_cell_chg_notif_unassigned_dl_tbf() ); |
Philipp Maier | d55fe7e | 2021-02-01 17:23:40 +0100 | [diff] [blame] | 5944 | |
| 5945 | execute( TC_rim_ran_info_req_single_rep() ); |
Pau Espin Pedrol | 436e2bd | 2021-05-06 20:07:08 +0200 | [diff] [blame] | 5946 | execute( TC_rim_ran_info_req_single_rep_eutran() ); |
Philipp Maier | d55fe7e | 2021-02-01 17:23:40 +0100 | [diff] [blame] | 5947 | execute( TC_rim_ran_info_req_single_rep_no_si() ); |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 5948 | } |
| 5949 | |
Harald Welte | a419df2 | 2019-03-21 17:23:04 +0100 | [diff] [blame] | 5950 | } |