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 | |
| 1041 | private function f_TC_paging_ps_ptp_bss(charstring id) runs on BSSGP_ConnHdlr |
| 1042 | { |
| 1043 | /* doesn't really make sense: Sending to a single BVCI means the message ends up |
| 1044 | * at that BVC (cell) only, and paging all over the BSS area is not possible */ |
| 1045 | f_send_paging_ps_exp_one_bss(ts_BssgpP4BssArea, 0, false, 0); |
| 1046 | } |
| 1047 | testcase TC_paging_ps_ptp_bss() runs on test_CT { |
| 1048 | var BSSGP_ConnHdlr vc_conn; |
| 1049 | f_init(); |
| 1050 | |
| 1051 | vc_conn := f_start_handler(refers(f_TC_paging_ps_ptp_bss), testcasename(), g_pcu, g_sgsn, 9); |
| 1052 | vc_conn.done; |
| 1053 | |
| 1054 | f_cleanup(); |
| 1055 | } |
| 1056 | |
| 1057 | /* PS-PAGING on PTP-BVC for Location Area */ |
| 1058 | private function f_TC_paging_ps_ptp_lac(charstring id) runs on BSSGP_ConnHdlr |
| 1059 | { |
| 1060 | var template (present) PDU_BSSGP exp_rx; |
| 1061 | /* doesn't really make sense: Sending to a single BVCI means the message ends up |
| 1062 | * at that BVC (cell) only, and paging all over the BSS area is not possible */ |
| 1063 | f_send_paging_ps_exp_one_bss(ts_BssgpP4LAC(pcu_bvc_cfg[0].cell_id.ra_id.lai), 0, false, 0); |
| 1064 | } |
| 1065 | testcase TC_paging_ps_ptp_lac() runs on test_CT { |
| 1066 | var BSSGP_ConnHdlr vc_conn; |
| 1067 | f_init(); |
| 1068 | |
| 1069 | vc_conn := f_start_handler(refers(f_TC_paging_ps_ptp_lac), testcasename(), g_pcu, g_sgsn, 10); |
| 1070 | vc_conn.done; |
| 1071 | |
| 1072 | f_cleanup(); |
| 1073 | } |
| 1074 | |
| 1075 | /* PS-PAGING on PTP-BVC for Routeing Area */ |
| 1076 | private function f_TC_paging_ps_ptp_rac(charstring id) runs on BSSGP_ConnHdlr |
| 1077 | { |
| 1078 | /* doesn't really make sense: Sending to a single BVCI means the message ends up |
| 1079 | * at that BVC (cell) only, and paging all over the BSS area is not possible */ |
| 1080 | f_send_paging_ps_exp_one_bss(ts_BssgpP4RAC(pcu_bvc_cfg[0].cell_id.ra_id), 0, false, 0); |
| 1081 | } |
| 1082 | testcase TC_paging_ps_ptp_rac() runs on test_CT { |
| 1083 | var BSSGP_ConnHdlr vc_conn; |
| 1084 | f_init(); |
| 1085 | |
| 1086 | vc_conn := f_start_handler(refers(f_TC_paging_ps_ptp_rac), testcasename(), g_pcu, g_sgsn, 11); |
| 1087 | vc_conn.done; |
| 1088 | |
| 1089 | f_cleanup(); |
| 1090 | } |
| 1091 | |
| 1092 | /* PS-PAGING on PTP-BVC for BVCI (one cell) */ |
| 1093 | private function f_TC_paging_ps_ptp_bvci(charstring id) runs on BSSGP_ConnHdlr |
| 1094 | { |
| 1095 | /* this should be the normal case for MS in READY MM state after a lower layer failure */ |
| 1096 | f_send_paging_ps_exp_one_bss(ts_BssgpP4Bvci(pcu_bvc_cfg[0].bvci), 0, false, 0); |
| 1097 | } |
| 1098 | testcase TC_paging_ps_ptp_bvci() runs on test_CT { |
| 1099 | var BSSGP_ConnHdlr vc_conn; |
| 1100 | f_init(); |
| 1101 | |
| 1102 | vc_conn := f_start_handler(refers(f_TC_paging_ps_ptp_bvci), testcasename(), g_pcu, g_sgsn, 12); |
| 1103 | vc_conn.done; |
| 1104 | |
| 1105 | f_cleanup(); |
| 1106 | } |
| 1107 | |
| 1108 | /* altstep for expecting BSSGP PDU on signaling BVC of given pcu_idx + storing in 'roi' */ |
| 1109 | private altstep as_paging_sig_pcu(integer pcu_idx, template (present) PDU_BSSGP exp_rx, inout ro_integer roi) |
| 1110 | runs on BSSGP_ConnHdlr { |
| 1111 | [] PCU_SIG[pcu_idx].receive(exp_rx) { |
| 1112 | if (ro_integer_contains(roi, pcu_idx)) { |
| 1113 | setverdict(fail, "Received multiple paging on same SIG BVC"); |
| 1114 | } |
| 1115 | roi := roi & { pcu_idx }; |
| 1116 | repeat; |
| 1117 | } |
| 1118 | [] PCU[pcu_idx].receive(exp_rx) { |
| 1119 | setverdict(fail, "Received paging on PTP BVC, expected SIGNALING BVC"); |
| 1120 | } |
| 1121 | [] PCU_SIG[pcu_idx].receive(PDU_BSSGP:{pDU_BSSGP_PAGING_PS:=?}) { |
| 1122 | setverdict(fail, "Different Paging than expected received SIGNALING BVC"); |
| 1123 | } |
| 1124 | [] PCU[pcu_idx].receive(PDU_BSSGP:{pDU_BSSGP_PAGING_PS:=?}) { |
| 1125 | setverdict(fail, "Different Paging than expected received PTP BVC"); |
| 1126 | } |
| 1127 | } |
| 1128 | |
| 1129 | type record of default ro_default; |
| 1130 | |
| 1131 | /* send PS-PAGING on SIG BVC, expect it to arrive on given list of PCU indexes */ |
| 1132 | private function f_send_paging_ps_exp_multi(template (value) Paging_Field4 p4, integer sgsn_idx := 0, |
| 1133 | ro_integer exp_on_pcu_idx) runs on BSSGP_ConnHdlr |
| 1134 | { |
| 1135 | var template (present) PDU_BSSGP exp_rx; |
| 1136 | exp_rx := f_send_paging_ps(p4, 0, true); |
| 1137 | |
| 1138 | /* FIXME: make sure the relevant BVCs/BSS are connected to the ports! */ |
| 1139 | var ro_default defaults := {}; |
| 1140 | for (var integer i := 0; i < lengthof(mp_nsconfig_pcu); i := i+1) { |
| 1141 | var default d := activate(as_paging_sig_pcu(i, exp_rx, g_roi)); |
| 1142 | defaults := defaults & { d }; |
| 1143 | } |
| 1144 | f_sleep(2.0); |
| 1145 | for (var integer i := 0; i < lengthof(defaults); i := i+1) { |
| 1146 | deactivate(defaults[i]); |
| 1147 | } |
| 1148 | log("Paging received on PCU ", g_roi); |
| 1149 | |
| 1150 | for (var integer i := 0; i < lengthof(mp_nsconfig_pcu); i := i+1) { |
| 1151 | var boolean rx_on_i := ro_integer_contains(g_roi, i); |
| 1152 | var boolean exp_on_i := ro_integer_contains(exp_on_pcu_idx, i); |
| 1153 | if (exp_on_i and not rx_on_i) { |
| 1154 | setverdict(fail, "PS-PAGING not received on ", mp_nsconfig_pcu[i].nsei); |
| 1155 | } |
| 1156 | if (not exp_on_i and rx_on_i) { |
| 1157 | setverdict(fail, "PS-PAGING not expected but received on ", mp_nsconfig_pcu[i].nsei); |
| 1158 | } |
| 1159 | } |
| 1160 | setverdict(pass); |
| 1161 | } |
| 1162 | |
| 1163 | /* PS-PAGING on SIG-BVC for BSS Area */ |
| 1164 | private function f_TC_paging_ps_sig_bss(charstring id) runs on BSSGP_ConnHdlr |
| 1165 | { |
| 1166 | /* we expect the paging to arrive on all three NSE */ |
| 1167 | f_send_paging_ps_exp_multi(ts_BssgpP4BssArea, 0, {0, 1, 2}); |
| 1168 | } |
| 1169 | testcase TC_paging_ps_sig_bss() 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_sig_bss), testcasename(), g_pcu, g_sgsn, 13); |
| 1174 | vc_conn.done; |
| 1175 | |
| 1176 | f_cleanup(); |
| 1177 | } |
| 1178 | |
| 1179 | /* PS-PAGING on SIG-BVC for Location Area */ |
| 1180 | private function f_TC_paging_ps_sig_lac(charstring id) runs on BSSGP_ConnHdlr |
| 1181 | { |
| 1182 | /* Both PCU index 0 and 1 have a BVC within the LAC */ |
| 1183 | f_send_paging_ps_exp_multi(ts_BssgpP4LAC(pcu_bvc_cfg[0].cell_id.ra_id.lai), 0, {0, 1}); |
| 1184 | } |
| 1185 | testcase TC_paging_ps_sig_lac() 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_sig_lac), testcasename(), g_pcu, g_sgsn, 14); |
| 1190 | vc_conn.done; |
| 1191 | |
| 1192 | f_cleanup(); |
| 1193 | } |
| 1194 | |
| 1195 | /* PS-PAGING on SIG-BVC for Routeing Area */ |
| 1196 | private function f_TC_paging_ps_sig_rac(charstring id) runs on BSSGP_ConnHdlr |
| 1197 | { |
| 1198 | /* Only PCU index 0 has a matching BVC within the LAC */ |
| 1199 | f_send_paging_ps_exp_multi(ts_BssgpP4RAC(pcu_bvc_cfg[0].cell_id.ra_id), 0, {0}); |
| 1200 | } |
| 1201 | testcase TC_paging_ps_sig_rac() runs on test_CT { |
| 1202 | var BSSGP_ConnHdlr vc_conn; |
| 1203 | f_init(); |
| 1204 | |
| 1205 | vc_conn := f_start_handler(refers(f_TC_paging_ps_sig_rac), testcasename(), g_pcu, g_sgsn, 15); |
| 1206 | vc_conn.done; |
| 1207 | |
| 1208 | f_cleanup(); |
| 1209 | } |
| 1210 | |
| 1211 | /* PS-PAGING on SIG-BVC for BVCI (one cell) */ |
| 1212 | private function f_TC_paging_ps_sig_bvci(charstring id) runs on BSSGP_ConnHdlr |
| 1213 | { |
| 1214 | f_send_paging_ps_exp_multi(ts_BssgpP4Bvci(pcu_bvc_cfg[0].bvci), 0, {0}); |
| 1215 | } |
| 1216 | testcase TC_paging_ps_sig_bvci() runs on test_CT { |
| 1217 | var BSSGP_ConnHdlr vc_conn; |
| 1218 | f_init(); |
| 1219 | |
| 1220 | vc_conn := f_start_handler(refers(f_TC_paging_ps_sig_bvci), testcasename(), g_pcu, g_sgsn, 16); |
| 1221 | vc_conn.done; |
| 1222 | |
| 1223 | f_cleanup(); |
| 1224 | } |
| 1225 | |
| 1226 | |
| 1227 | /*********************************************************************** |
| 1228 | * PAGING CS procedure |
| 1229 | ***********************************************************************/ |
| 1230 | |
| 1231 | private function f_send_paging_cs(template (value) Paging_Field4 p4, integer sgsn_idx := 0, |
| 1232 | boolean use_sig := false) |
| 1233 | runs on BSSGP_ConnHdlr return template (present) PDU_BSSGP { |
| 1234 | var template (value) PDU_BSSGP pdu_tx; |
| 1235 | var template (present) PDU_BSSGP pdu_rx; |
| 1236 | /* we always specify '0' as BVCI in the templates below, as we override it with |
| 1237 | * 'p4' later anyway */ |
| 1238 | pdu_rx := tr_BSSGP_CS_PAGING(0); |
| 1239 | pdu_rx.pDU_BSSGP_PAGING_CS.iMSI := tr_BSSGP_IMSI(g_pars.imsi); |
| 1240 | if (ispresent(g_pars.p_tmsi)) { |
| 1241 | pdu_tx := ts_BSSGP_CS_PAGING_PTMSI(0, g_pars.imsi, oct2int(g_pars.p_tmsi)); |
| 1242 | pdu_rx.pDU_BSSGP_PAGING_CS.tMSI := tr_BSSGP_TMSI(oct2int(g_pars.p_tmsi)); |
| 1243 | } else { |
| 1244 | pdu_tx := ts_BSSGP_CS_PAGING_IMSI(0, g_pars.imsi); |
| 1245 | pdu_rx.pDU_BSSGP_PAGING_CS.tMSI := omit; |
| 1246 | } |
| 1247 | pdu_tx.pDU_BSSGP_PAGING_CS.paging_Field4 := p4; |
| 1248 | pdu_rx.pDU_BSSGP_PAGING_CS.paging_Field4 := p4; |
| 1249 | if (use_sig == false) { |
| 1250 | SGSN[sgsn_idx].send(pdu_tx); |
| 1251 | } else { |
| 1252 | SGSN_SIG[sgsn_idx].send(pdu_tx); |
| 1253 | } |
| 1254 | return pdu_rx; |
| 1255 | } |
| 1256 | |
| 1257 | /* send paging defined by 'p4' on given SGSN-side index (ptp or signaling) and expect one paging to arrive on |
| 1258 | * specified PCU index */ |
| 1259 | private function f_send_paging_cs_exp_one_bss(template (value) Paging_Field4 p4, integer sgsn_idx := 0, |
| 1260 | boolean use_sig := false,integer pcu_idx := 0) |
| 1261 | runs on BSSGP_ConnHdlr { |
| 1262 | var template (present) PDU_BSSGP exp_rx; |
| 1263 | /* doesn't really make sense: Sending to a single BVCI means the message ends up |
| 1264 | * at that BVC (cell) only, and paging all over the BSS area is not possible */ |
| 1265 | exp_rx := f_send_paging_cs(p4, sgsn_idx, use_sig); |
| 1266 | /* Expect paging to propagate to the one BSS addressed by the BVCI only */ |
| 1267 | timer T := 2.0; |
| 1268 | T.start; |
| 1269 | alt { |
| 1270 | [not use_sig] PCU[pcu_idx].receive(exp_rx) { |
| 1271 | setverdict(pass); |
| 1272 | repeat; |
| 1273 | } |
| 1274 | [not use_sig] PCU_SIG[pcu_idx].receive(exp_rx) { |
| 1275 | setverdict(fail, "Received paging on SIGNALING BVC, expected PTP BVC"); |
| 1276 | } |
| 1277 | [use_sig] PCU_SIG[pcu_idx].receive(exp_rx) { |
| 1278 | setverdict(pass); |
| 1279 | repeat; |
| 1280 | } |
| 1281 | [use_sig] PCU[pcu_idx].receive(exp_rx) { |
| 1282 | setverdict(fail, "Received paging on PTP BVC, expected SIGNALING BVC"); |
| 1283 | } |
| 1284 | [] any from PCU.receive(exp_rx) { |
| 1285 | setverdict(fail, "Paging received on unexpected BVC"); |
| 1286 | } |
| 1287 | [] any from PCU_SIG.receive(exp_rx) { |
| 1288 | setverdict(fail, "Paging received on unexpected BVC"); |
| 1289 | } |
| 1290 | [] any from PCU.receive(PDU_BSSGP:{pDU_BSSGP_PAGING_CS:=?}) { |
| 1291 | setverdict(fail, "Different Paging than expected received PTP BVC"); |
| 1292 | } |
| 1293 | [] any from PCU_SIG.receive(PDU_BSSGP:{pDU_BSSGP_PAGING_CS:=?}) { |
| 1294 | setverdict(fail, "Different Paging than expected on SIGNALING BVC"); |
| 1295 | } |
| 1296 | [] T.timeout; |
| 1297 | } |
| 1298 | } |
| 1299 | |
| 1300 | private function f_TC_paging_cs_ptp_bss(charstring id) runs on BSSGP_ConnHdlr |
| 1301 | { |
| 1302 | /* doesn't really make sense: Sending to a single BVCI means the message ends up |
| 1303 | * at that BVC (cell) only, and paging all over the BSS area is not possible */ |
| 1304 | f_send_paging_cs_exp_one_bss(ts_BssgpP4BssArea, 0, false, 0); |
| 1305 | } |
| 1306 | testcase TC_paging_cs_ptp_bss() runs on test_CT { |
| 1307 | var BSSGP_ConnHdlr vc_conn; |
| 1308 | f_init(); |
| 1309 | |
| 1310 | vc_conn := f_start_handler(refers(f_TC_paging_cs_ptp_bss), testcasename(), g_pcu, g_sgsn, 17); |
| 1311 | vc_conn.done; |
| 1312 | |
| 1313 | f_cleanup(); |
| 1314 | } |
| 1315 | |
| 1316 | /* CS-PAGING on PTP-BVC for Location Area */ |
| 1317 | private function f_TC_paging_cs_ptp_lac(charstring id) runs on BSSGP_ConnHdlr |
| 1318 | { |
| 1319 | var template (present) PDU_BSSGP exp_rx; |
| 1320 | /* doesn't really make sense: Sending to a single BVCI means the message ends up |
| 1321 | * at that BVC (cell) only, and paging all over the BSS area is not possible */ |
| 1322 | f_send_paging_cs_exp_one_bss(ts_BssgpP4LAC(pcu_bvc_cfg[0].cell_id.ra_id.lai), 0, false, 0); |
| 1323 | } |
| 1324 | testcase TC_paging_cs_ptp_lac() runs on test_CT { |
| 1325 | var BSSGP_ConnHdlr vc_conn; |
| 1326 | f_init(); |
| 1327 | |
| 1328 | vc_conn := f_start_handler(refers(f_TC_paging_cs_ptp_lac), testcasename(), g_pcu, g_sgsn, 18); |
| 1329 | vc_conn.done; |
| 1330 | |
| 1331 | f_cleanup(); |
| 1332 | } |
| 1333 | |
| 1334 | /* CS-PAGING on PTP-BVC for Routeing Area */ |
| 1335 | private function f_TC_paging_cs_ptp_rac(charstring id) runs on BSSGP_ConnHdlr |
| 1336 | { |
| 1337 | /* doesn't really make sense: Sending to a single BVCI means the message ends up |
| 1338 | * at that BVC (cell) only, and paging all over the BSS area is not possible */ |
| 1339 | f_send_paging_cs_exp_one_bss(ts_BssgpP4RAC(pcu_bvc_cfg[0].cell_id.ra_id), 0, false, 0); |
| 1340 | } |
| 1341 | testcase TC_paging_cs_ptp_rac() runs on test_CT { |
| 1342 | var BSSGP_ConnHdlr vc_conn; |
| 1343 | f_init(); |
| 1344 | |
| 1345 | vc_conn := f_start_handler(refers(f_TC_paging_cs_ptp_rac), testcasename(), g_pcu, g_sgsn, 19); |
| 1346 | vc_conn.done; |
| 1347 | |
| 1348 | f_cleanup(); |
| 1349 | } |
| 1350 | |
| 1351 | /* CS-PAGING on PTP-BVC for BVCI (one cell) */ |
| 1352 | private function f_TC_paging_cs_ptp_bvci(charstring id) runs on BSSGP_ConnHdlr |
| 1353 | { |
| 1354 | /* this should be the normal case for MS in READY MM state after a lower layer failure */ |
| 1355 | f_send_paging_cs_exp_one_bss(ts_BssgpP4Bvci(pcu_bvc_cfg[0].bvci), 0, false, 0); |
| 1356 | } |
| 1357 | testcase TC_paging_cs_ptp_bvci() runs on test_CT { |
| 1358 | var BSSGP_ConnHdlr vc_conn; |
| 1359 | f_init(); |
| 1360 | |
| 1361 | vc_conn := f_start_handler(refers(f_TC_paging_cs_ptp_bvci), testcasename(), g_pcu, g_sgsn, 20); |
| 1362 | vc_conn.done; |
| 1363 | |
| 1364 | f_cleanup(); |
| 1365 | } |
| 1366 | |
| 1367 | /* send CS-PAGING on SIG BVC, expect it to arrive on given list of PCU indexes */ |
| 1368 | private function f_send_paging_cs_exp_multi(template (value) Paging_Field4 p4, integer sgsn_idx := 0, |
| 1369 | ro_integer exp_on_pcu_idx) runs on BSSGP_ConnHdlr |
| 1370 | { |
| 1371 | var template (present) PDU_BSSGP exp_rx; |
| 1372 | exp_rx := f_send_paging_cs(p4, 0, true); |
| 1373 | |
| 1374 | /* FIXME: make sure the relevant BVCs/BSS are connected to the ports! */ |
| 1375 | var ro_default defaults := {}; |
| 1376 | for (var integer i := 0; i < lengthof(mp_nsconfig_pcu); i := i+1) { |
| 1377 | var default d := activate(as_paging_sig_pcu(i, exp_rx, g_roi)); |
| 1378 | defaults := defaults & { d }; |
| 1379 | } |
| 1380 | f_sleep(2.0); |
| 1381 | for (var integer i := 0; i < lengthof(defaults); i := i+1) { |
| 1382 | deactivate(defaults[i]); |
| 1383 | } |
| 1384 | log("Paging received on PCU ", g_roi); |
| 1385 | |
| 1386 | for (var integer i := 0; i < lengthof(mp_nsconfig_pcu); i := i+1) { |
| 1387 | var boolean rx_on_i := ro_integer_contains(g_roi, i); |
| 1388 | var boolean exp_on_i := ro_integer_contains(exp_on_pcu_idx, i); |
| 1389 | if (exp_on_i and not rx_on_i) { |
| 1390 | setverdict(fail, "PS-PAGING not received on ", mp_nsconfig_pcu[i].nsei); |
| 1391 | } |
| 1392 | if (not exp_on_i and rx_on_i) { |
| 1393 | setverdict(fail, "PS-PAGING not expected but received on ", mp_nsconfig_pcu[i].nsei); |
| 1394 | } |
| 1395 | } |
| 1396 | setverdict(pass); |
| 1397 | } |
| 1398 | |
| 1399 | /* CS-PAGING on SIG-BVC for BSS Area */ |
| 1400 | private function f_TC_paging_cs_sig_bss(charstring id) runs on BSSGP_ConnHdlr |
| 1401 | { |
| 1402 | /* we expect the paging to arrive on all three NSE */ |
| 1403 | f_send_paging_cs_exp_multi(ts_BssgpP4BssArea, 0, {0, 1, 2}); |
| 1404 | } |
| 1405 | testcase TC_paging_cs_sig_bss() runs on test_CT { |
| 1406 | var BSSGP_ConnHdlr vc_conn; |
| 1407 | f_init(); |
| 1408 | |
| 1409 | vc_conn := f_start_handler(refers(f_TC_paging_cs_sig_bss), testcasename(), g_pcu, g_sgsn, 13); |
| 1410 | vc_conn.done; |
| 1411 | |
| 1412 | f_cleanup(); |
| 1413 | } |
| 1414 | |
| 1415 | /* CS-PAGING on SIG-BVC for Location Area */ |
| 1416 | private function f_TC_paging_cs_sig_lac(charstring id) runs on BSSGP_ConnHdlr |
| 1417 | { |
| 1418 | /* Both PCU index 0 and 1 have a BVC within the LAC */ |
| 1419 | f_send_paging_cs_exp_multi(ts_BssgpP4LAC(pcu_bvc_cfg[0].cell_id.ra_id.lai), 0, {0, 1}); |
| 1420 | } |
| 1421 | testcase TC_paging_cs_sig_lac() runs on test_CT { |
| 1422 | var BSSGP_ConnHdlr vc_conn; |
| 1423 | f_init(); |
| 1424 | |
| 1425 | vc_conn := f_start_handler(refers(f_TC_paging_cs_sig_lac), testcasename(), g_pcu, g_sgsn, 14); |
| 1426 | vc_conn.done; |
| 1427 | |
| 1428 | f_cleanup(); |
| 1429 | } |
| 1430 | |
| 1431 | /* CS-PAGING on SIG-BVC for Routeing Area */ |
| 1432 | private function f_TC_paging_cs_sig_rac(charstring id) runs on BSSGP_ConnHdlr |
| 1433 | { |
| 1434 | /* Only PCU index 0 has a matching BVC within the LAC */ |
| 1435 | f_send_paging_cs_exp_multi(ts_BssgpP4RAC(pcu_bvc_cfg[0].cell_id.ra_id), 0, {0}); |
| 1436 | } |
| 1437 | testcase TC_paging_cs_sig_rac() runs on test_CT { |
| 1438 | var BSSGP_ConnHdlr vc_conn; |
| 1439 | f_init(); |
| 1440 | |
| 1441 | vc_conn := f_start_handler(refers(f_TC_paging_cs_sig_rac), testcasename(), g_pcu, g_sgsn, 15); |
| 1442 | vc_conn.done; |
| 1443 | |
| 1444 | f_cleanup(); |
| 1445 | } |
| 1446 | |
| 1447 | /* CS-PAGING on SIG-BVC for BVCI (one cell) */ |
| 1448 | private function f_TC_paging_cs_sig_bvci(charstring id) runs on BSSGP_ConnHdlr |
| 1449 | { |
| 1450 | f_send_paging_cs_exp_multi(ts_BssgpP4Bvci(pcu_bvc_cfg[0].bvci), 0, {0}); |
| 1451 | } |
| 1452 | testcase TC_paging_cs_sig_bvci() runs on test_CT { |
| 1453 | var BSSGP_ConnHdlr vc_conn; |
| 1454 | f_init(); |
| 1455 | |
| 1456 | vc_conn := f_start_handler(refers(f_TC_paging_cs_sig_bvci), testcasename(), g_pcu, g_sgsn, 16); |
| 1457 | vc_conn.done; |
| 1458 | |
| 1459 | f_cleanup(); |
| 1460 | } |
| 1461 | |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 1462 | |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 1463 | control { |
| 1464 | execute( TC_BVC_bringup() ); |
Harald Welte | 9268601 | 2020-11-15 21:45:49 +0100 | [diff] [blame] | 1465 | execute( TC_ul_unitdata() ); |
Harald Welte | 78d8db9 | 2020-11-15 23:27:27 +0100 | [diff] [blame] | 1466 | execute( TC_dl_unitdata() ); |
Harald Welte | 6dc2ac4 | 2020-11-16 09:16:17 +0100 | [diff] [blame] | 1467 | execute( TC_ra_capability() ); |
Daniel Willmann | ace3ece | 2020-11-16 19:53:26 +0100 | [diff] [blame] | 1468 | execute( TC_ra_capability_upd() ); |
Daniel Willmann | 165d661 | 2020-11-19 14:27:29 +0100 | [diff] [blame] | 1469 | execute( TC_radio_status() ); |
Daniel Willmann | fa67f49 | 2020-11-19 15:48:05 +0100 | [diff] [blame] | 1470 | execute( TC_suspend() ); |
Daniel Willmann | 087a33d | 2020-11-19 15:58:43 +0100 | [diff] [blame] | 1471 | execute( TC_resume() ); |
Harald Welte | f8ef028 | 2020-11-18 12:16:59 +0100 | [diff] [blame] | 1472 | if (false) { |
| 1473 | /* don't enable this by default, as we don't yet have any automatic test setup for FR with 4 NS-VC */ |
| 1474 | execute( TC_load_sharing_dl() ); |
| 1475 | } |
Harald Welte | 0e18824 | 2020-11-22 21:46:48 +0100 | [diff] [blame] | 1476 | |
| 1477 | /* PAGING-PS over PTP BVC */ |
| 1478 | execute( TC_paging_ps_ptp_bss() ); |
| 1479 | execute( TC_paging_ps_ptp_lac() ); |
| 1480 | execute( TC_paging_ps_ptp_rac() ); |
| 1481 | execute( TC_paging_ps_ptp_bvci() ); |
| 1482 | |
| 1483 | /* PAGING-PS over SIG BVC */ |
| 1484 | execute( TC_paging_ps_sig_bss() ); |
| 1485 | execute( TC_paging_ps_sig_lac() ); |
| 1486 | execute( TC_paging_ps_sig_rac() ); |
| 1487 | execute( TC_paging_ps_sig_bvci() ); |
| 1488 | |
| 1489 | /* PAGING-CS over PTP BVC */ |
| 1490 | execute( TC_paging_cs_ptp_bss() ); |
| 1491 | execute( TC_paging_cs_ptp_lac() ); |
| 1492 | execute( TC_paging_cs_ptp_rac() ); |
| 1493 | execute( TC_paging_cs_ptp_bvci() ); |
| 1494 | |
| 1495 | /* PAGING-CS over SIG BVC */ |
| 1496 | execute( TC_paging_cs_sig_bss() ); |
| 1497 | execute( TC_paging_cs_sig_lac() ); |
| 1498 | execute( TC_paging_cs_sig_rac() ); |
| 1499 | execute( TC_paging_cs_sig_bvci() ); |
| 1500 | |
| 1501 | |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 1502 | } |
| 1503 | |
| 1504 | |
| 1505 | } |