Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 1 | module GBProxy_Tests { |
| 2 | |
| 3 | /* Osmocom GBProxy test suite in TTCN-3 |
| 4 | * (C) 2020 sysmocom - s.f.m.c. GmbH |
| 5 | * All rights reserved. |
| 6 | * |
| 7 | * Author: Daniel Willmann <dwillmann@sysmocom.de> |
| 8 | |
| 9 | * Released under the terms of GNU General Public License, Version 2 or |
| 10 | * (at your option) any later version. |
| 11 | * |
| 12 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 13 | */ |
| 14 | |
| 15 | import from General_Types all; |
| 16 | import from Osmocom_Types all; |
| 17 | import from GSM_Types all; |
| 18 | import from Native_Functions all; |
| 19 | import from NS_Types all; |
| 20 | import from NS_Emulation all; |
| 21 | import from BSSGP_Types all; |
| 22 | import from BSSGP_Emulation all; |
| 23 | import from SCCPasp_Types all; |
| 24 | import from Osmocom_Gb_Types all; |
| 25 | |
| 26 | import from MobileL3_CommonIE_Types all; |
| 27 | import from MobileL3_GMM_SM_Types all; |
| 28 | import from MobileL3_Types all; |
| 29 | import from L3_Templates all; |
| 30 | import from L3_Common all; |
| 31 | |
| 32 | import from TELNETasp_PortType all; |
| 33 | import from Osmocom_VTY_Functions all; |
| 34 | |
| 35 | import from LLC_Types all; |
| 36 | import from LLC_Templates all; |
| 37 | |
| 38 | import from GSM_RR_Types all; |
| 39 | |
Harald Welte | 6d63f74 | 2020-11-15 19:44:04 +0100 | [diff] [blame] | 40 | /* mcc_mnc is 24.008 10.5.5.15 encoded. 262 42 */ |
| 41 | const BcdMccMnc c_mcc_mnc := '262F42'H; |
| 42 | |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 43 | modulepar { |
| 44 | /* IP/port on which we run our internal GSUP/HLR emulation */ |
Harald Welte | 6d63f74 | 2020-11-15 19:44:04 +0100 | [diff] [blame] | 45 | NSConfigurations mp_nsconfig_sgsn := { |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 46 | { |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 47 | nsei := 101, |
| 48 | role_sgsn := true, |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 49 | handle_sns := false, |
| 50 | nsvc := { |
| 51 | { |
| 52 | provider := { |
| 53 | ip := { |
| 54 | address_family := AF_INET, |
| 55 | local_udp_port := 7777, |
| 56 | local_ip := "127.0.0.1", |
| 57 | remote_udp_port := 23000, |
| 58 | remote_ip := "127.0.0.1" |
| 59 | } |
| 60 | }, |
| 61 | nsvci := 101 |
| 62 | } |
| 63 | } |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 64 | } |
| 65 | }; |
Harald Welte | 6d63f74 | 2020-11-15 19:44:04 +0100 | [diff] [blame] | 66 | NSConfigurations mp_nsconfig_pcu := { |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 67 | { |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 68 | nsei := 96, |
| 69 | role_sgsn := false, |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 70 | handle_sns := false, |
| 71 | nsvc := { |
| 72 | { |
| 73 | provider := { |
| 74 | ip := { |
| 75 | address_family := AF_INET, |
| 76 | local_udp_port := 21010, |
| 77 | local_ip := "127.0.0.1", |
| 78 | remote_udp_port := 23000, |
| 79 | remote_ip := "127.0.0.1" |
| 80 | } |
| 81 | }, |
| 82 | nsvci := 97 |
| 83 | } |
| 84 | } |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 85 | }, |
| 86 | { |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 87 | nsei := 97, |
| 88 | role_sgsn := false, |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 89 | handle_sns := false, |
| 90 | nsvc := { |
| 91 | { |
| 92 | provider := { |
| 93 | ip := { |
| 94 | address_family := AF_INET, |
| 95 | local_udp_port := 21011, |
| 96 | local_ip := "127.0.0.1", |
| 97 | remote_udp_port := 23000, |
| 98 | remote_ip := "127.0.0.1" |
| 99 | } |
| 100 | }, |
| 101 | nsvci := 98 |
| 102 | } |
| 103 | } |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 104 | }, |
| 105 | { |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 106 | nsei := 98, |
| 107 | role_sgsn := false, |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 108 | handle_sns := false, |
| 109 | nsvc := { |
| 110 | { |
| 111 | provider := { |
| 112 | ip := { |
| 113 | address_family := AF_INET, |
| 114 | local_udp_port := 21012, |
| 115 | local_ip := "127.0.0.1", |
| 116 | remote_udp_port := 23000, |
| 117 | remote_ip := "127.0.0.1" |
| 118 | } |
| 119 | }, |
| 120 | nsvci := 99 |
| 121 | } |
| 122 | } |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 123 | } |
| 124 | }; |
Harald Welte | 6d63f74 | 2020-11-15 19:44:04 +0100 | [diff] [blame] | 125 | BssgpConfigs mp_gbconfigs := { |
| 126 | { |
| 127 | nsei := 96, |
| 128 | sgsn_role := false, |
| 129 | bvc := { |
| 130 | { |
| 131 | bvci := 196, |
| 132 | cell_id := { |
| 133 | ra_id := { |
| 134 | lai := { |
| 135 | mcc_mnc := c_mcc_mnc, |
| 136 | lac := 13135 |
| 137 | }, |
| 138 | rac := 0 |
| 139 | }, |
| 140 | cell_id := 20960 |
| 141 | }, |
| 142 | depth := BSSGP_DECODE_DEPTH_BSSGP, |
| 143 | create_cb := refers(BSSGP_Emulation.DefaultCreateCallback) |
| 144 | } |
| 145 | } |
| 146 | }, { |
| 147 | nsei := 97, |
| 148 | sgsn_role := false, |
| 149 | bvc := { |
| 150 | { |
| 151 | bvci := 210, |
| 152 | cell_id := { |
| 153 | ra_id := { |
| 154 | lai := { |
| 155 | mcc_mnc := c_mcc_mnc, |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 156 | lac := 13135 |
Harald Welte | 6d63f74 | 2020-11-15 19:44:04 +0100 | [diff] [blame] | 157 | }, |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 158 | rac := 1 |
Harald Welte | 6d63f74 | 2020-11-15 19:44:04 +0100 | [diff] [blame] | 159 | }, |
| 160 | cell_id := 20961 |
| 161 | }, |
| 162 | depth := BSSGP_DECODE_DEPTH_BSSGP, |
| 163 | create_cb := refers(BSSGP_Emulation.DefaultCreateCallback) |
| 164 | } |
| 165 | } |
| 166 | }, { |
| 167 | nsei := 98, |
| 168 | sgsn_role := false, |
| 169 | bvc := { |
| 170 | { |
| 171 | bvci := 220, |
| 172 | cell_id := { |
| 173 | ra_id := { |
| 174 | lai := { |
| 175 | mcc_mnc := c_mcc_mnc, |
| 176 | lac := 13300 |
| 177 | }, |
| 178 | rac := 0 |
| 179 | }, |
| 180 | cell_id := 20962 |
| 181 | }, |
| 182 | depth := BSSGP_DECODE_DEPTH_BSSGP, |
| 183 | create_cb := refers(BSSGP_Emulation.DefaultCreateCallback) |
| 184 | } |
| 185 | } |
| 186 | } |
| 187 | } |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 188 | }; |
| 189 | |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 190 | type record GbInstance { |
| 191 | NS_CT vc_NS, |
| 192 | BSSGP_CT vc_BSSGP, |
Harald Welte | 67dc8c2 | 2020-11-17 18:32:29 +0100 | [diff] [blame] | 193 | BSSGP_BVC_CTs vc_BSSGP_BVC, |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 194 | BssgpConfig cfg |
| 195 | }; |
Harald Welte | 67dc8c2 | 2020-11-17 18:32:29 +0100 | [diff] [blame] | 196 | type record of BSSGP_BVC_CT BSSGP_BVC_CTs |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 197 | |
| 198 | const integer NUM_PCU := 3; |
Harald Welte | 6d63f74 | 2020-11-15 19:44:04 +0100 | [diff] [blame] | 199 | type record of GbInstance GbInstances; |
| 200 | type record of BssgpConfig BssgpConfigs; |
| 201 | type record of NSConfiguration NSConfigurations; |
| 202 | type record of BssgpCellId BssgpCellIds; |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 203 | |
| 204 | const integer NUM_SGSN := 1; |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 205 | |
| 206 | type component test_CT { |
Harald Welte | 6d63f74 | 2020-11-15 19:44:04 +0100 | [diff] [blame] | 207 | var GbInstances g_pcu; |
| 208 | var GbInstances g_sgsn; |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 209 | |
| 210 | port BSSGP_CT_PROC_PT PROC; |
| 211 | |
Harald Welte | fbae83f | 2020-11-15 23:25:55 +0100 | [diff] [blame] | 212 | port BSSGP_BVC_MGMT_PT SGSN_MGMT; |
| 213 | port BSSGP_BVC_MGMT_PT PCU_MGMT; |
| 214 | |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 215 | port TELNETasp_PT GBPVTY; |
| 216 | |
| 217 | var boolean g_initialized := false; |
| 218 | var boolean g_use_echo := false; |
| 219 | }; |
| 220 | |
| 221 | type component BSSGP_ConnHdlr { |
Harald Welte | 3dd21b3 | 2020-11-17 19:21:00 +0100 | [diff] [blame] | 222 | /* array of per-BVC ports on the PCU side */ |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 223 | port BSSGP_PT PCU[NUM_PCU]; |
| 224 | port BSSGP_PT PCU_SIG[NUM_PCU]; |
| 225 | port BSSGP_PROC_PT PCU_PROC[NUM_PCU]; |
Harald Welte | 3dd21b3 | 2020-11-17 19:21:00 +0100 | [diff] [blame] | 226 | /* component reference to the component to which we're currently connected */ |
| 227 | var BSSGP_BVC_CT pcu_ct[NUM_PCU]; |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 228 | /* BSSGP BVC configuration of the component to which we're currently connected */ |
| 229 | var BssgpBvcConfig pcu_bvc_cfg[NUM_PCU]; |
Harald Welte | 3dd21b3 | 2020-11-17 19:21:00 +0100 | [diff] [blame] | 230 | |
| 231 | /* array of per-BVC ports on the SGSN side */ |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 232 | port BSSGP_PT SGSN[NUM_SGSN]; |
| 233 | port BSSGP_PT SGSN_SIG[NUM_SGSN]; |
| 234 | port BSSGP_PROC_PT SGSN_PROC[NUM_SGSN]; |
Harald Welte | 3dd21b3 | 2020-11-17 19:21:00 +0100 | [diff] [blame] | 235 | /* component reference to the component to which we're currently connected */ |
| 236 | var BSSGP_BVC_CT sgsn_ct[NUM_PCU]; |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 237 | |
| 238 | var BSSGP_ConnHdlrPars g_pars; |
| 239 | timer g_Tguard; |
| 240 | var LLC_Entities llc; |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 241 | |
| 242 | var ro_integer g_roi := {}; |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 243 | } |
| 244 | |
| 245 | type record SGSN_ConnHdlrNetworkPars { |
| 246 | boolean expect_ptmsi, |
| 247 | boolean expect_auth, |
| 248 | boolean expect_ciph |
| 249 | }; |
| 250 | |
| 251 | type record BSSGP_ConnHdlrPars { |
| 252 | /* IMEI of the simulated ME */ |
| 253 | hexstring imei, |
| 254 | /* IMSI of the simulated MS */ |
| 255 | hexstring imsi, |
| 256 | /* MSISDN of the simulated MS (probably unused) */ |
| 257 | hexstring msisdn, |
| 258 | /* P-TMSI allocated to the simulated MS */ |
| 259 | OCT4 p_tmsi optional, |
| 260 | OCT3 p_tmsi_sig optional, |
| 261 | /* TLLI of the simulated MS */ |
| 262 | OCT4 tlli, |
| 263 | OCT4 tlli_old optional, |
| 264 | RoutingAreaIdentificationV ra optional, |
Harald Welte | 16357a9 | 2020-11-17 18:20:00 +0100 | [diff] [blame] | 265 | GbInstances pcu, |
Harald Welte | 3dd21b3 | 2020-11-17 19:21:00 +0100 | [diff] [blame] | 266 | GbInstances sgsn, |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 267 | float t_guard |
| 268 | }; |
| 269 | |
| 270 | private function f_cellid_to_RAI(in BssgpCellId cell_id) return RoutingAreaIdentificationV { |
| 271 | /* mcc_mnc is encoded as of 24.008 10.5.5.15 */ |
| 272 | var BcdMccMnc mcc_mnc := cell_id.ra_id.lai.mcc_mnc; |
| 273 | |
| 274 | var RoutingAreaIdentificationV ret := { |
| 275 | mccDigit1 := mcc_mnc[0], |
| 276 | mccDigit2 := mcc_mnc[1], |
| 277 | mccDigit3 := mcc_mnc[2], |
| 278 | mncDigit3 := mcc_mnc[3], |
| 279 | mncDigit1 := mcc_mnc[4], |
| 280 | mncDigit2 := mcc_mnc[5], |
| 281 | lac := int2oct(cell_id.ra_id.lai.lac, 16), |
| 282 | rac := int2oct(cell_id.ra_id.rac, 8) |
| 283 | } |
| 284 | return ret; |
| 285 | }; |
| 286 | |
| 287 | private function f_init_gb_pcu(inout GbInstance gb, charstring id, integer offset) runs on test_CT { |
Harald Welte | b419d0e | 2020-11-16 16:45:05 +0100 | [diff] [blame] | 288 | var charstring ns_id := id & "-NS(PCU[" & int2str(offset) & "])"; |
| 289 | var charstring bssgp_id := id & "-BSSGP(PCU[" & int2str(offset) & "])"; |
| 290 | gb.vc_NS := NS_CT.create(ns_id); |
| 291 | gb.vc_BSSGP := BSSGP_CT.create(bssgp_id); |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 292 | /* connect lower end of BSSGP emulation with NS upper port */ |
| 293 | connect(gb.vc_BSSGP:BSCP, gb.vc_NS:NS_SP); |
| 294 | |
Harald Welte | b419d0e | 2020-11-16 16:45:05 +0100 | [diff] [blame] | 295 | gb.vc_NS.start(NSStart(mp_nsconfig_pcu[offset], ns_id)); |
| 296 | gb.vc_BSSGP.start(BssgpStart(gb.cfg, bssgp_id)); |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 297 | |
| 298 | for (var integer i := 0; i < lengthof(gb.cfg.bvc); i := i + 1) { |
| 299 | connect(self:PROC, gb.vc_BSSGP:PROC); |
| 300 | gb.vc_BSSGP_BVC[i] := f_bssgp_get_bvci_ct(gb.cfg.bvc[i].bvci, PROC); |
| 301 | disconnect(self:PROC, gb.vc_BSSGP:PROC); |
Harald Welte | fbae83f | 2020-11-15 23:25:55 +0100 | [diff] [blame] | 302 | connect(self:PCU_MGMT, gb.vc_BSSGP_BVC[i]:MGMT); |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 303 | } |
| 304 | } |
| 305 | |
| 306 | private function f_init_gb_sgsn(inout GbInstance gb, charstring id, integer offset) runs on test_CT { |
Harald Welte | b419d0e | 2020-11-16 16:45:05 +0100 | [diff] [blame] | 307 | var charstring ns_id := id & "-NS(SGSN[" & int2str(offset) & "])"; |
| 308 | var charstring bssgp_id := id & "-BSSGP(SGSN[" & int2str(offset) & "])"; |
| 309 | gb.vc_NS := NS_CT.create(ns_id); |
| 310 | gb.vc_BSSGP := BSSGP_CT.create(bssgp_id); |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 311 | /* connect lower end of BSSGP emulation with NS upper port */ |
| 312 | connect(gb.vc_BSSGP:BSCP, gb.vc_NS:NS_SP); |
| 313 | |
Harald Welte | b419d0e | 2020-11-16 16:45:05 +0100 | [diff] [blame] | 314 | gb.vc_NS.start(NSStart(mp_nsconfig_sgsn[offset], ns_id)); |
| 315 | gb.vc_BSSGP.start(BssgpStart(gb.cfg, bssgp_id)); |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 316 | |
| 317 | for (var integer i := 0; i < lengthof(gb.cfg.bvc); i := i + 1) { |
| 318 | connect(self:PROC, gb.vc_BSSGP:PROC); |
| 319 | gb.vc_BSSGP_BVC[i] := f_bssgp_get_bvci_ct(gb.cfg.bvc[i].bvci, PROC); |
| 320 | disconnect(self:PROC, gb.vc_BSSGP:PROC); |
Harald Welte | fbae83f | 2020-11-15 23:25:55 +0100 | [diff] [blame] | 321 | connect(self:SGSN_MGMT, gb.vc_BSSGP_BVC[i]:MGMT); |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 322 | } |
| 323 | } |
| 324 | |
| 325 | |
| 326 | private function f_init_vty() runs on test_CT { |
| 327 | map(self:GBPVTY, system:GBPVTY); |
| 328 | f_vty_set_prompts(GBPVTY); |
| 329 | f_vty_transceive(GBPVTY, "enable"); |
| 330 | } |
| 331 | |
Harald Welte | fbae83f | 2020-11-15 23:25:55 +0100 | [diff] [blame] | 332 | type record of integer ro_integer; |
| 333 | |
| 334 | private function ro_integer_contains(ro_integer r, integer x) return boolean { |
| 335 | for (var integer j := 0; j < lengthof(r); j := j+1) { |
| 336 | if (r[j] == x) { |
| 337 | return true; |
| 338 | } |
| 339 | } |
| 340 | return false; |
| 341 | } |
| 342 | |
Harald Welte | 6d63f74 | 2020-11-15 19:44:04 +0100 | [diff] [blame] | 343 | function f_init() runs on test_CT { |
Harald Welte | fbae83f | 2020-11-15 23:25:55 +0100 | [diff] [blame] | 344 | var ro_integer bvci_unblocked := {}; |
| 345 | var BssgpStatusIndication bsi; |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 346 | var integer i; |
| 347 | |
| 348 | if (g_initialized == true) { |
| 349 | return; |
| 350 | } |
| 351 | g_initialized := true; |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 352 | |
| 353 | g_sgsn[0].cfg := { |
Harald Welte | 6d63f74 | 2020-11-15 19:44:04 +0100 | [diff] [blame] | 354 | nsei := mp_nsconfig_sgsn[0].nsei, |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 355 | sgsn_role := true, |
Harald Welte | 6d63f74 | 2020-11-15 19:44:04 +0100 | [diff] [blame] | 356 | bvc := { } |
| 357 | } |
| 358 | for (i := 0; i < lengthof(mp_gbconfigs); i := i+1) { |
| 359 | g_pcu[i].cfg := mp_gbconfigs[i]; |
| 360 | /* concatenate all the PCU-side BVCs for the SGSN side */ |
| 361 | g_sgsn[0].cfg.bvc := g_sgsn[0].cfg.bvc & mp_gbconfigs[i].bvc; |
| 362 | } |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 363 | |
| 364 | f_init_vty(); |
Harald Welte | 6d63f74 | 2020-11-15 19:44:04 +0100 | [diff] [blame] | 365 | for (i := 0; i < lengthof(mp_nsconfig_sgsn); i := i+1) { |
Daniel Willmann | 443fc57 | 2020-11-18 13:26:57 +0100 | [diff] [blame] | 366 | f_vty_transceive(GBPVTY, "nsvc nsei " & int2str(g_sgsn[i].cfg.nsei) & " force-unconfigured"); |
Harald Welte | ea1ba59 | 2020-11-17 18:05:13 +0100 | [diff] [blame] | 367 | f_init_gb_sgsn(g_sgsn[i], "GbProxy_Test", i); |
Harald Welte | 6d63f74 | 2020-11-15 19:44:04 +0100 | [diff] [blame] | 368 | } |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 369 | f_sleep(4.0); |
Harald Welte | 6d63f74 | 2020-11-15 19:44:04 +0100 | [diff] [blame] | 370 | for (i := 0; i < lengthof(mp_nsconfig_pcu); i := i+1) { |
Harald Welte | b419d0e | 2020-11-16 16:45:05 +0100 | [diff] [blame] | 371 | f_init_gb_pcu(g_pcu[i], "GbProxy_Test", i); |
Harald Welte | 6d63f74 | 2020-11-15 19:44:04 +0100 | [diff] [blame] | 372 | } |
Harald Welte | fbae83f | 2020-11-15 23:25:55 +0100 | [diff] [blame] | 373 | |
| 374 | /* wait until all BVC are unblocked on both sides */ |
Harald Welte | d280127 | 2020-11-17 19:22:58 +0100 | [diff] [blame] | 375 | timer T := 15.0; |
Harald Welte | fbae83f | 2020-11-15 23:25:55 +0100 | [diff] [blame] | 376 | T.start; |
| 377 | alt { |
| 378 | [] SGSN_MGMT.receive(BssgpStatusIndication:{*, ?, BVC_S_UNBLOCKED}) -> value bsi { |
| 379 | bvci_unblocked := bvci_unblocked & { bsi.bvci }; |
| 380 | if (lengthof(bvci_unblocked) != lengthof(g_sgsn[0].cfg.bvc)) { |
| 381 | repeat; |
| 382 | } |
| 383 | } |
| 384 | [] SGSN_MGMT.receive(BssgpStatusIndication:{*, ?, ?}) { |
| 385 | repeat; |
| 386 | } |
| 387 | [] SGSN_MGMT.receive { |
| 388 | setverdict(fail, "Received unexpected message on SGSN_MGMT"); |
| 389 | mtc.stop; |
| 390 | } |
| 391 | |
| 392 | [] PCU_MGMT.receive(BssgpStatusIndication:{*, ?, BVC_S_UNBLOCKED}) -> value bsi { |
| 393 | repeat; |
| 394 | } |
| 395 | [] PCU_MGMT.receive(BssgpStatusIndication:{*, ?, ?}) { |
| 396 | repeat; |
| 397 | } |
| 398 | [] PCU_MGMT.receive(BssgpResetIndication:{0}) { |
| 399 | repeat; |
| 400 | } |
| 401 | [] PCU_MGMT.receive { |
| 402 | setverdict(fail, "Received unexpected message on PCU_MGMT"); |
| 403 | mtc.stop; |
| 404 | } |
| 405 | |
| 406 | [] T.timeout { |
| 407 | setverdict(fail, "Timeout waiting for unblock of all BVCs"); |
| 408 | mtc.stop; |
| 409 | } |
| 410 | } |
| 411 | |
| 412 | /* iterate over list and check all BVCI */ |
| 413 | for (i := 0; i < lengthof(g_sgsn[0].cfg.bvc); i := i+1) { |
| 414 | var BssgpBvci bvci := g_sgsn[0].cfg.bvc[i].bvci; |
| 415 | if (not ro_integer_contains(bvci_unblocked, bvci)) { |
| 416 | setverdict(fail, "BVCI=", bvci, " was not unblocked during start-up"); |
| 417 | mtc.stop; |
| 418 | } |
| 419 | } |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 420 | } |
| 421 | |
| 422 | function f_cleanup() runs on test_CT { |
| 423 | self.stop; |
| 424 | } |
| 425 | |
| 426 | type function void_fn(charstring id) runs on BSSGP_ConnHdlr; |
| 427 | |
| 428 | /* helper function to create, connect and start a BSSGP_ConnHdlr component */ |
Harald Welte | 6d63f74 | 2020-11-15 19:44:04 +0100 | [diff] [blame] | 429 | function f_start_handler(void_fn fn, charstring id, GbInstances pcu, GbInstances sgsn, integer imsi_suffix, |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 430 | float t_guard := 30.0) |
| 431 | runs on test_CT return BSSGP_ConnHdlr { |
| 432 | var BSSGP_ConnHdlr vc_conn; |
| 433 | |
| 434 | var BSSGP_ConnHdlrPars pars := { |
| 435 | imei := f_gen_imei(imsi_suffix), |
| 436 | imsi := f_gen_imsi(imsi_suffix), |
| 437 | msisdn := f_gen_msisdn(imsi_suffix), |
| 438 | p_tmsi := omit, |
| 439 | p_tmsi_sig := omit, |
| 440 | tlli := f_gprs_tlli_random(), |
| 441 | tlli_old := omit, |
| 442 | ra := omit, |
Harald Welte | 16357a9 | 2020-11-17 18:20:00 +0100 | [diff] [blame] | 443 | pcu := g_pcu, |
Harald Welte | 3dd21b3 | 2020-11-17 19:21:00 +0100 | [diff] [blame] | 444 | sgsn := g_sgsn, |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 445 | t_guard := t_guard |
| 446 | }; |
| 447 | |
| 448 | vc_conn := BSSGP_ConnHdlr.create(id); |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 449 | |
| 450 | vc_conn.start(f_handler_init(fn, id, pars)); |
| 451 | return vc_conn; |
| 452 | } |
| 453 | |
Harald Welte | 3dd21b3 | 2020-11-17 19:21:00 +0100 | [diff] [blame] | 454 | /* Connect the PCU-side per-BVC ports (PCU/PCU_SIG/PCU_PROC) array slot 'port_idx' to specified per-BVC component */ |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 455 | private function f_connect_to_pcu_bvc(integer port_idx, integer nse_idx, integer bvc_idx) |
| 456 | runs on BSSGP_ConnHdlr { |
| 457 | var BSSGP_BVC_CT bvc_ct := g_pars.pcu[nse_idx].vc_BSSGP_BVC[bvc_idx] |
Harald Welte | 3dd21b3 | 2020-11-17 19:21:00 +0100 | [diff] [blame] | 458 | if (PCU[port_idx].checkstate("Connected")) { |
| 459 | /* unregister + disconnect from old BVC */ |
| 460 | f_client_unregister(g_pars.imsi, PCU_PROC[port_idx]); |
| 461 | disconnect(self:PCU[port_idx], pcu_ct[port_idx]:BSSGP_SP); |
| 462 | disconnect(self:PCU_SIG[port_idx], pcu_ct[port_idx]:BSSGP_SP_SIG); |
| 463 | disconnect(self:PCU_PROC[port_idx], pcu_ct[port_idx]:BSSGP_PROC); |
| 464 | } |
| 465 | /* connect to new BVC and register us */ |
| 466 | connect(self:PCU[port_idx], bvc_ct:BSSGP_SP); |
| 467 | connect(self:PCU_SIG[port_idx], bvc_ct:BSSGP_SP_SIG); |
| 468 | connect(self:PCU_PROC[port_idx], bvc_ct:BSSGP_PROC); |
| 469 | f_client_register(g_pars.imsi, g_pars.tlli, PCU_PROC[port_idx]); |
| 470 | pcu_ct[port_idx] := bvc_ct; |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 471 | pcu_bvc_cfg[port_idx] := g_pars.pcu[nse_idx].cfg.bvc[bvc_idx]; |
Harald Welte | 3dd21b3 | 2020-11-17 19:21:00 +0100 | [diff] [blame] | 472 | } |
| 473 | |
| 474 | /* Connect the SGSN-side per-BVC ports (SGSN/SGSN_SIG/SGSN_PROC) array slot 'port_idx' to specified per-BVC component */ |
| 475 | private function f_connect_to_sgsn_bvc(integer port_idx, BSSGP_BVC_CT bvc_ct) runs on BSSGP_ConnHdlr { |
| 476 | if (SGSN[port_idx].checkstate("Connected")) { |
| 477 | /* unregister + disconnect from old BVC */ |
| 478 | f_client_unregister(g_pars.imsi, SGSN_PROC[port_idx]); |
| 479 | disconnect(self:SGSN[port_idx], sgsn_ct[port_idx]:BSSGP_SP); |
| 480 | disconnect(self:SGSN_SIG[port_idx], sgsn_ct[port_idx]:BSSGP_SP_SIG); |
| 481 | disconnect(self:SGSN_PROC[port_idx], sgsn_ct[port_idx]:BSSGP_PROC); |
| 482 | } |
| 483 | /* connect to new BVC and register us */ |
| 484 | connect(self:SGSN[port_idx], bvc_ct:BSSGP_SP); |
| 485 | connect(self:SGSN_SIG[port_idx], bvc_ct:BSSGP_SP_SIG); |
| 486 | connect(self:SGSN_PROC[port_idx], bvc_ct:BSSGP_PROC); |
| 487 | f_client_register(g_pars.imsi, g_pars.tlli, SGSN_PROC[port_idx]); |
| 488 | sgsn_ct[port_idx] := bvc_ct; |
| 489 | } |
| 490 | |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 491 | private altstep as_Tguard() runs on BSSGP_ConnHdlr { |
| 492 | [] g_Tguard.timeout { |
| 493 | setverdict(fail, "Tguard timeout"); |
| 494 | mtc.stop; |
| 495 | } |
| 496 | } |
| 497 | |
| 498 | /* first function called in every ConnHdlr */ |
| 499 | private function f_handler_init(void_fn fn, charstring id, BSSGP_ConnHdlrPars pars) |
| 500 | runs on BSSGP_ConnHdlr { |
Harald Welte | 1e834f3 | 2020-11-15 20:02:59 +0100 | [diff] [blame] | 501 | var integer i; |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 502 | /* do some common stuff like setting up g_pars */ |
| 503 | g_pars := pars; |
| 504 | |
| 505 | llc := f_llc_create(false); |
| 506 | |
Harald Welte | 3dd21b3 | 2020-11-17 19:21:00 +0100 | [diff] [blame] | 507 | /* default connections on PCU side: First BVC of each NSE/PCU */ |
| 508 | for (i := 0; i < lengthof(g_pars.pcu); i := i+1) { |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 509 | f_connect_to_pcu_bvc(port_idx := i, nse_idx := i, bvc_idx := 0); |
Harald Welte | 1e834f3 | 2020-11-15 20:02:59 +0100 | [diff] [blame] | 510 | } |
Harald Welte | 3dd21b3 | 2020-11-17 19:21:00 +0100 | [diff] [blame] | 511 | |
| 512 | /* default connections on SGSN side: First BVC of each NSE/SGSN */ |
| 513 | for (i := 0; i < lengthof(g_pars.sgsn); i := i+1) { |
| 514 | f_connect_to_sgsn_bvc(i, g_pars.sgsn[i].vc_BSSGP_BVC[0]); |
Harald Welte | 1e834f3 | 2020-11-15 20:02:59 +0100 | [diff] [blame] | 515 | } |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 516 | |
| 517 | g_Tguard.start(pars.t_guard); |
| 518 | activate(as_Tguard()); |
| 519 | |
| 520 | /* call the user-supplied test case function */ |
| 521 | fn.apply(id); |
| 522 | } |
| 523 | |
Harald Welte | 1e834f3 | 2020-11-15 20:02:59 +0100 | [diff] [blame] | 524 | private function f_client_register(hexstring imsi, OCT4 tlli, BSSGP_PROC_PT PT) |
| 525 | runs on BSSGP_ConnHdlr { |
| 526 | PT.call(BSSGP_register_client:{imsi, tlli}) { |
| 527 | [] PT.getreply(BSSGP_register_client:{imsi, tlli}) {}; |
| 528 | } |
| 529 | } |
| 530 | |
| 531 | private function f_client_unregister(hexstring imsi, BSSGP_PROC_PT PT) |
| 532 | runs on BSSGP_ConnHdlr { |
| 533 | PT.call(BSSGP_unregister_client:{imsi}) { |
| 534 | [] PT.getreply(BSSGP_unregister_client:{imsi}) {}; |
| 535 | } |
| 536 | } |
| 537 | |
Harald Welte | 22ef5d9 | 2020-11-16 13:35:14 +0100 | [diff] [blame] | 538 | /* Send 'tx' on PTP-BVCI from PCU; expect 'rx' on SGSN */ |
| 539 | friend function f_pcu2sgsn(template (value) PDU_BSSGP tx, template (present) PDU_BSSGP exp_rx, |
Daniel Willmann | 4798fd7 | 2020-11-24 16:23:29 +0100 | [diff] [blame] | 540 | integer pcu_idx := 0, integer sgsn_idx := 0, boolean use_sig := false) runs on BSSGP_ConnHdlr { |
Harald Welte | 22ef5d9 | 2020-11-16 13:35:14 +0100 | [diff] [blame] | 541 | var PDU_BSSGP rx; |
| 542 | timer T := 1.0; |
| 543 | |
Daniel Willmann | 4798fd7 | 2020-11-24 16:23:29 +0100 | [diff] [blame] | 544 | if (use_sig) { |
| 545 | PCU_SIG[pcu_idx].send(tx); |
| 546 | } else { |
| 547 | PCU[pcu_idx].send(tx); |
| 548 | } |
| 549 | |
Harald Welte | 22ef5d9 | 2020-11-16 13:35:14 +0100 | [diff] [blame] | 550 | T.start; |
| 551 | alt { |
Daniel Willmann | 4798fd7 | 2020-11-24 16:23:29 +0100 | [diff] [blame] | 552 | [use_sig] SGSN_SIG[sgsn_idx].receive(exp_rx) { |
| 553 | setverdict(pass); |
| 554 | } |
| 555 | [not use_sig] SGSN[sgsn_idx].receive(exp_rx) { |
Harald Welte | 22ef5d9 | 2020-11-16 13:35:14 +0100 | [diff] [blame] | 556 | setverdict(pass); |
| 557 | } |
| 558 | [] SGSN[sgsn_idx].receive(PDU_BSSGP:?) -> value rx { |
| 559 | setverdict(fail, "Unexpected BSSGP on SGSN side: ", rx); |
| 560 | mtc.stop; |
| 561 | } |
Daniel Willmann | 4798fd7 | 2020-11-24 16:23:29 +0100 | [diff] [blame] | 562 | [] SGSN_SIG[sgsn_idx].receive(PDU_BSSGP:?) -> value rx { |
| 563 | setverdict(fail, "Unexpected SIG BSSGP on SGSN side: ", rx); |
| 564 | mtc.stop; |
| 565 | } |
Harald Welte | 22ef5d9 | 2020-11-16 13:35:14 +0100 | [diff] [blame] | 566 | [] T.timeout { |
| 567 | setverdict(fail, "Timeout waiting for BSSGP on SGSN side: ", rx); |
| 568 | mtc.stop; |
| 569 | } |
| 570 | } |
| 571 | } |
| 572 | |
| 573 | /* Send 'tx' on PTP-BVCI from SGSN; expect 'rx' on PCU */ |
| 574 | friend function f_sgsn2pcu(template (value) PDU_BSSGP tx, template (present) PDU_BSSGP exp_rx, |
Daniel Willmann | 4798fd7 | 2020-11-24 16:23:29 +0100 | [diff] [blame] | 575 | integer sgsn_idx:= 0, integer pcu_idx := 0, boolean use_sig := false) runs on BSSGP_ConnHdlr { |
Harald Welte | 22ef5d9 | 2020-11-16 13:35:14 +0100 | [diff] [blame] | 576 | var PDU_BSSGP rx; |
| 577 | timer T := 1.0; |
| 578 | |
Daniel Willmann | 4798fd7 | 2020-11-24 16:23:29 +0100 | [diff] [blame] | 579 | if (use_sig) { |
| 580 | SGSN_SIG[sgsn_idx].send(tx); |
| 581 | } else { |
| 582 | SGSN[sgsn_idx].send(tx); |
| 583 | } |
| 584 | |
Harald Welte | 22ef5d9 | 2020-11-16 13:35:14 +0100 | [diff] [blame] | 585 | T.start; |
| 586 | alt { |
Daniel Willmann | 4798fd7 | 2020-11-24 16:23:29 +0100 | [diff] [blame] | 587 | [use_sig] PCU_SIG[pcu_idx].receive(exp_rx) { |
| 588 | setverdict(pass); |
| 589 | } |
| 590 | [not use_sig] PCU[pcu_idx].receive(exp_rx) { |
Harald Welte | 22ef5d9 | 2020-11-16 13:35:14 +0100 | [diff] [blame] | 591 | setverdict(pass); |
| 592 | } |
| 593 | [] PCU[pcu_idx].receive(PDU_BSSGP:?) -> value rx { |
| 594 | setverdict(fail, "Unexpected BSSGP on PCU side: ", rx); |
| 595 | mtc.stop; |
| 596 | } |
Daniel Willmann | 4798fd7 | 2020-11-24 16:23:29 +0100 | [diff] [blame] | 597 | [] PCU_SIG[pcu_idx].receive(PDU_BSSGP:?) -> value rx { |
| 598 | setverdict(fail, "Unexpected SIG BSSGP on PCU side: ", rx); |
| 599 | mtc.stop; |
| 600 | } |
Harald Welte | 22ef5d9 | 2020-11-16 13:35:14 +0100 | [diff] [blame] | 601 | [] T.timeout { |
| 602 | setverdict(fail, "Timeout waiting for BSSGP on PCU side: ", rx); |
| 603 | mtc.stop; |
| 604 | } |
| 605 | } |
| 606 | } |
Harald Welte | 1e834f3 | 2020-11-15 20:02:59 +0100 | [diff] [blame] | 607 | |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 608 | /* TODO: |
| 609 | * Detach without Attach |
| 610 | * SM procedures without attach / RAU |
| 611 | * ATTACH / RAU |
| 612 | ** with / without authentication |
| 613 | ** with / without P-TMSI allocation |
| 614 | * re-transmissions of LLC frames |
| 615 | * PDP Context activation |
| 616 | ** with different GGSN config in SGSN VTY |
| 617 | ** with different PDP context type (v4/v6/v46) |
| 618 | ** timeout from GGSN |
| 619 | ** multiple / secondary PDP context |
| 620 | */ |
| 621 | |
| 622 | private function f_TC_BVC_bringup(charstring id) runs on BSSGP_ConnHdlr { |
| 623 | f_sleep(5.0); |
| 624 | setverdict(pass); |
| 625 | } |
| 626 | |
| 627 | testcase TC_BVC_bringup() runs on test_CT { |
| 628 | var BSSGP_ConnHdlr vc_conn; |
| 629 | f_init(); |
| 630 | |
| 631 | vc_conn := f_start_handler(refers(f_TC_BVC_bringup), testcasename(), g_pcu, g_sgsn, 51); |
| 632 | vc_conn.done; |
| 633 | |
| 634 | f_cleanup(); |
| 635 | } |
| 636 | |
| 637 | friend function f_bssgp_suspend(integer ran_idx := 0) runs on BSSGP_ConnHdlr return OCT1 { |
Harald Welte | 16357a9 | 2020-11-17 18:20:00 +0100 | [diff] [blame] | 638 | var BssgpBvcConfig bvcc := g_pars.pcu[ran_idx].cfg.bvc[0]; |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 639 | timer T := 5.0; |
| 640 | var PDU_BSSGP rx_pdu; |
Harald Welte | 16357a9 | 2020-11-17 18:20:00 +0100 | [diff] [blame] | 641 | PCU_SIG[ran_idx].send(ts_BSSGP_SUSPEND(g_pars.tlli, bvcc.cell_id.ra_id)); |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 642 | T.start; |
| 643 | alt { |
Harald Welte | 16357a9 | 2020-11-17 18:20:00 +0100 | [diff] [blame] | 644 | [] PCU_SIG[ran_idx].receive(tr_BSSGP_SUSPEND_ACK(g_pars.tlli, bvcc.cell_id.ra_id, ?)) -> value rx_pdu { |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 645 | return rx_pdu.pDU_BSSGP_SUSPEND_ACK.suspend_Reference_Number.suspend_Reference_Number_value; |
| 646 | } |
Harald Welte | 16357a9 | 2020-11-17 18:20:00 +0100 | [diff] [blame] | 647 | [] PCU_SIG[ran_idx].receive(tr_BSSGP_SUSPEND_NACK(g_pars.tlli, bvcc.cell_id.ra_id, ?)) -> value rx_pdu { |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 648 | setverdict(fail, "SUSPEND-NACK in response to SUSPEND for TLLI ", g_pars.tlli); |
| 649 | mtc.stop; |
| 650 | } |
| 651 | [] T.timeout { |
| 652 | setverdict(fail, "No SUSPEND-ACK in response to SUSPEND for TLLI ", g_pars.tlli); |
| 653 | mtc.stop; |
| 654 | } |
| 655 | } |
| 656 | return '00'O; |
| 657 | } |
| 658 | |
| 659 | friend function f_bssgp_resume(OCT1 susp_ref, integer ran_idx := 0) runs on BSSGP_ConnHdlr { |
Harald Welte | 16357a9 | 2020-11-17 18:20:00 +0100 | [diff] [blame] | 660 | var BssgpBvcConfig bvcc := g_pars.pcu[ran_idx].cfg.bvc[0]; |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 661 | timer T := 5.0; |
Harald Welte | 16357a9 | 2020-11-17 18:20:00 +0100 | [diff] [blame] | 662 | PCU_SIG[ran_idx].send(ts_BSSGP_RESUME(g_pars.tlli, bvcc.cell_id.ra_id, susp_ref)); |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 663 | T.start; |
| 664 | alt { |
Harald Welte | 16357a9 | 2020-11-17 18:20:00 +0100 | [diff] [blame] | 665 | [] PCU_SIG[ran_idx].receive(tr_BSSGP_RESUME_ACK(g_pars.tlli, bvcc.cell_id.ra_id)); |
| 666 | [] PCU_SIG[ran_idx].receive(tr_BSSGP_RESUME_NACK(g_pars.tlli, bvcc.cell_id.ra_id, ?)) { |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 667 | setverdict(fail, "RESUME-NACK in response to RESUME for TLLI ", g_pars.tlli); |
| 668 | mtc.stop; |
| 669 | } |
| 670 | [] T.timeout { |
| 671 | setverdict(fail, "No RESUME-ACK in response to SUSPEND for TLLI ", g_pars.tlli); |
| 672 | mtc.stop; |
| 673 | } |
| 674 | } |
| 675 | } |
| 676 | |
| 677 | |
Harald Welte | 9268601 | 2020-11-15 21:45:49 +0100 | [diff] [blame] | 678 | /* send uplink-unitdata of a variety of different sizes; expect it to show up on SGSN */ |
| 679 | private function f_TC_ul_unitdata(charstring id) runs on BSSGP_ConnHdlr { |
Harald Welte | 16357a9 | 2020-11-17 18:20:00 +0100 | [diff] [blame] | 680 | var integer ran_idx := 0; |
| 681 | var BssgpBvcConfig bvcc := g_pars.pcu[ran_idx].cfg.bvc[0]; |
Harald Welte | 9268601 | 2020-11-15 21:45:49 +0100 | [diff] [blame] | 682 | var integer i; |
| 683 | |
| 684 | for (i := 0; i < 1024; i := i+1) { |
| 685 | var octetstring payload := f_rnd_octstring(i); |
Harald Welte | 16357a9 | 2020-11-17 18:20:00 +0100 | [diff] [blame] | 686 | var template (value) PDU_BSSGP pdu_tx := ts_BSSGP_UL_UD(g_pars.tlli, bvcc.cell_id, payload); |
Harald Welte | 9268601 | 2020-11-15 21:45:49 +0100 | [diff] [blame] | 687 | /* we cannot use pdu_tx as there are some subtle differences in the length field :/ */ |
Harald Welte | 16357a9 | 2020-11-17 18:20:00 +0100 | [diff] [blame] | 688 | var template (present) PDU_BSSGP pdu_rx := tr_BSSGP_UL_UD(g_pars.tlli, bvcc.cell_id, payload); |
Harald Welte | 9268601 | 2020-11-15 21:45:49 +0100 | [diff] [blame] | 689 | |
Harald Welte | 22ef5d9 | 2020-11-16 13:35:14 +0100 | [diff] [blame] | 690 | f_pcu2sgsn(pdu_tx, pdu_rx); |
Harald Welte | 9268601 | 2020-11-15 21:45:49 +0100 | [diff] [blame] | 691 | } |
| 692 | setverdict(pass); |
| 693 | } |
| 694 | |
| 695 | testcase TC_ul_unitdata() runs on test_CT |
| 696 | { |
| 697 | var BSSGP_ConnHdlr vc_conn; |
| 698 | f_init(); |
| 699 | |
| 700 | vc_conn := f_start_handler(refers(f_TC_ul_unitdata), testcasename(), g_pcu, g_sgsn, 1); |
| 701 | vc_conn.done; |
| 702 | /* TODO: start multiple handlers (UEs) on various cells on same and other NSEs */ |
| 703 | |
| 704 | f_cleanup(); |
| 705 | } |
| 706 | |
Harald Welte | 78d8db9 | 2020-11-15 23:27:27 +0100 | [diff] [blame] | 707 | /* send downlink-unitdata of a variety of different sizes; expect it to show up on PCU */ |
| 708 | private function f_TC_dl_unitdata(charstring id) runs on BSSGP_ConnHdlr { |
| 709 | var integer i; |
| 710 | |
| 711 | for (i := 0; i < 1024; i := i+1) { |
| 712 | var octetstring payload := f_rnd_octstring(i); |
| 713 | var template (value) PDU_BSSGP pdu_tx := |
| 714 | ts_BSSGP_DL_UD(g_pars.tlli, payload, omit, ts_BSSGP_IMSI(g_pars.imsi)); |
| 715 | /* we cannot use pdu_tx as there are some subtle differences in the length field :/ */ |
| 716 | var template (present) PDU_BSSGP pdu_rx := |
| 717 | tr_BSSGP_DL_UD(g_pars.tlli, payload, tr_BSSGP_IMSI(g_pars.imsi)); |
| 718 | |
Harald Welte | 22ef5d9 | 2020-11-16 13:35:14 +0100 | [diff] [blame] | 719 | f_sgsn2pcu(pdu_tx, pdu_rx); |
Harald Welte | 78d8db9 | 2020-11-15 23:27:27 +0100 | [diff] [blame] | 720 | } |
| 721 | setverdict(pass); |
| 722 | } |
| 723 | |
| 724 | testcase TC_dl_unitdata() runs on test_CT |
| 725 | { |
| 726 | var BSSGP_ConnHdlr vc_conn; |
| 727 | f_init(); |
| 728 | |
| 729 | vc_conn := f_start_handler(refers(f_TC_dl_unitdata), testcasename(), g_pcu, g_sgsn, 2); |
| 730 | vc_conn.done; |
| 731 | /* TODO: start multiple handlers (UEs) on various cells on same and other NSEs */ |
| 732 | |
| 733 | f_cleanup(); |
| 734 | } |
Harald Welte | 9268601 | 2020-11-15 21:45:49 +0100 | [diff] [blame] | 735 | |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 736 | private function f_TC_ra_capability(charstring id) runs on BSSGP_ConnHdlr { |
| 737 | var integer i; |
| 738 | |
| 739 | for (i := 0; i < 10; i := i+1) { |
| 740 | var template (value) PDU_BSSGP pdu_tx := ts_BSSGP_RA_CAP(g_pars.tlli, { ts_RaCapRec_BSSGP }); |
| 741 | /* we cannot use pdu_tx as there are some subtle differences in the length field :/ */ |
| 742 | var template (present) PDU_BSSGP pdu_rx := tr_BSSGP_RA_CAP(g_pars.tlli, { tr_RaCapRec_BSSGP }) |
| 743 | |
Harald Welte | 22ef5d9 | 2020-11-16 13:35:14 +0100 | [diff] [blame] | 744 | f_sgsn2pcu(pdu_tx, pdu_rx); |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 745 | } |
| 746 | setverdict(pass); |
| 747 | } |
| 748 | testcase TC_ra_capability() runs on test_CT |
| 749 | { |
| 750 | var BSSGP_ConnHdlr vc_conn; |
| 751 | f_init(); |
| 752 | |
| 753 | vc_conn := f_start_handler(refers(f_TC_ra_capability), testcasename(), g_pcu, g_sgsn, 3); |
| 754 | vc_conn.done; |
| 755 | /* TODO: start multiple handlers (UEs) on various cells on same and other NSEs */ |
| 756 | |
| 757 | f_cleanup(); |
| 758 | } |
| 759 | |
Daniel Willmann | ace3ece | 2020-11-16 19:53:26 +0100 | [diff] [blame] | 760 | private function f_TC_ra_capability_upd(charstring id) runs on BSSGP_ConnHdlr { |
| 761 | var integer i; |
| 762 | var OCT1 tag; |
| 763 | for (i := 0; i < 10; i := i+1) { |
| 764 | tag := int2oct(23 + i, 1); |
| 765 | var template (value) PDU_BSSGP pdu_tx := ts_BSSGP_RA_CAP_UPD(g_pars.tlli, tag); |
| 766 | /* we cannot use pdu_tx as there are some subtle differences in the length field :/ */ |
| 767 | var template (present) PDU_BSSGP pdu_rx := tr_BSSGP_RA_CAP_UPD(g_pars.tlli, tag) |
| 768 | |
| 769 | f_pcu2sgsn(pdu_tx, pdu_rx); |
| 770 | |
| 771 | pdu_tx := ts_BSSGP_RA_CAP_UPD_ACK(g_pars.tlli, tag, '42'O); |
| 772 | /* we cannot use pdu_tx as there are some subtle differences in the length field :/ */ |
| 773 | pdu_rx := tr_BSSGP_RA_CAP_UPD_ACK(g_pars.tlli, tag, '42'O) |
| 774 | |
| 775 | f_sgsn2pcu(pdu_tx, pdu_rx); |
| 776 | } |
| 777 | setverdict(pass); |
| 778 | } |
| 779 | testcase TC_ra_capability_upd() runs on test_CT |
| 780 | { |
| 781 | var BSSGP_ConnHdlr vc_conn; |
| 782 | f_init(); |
| 783 | |
Daniel Willmann | 54833f2 | 2020-11-19 15:43:52 +0100 | [diff] [blame] | 784 | vc_conn := f_start_handler(refers(f_TC_ra_capability_upd), testcasename(), g_pcu, g_sgsn, 4); |
Daniel Willmann | ace3ece | 2020-11-16 19:53:26 +0100 | [diff] [blame] | 785 | vc_conn.done; |
| 786 | /* TODO: start multiple handlers (UEs) on various cells on same and other NSEs */ |
| 787 | |
| 788 | f_cleanup(); |
| 789 | } |
| 790 | |
Daniel Willmann | 165d661 | 2020-11-19 14:27:29 +0100 | [diff] [blame] | 791 | private function f_TC_radio_status(charstring id) runs on BSSGP_ConnHdlr { |
| 792 | var integer i; |
| 793 | var BssgpRadioCause cause := BSSGP_RADIO_CAUSE_CONTACT_LOST; |
| 794 | for (i := 0; i < 10; i := i+1) { |
| 795 | var template (value) PDU_BSSGP pdu_tx := ts_BSSGP_RADIO_STATUS(g_pars.tlli, cause); |
| 796 | /* we cannot use pdu_tx as there are some subtle differences in the length field :/ */ |
| 797 | var template (present) PDU_BSSGP pdu_rx := tr_BSSGP_RADIO_STATUS(g_pars.tlli, cause) |
| 798 | |
| 799 | f_pcu2sgsn(pdu_tx, pdu_rx); |
| 800 | } |
| 801 | setverdict(pass); |
| 802 | } |
| 803 | testcase TC_radio_status() runs on test_CT |
| 804 | { |
| 805 | var BSSGP_ConnHdlr vc_conn; |
| 806 | f_init(); |
| 807 | |
Daniel Willmann | 54833f2 | 2020-11-19 15:43:52 +0100 | [diff] [blame] | 808 | vc_conn := f_start_handler(refers(f_TC_radio_status), testcasename(), g_pcu, g_sgsn, 5); |
Daniel Willmann | 165d661 | 2020-11-19 14:27:29 +0100 | [diff] [blame] | 809 | vc_conn.done; |
| 810 | /* TODO: start multiple handlers (UEs) on various cells on same and other NSEs */ |
| 811 | |
| 812 | f_cleanup(); |
| 813 | } |
| 814 | |
Daniel Willmann | fa67f49 | 2020-11-19 15:48:05 +0100 | [diff] [blame] | 815 | private function f_TC_suspend(charstring id) runs on BSSGP_ConnHdlr { |
| 816 | var integer i; |
Daniel Willmann | 165d661 | 2020-11-19 14:27:29 +0100 | [diff] [blame] | 817 | |
Daniel Willmann | fa67f49 | 2020-11-19 15:48:05 +0100 | [diff] [blame] | 818 | /* TODO: Generate RA ID for each ConnHdlr */ |
| 819 | var RoutingAreaIdentification ra_id := g_pars.pcu[0].cfg.bvc[0].cell_id.ra_id; |
| 820 | for (i := 0; i < 10; i := i+1) { |
| 821 | |
| 822 | var template (value) PDU_BSSGP pdu_tx := ts_BSSGP_SUSPEND(g_pars.tlli, ra_id); |
| 823 | /* we cannot use pdu_tx as there are some subtle differences in the length field :/ */ |
| 824 | var template (present) PDU_BSSGP pdu_rx := tr_BSSGP_SUSPEND(g_pars.tlli, ra_id); |
| 825 | |
| 826 | f_pcu2sgsn(pdu_tx, pdu_rx); |
| 827 | |
| 828 | pdu_tx := ts_BSSGP_SUSPEND_ACK(g_pars.tlli, ra_id, int2oct(i, 1)); |
| 829 | /* we cannot use pdu_tx as there are some subtle differences in the length field :/ */ |
| 830 | pdu_rx := tr_BSSGP_SUSPEND_ACK(g_pars.tlli, ra_id, int2oct(i, 1)); |
| 831 | |
| 832 | f_sgsn2pcu(pdu_tx, pdu_rx); |
| 833 | |
| 834 | /* These messages are simple passed through so just also test sending NACK */ |
| 835 | pdu_tx := ts_BSSGP_SUSPEND_NACK(g_pars.tlli, ra_id, BSSGP_CAUSE_UNKNOWN_MS); |
| 836 | /* we cannot use pdu_tx as there are some subtle differences in the length field :/ */ |
| 837 | pdu_rx := tr_BSSGP_SUSPEND_NACK(g_pars.tlli, ra_id, BSSGP_CAUSE_UNKNOWN_MS); |
| 838 | |
| 839 | f_sgsn2pcu(pdu_tx, pdu_rx); |
| 840 | } |
| 841 | setverdict(pass); |
| 842 | } |
| 843 | testcase TC_suspend() runs on test_CT |
| 844 | { |
| 845 | var BSSGP_ConnHdlr vc_conn; |
| 846 | f_init(); |
| 847 | |
| 848 | vc_conn := f_start_handler(refers(f_TC_suspend), testcasename(), g_pcu, g_sgsn, 6); |
| 849 | vc_conn.done; |
| 850 | /* TODO: start multiple handlers (UEs) on various cells on same and other NSEs */ |
| 851 | |
| 852 | f_cleanup(); |
| 853 | } |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 854 | |
Daniel Willmann | 087a33d | 2020-11-19 15:58:43 +0100 | [diff] [blame] | 855 | private function f_TC_resume(charstring id) runs on BSSGP_ConnHdlr { |
| 856 | var integer i; |
| 857 | |
| 858 | /* TODO: Generate RA ID for each ConnHdlr */ |
| 859 | var RoutingAreaIdentification ra_id := g_pars.pcu[0].cfg.bvc[0].cell_id.ra_id; |
| 860 | for (i := 0; i < 10; i := i+1) { |
| 861 | |
| 862 | var template (value) PDU_BSSGP pdu_tx := ts_BSSGP_RESUME(g_pars.tlli, ra_id, int2oct(i, 1)); |
| 863 | /* we cannot use pdu_tx as there are some subtle differences in the length field :/ */ |
| 864 | var template (present) PDU_BSSGP pdu_rx := tr_BSSGP_RESUME(g_pars.tlli, ra_id, int2oct(i, 1)); |
| 865 | |
| 866 | f_pcu2sgsn(pdu_tx, pdu_rx); |
| 867 | |
| 868 | pdu_tx := ts_BSSGP_RESUME_ACK(g_pars.tlli, ra_id); |
| 869 | /* we cannot use pdu_tx as there are some subtle differences in the length field :/ */ |
| 870 | pdu_rx := tr_BSSGP_RESUME_ACK(g_pars.tlli, ra_id); |
| 871 | |
| 872 | f_sgsn2pcu(pdu_tx, pdu_rx); |
| 873 | |
| 874 | /* These messages are simple passed through so just also test sending NACK */ |
| 875 | pdu_tx := ts_BSSGP_RESUME_NACK(g_pars.tlli, ra_id, BSSGP_CAUSE_UNKNOWN_MS); |
| 876 | /* we cannot use pdu_tx as there are some subtle differences in the length field :/ */ |
| 877 | pdu_rx := tr_BSSGP_RESUME_NACK(g_pars.tlli, ra_id, BSSGP_CAUSE_UNKNOWN_MS); |
| 878 | |
| 879 | f_sgsn2pcu(pdu_tx, pdu_rx); |
| 880 | } |
| 881 | setverdict(pass); |
| 882 | } |
| 883 | testcase TC_resume() runs on test_CT |
| 884 | { |
| 885 | var BSSGP_ConnHdlr vc_conn; |
| 886 | f_init(); |
| 887 | |
| 888 | vc_conn := f_start_handler(refers(f_TC_resume), testcasename(), g_pcu, g_sgsn, 6); |
| 889 | vc_conn.done; |
| 890 | /* TODO: start multiple handlers (UEs) on various cells on same and other NSEs */ |
| 891 | |
| 892 | f_cleanup(); |
| 893 | } |
| 894 | |
Harald Welte | f8ef028 | 2020-11-18 12:16:59 +0100 | [diff] [blame] | 895 | /* test the load-sharing between multiple NS-VC on the BSS side */ |
| 896 | private function f_TC_dl_ud_unidir(charstring id) runs on BSSGP_ConnHdlr { |
| 897 | var integer i; |
| 898 | |
| 899 | for (i := 0; i < 10; i := i+1) { |
| 900 | var octetstring payload := f_rnd_octstring(i); |
| 901 | var template (value) PDU_BSSGP pdu_tx := |
| 902 | ts_BSSGP_DL_UD(g_pars.tlli, payload, omit, ts_BSSGP_IMSI(g_pars.imsi)); |
| 903 | SGSN[0].send(pdu_tx); |
| 904 | } |
| 905 | setverdict(pass); |
| 906 | } |
| 907 | testcase TC_load_sharing_dl() runs on test_CT_NS |
| 908 | { |
| 909 | const integer num_ue := 10; |
| 910 | var BSSGP_ConnHdlr vc_conn[num_ue]; |
| 911 | f_init(); |
| 912 | |
| 913 | /* all BVC are now fully brought up. We disconnect BSSGP from NS on the BSS |
| 914 | * side so we get the raw NsUnitdataIndication and hence observe different |
| 915 | * NSVCI */ |
| 916 | disconnect(g_pcu[0].vc_NS:NS_SP, g_pcu[0].vc_BSSGP:BSCP); |
| 917 | connect(g_pcu[0].vc_NS:NS_SP, self:NS); |
| 918 | |
| 919 | /* there may still be some NS-VCs coming up? After all, the BVC-RESET succeeds after the first |
| 920 | * of the NS-VC is ALIVE/UNBLOCKED */ |
| 921 | f_sleep(3.0); |
| 922 | |
| 923 | /* start parallel components generating DL-UNITDATA from the SGSN side */ |
| 924 | for (var integer i:= 0; i < num_ue; i := i+1) { |
| 925 | vc_conn[i] := f_start_handler(refers(f_TC_dl_ud_unidir), testcasename(), g_pcu, g_sgsn, 5+i); |
| 926 | } |
| 927 | |
| 928 | /* now start counting all the messages that were queued before */ |
| 929 | /* TODO: We have a hard-coded assumption of 4 NS-VC in one NSE/NS-VCG here! */ |
| 930 | var ro_integer rx_count := { 0, 0, 0, 0 }; |
| 931 | timer T := 2.0; |
| 932 | T.start; |
| 933 | alt { |
| 934 | [] as_NsUdiCount(0, rx_count); |
| 935 | [] as_NsUdiCount(1, rx_count); |
| 936 | [] as_NsUdiCount(2, rx_count); |
| 937 | [] as_NsUdiCount(3, rx_count); |
| 938 | [] NS.receive(NsUnitdataIndication:{0,?,?,*,*}) { repeat; } /* signaling BVC */ |
| 939 | [] NS.receive(NsStatusIndication:?) { repeat; } |
| 940 | [] NS.receive { |
| 941 | setverdict(fail, "Rx unexpected NS"); |
| 942 | mtc.stop; |
| 943 | } |
| 944 | [] T.timeout { |
| 945 | } |
| 946 | } |
| 947 | for (var integer i := 0; i < lengthof(rx_count); i := i+1) { |
| 948 | log("Rx on NSVCI ", mp_nsconfig_pcu[0].nsvc[i].nsvci, ": ", rx_count[i]); |
| 949 | if (rx_count[i] == 0) { |
| 950 | setverdict(fail, "Data not shared over all NSVC"); |
| 951 | } |
| 952 | } |
| 953 | setverdict(pass); |
| 954 | } |
| 955 | private altstep as_NsUdiCount(integer nsvc_idx, inout ro_integer roi) runs on test_CT_NS { |
| 956 | var NsUnitdataIndication udi; |
| 957 | var BssgpBvcConfig bvcc := g_pcu[0].cfg.bvc[0]; |
| 958 | [] NS.receive(NsUnitdataIndication:{bvcc.bvci, g_pcu[0].cfg.nsei, mp_nsconfig_pcu[0].nsvc[nsvc_idx].nsvci, *, *}) -> value udi { |
| 959 | roi[nsvc_idx] := roi[nsvc_idx] + 1; |
| 960 | repeat; |
| 961 | } |
| 962 | } |
| 963 | type component test_CT_NS extends test_CT { |
| 964 | port NS_PT NS; |
| 965 | }; |
| 966 | |
| 967 | |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 968 | /*********************************************************************** |
| 969 | * PAGING PS procedure |
| 970 | ***********************************************************************/ |
| 971 | |
| 972 | private function f_send_paging_ps(template (value) Paging_Field4 p4, integer sgsn_idx := 0, |
| 973 | boolean use_sig := false) |
| 974 | runs on BSSGP_ConnHdlr return template (present) PDU_BSSGP { |
| 975 | var template (value) PDU_BSSGP pdu_tx; |
| 976 | var template (present) PDU_BSSGP pdu_rx; |
| 977 | /* we always specify '0' as BVCI in the templates below, as we override it with |
| 978 | * 'p4' later anyway */ |
| 979 | pdu_rx := tr_BSSGP_PS_PAGING(0); |
| 980 | pdu_rx.pDU_BSSGP_PAGING_PS.iMSI := tr_BSSGP_IMSI(g_pars.imsi); |
| 981 | if (ispresent(g_pars.p_tmsi)) { |
| 982 | pdu_tx := ts_BSSGP_PS_PAGING_PTMSI(0, g_pars.imsi, oct2int(g_pars.p_tmsi)); |
| 983 | pdu_rx.pDU_BSSGP_PAGING_PS.pTMSI := tr_BSSGP_TMSI(oct2int(g_pars.p_tmsi)); |
| 984 | } else { |
| 985 | pdu_tx := ts_BSSGP_PS_PAGING_IMSI(0, g_pars.imsi); |
| 986 | pdu_rx.pDU_BSSGP_PAGING_PS.pTMSI := omit; |
| 987 | } |
| 988 | pdu_tx.pDU_BSSGP_PAGING_PS.paging_Field4 := p4; |
| 989 | pdu_rx.pDU_BSSGP_PAGING_PS.paging_Field4 := p4; |
| 990 | if (use_sig == false) { |
| 991 | SGSN[sgsn_idx].send(pdu_tx); |
| 992 | } else { |
| 993 | SGSN_SIG[sgsn_idx].send(pdu_tx); |
| 994 | } |
| 995 | return pdu_rx; |
| 996 | } |
| 997 | |
| 998 | /* send paging defined by 'p4' on given SGSN-side index (ptp or signaling) and expect one paging to arrive on |
| 999 | * specified PCU index */ |
| 1000 | private function f_send_paging_ps_exp_one_bss(template (value) Paging_Field4 p4, integer sgsn_idx := 0, |
| 1001 | boolean use_sig := false,integer pcu_idx := 0) |
| 1002 | runs on BSSGP_ConnHdlr { |
| 1003 | var template (present) PDU_BSSGP exp_rx; |
| 1004 | /* doesn't really make sense: Sending to a single BVCI means the message ends up |
| 1005 | * at that BVC (cell) only, and paging all over the BSS area is not possible */ |
| 1006 | exp_rx := f_send_paging_ps(p4, sgsn_idx, use_sig); |
| 1007 | /* Expect paging to propagate to the one BSS addressed by the BVCI only */ |
| 1008 | timer T := 2.0; |
| 1009 | T.start; |
| 1010 | alt { |
| 1011 | [not use_sig] PCU[pcu_idx].receive(exp_rx) { |
| 1012 | setverdict(pass); |
| 1013 | repeat; |
| 1014 | } |
| 1015 | [not use_sig] PCU_SIG[pcu_idx].receive(exp_rx) { |
| 1016 | setverdict(fail, "Received paging on SIGNALING BVC, expected PTP BVC"); |
| 1017 | } |
| 1018 | [use_sig] PCU_SIG[pcu_idx].receive(exp_rx) { |
| 1019 | setverdict(pass); |
| 1020 | repeat; |
| 1021 | } |
| 1022 | [use_sig] PCU[pcu_idx].receive(exp_rx) { |
| 1023 | setverdict(fail, "Received paging on PTP BVC, expected SIGNALING BVC"); |
| 1024 | } |
| 1025 | [] any from PCU.receive(exp_rx) { |
| 1026 | setverdict(fail, "Paging received on unexpected BVC"); |
| 1027 | } |
| 1028 | [] any from PCU_SIG.receive(exp_rx) { |
| 1029 | setverdict(fail, "Paging received on unexpected BVC"); |
| 1030 | } |
| 1031 | [] any from PCU.receive(PDU_BSSGP:{pDU_BSSGP_PAGING_PS:=?}) { |
| 1032 | setverdict(fail, "Different Paging than expected received PTP BVC"); |
| 1033 | } |
| 1034 | [] any from PCU_SIG.receive(PDU_BSSGP:{pDU_BSSGP_PAGING_PS:=?}) { |
| 1035 | setverdict(fail, "Different Paging than expected on SIGNALING BVC"); |
| 1036 | } |
| 1037 | [] T.timeout; |
| 1038 | } |
| 1039 | } |
| 1040 | |
Harald Welte | 7462a59 | 2020-11-23 22:07:07 +0100 | [diff] [blame^] | 1041 | /* send a PS-PAGING but don't expect it to show up on any PTP or SIG BVC */ |
| 1042 | private function f_send_paging_ps_exp_no_bss(template (value) Paging_Field4 p4, integer sgsn_idx := 0, |
| 1043 | boolean use_sig := false) |
| 1044 | runs on BSSGP_ConnHdlr { |
| 1045 | var template (present) PDU_BSSGP exp_rx; |
| 1046 | exp_rx := f_send_paging_ps(p4, sgsn_idx, use_sig); |
| 1047 | /* Expect paging to propagate to no BSS */ |
| 1048 | timer T := 2.0; |
| 1049 | T.start; |
| 1050 | alt { |
| 1051 | [] any from PCU.receive(exp_rx) { |
| 1052 | setverdict(fail, "Paging received on unexpected BVC"); |
| 1053 | } |
| 1054 | [] any from PCU_SIG.receive(exp_rx) { |
| 1055 | setverdict(fail, "Paging received on unexpected BVC"); |
| 1056 | } |
| 1057 | [] any from PCU.receive(PDU_BSSGP:{pDU_BSSGP_PAGING_PS:=?}) { |
| 1058 | setverdict(fail, "Different Paging received on PTP BVC"); |
| 1059 | } |
| 1060 | [] any from PCU_SIG.receive(PDU_BSSGP:{pDU_BSSGP_PAGING_PS:=?}) { |
| 1061 | setverdict(fail, "Different Paging received on SIGNALING BVC"); |
| 1062 | } |
| 1063 | [] T.timeout { |
| 1064 | setverdict(pass); |
| 1065 | } |
| 1066 | } |
| 1067 | } |
| 1068 | |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1069 | private function f_TC_paging_ps_ptp_bss(charstring id) runs on BSSGP_ConnHdlr |
| 1070 | { |
| 1071 | /* doesn't really make sense: Sending to a single BVCI means the message ends up |
| 1072 | * at that BVC (cell) only, and paging all over the BSS area is not possible */ |
| 1073 | f_send_paging_ps_exp_one_bss(ts_BssgpP4BssArea, 0, false, 0); |
| 1074 | } |
| 1075 | testcase TC_paging_ps_ptp_bss() runs on test_CT { |
| 1076 | var BSSGP_ConnHdlr vc_conn; |
| 1077 | f_init(); |
| 1078 | |
| 1079 | vc_conn := f_start_handler(refers(f_TC_paging_ps_ptp_bss), testcasename(), g_pcu, g_sgsn, 9); |
| 1080 | vc_conn.done; |
| 1081 | |
| 1082 | f_cleanup(); |
| 1083 | } |
| 1084 | |
| 1085 | /* PS-PAGING on PTP-BVC for Location Area */ |
| 1086 | private function f_TC_paging_ps_ptp_lac(charstring id) runs on BSSGP_ConnHdlr |
| 1087 | { |
| 1088 | var template (present) PDU_BSSGP exp_rx; |
| 1089 | /* doesn't really make sense: Sending to a single BVCI means the message ends up |
| 1090 | * at that BVC (cell) only, and paging all over the BSS area is not possible */ |
| 1091 | f_send_paging_ps_exp_one_bss(ts_BssgpP4LAC(pcu_bvc_cfg[0].cell_id.ra_id.lai), 0, false, 0); |
| 1092 | } |
| 1093 | testcase TC_paging_ps_ptp_lac() runs on test_CT { |
| 1094 | var BSSGP_ConnHdlr vc_conn; |
| 1095 | f_init(); |
| 1096 | |
| 1097 | vc_conn := f_start_handler(refers(f_TC_paging_ps_ptp_lac), testcasename(), g_pcu, g_sgsn, 10); |
| 1098 | vc_conn.done; |
| 1099 | |
| 1100 | f_cleanup(); |
| 1101 | } |
| 1102 | |
Harald Welte | 7462a59 | 2020-11-23 22:07:07 +0100 | [diff] [blame^] | 1103 | /* PS-PAGING on PTP-BVC for unknown Location Area */ |
| 1104 | private function f_TC_paging_ps_ptp_lac_unknown(charstring id) runs on BSSGP_ConnHdlr |
| 1105 | { |
| 1106 | var GSM_Types.LocationAreaIdentification unknown_la := { |
| 1107 | mcc_mnc := '567F99'H, |
| 1108 | lac := 33333 |
| 1109 | }; |
| 1110 | /* as it's sent on the PTP BVC, we expect it to pass even for unknown LAC */ |
| 1111 | f_send_paging_ps_exp_one_bss(ts_BssgpP4LAC(unknown_la), 0, false, 0); |
| 1112 | } |
| 1113 | testcase TC_paging_ps_ptp_lac_unknown() runs on test_CT { |
| 1114 | var BSSGP_ConnHdlr vc_conn; |
| 1115 | f_init(); |
| 1116 | |
| 1117 | vc_conn := f_start_handler(refers(f_TC_paging_ps_ptp_lac_unknown), testcasename(), g_pcu, g_sgsn, 11); |
| 1118 | vc_conn.done; |
| 1119 | |
| 1120 | f_cleanup(); |
| 1121 | } |
| 1122 | |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1123 | /* PS-PAGING on PTP-BVC for Routeing Area */ |
| 1124 | private function f_TC_paging_ps_ptp_rac(charstring id) runs on BSSGP_ConnHdlr |
| 1125 | { |
| 1126 | /* doesn't really make sense: Sending to a single BVCI means the message ends up |
| 1127 | * at that BVC (cell) only, and paging all over the BSS area is not possible */ |
| 1128 | f_send_paging_ps_exp_one_bss(ts_BssgpP4RAC(pcu_bvc_cfg[0].cell_id.ra_id), 0, false, 0); |
| 1129 | } |
| 1130 | testcase TC_paging_ps_ptp_rac() runs on test_CT { |
| 1131 | var BSSGP_ConnHdlr vc_conn; |
| 1132 | f_init(); |
| 1133 | |
| 1134 | vc_conn := f_start_handler(refers(f_TC_paging_ps_ptp_rac), testcasename(), g_pcu, g_sgsn, 11); |
| 1135 | vc_conn.done; |
| 1136 | |
| 1137 | f_cleanup(); |
| 1138 | } |
| 1139 | |
Harald Welte | 7462a59 | 2020-11-23 22:07:07 +0100 | [diff] [blame^] | 1140 | /* PS-PAGING on PTP-BVC for unknown Routeing Area */ |
| 1141 | private function f_TC_paging_ps_ptp_rac_unknown(charstring id) runs on BSSGP_ConnHdlr |
| 1142 | { |
| 1143 | var RoutingAreaIdentification unknown_ra := { |
| 1144 | lai := { |
| 1145 | mcc_mnc := '567F99'H, |
| 1146 | lac := 33333 |
| 1147 | }, |
| 1148 | rac := 254 |
| 1149 | }; |
| 1150 | /* as it's sent on the PTP BVC, we expect it to pass even for unknown RAC */ |
| 1151 | f_send_paging_ps_exp_one_bss(ts_BssgpP4RAC(unknown_ra), 0, false, 0); |
| 1152 | } |
| 1153 | testcase TC_paging_ps_ptp_rac_unknown() runs on test_CT { |
| 1154 | var BSSGP_ConnHdlr vc_conn; |
| 1155 | f_init(); |
| 1156 | |
| 1157 | vc_conn := f_start_handler(refers(f_TC_paging_ps_ptp_rac_unknown), testcasename(), g_pcu, g_sgsn, 11); |
| 1158 | vc_conn.done; |
| 1159 | |
| 1160 | f_cleanup(); |
| 1161 | } |
| 1162 | |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1163 | /* PS-PAGING on PTP-BVC for BVCI (one cell) */ |
| 1164 | private function f_TC_paging_ps_ptp_bvci(charstring id) runs on BSSGP_ConnHdlr |
| 1165 | { |
| 1166 | /* this should be the normal case for MS in READY MM state after a lower layer failure */ |
| 1167 | f_send_paging_ps_exp_one_bss(ts_BssgpP4Bvci(pcu_bvc_cfg[0].bvci), 0, false, 0); |
| 1168 | } |
| 1169 | testcase TC_paging_ps_ptp_bvci() runs on test_CT { |
| 1170 | var BSSGP_ConnHdlr vc_conn; |
| 1171 | f_init(); |
| 1172 | |
| 1173 | vc_conn := f_start_handler(refers(f_TC_paging_ps_ptp_bvci), testcasename(), g_pcu, g_sgsn, 12); |
| 1174 | vc_conn.done; |
| 1175 | |
| 1176 | f_cleanup(); |
| 1177 | } |
| 1178 | |
Harald Welte | 7462a59 | 2020-11-23 22:07:07 +0100 | [diff] [blame^] | 1179 | /* PS-PAGING on PTP-BVC for unknown BVCI */ |
| 1180 | private function f_TC_paging_ps_ptp_bvci_unknown(charstring id) runs on BSSGP_ConnHdlr |
| 1181 | { |
| 1182 | /* as it's sent on the PTP BVC, we expect it to pass even for unknown BVCI */ |
| 1183 | f_send_paging_ps_exp_one_bss(ts_BssgpP4Bvci(33333), 0, false, 0); |
| 1184 | } |
| 1185 | testcase TC_paging_ps_ptp_bvci_unknown() runs on test_CT { |
| 1186 | var BSSGP_ConnHdlr vc_conn; |
| 1187 | f_init(); |
| 1188 | |
| 1189 | vc_conn := f_start_handler(refers(f_TC_paging_ps_ptp_bvci_unknown), testcasename(), g_pcu, g_sgsn, 11); |
| 1190 | vc_conn.done; |
| 1191 | |
| 1192 | f_cleanup(); |
| 1193 | } |
| 1194 | |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1195 | /* altstep for expecting BSSGP PDU on signaling BVC of given pcu_idx + storing in 'roi' */ |
| 1196 | private altstep as_paging_sig_pcu(integer pcu_idx, template (present) PDU_BSSGP exp_rx, inout ro_integer roi) |
| 1197 | runs on BSSGP_ConnHdlr { |
| 1198 | [] PCU_SIG[pcu_idx].receive(exp_rx) { |
| 1199 | if (ro_integer_contains(roi, pcu_idx)) { |
| 1200 | setverdict(fail, "Received multiple paging on same SIG BVC"); |
| 1201 | } |
| 1202 | roi := roi & { pcu_idx }; |
| 1203 | repeat; |
| 1204 | } |
| 1205 | [] PCU[pcu_idx].receive(exp_rx) { |
| 1206 | setverdict(fail, "Received paging on PTP BVC, expected SIGNALING BVC"); |
| 1207 | } |
| 1208 | [] PCU_SIG[pcu_idx].receive(PDU_BSSGP:{pDU_BSSGP_PAGING_PS:=?}) { |
| 1209 | setverdict(fail, "Different Paging than expected received SIGNALING BVC"); |
| 1210 | } |
| 1211 | [] PCU[pcu_idx].receive(PDU_BSSGP:{pDU_BSSGP_PAGING_PS:=?}) { |
| 1212 | setverdict(fail, "Different Paging than expected received PTP BVC"); |
| 1213 | } |
| 1214 | } |
| 1215 | |
| 1216 | type record of default ro_default; |
| 1217 | |
| 1218 | /* send PS-PAGING on SIG BVC, expect it to arrive on given list of PCU indexes */ |
| 1219 | private function f_send_paging_ps_exp_multi(template (value) Paging_Field4 p4, integer sgsn_idx := 0, |
| 1220 | ro_integer exp_on_pcu_idx) runs on BSSGP_ConnHdlr |
| 1221 | { |
| 1222 | var template (present) PDU_BSSGP exp_rx; |
| 1223 | exp_rx := f_send_paging_ps(p4, 0, true); |
| 1224 | |
| 1225 | /* FIXME: make sure the relevant BVCs/BSS are connected to the ports! */ |
| 1226 | var ro_default defaults := {}; |
| 1227 | for (var integer i := 0; i < lengthof(mp_nsconfig_pcu); i := i+1) { |
| 1228 | var default d := activate(as_paging_sig_pcu(i, exp_rx, g_roi)); |
| 1229 | defaults := defaults & { d }; |
| 1230 | } |
| 1231 | f_sleep(2.0); |
| 1232 | for (var integer i := 0; i < lengthof(defaults); i := i+1) { |
| 1233 | deactivate(defaults[i]); |
| 1234 | } |
| 1235 | log("Paging received on PCU ", g_roi); |
| 1236 | |
| 1237 | for (var integer i := 0; i < lengthof(mp_nsconfig_pcu); i := i+1) { |
| 1238 | var boolean rx_on_i := ro_integer_contains(g_roi, i); |
| 1239 | var boolean exp_on_i := ro_integer_contains(exp_on_pcu_idx, i); |
| 1240 | if (exp_on_i and not rx_on_i) { |
| 1241 | setverdict(fail, "PS-PAGING not received on ", mp_nsconfig_pcu[i].nsei); |
| 1242 | } |
| 1243 | if (not exp_on_i and rx_on_i) { |
| 1244 | setverdict(fail, "PS-PAGING not expected but received on ", mp_nsconfig_pcu[i].nsei); |
| 1245 | } |
| 1246 | } |
| 1247 | setverdict(pass); |
| 1248 | } |
| 1249 | |
| 1250 | /* PS-PAGING on SIG-BVC for BSS Area */ |
| 1251 | private function f_TC_paging_ps_sig_bss(charstring id) runs on BSSGP_ConnHdlr |
| 1252 | { |
| 1253 | /* we expect the paging to arrive on all three NSE */ |
| 1254 | f_send_paging_ps_exp_multi(ts_BssgpP4BssArea, 0, {0, 1, 2}); |
| 1255 | } |
| 1256 | testcase TC_paging_ps_sig_bss() runs on test_CT { |
| 1257 | var BSSGP_ConnHdlr vc_conn; |
| 1258 | f_init(); |
| 1259 | |
| 1260 | vc_conn := f_start_handler(refers(f_TC_paging_ps_sig_bss), testcasename(), g_pcu, g_sgsn, 13); |
| 1261 | vc_conn.done; |
| 1262 | |
| 1263 | f_cleanup(); |
| 1264 | } |
| 1265 | |
| 1266 | /* PS-PAGING on SIG-BVC for Location Area */ |
| 1267 | private function f_TC_paging_ps_sig_lac(charstring id) runs on BSSGP_ConnHdlr |
| 1268 | { |
| 1269 | /* Both PCU index 0 and 1 have a BVC within the LAC */ |
| 1270 | f_send_paging_ps_exp_multi(ts_BssgpP4LAC(pcu_bvc_cfg[0].cell_id.ra_id.lai), 0, {0, 1}); |
| 1271 | } |
| 1272 | testcase TC_paging_ps_sig_lac() runs on test_CT { |
| 1273 | var BSSGP_ConnHdlr vc_conn; |
| 1274 | f_init(); |
| 1275 | |
| 1276 | vc_conn := f_start_handler(refers(f_TC_paging_ps_sig_lac), testcasename(), g_pcu, g_sgsn, 14); |
| 1277 | vc_conn.done; |
| 1278 | |
| 1279 | f_cleanup(); |
| 1280 | } |
| 1281 | |
Harald Welte | 7462a59 | 2020-11-23 22:07:07 +0100 | [diff] [blame^] | 1282 | /* PS-PAGING on SIG-BVC for unknown Location Area */ |
| 1283 | private function f_TC_paging_ps_sig_lac_unknown(charstring id) runs on BSSGP_ConnHdlr |
| 1284 | { |
| 1285 | var GSM_Types.LocationAreaIdentification unknown_la := { |
| 1286 | mcc_mnc := '567F99'H, |
| 1287 | lac := 33333 |
| 1288 | }; |
| 1289 | f_send_paging_ps_exp_no_bss(ts_BssgpP4LAC(unknown_la), 0, true); |
| 1290 | } |
| 1291 | testcase TC_paging_ps_sig_lac_unknown() runs on test_CT { |
| 1292 | var BSSGP_ConnHdlr vc_conn; |
| 1293 | f_init(); |
| 1294 | |
| 1295 | vc_conn := f_start_handler(refers(f_TC_paging_ps_sig_lac_unknown), testcasename(), g_pcu, g_sgsn, 11); |
| 1296 | vc_conn.done; |
| 1297 | |
| 1298 | f_cleanup(); |
| 1299 | } |
| 1300 | |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1301 | /* PS-PAGING on SIG-BVC for Routeing Area */ |
| 1302 | private function f_TC_paging_ps_sig_rac(charstring id) runs on BSSGP_ConnHdlr |
| 1303 | { |
| 1304 | /* Only PCU index 0 has a matching BVC within the LAC */ |
| 1305 | f_send_paging_ps_exp_multi(ts_BssgpP4RAC(pcu_bvc_cfg[0].cell_id.ra_id), 0, {0}); |
| 1306 | } |
| 1307 | testcase TC_paging_ps_sig_rac() runs on test_CT { |
| 1308 | var BSSGP_ConnHdlr vc_conn; |
| 1309 | f_init(); |
| 1310 | |
| 1311 | vc_conn := f_start_handler(refers(f_TC_paging_ps_sig_rac), testcasename(), g_pcu, g_sgsn, 15); |
| 1312 | vc_conn.done; |
| 1313 | |
| 1314 | f_cleanup(); |
| 1315 | } |
| 1316 | |
Harald Welte | 7462a59 | 2020-11-23 22:07:07 +0100 | [diff] [blame^] | 1317 | /* PS-PAGING on SIG-BVC for unknown Routeing Area */ |
| 1318 | private function f_TC_paging_ps_sig_rac_unknown(charstring id) runs on BSSGP_ConnHdlr |
| 1319 | { |
| 1320 | var RoutingAreaIdentification unknown_ra := { |
| 1321 | lai := { |
| 1322 | mcc_mnc := '567F99'H, |
| 1323 | lac := 33333 |
| 1324 | }, |
| 1325 | rac := 254 |
| 1326 | }; |
| 1327 | f_send_paging_ps_exp_no_bss(ts_BssgpP4RAC(unknown_ra), 0, true); |
| 1328 | } |
| 1329 | testcase TC_paging_ps_sig_rac_unknown() runs on test_CT { |
| 1330 | var BSSGP_ConnHdlr vc_conn; |
| 1331 | f_init(); |
| 1332 | |
| 1333 | vc_conn := f_start_handler(refers(f_TC_paging_ps_sig_rac_unknown), testcasename(), g_pcu, g_sgsn, 11); |
| 1334 | vc_conn.done; |
| 1335 | |
| 1336 | f_cleanup(); |
| 1337 | } |
| 1338 | |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1339 | /* PS-PAGING on SIG-BVC for BVCI (one cell) */ |
| 1340 | private function f_TC_paging_ps_sig_bvci(charstring id) runs on BSSGP_ConnHdlr |
| 1341 | { |
| 1342 | f_send_paging_ps_exp_multi(ts_BssgpP4Bvci(pcu_bvc_cfg[0].bvci), 0, {0}); |
| 1343 | } |
| 1344 | testcase TC_paging_ps_sig_bvci() runs on test_CT { |
| 1345 | var BSSGP_ConnHdlr vc_conn; |
| 1346 | f_init(); |
| 1347 | |
| 1348 | vc_conn := f_start_handler(refers(f_TC_paging_ps_sig_bvci), testcasename(), g_pcu, g_sgsn, 16); |
| 1349 | vc_conn.done; |
| 1350 | |
| 1351 | f_cleanup(); |
| 1352 | } |
| 1353 | |
Harald Welte | 7462a59 | 2020-11-23 22:07:07 +0100 | [diff] [blame^] | 1354 | /* PS-PAGING on SIG-BVC for unknown BVCI */ |
| 1355 | private function f_TC_paging_ps_sig_bvci_unknown(charstring id) runs on BSSGP_ConnHdlr |
| 1356 | { |
| 1357 | f_send_paging_ps_exp_no_bss(ts_BssgpP4Bvci(33333), 0, true); |
| 1358 | } |
| 1359 | testcase TC_paging_ps_sig_bvci_unknown() runs on test_CT { |
| 1360 | var BSSGP_ConnHdlr vc_conn; |
| 1361 | f_init(); |
| 1362 | |
| 1363 | vc_conn := f_start_handler(refers(f_TC_paging_ps_sig_bvci_unknown), testcasename(), g_pcu, g_sgsn, 11); |
| 1364 | vc_conn.done; |
| 1365 | |
| 1366 | f_cleanup(); |
| 1367 | } |
| 1368 | |
| 1369 | |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1370 | |
| 1371 | /*********************************************************************** |
| 1372 | * PAGING CS procedure |
| 1373 | ***********************************************************************/ |
| 1374 | |
| 1375 | private function f_send_paging_cs(template (value) Paging_Field4 p4, integer sgsn_idx := 0, |
| 1376 | boolean use_sig := false) |
| 1377 | runs on BSSGP_ConnHdlr return template (present) PDU_BSSGP { |
| 1378 | var template (value) PDU_BSSGP pdu_tx; |
| 1379 | var template (present) PDU_BSSGP pdu_rx; |
| 1380 | /* we always specify '0' as BVCI in the templates below, as we override it with |
| 1381 | * 'p4' later anyway */ |
| 1382 | pdu_rx := tr_BSSGP_CS_PAGING(0); |
| 1383 | pdu_rx.pDU_BSSGP_PAGING_CS.iMSI := tr_BSSGP_IMSI(g_pars.imsi); |
| 1384 | if (ispresent(g_pars.p_tmsi)) { |
| 1385 | pdu_tx := ts_BSSGP_CS_PAGING_PTMSI(0, g_pars.imsi, oct2int(g_pars.p_tmsi)); |
| 1386 | pdu_rx.pDU_BSSGP_PAGING_CS.tMSI := tr_BSSGP_TMSI(oct2int(g_pars.p_tmsi)); |
| 1387 | } else { |
| 1388 | pdu_tx := ts_BSSGP_CS_PAGING_IMSI(0, g_pars.imsi); |
| 1389 | pdu_rx.pDU_BSSGP_PAGING_CS.tMSI := omit; |
| 1390 | } |
| 1391 | pdu_tx.pDU_BSSGP_PAGING_CS.paging_Field4 := p4; |
| 1392 | pdu_rx.pDU_BSSGP_PAGING_CS.paging_Field4 := p4; |
| 1393 | if (use_sig == false) { |
| 1394 | SGSN[sgsn_idx].send(pdu_tx); |
| 1395 | } else { |
| 1396 | SGSN_SIG[sgsn_idx].send(pdu_tx); |
| 1397 | } |
| 1398 | return pdu_rx; |
| 1399 | } |
| 1400 | |
| 1401 | /* send paging defined by 'p4' on given SGSN-side index (ptp or signaling) and expect one paging to arrive on |
| 1402 | * specified PCU index */ |
| 1403 | private function f_send_paging_cs_exp_one_bss(template (value) Paging_Field4 p4, integer sgsn_idx := 0, |
| 1404 | boolean use_sig := false,integer pcu_idx := 0) |
| 1405 | runs on BSSGP_ConnHdlr { |
| 1406 | var template (present) PDU_BSSGP exp_rx; |
| 1407 | /* doesn't really make sense: Sending to a single BVCI means the message ends up |
| 1408 | * at that BVC (cell) only, and paging all over the BSS area is not possible */ |
| 1409 | exp_rx := f_send_paging_cs(p4, sgsn_idx, use_sig); |
| 1410 | /* Expect paging to propagate to the one BSS addressed by the BVCI only */ |
| 1411 | timer T := 2.0; |
| 1412 | T.start; |
| 1413 | alt { |
| 1414 | [not use_sig] PCU[pcu_idx].receive(exp_rx) { |
| 1415 | setverdict(pass); |
| 1416 | repeat; |
| 1417 | } |
| 1418 | [not use_sig] PCU_SIG[pcu_idx].receive(exp_rx) { |
| 1419 | setverdict(fail, "Received paging on SIGNALING BVC, expected PTP BVC"); |
| 1420 | } |
| 1421 | [use_sig] PCU_SIG[pcu_idx].receive(exp_rx) { |
| 1422 | setverdict(pass); |
| 1423 | repeat; |
| 1424 | } |
| 1425 | [use_sig] PCU[pcu_idx].receive(exp_rx) { |
| 1426 | setverdict(fail, "Received paging on PTP BVC, expected SIGNALING BVC"); |
| 1427 | } |
| 1428 | [] any from PCU.receive(exp_rx) { |
| 1429 | setverdict(fail, "Paging received on unexpected BVC"); |
| 1430 | } |
| 1431 | [] any from PCU_SIG.receive(exp_rx) { |
| 1432 | setverdict(fail, "Paging received on unexpected BVC"); |
| 1433 | } |
| 1434 | [] any from PCU.receive(PDU_BSSGP:{pDU_BSSGP_PAGING_CS:=?}) { |
| 1435 | setverdict(fail, "Different Paging than expected received PTP BVC"); |
| 1436 | } |
| 1437 | [] any from PCU_SIG.receive(PDU_BSSGP:{pDU_BSSGP_PAGING_CS:=?}) { |
| 1438 | setverdict(fail, "Different Paging than expected on SIGNALING BVC"); |
| 1439 | } |
| 1440 | [] T.timeout; |
| 1441 | } |
| 1442 | } |
| 1443 | |
Harald Welte | 7462a59 | 2020-11-23 22:07:07 +0100 | [diff] [blame^] | 1444 | /* send a CS-PAGING but don't expect it to show up on any PTP or SIG BVC */ |
| 1445 | private function f_send_paging_cs_exp_no_bss(template (value) Paging_Field4 p4, integer sgsn_idx := 0, |
| 1446 | boolean use_sig := false) |
| 1447 | runs on BSSGP_ConnHdlr { |
| 1448 | var template (present) PDU_BSSGP exp_rx; |
| 1449 | exp_rx := f_send_paging_cs(p4, sgsn_idx, use_sig); |
| 1450 | /* Expect paging to propagate to no BSS */ |
| 1451 | timer T := 2.0; |
| 1452 | T.start; |
| 1453 | alt { |
| 1454 | [] any from PCU.receive(exp_rx) { |
| 1455 | setverdict(fail, "Paging received on unexpected BVC"); |
| 1456 | } |
| 1457 | [] any from PCU_SIG.receive(exp_rx) { |
| 1458 | setverdict(fail, "Paging received on unexpected BVC"); |
| 1459 | } |
| 1460 | [] any from PCU.receive(PDU_BSSGP:{pDU_BSSGP_PAGING_CS:=?}) { |
| 1461 | setverdict(fail, "Different Paging received on PTP BVC"); |
| 1462 | } |
| 1463 | [] any from PCU_SIG.receive(PDU_BSSGP:{pDU_BSSGP_PAGING_CS:=?}) { |
| 1464 | setverdict(fail, "Different Paging received on SIGNALING BVC"); |
| 1465 | } |
| 1466 | [] T.timeout { |
| 1467 | setverdict(pass); |
| 1468 | } |
| 1469 | } |
| 1470 | } |
| 1471 | |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1472 | private function f_TC_paging_cs_ptp_bss(charstring id) runs on BSSGP_ConnHdlr |
| 1473 | { |
| 1474 | /* doesn't really make sense: Sending to a single BVCI means the message ends up |
| 1475 | * at that BVC (cell) only, and paging all over the BSS area is not possible */ |
| 1476 | f_send_paging_cs_exp_one_bss(ts_BssgpP4BssArea, 0, false, 0); |
| 1477 | } |
| 1478 | testcase TC_paging_cs_ptp_bss() runs on test_CT { |
| 1479 | var BSSGP_ConnHdlr vc_conn; |
| 1480 | f_init(); |
| 1481 | |
| 1482 | vc_conn := f_start_handler(refers(f_TC_paging_cs_ptp_bss), testcasename(), g_pcu, g_sgsn, 17); |
| 1483 | vc_conn.done; |
| 1484 | |
| 1485 | f_cleanup(); |
| 1486 | } |
| 1487 | |
| 1488 | /* CS-PAGING on PTP-BVC for Location Area */ |
| 1489 | private function f_TC_paging_cs_ptp_lac(charstring id) runs on BSSGP_ConnHdlr |
| 1490 | { |
| 1491 | var template (present) PDU_BSSGP exp_rx; |
| 1492 | /* doesn't really make sense: Sending to a single BVCI means the message ends up |
| 1493 | * at that BVC (cell) only, and paging all over the BSS area is not possible */ |
| 1494 | f_send_paging_cs_exp_one_bss(ts_BssgpP4LAC(pcu_bvc_cfg[0].cell_id.ra_id.lai), 0, false, 0); |
| 1495 | } |
| 1496 | testcase TC_paging_cs_ptp_lac() runs on test_CT { |
| 1497 | var BSSGP_ConnHdlr vc_conn; |
| 1498 | f_init(); |
| 1499 | |
| 1500 | vc_conn := f_start_handler(refers(f_TC_paging_cs_ptp_lac), testcasename(), g_pcu, g_sgsn, 18); |
| 1501 | vc_conn.done; |
| 1502 | |
| 1503 | f_cleanup(); |
| 1504 | } |
| 1505 | |
Harald Welte | 7462a59 | 2020-11-23 22:07:07 +0100 | [diff] [blame^] | 1506 | /* CS-PAGING on PTP-BVC for unknown Location Area */ |
| 1507 | private function f_TC_paging_cs_ptp_lac_unknown(charstring id) runs on BSSGP_ConnHdlr |
| 1508 | { |
| 1509 | var GSM_Types.LocationAreaIdentification unknown_la := { |
| 1510 | mcc_mnc := '567F99'H, |
| 1511 | lac := 33333 |
| 1512 | }; |
| 1513 | /* as it's sent on the PTP BVC, we expect it to pass even for unknown LAC */ |
| 1514 | f_send_paging_cs_exp_one_bss(ts_BssgpP4LAC(unknown_la), 0, false, 0); |
| 1515 | } |
| 1516 | testcase TC_paging_cs_ptp_lac_unknown() runs on test_CT { |
| 1517 | var BSSGP_ConnHdlr vc_conn; |
| 1518 | f_init(); |
| 1519 | |
| 1520 | vc_conn := f_start_handler(refers(f_TC_paging_cs_ptp_lac_unknown), testcasename(), g_pcu, g_sgsn, 11); |
| 1521 | vc_conn.done; |
| 1522 | |
| 1523 | f_cleanup(); |
| 1524 | } |
| 1525 | |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1526 | /* CS-PAGING on PTP-BVC for Routeing Area */ |
| 1527 | private function f_TC_paging_cs_ptp_rac(charstring id) runs on BSSGP_ConnHdlr |
| 1528 | { |
| 1529 | /* doesn't really make sense: Sending to a single BVCI means the message ends up |
| 1530 | * at that BVC (cell) only, and paging all over the BSS area is not possible */ |
| 1531 | f_send_paging_cs_exp_one_bss(ts_BssgpP4RAC(pcu_bvc_cfg[0].cell_id.ra_id), 0, false, 0); |
| 1532 | } |
| 1533 | testcase TC_paging_cs_ptp_rac() runs on test_CT { |
| 1534 | var BSSGP_ConnHdlr vc_conn; |
| 1535 | f_init(); |
| 1536 | |
| 1537 | vc_conn := f_start_handler(refers(f_TC_paging_cs_ptp_rac), testcasename(), g_pcu, g_sgsn, 19); |
| 1538 | vc_conn.done; |
| 1539 | |
| 1540 | f_cleanup(); |
| 1541 | } |
| 1542 | |
Harald Welte | 7462a59 | 2020-11-23 22:07:07 +0100 | [diff] [blame^] | 1543 | /* CS-PAGING on PTP-BVC for unknown Routeing Area */ |
| 1544 | private function f_TC_paging_cs_ptp_rac_unknown(charstring id) runs on BSSGP_ConnHdlr |
| 1545 | { |
| 1546 | var RoutingAreaIdentification unknown_ra := { |
| 1547 | lai := { |
| 1548 | mcc_mnc := '567F99'H, |
| 1549 | lac := 33333 |
| 1550 | }, |
| 1551 | rac := 254 |
| 1552 | }; |
| 1553 | /* as it's sent on the PTP BVC, we expect it to pass even for unknown RAC */ |
| 1554 | f_send_paging_cs_exp_one_bss(ts_BssgpP4RAC(unknown_ra), 0, false, 0); |
| 1555 | } |
| 1556 | testcase TC_paging_cs_ptp_rac_unknown() runs on test_CT { |
| 1557 | var BSSGP_ConnHdlr vc_conn; |
| 1558 | f_init(); |
| 1559 | |
| 1560 | vc_conn := f_start_handler(refers(f_TC_paging_cs_ptp_rac_unknown), testcasename(), g_pcu, g_sgsn, 11); |
| 1561 | vc_conn.done; |
| 1562 | |
| 1563 | f_cleanup(); |
| 1564 | } |
| 1565 | |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1566 | /* CS-PAGING on PTP-BVC for BVCI (one cell) */ |
| 1567 | private function f_TC_paging_cs_ptp_bvci(charstring id) runs on BSSGP_ConnHdlr |
| 1568 | { |
| 1569 | /* this should be the normal case for MS in READY MM state after a lower layer failure */ |
| 1570 | f_send_paging_cs_exp_one_bss(ts_BssgpP4Bvci(pcu_bvc_cfg[0].bvci), 0, false, 0); |
| 1571 | } |
| 1572 | testcase TC_paging_cs_ptp_bvci() runs on test_CT { |
| 1573 | var BSSGP_ConnHdlr vc_conn; |
| 1574 | f_init(); |
| 1575 | |
| 1576 | vc_conn := f_start_handler(refers(f_TC_paging_cs_ptp_bvci), testcasename(), g_pcu, g_sgsn, 20); |
| 1577 | vc_conn.done; |
| 1578 | |
| 1579 | f_cleanup(); |
| 1580 | } |
| 1581 | |
Harald Welte | 7462a59 | 2020-11-23 22:07:07 +0100 | [diff] [blame^] | 1582 | /* CS-PAGING on PTP-BVC for unknown BVCI */ |
| 1583 | private function f_TC_paging_cs_ptp_bvci_unknown(charstring id) runs on BSSGP_ConnHdlr |
| 1584 | { |
| 1585 | /* as it's sent on the PTP BVC, we expect it to pass even for unknown BVCI */ |
| 1586 | f_send_paging_cs_exp_one_bss(ts_BssgpP4Bvci(33333), 0, false, 0); |
| 1587 | } |
| 1588 | testcase TC_paging_cs_ptp_bvci_unknown() runs on test_CT { |
| 1589 | var BSSGP_ConnHdlr vc_conn; |
| 1590 | f_init(); |
| 1591 | |
| 1592 | vc_conn := f_start_handler(refers(f_TC_paging_cs_ptp_bvci_unknown), testcasename(), g_pcu, g_sgsn, 11); |
| 1593 | vc_conn.done; |
| 1594 | |
| 1595 | f_cleanup(); |
| 1596 | } |
| 1597 | |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1598 | /* send CS-PAGING on SIG BVC, expect it to arrive on given list of PCU indexes */ |
| 1599 | private function f_send_paging_cs_exp_multi(template (value) Paging_Field4 p4, integer sgsn_idx := 0, |
| 1600 | ro_integer exp_on_pcu_idx) runs on BSSGP_ConnHdlr |
| 1601 | { |
| 1602 | var template (present) PDU_BSSGP exp_rx; |
| 1603 | exp_rx := f_send_paging_cs(p4, 0, true); |
| 1604 | |
| 1605 | /* FIXME: make sure the relevant BVCs/BSS are connected to the ports! */ |
| 1606 | var ro_default defaults := {}; |
| 1607 | for (var integer i := 0; i < lengthof(mp_nsconfig_pcu); i := i+1) { |
| 1608 | var default d := activate(as_paging_sig_pcu(i, exp_rx, g_roi)); |
| 1609 | defaults := defaults & { d }; |
| 1610 | } |
| 1611 | f_sleep(2.0); |
| 1612 | for (var integer i := 0; i < lengthof(defaults); i := i+1) { |
| 1613 | deactivate(defaults[i]); |
| 1614 | } |
| 1615 | log("Paging received on PCU ", g_roi); |
| 1616 | |
| 1617 | for (var integer i := 0; i < lengthof(mp_nsconfig_pcu); i := i+1) { |
| 1618 | var boolean rx_on_i := ro_integer_contains(g_roi, i); |
| 1619 | var boolean exp_on_i := ro_integer_contains(exp_on_pcu_idx, i); |
| 1620 | if (exp_on_i and not rx_on_i) { |
| 1621 | setverdict(fail, "PS-PAGING not received on ", mp_nsconfig_pcu[i].nsei); |
| 1622 | } |
| 1623 | if (not exp_on_i and rx_on_i) { |
| 1624 | setverdict(fail, "PS-PAGING not expected but received on ", mp_nsconfig_pcu[i].nsei); |
| 1625 | } |
| 1626 | } |
| 1627 | setverdict(pass); |
| 1628 | } |
| 1629 | |
| 1630 | /* CS-PAGING on SIG-BVC for BSS Area */ |
| 1631 | private function f_TC_paging_cs_sig_bss(charstring id) runs on BSSGP_ConnHdlr |
| 1632 | { |
| 1633 | /* we expect the paging to arrive on all three NSE */ |
| 1634 | f_send_paging_cs_exp_multi(ts_BssgpP4BssArea, 0, {0, 1, 2}); |
| 1635 | } |
| 1636 | testcase TC_paging_cs_sig_bss() runs on test_CT { |
| 1637 | var BSSGP_ConnHdlr vc_conn; |
| 1638 | f_init(); |
| 1639 | |
| 1640 | vc_conn := f_start_handler(refers(f_TC_paging_cs_sig_bss), testcasename(), g_pcu, g_sgsn, 13); |
| 1641 | vc_conn.done; |
| 1642 | |
| 1643 | f_cleanup(); |
| 1644 | } |
| 1645 | |
| 1646 | /* CS-PAGING on SIG-BVC for Location Area */ |
| 1647 | private function f_TC_paging_cs_sig_lac(charstring id) runs on BSSGP_ConnHdlr |
| 1648 | { |
| 1649 | /* Both PCU index 0 and 1 have a BVC within the LAC */ |
| 1650 | f_send_paging_cs_exp_multi(ts_BssgpP4LAC(pcu_bvc_cfg[0].cell_id.ra_id.lai), 0, {0, 1}); |
| 1651 | } |
| 1652 | testcase TC_paging_cs_sig_lac() runs on test_CT { |
| 1653 | var BSSGP_ConnHdlr vc_conn; |
| 1654 | f_init(); |
| 1655 | |
| 1656 | vc_conn := f_start_handler(refers(f_TC_paging_cs_sig_lac), testcasename(), g_pcu, g_sgsn, 14); |
| 1657 | vc_conn.done; |
| 1658 | |
| 1659 | f_cleanup(); |
| 1660 | } |
| 1661 | |
Harald Welte | 7462a59 | 2020-11-23 22:07:07 +0100 | [diff] [blame^] | 1662 | /* CS-PAGING on SIG-BVC for unknown Location Area */ |
| 1663 | private function f_TC_paging_cs_sig_lac_unknown(charstring id) runs on BSSGP_ConnHdlr |
| 1664 | { |
| 1665 | var GSM_Types.LocationAreaIdentification unknown_la := { |
| 1666 | mcc_mnc := '567F99'H, |
| 1667 | lac := 33333 |
| 1668 | }; |
| 1669 | f_send_paging_cs_exp_no_bss(ts_BssgpP4LAC(unknown_la), 0, true); |
| 1670 | } |
| 1671 | testcase TC_paging_cs_sig_lac_unknown() runs on test_CT { |
| 1672 | var BSSGP_ConnHdlr vc_conn; |
| 1673 | f_init(); |
| 1674 | |
| 1675 | vc_conn := f_start_handler(refers(f_TC_paging_cs_sig_lac_unknown), testcasename(), g_pcu, g_sgsn, 11); |
| 1676 | vc_conn.done; |
| 1677 | |
| 1678 | f_cleanup(); |
| 1679 | } |
| 1680 | |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1681 | /* CS-PAGING on SIG-BVC for Routeing Area */ |
| 1682 | private function f_TC_paging_cs_sig_rac(charstring id) runs on BSSGP_ConnHdlr |
| 1683 | { |
| 1684 | /* Only PCU index 0 has a matching BVC within the LAC */ |
| 1685 | f_send_paging_cs_exp_multi(ts_BssgpP4RAC(pcu_bvc_cfg[0].cell_id.ra_id), 0, {0}); |
| 1686 | } |
| 1687 | testcase TC_paging_cs_sig_rac() runs on test_CT { |
| 1688 | var BSSGP_ConnHdlr vc_conn; |
| 1689 | f_init(); |
| 1690 | |
| 1691 | vc_conn := f_start_handler(refers(f_TC_paging_cs_sig_rac), testcasename(), g_pcu, g_sgsn, 15); |
| 1692 | vc_conn.done; |
| 1693 | |
| 1694 | f_cleanup(); |
| 1695 | } |
| 1696 | |
Harald Welte | 7462a59 | 2020-11-23 22:07:07 +0100 | [diff] [blame^] | 1697 | /* CS-PAGING on SIG-BVC for unknown Routeing Area */ |
| 1698 | private function f_TC_paging_cs_sig_rac_unknown(charstring id) runs on BSSGP_ConnHdlr |
| 1699 | { |
| 1700 | var RoutingAreaIdentification unknown_ra := { |
| 1701 | lai := { |
| 1702 | mcc_mnc := '567F99'H, |
| 1703 | lac := 33333 |
| 1704 | }, |
| 1705 | rac := 254 |
| 1706 | }; |
| 1707 | f_send_paging_cs_exp_no_bss(ts_BssgpP4RAC(unknown_ra), 0, true); |
| 1708 | } |
| 1709 | testcase TC_paging_cs_sig_rac_unknown() runs on test_CT { |
| 1710 | var BSSGP_ConnHdlr vc_conn; |
| 1711 | f_init(); |
| 1712 | |
| 1713 | vc_conn := f_start_handler(refers(f_TC_paging_cs_sig_rac_unknown), testcasename(), g_pcu, g_sgsn, 11); |
| 1714 | vc_conn.done; |
| 1715 | |
| 1716 | f_cleanup(); |
| 1717 | } |
| 1718 | |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1719 | /* CS-PAGING on SIG-BVC for BVCI (one cell) */ |
| 1720 | private function f_TC_paging_cs_sig_bvci(charstring id) runs on BSSGP_ConnHdlr |
| 1721 | { |
| 1722 | f_send_paging_cs_exp_multi(ts_BssgpP4Bvci(pcu_bvc_cfg[0].bvci), 0, {0}); |
| 1723 | } |
| 1724 | testcase TC_paging_cs_sig_bvci() runs on test_CT { |
| 1725 | var BSSGP_ConnHdlr vc_conn; |
| 1726 | f_init(); |
| 1727 | |
| 1728 | vc_conn := f_start_handler(refers(f_TC_paging_cs_sig_bvci), testcasename(), g_pcu, g_sgsn, 16); |
| 1729 | vc_conn.done; |
| 1730 | |
| 1731 | f_cleanup(); |
| 1732 | } |
| 1733 | |
Harald Welte | 7462a59 | 2020-11-23 22:07:07 +0100 | [diff] [blame^] | 1734 | /* CS-PAGING on SIG-BVC for unknown BVCI */ |
| 1735 | private function f_TC_paging_cs_sig_bvci_unknown(charstring id) runs on BSSGP_ConnHdlr |
| 1736 | { |
| 1737 | f_send_paging_cs_exp_no_bss(ts_BssgpP4Bvci(33333), 0, true); |
| 1738 | } |
| 1739 | testcase TC_paging_cs_sig_bvci_unknown() runs on test_CT { |
| 1740 | var BSSGP_ConnHdlr vc_conn; |
| 1741 | f_init(); |
| 1742 | |
| 1743 | vc_conn := f_start_handler(refers(f_TC_paging_cs_sig_bvci_unknown), testcasename(), g_pcu, g_sgsn, 11); |
| 1744 | vc_conn.done; |
| 1745 | |
| 1746 | f_cleanup(); |
| 1747 | } |
| 1748 | |
Daniel Willmann | 91a8e25b | 2020-11-24 14:50:59 +0100 | [diff] [blame] | 1749 | private function f_TC_flush_ll(charstring id) runs on BSSGP_ConnHdlr { |
| 1750 | var BssgpBvci bvci := g_pars.pcu[0].cfg.bvc[0].bvci; |
| 1751 | var integer i; |
| 1752 | for (i := 0; i < 10; i := i+1) { |
| 1753 | var template (value) PDU_BSSGP pdu_tx := ts_BSSGP_FLUSH_LL(g_pars.tlli, bvci, bvci_new := bvci); |
| 1754 | /* we cannot use pdu_tx as there are some subtle differences in the length field :/ */ |
| 1755 | var template (present) PDU_BSSGP pdu_rx := tr_BSSGP_FLUSH_LL(g_pars.tlli, bvci, bvci_new := bvci); |
| 1756 | |
| 1757 | f_sgsn2pcu(pdu_tx, pdu_rx, use_sig := true); |
| 1758 | |
| 1759 | pdu_tx := ts_BSSGP_FLUSH_LL_ACK(g_pars.tlli, int2oct(0, 1), 23, bvci_new := bvci); |
| 1760 | /* we cannot use pdu_tx as there are some subtle differences in the length field :/ */ |
| 1761 | pdu_rx := tr_BSSGP_FLUSH_LL_ACK(g_pars.tlli, int2oct(0, 1), 23, bvci_new := bvci); |
| 1762 | |
| 1763 | f_pcu2sgsn(pdu_tx, pdu_rx, use_sig := true); |
| 1764 | } |
| 1765 | setverdict(pass); |
| 1766 | } |
| 1767 | testcase TC_flush_ll() runs on test_CT |
| 1768 | { |
| 1769 | var BSSGP_ConnHdlr vc_conn; |
| 1770 | f_init(); |
| 1771 | |
| 1772 | vc_conn := f_start_handler(refers(f_TC_flush_ll), testcasename(), g_pcu, g_sgsn, 6); |
| 1773 | vc_conn.done; |
| 1774 | /* TODO: start multiple handlers (UEs) on various cells on same and other NSEs */ |
| 1775 | |
| 1776 | f_cleanup(); |
| 1777 | } |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 1778 | |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 1779 | control { |
| 1780 | execute( TC_BVC_bringup() ); |
Harald Welte | 9268601 | 2020-11-15 21:45:49 +0100 | [diff] [blame] | 1781 | execute( TC_ul_unitdata() ); |
Harald Welte | 78d8db9 | 2020-11-15 23:27:27 +0100 | [diff] [blame] | 1782 | execute( TC_dl_unitdata() ); |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 1783 | execute( TC_ra_capability() ); |
Daniel Willmann | ace3ece | 2020-11-16 19:53:26 +0100 | [diff] [blame] | 1784 | execute( TC_ra_capability_upd() ); |
Daniel Willmann | 165d661 | 2020-11-19 14:27:29 +0100 | [diff] [blame] | 1785 | execute( TC_radio_status() ); |
Daniel Willmann | fa67f49 | 2020-11-19 15:48:05 +0100 | [diff] [blame] | 1786 | execute( TC_suspend() ); |
Daniel Willmann | 087a33d | 2020-11-19 15:58:43 +0100 | [diff] [blame] | 1787 | execute( TC_resume() ); |
Harald Welte | f8ef028 | 2020-11-18 12:16:59 +0100 | [diff] [blame] | 1788 | if (false) { |
| 1789 | /* don't enable this by default, as we don't yet have any automatic test setup for FR with 4 NS-VC */ |
| 1790 | execute( TC_load_sharing_dl() ); |
| 1791 | } |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1792 | |
| 1793 | /* PAGING-PS over PTP BVC */ |
| 1794 | execute( TC_paging_ps_ptp_bss() ); |
| 1795 | execute( TC_paging_ps_ptp_lac() ); |
Harald Welte | 7462a59 | 2020-11-23 22:07:07 +0100 | [diff] [blame^] | 1796 | execute( TC_paging_ps_ptp_lac_unknown() ); |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1797 | execute( TC_paging_ps_ptp_rac() ); |
Harald Welte | 7462a59 | 2020-11-23 22:07:07 +0100 | [diff] [blame^] | 1798 | execute( TC_paging_ps_ptp_rac_unknown() ); |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1799 | execute( TC_paging_ps_ptp_bvci() ); |
Harald Welte | 7462a59 | 2020-11-23 22:07:07 +0100 | [diff] [blame^] | 1800 | execute( TC_paging_ps_ptp_bvci_unknown() ); |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1801 | |
| 1802 | /* PAGING-PS over SIG BVC */ |
| 1803 | execute( TC_paging_ps_sig_bss() ); |
| 1804 | execute( TC_paging_ps_sig_lac() ); |
Harald Welte | 7462a59 | 2020-11-23 22:07:07 +0100 | [diff] [blame^] | 1805 | execute( TC_paging_ps_sig_lac_unknown() ); |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1806 | execute( TC_paging_ps_sig_rac() ); |
Harald Welte | 7462a59 | 2020-11-23 22:07:07 +0100 | [diff] [blame^] | 1807 | execute( TC_paging_ps_sig_rac_unknown() ); |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1808 | execute( TC_paging_ps_sig_bvci() ); |
Harald Welte | 7462a59 | 2020-11-23 22:07:07 +0100 | [diff] [blame^] | 1809 | execute( TC_paging_ps_sig_bvci_unknown() ); |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1810 | |
| 1811 | /* PAGING-CS over PTP BVC */ |
| 1812 | execute( TC_paging_cs_ptp_bss() ); |
| 1813 | execute( TC_paging_cs_ptp_lac() ); |
Harald Welte | 7462a59 | 2020-11-23 22:07:07 +0100 | [diff] [blame^] | 1814 | execute( TC_paging_cs_ptp_lac_unknown() ); |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1815 | execute( TC_paging_cs_ptp_rac() ); |
Harald Welte | 7462a59 | 2020-11-23 22:07:07 +0100 | [diff] [blame^] | 1816 | execute( TC_paging_cs_ptp_rac_unknown() ); |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1817 | execute( TC_paging_cs_ptp_bvci() ); |
Harald Welte | 7462a59 | 2020-11-23 22:07:07 +0100 | [diff] [blame^] | 1818 | execute( TC_paging_cs_ptp_bvci_unknown() ); |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1819 | |
| 1820 | /* PAGING-CS over SIG BVC */ |
| 1821 | execute( TC_paging_cs_sig_bss() ); |
| 1822 | execute( TC_paging_cs_sig_lac() ); |
Harald Welte | 7462a59 | 2020-11-23 22:07:07 +0100 | [diff] [blame^] | 1823 | execute( TC_paging_cs_sig_lac_unknown() ); |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1824 | execute( TC_paging_cs_sig_rac() ); |
Harald Welte | 7462a59 | 2020-11-23 22:07:07 +0100 | [diff] [blame^] | 1825 | execute( TC_paging_cs_sig_rac_unknown() ); |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1826 | execute( TC_paging_cs_sig_bvci() ); |
Harald Welte | 7462a59 | 2020-11-23 22:07:07 +0100 | [diff] [blame^] | 1827 | execute( TC_paging_cs_sig_bvci_unknown() ); |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1828 | |
| 1829 | |
Daniel Willmann | 91a8e25b | 2020-11-24 14:50:59 +0100 | [diff] [blame] | 1830 | execute( TC_flush_ll() ); |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 1831 | } |
| 1832 | |
| 1833 | |
| 1834 | } |