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 | |
| 40 | modulepar { |
| 41 | /* IP/port on which we run our internal GSUP/HLR emulation */ |
| 42 | NSConfigurations_SGSN mp_nsconfig_sgsn := { |
| 43 | { |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 44 | nsei := 101, |
| 45 | role_sgsn := true, |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 46 | handle_sns := false, |
| 47 | nsvc := { |
| 48 | { |
| 49 | provider := { |
| 50 | ip := { |
| 51 | address_family := AF_INET, |
| 52 | local_udp_port := 7777, |
| 53 | local_ip := "127.0.0.1", |
| 54 | remote_udp_port := 23000, |
| 55 | remote_ip := "127.0.0.1" |
| 56 | } |
| 57 | }, |
| 58 | nsvci := 101 |
| 59 | } |
| 60 | } |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 61 | } |
| 62 | }; |
| 63 | NSConfigurations_PCU mp_nsconfig_pcu := { |
| 64 | { |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 65 | nsei := 96, |
| 66 | role_sgsn := false, |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 67 | handle_sns := false, |
| 68 | nsvc := { |
| 69 | { |
| 70 | provider := { |
| 71 | ip := { |
| 72 | address_family := AF_INET, |
| 73 | local_udp_port := 21010, |
| 74 | local_ip := "127.0.0.1", |
| 75 | remote_udp_port := 23000, |
| 76 | remote_ip := "127.0.0.1" |
| 77 | } |
| 78 | }, |
| 79 | nsvci := 97 |
| 80 | } |
| 81 | } |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 82 | }, |
| 83 | { |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 84 | nsei := 97, |
| 85 | role_sgsn := false, |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 86 | handle_sns := false, |
| 87 | nsvc := { |
| 88 | { |
| 89 | provider := { |
| 90 | ip := { |
| 91 | address_family := AF_INET, |
| 92 | local_udp_port := 21011, |
| 93 | local_ip := "127.0.0.1", |
| 94 | remote_udp_port := 23000, |
| 95 | remote_ip := "127.0.0.1" |
| 96 | } |
| 97 | }, |
| 98 | nsvci := 98 |
| 99 | } |
| 100 | } |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 101 | }, |
| 102 | { |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 103 | nsei := 98, |
| 104 | role_sgsn := false, |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 105 | handle_sns := false, |
| 106 | nsvc := { |
| 107 | { |
| 108 | provider := { |
| 109 | ip := { |
| 110 | address_family := AF_INET, |
| 111 | local_udp_port := 21012, |
| 112 | local_ip := "127.0.0.1", |
| 113 | remote_udp_port := 23000, |
| 114 | remote_ip := "127.0.0.1" |
| 115 | } |
| 116 | }, |
| 117 | nsvci := 99 |
| 118 | } |
| 119 | } |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 120 | } |
| 121 | }; |
| 122 | }; |
| 123 | |
| 124 | const integer NUM_BVC_PER_NSE := 3; |
| 125 | type record GbInstance { |
| 126 | NS_CT vc_NS, |
| 127 | BSSGP_CT vc_BSSGP, |
| 128 | BSSGP_BVC_CT vc_BSSGP_BVC[NUM_BVC_PER_NSE], |
| 129 | BssgpConfig cfg |
| 130 | }; |
| 131 | |
| 132 | const integer NUM_PCU := 3; |
| 133 | type record length(NUM_PCU) of GbInstance GbInstances_PCU; |
| 134 | type record length(NUM_PCU) of NSConfiguration NSConfigurations_PCU; |
| 135 | type record length(NUM_PCU) of BssgpCellId BssgpCellIds; |
| 136 | |
| 137 | const integer NUM_SGSN := 1; |
| 138 | type record length(NUM_SGSN) of GbInstance GbInstances_SGSN; |
| 139 | type record length(NUM_SGSN) of NSConfiguration NSConfigurations_SGSN; |
| 140 | |
| 141 | type component test_CT { |
| 142 | var GbInstances_PCU g_pcu; |
| 143 | var GbInstances_SGSN g_sgsn; |
| 144 | |
| 145 | port BSSGP_CT_PROC_PT PROC; |
| 146 | |
| 147 | port TELNETasp_PT GBPVTY; |
| 148 | |
| 149 | var boolean g_initialized := false; |
| 150 | var boolean g_use_echo := false; |
| 151 | }; |
| 152 | |
| 153 | type component BSSGP_ConnHdlr { |
| 154 | port BSSGP_PT PCU[NUM_PCU]; |
| 155 | port BSSGP_PT PCU_SIG[NUM_PCU]; |
| 156 | port BSSGP_PROC_PT PCU_PROC[NUM_PCU]; |
| 157 | port BSSGP_PT SGSN[NUM_SGSN]; |
| 158 | port BSSGP_PT SGSN_SIG[NUM_SGSN]; |
| 159 | port BSSGP_PROC_PT SGSN_PROC[NUM_SGSN]; |
| 160 | |
| 161 | var BSSGP_ConnHdlrPars g_pars; |
| 162 | timer g_Tguard; |
| 163 | var LLC_Entities llc; |
| 164 | } |
| 165 | |
| 166 | type record SGSN_ConnHdlrNetworkPars { |
| 167 | boolean expect_ptmsi, |
| 168 | boolean expect_auth, |
| 169 | boolean expect_ciph |
| 170 | }; |
| 171 | |
| 172 | type record BSSGP_ConnHdlrPars { |
| 173 | /* IMEI of the simulated ME */ |
| 174 | hexstring imei, |
| 175 | /* IMSI of the simulated MS */ |
| 176 | hexstring imsi, |
| 177 | /* MSISDN of the simulated MS (probably unused) */ |
| 178 | hexstring msisdn, |
| 179 | /* P-TMSI allocated to the simulated MS */ |
| 180 | OCT4 p_tmsi optional, |
| 181 | OCT3 p_tmsi_sig optional, |
| 182 | /* TLLI of the simulated MS */ |
| 183 | OCT4 tlli, |
| 184 | OCT4 tlli_old optional, |
| 185 | RoutingAreaIdentificationV ra optional, |
| 186 | BssgpCellIds bssgp_cell_id, |
| 187 | float t_guard |
| 188 | }; |
| 189 | |
| 190 | private function f_cellid_to_RAI(in BssgpCellId cell_id) return RoutingAreaIdentificationV { |
| 191 | /* mcc_mnc is encoded as of 24.008 10.5.5.15 */ |
| 192 | var BcdMccMnc mcc_mnc := cell_id.ra_id.lai.mcc_mnc; |
| 193 | |
| 194 | var RoutingAreaIdentificationV ret := { |
| 195 | mccDigit1 := mcc_mnc[0], |
| 196 | mccDigit2 := mcc_mnc[1], |
| 197 | mccDigit3 := mcc_mnc[2], |
| 198 | mncDigit3 := mcc_mnc[3], |
| 199 | mncDigit1 := mcc_mnc[4], |
| 200 | mncDigit2 := mcc_mnc[5], |
| 201 | lac := int2oct(cell_id.ra_id.lai.lac, 16), |
| 202 | rac := int2oct(cell_id.ra_id.rac, 8) |
| 203 | } |
| 204 | return ret; |
| 205 | }; |
| 206 | |
| 207 | private function f_init_gb_pcu(inout GbInstance gb, charstring id, integer offset) runs on test_CT { |
| 208 | gb.vc_NS := NS_CT.create(id & "-NS(PCU)" & int2str(offset)); |
| 209 | gb.vc_BSSGP := BSSGP_CT.create(id & "-BSSGP(PCU)" & int2str(offset)); |
| 210 | /* connect lower end of BSSGP emulation with NS upper port */ |
| 211 | connect(gb.vc_BSSGP:BSCP, gb.vc_NS:NS_SP); |
| 212 | |
| 213 | gb.vc_NS.start(NSStart(mp_nsconfig_pcu[offset])); |
| 214 | gb.vc_BSSGP.start(BssgpStart(gb.cfg, id)); |
| 215 | |
| 216 | for (var integer i := 0; i < lengthof(gb.cfg.bvc); i := i + 1) { |
| 217 | connect(self:PROC, gb.vc_BSSGP:PROC); |
| 218 | gb.vc_BSSGP_BVC[i] := f_bssgp_get_bvci_ct(gb.cfg.bvc[i].bvci, PROC); |
| 219 | disconnect(self:PROC, gb.vc_BSSGP:PROC); |
| 220 | } |
| 221 | } |
| 222 | |
| 223 | private function f_init_gb_sgsn(inout GbInstance gb, charstring id, integer offset) runs on test_CT { |
| 224 | gb.vc_NS := NS_CT.create(id & "-NS(SGSN)" & int2str(offset)); |
| 225 | gb.vc_BSSGP := BSSGP_CT.create(id & "-BSSGP(SGSN)" & int2str(offset)); |
| 226 | /* connect lower end of BSSGP emulation with NS upper port */ |
| 227 | connect(gb.vc_BSSGP:BSCP, gb.vc_NS:NS_SP); |
| 228 | |
| 229 | gb.vc_NS.start(NSStart(mp_nsconfig_sgsn[offset])); |
| 230 | gb.vc_BSSGP.start(BssgpStart(gb.cfg, id)); |
| 231 | |
| 232 | for (var integer i := 0; i < lengthof(gb.cfg.bvc); i := i + 1) { |
| 233 | connect(self:PROC, gb.vc_BSSGP:PROC); |
| 234 | gb.vc_BSSGP_BVC[i] := f_bssgp_get_bvci_ct(gb.cfg.bvc[i].bvci, PROC); |
| 235 | disconnect(self:PROC, gb.vc_BSSGP:PROC); |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | |
| 240 | private function f_init_vty() runs on test_CT { |
| 241 | map(self:GBPVTY, system:GBPVTY); |
| 242 | f_vty_set_prompts(GBPVTY); |
| 243 | f_vty_transceive(GBPVTY, "enable"); |
| 244 | } |
| 245 | |
| 246 | /* mcc_mnc is 24.008 10.5.5.15 encoded. 262 42 */ |
| 247 | function f_init(BcdMccMnc mcc_mnc := '262F42'H) runs on test_CT { |
| 248 | var integer i; |
| 249 | |
| 250 | if (g_initialized == true) { |
| 251 | return; |
| 252 | } |
| 253 | g_initialized := true; |
| 254 | g_pcu[0].cfg := { |
| 255 | nsei := 96, |
| 256 | sgsn_role := false, |
| 257 | bvc := { { |
| 258 | bvci := 196, |
| 259 | cell_id := { |
| 260 | ra_id := { |
| 261 | lai := { |
| 262 | mcc_mnc := mcc_mnc, lac := 13135}, |
| 263 | rac := 0 |
| 264 | }, |
| 265 | cell_id := 20960 |
| 266 | }, |
Harald Welte | 4d112c9 | 2020-11-12 19:48:31 +0100 | [diff] [blame] | 267 | depth := BSSGP_DECODE_DEPTH_BSSGP, |
| 268 | create_cb := refers(BSSGP_Emulation.DefaultCreateCallback) |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 269 | } } |
| 270 | }; |
| 271 | g_pcu[1].cfg := { |
| 272 | nsei := 97, |
| 273 | sgsn_role := false, |
| 274 | bvc := { { |
| 275 | bvci := 210, |
| 276 | cell_id := { |
| 277 | ra_id := { |
| 278 | lai := { |
| 279 | mcc_mnc := mcc_mnc, lac := 13200}, |
| 280 | rac := 0 |
| 281 | }, |
| 282 | cell_id := 20961 |
| 283 | }, |
Harald Welte | 4d112c9 | 2020-11-12 19:48:31 +0100 | [diff] [blame] | 284 | depth := BSSGP_DECODE_DEPTH_BSSGP, |
| 285 | create_cb := refers(BSSGP_Emulation.DefaultCreateCallback) |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 286 | } } |
| 287 | }; |
| 288 | g_pcu[2].cfg := { |
| 289 | nsei := 98, |
| 290 | sgsn_role := false, |
| 291 | bvc := { { |
| 292 | bvci := 220, |
| 293 | cell_id := { |
| 294 | ra_id := { |
| 295 | lai := { |
| 296 | mcc_mnc := mcc_mnc, lac := 13300}, |
| 297 | rac := 0 |
| 298 | }, |
| 299 | cell_id := 20962 |
| 300 | }, |
Harald Welte | 4d112c9 | 2020-11-12 19:48:31 +0100 | [diff] [blame] | 301 | depth := BSSGP_DECODE_DEPTH_BSSGP, |
| 302 | create_cb := refers(BSSGP_Emulation.DefaultCreateCallback) |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 303 | } } |
| 304 | }; |
| 305 | |
| 306 | g_sgsn[0].cfg := { |
| 307 | nsei := 101, |
| 308 | sgsn_role := true, |
| 309 | bvc := { |
| 310 | { |
| 311 | bvci := 196, |
| 312 | cell_id := { |
| 313 | ra_id := { |
| 314 | lai := { |
| 315 | mcc_mnc := mcc_mnc, lac := 13135}, |
| 316 | rac := 0 |
| 317 | }, |
| 318 | cell_id := 20960 |
| 319 | }, |
Harald Welte | 4d112c9 | 2020-11-12 19:48:31 +0100 | [diff] [blame] | 320 | depth := BSSGP_DECODE_DEPTH_BSSGP, |
| 321 | create_cb := refers(BSSGP_Emulation.DefaultCreateCallback) |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 322 | }, |
| 323 | { |
| 324 | bvci := 210, |
| 325 | cell_id := { |
| 326 | ra_id := { |
| 327 | lai := { |
| 328 | mcc_mnc := mcc_mnc, lac := 13200}, |
| 329 | rac := 0 |
| 330 | }, |
| 331 | cell_id := 20961 |
| 332 | }, |
Harald Welte | 4d112c9 | 2020-11-12 19:48:31 +0100 | [diff] [blame] | 333 | depth := BSSGP_DECODE_DEPTH_BSSGP, |
| 334 | create_cb := refers(BSSGP_Emulation.DefaultCreateCallback) |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 335 | }, |
| 336 | { |
| 337 | bvci := 220, |
| 338 | cell_id := { |
| 339 | ra_id := { |
| 340 | lai := { |
| 341 | mcc_mnc := mcc_mnc, lac := 13300}, |
| 342 | rac := 0 |
| 343 | }, |
| 344 | cell_id := 20962 |
| 345 | }, |
Harald Welte | 4d112c9 | 2020-11-12 19:48:31 +0100 | [diff] [blame] | 346 | depth := BSSGP_DECODE_DEPTH_BSSGP, |
| 347 | create_cb := refers(BSSGP_Emulation.DefaultCreateCallback) |
Daniel Willmann | 423d8f4 | 2020-09-08 18:58:22 +0200 | [diff] [blame] | 348 | } |
| 349 | } |
| 350 | }; |
| 351 | |
| 352 | f_init_vty(); |
| 353 | f_init_gb_sgsn(g_sgsn[0], "GbProxy_Test-SGSN0", 0); |
| 354 | f_sleep(4.0); |
| 355 | f_init_gb_pcu(g_pcu[0], "GbProxy_Test-PCU0", 0); |
| 356 | f_init_gb_pcu(g_pcu[1], "GbProxy_Test-PCU1", 1); |
| 357 | f_init_gb_pcu(g_pcu[2], "GbProxy_Test-PCU2", 2); |
| 358 | } |
| 359 | |
| 360 | function f_cleanup() runs on test_CT { |
| 361 | self.stop; |
| 362 | } |
| 363 | |
| 364 | type function void_fn(charstring id) runs on BSSGP_ConnHdlr; |
| 365 | |
| 366 | /* helper function to create, connect and start a BSSGP_ConnHdlr component */ |
| 367 | function f_start_handler(void_fn fn, charstring id, GbInstances_PCU pcu, GbInstances_SGSN sgsn, integer imsi_suffix, |
| 368 | float t_guard := 30.0) |
| 369 | runs on test_CT return BSSGP_ConnHdlr { |
| 370 | var BSSGP_ConnHdlr vc_conn; |
| 371 | |
| 372 | var BSSGP_ConnHdlrPars pars := { |
| 373 | imei := f_gen_imei(imsi_suffix), |
| 374 | imsi := f_gen_imsi(imsi_suffix), |
| 375 | msisdn := f_gen_msisdn(imsi_suffix), |
| 376 | p_tmsi := omit, |
| 377 | p_tmsi_sig := omit, |
| 378 | tlli := f_gprs_tlli_random(), |
| 379 | tlli_old := omit, |
| 380 | ra := omit, |
| 381 | bssgp_cell_id := { pcu[0].cfg.bvc[0].cell_id, pcu[1].cfg.bvc[0].cell_id, pcu[2].cfg.bvc[0].cell_id }, |
| 382 | t_guard := t_guard |
| 383 | }; |
| 384 | |
| 385 | vc_conn := BSSGP_ConnHdlr.create(id); |
| 386 | // PDU side |
| 387 | connect(vc_conn:PCU[0], pcu[0].vc_BSSGP_BVC[0]:BSSGP_SP); |
| 388 | connect(vc_conn:PCU_SIG[0], pcu[0].vc_BSSGP_BVC[0]:BSSGP_SP_SIG); |
| 389 | connect(vc_conn:PCU_PROC[0], pcu[0].vc_BSSGP_BVC[0]:BSSGP_PROC); |
| 390 | connect(vc_conn:PCU[1], pcu[1].vc_BSSGP_BVC[0]:BSSGP_SP); |
| 391 | connect(vc_conn:PCU_SIG[1], pcu[1].vc_BSSGP_BVC[0]:BSSGP_SP_SIG); |
| 392 | connect(vc_conn:PCU_PROC[1], pcu[1].vc_BSSGP_BVC[0]:BSSGP_PROC); |
| 393 | connect(vc_conn:PCU[2], pcu[2].vc_BSSGP_BVC[0]:BSSGP_SP); |
| 394 | connect(vc_conn:PCU_SIG[2], pcu[2].vc_BSSGP_BVC[0]:BSSGP_SP_SIG); |
| 395 | connect(vc_conn:PCU_PROC[2], pcu[2].vc_BSSGP_BVC[0]:BSSGP_PROC); |
| 396 | // SGSN side |
| 397 | connect(vc_conn:SGSN[0], sgsn[0].vc_BSSGP_BVC[0]:BSSGP_SP); |
| 398 | connect(vc_conn:SGSN_SIG[0], sgsn[0].vc_BSSGP_BVC[0]:BSSGP_SP_SIG); |
| 399 | connect(vc_conn:SGSN_PROC[0], sgsn[0].vc_BSSGP_BVC[0]:BSSGP_PROC); |
| 400 | |
| 401 | vc_conn.start(f_handler_init(fn, id, pars)); |
| 402 | return vc_conn; |
| 403 | } |
| 404 | |
| 405 | private altstep as_Tguard() runs on BSSGP_ConnHdlr { |
| 406 | [] g_Tguard.timeout { |
| 407 | setverdict(fail, "Tguard timeout"); |
| 408 | mtc.stop; |
| 409 | } |
| 410 | } |
| 411 | |
| 412 | /* first function called in every ConnHdlr */ |
| 413 | private function f_handler_init(void_fn fn, charstring id, BSSGP_ConnHdlrPars pars) |
| 414 | runs on BSSGP_ConnHdlr { |
| 415 | /* do some common stuff like setting up g_pars */ |
| 416 | g_pars := pars; |
| 417 | |
| 418 | llc := f_llc_create(false); |
| 419 | |
| 420 | |
| 421 | g_Tguard.start(pars.t_guard); |
| 422 | activate(as_Tguard()); |
| 423 | |
| 424 | /* call the user-supplied test case function */ |
| 425 | fn.apply(id); |
| 426 | } |
| 427 | |
| 428 | /* TODO: |
| 429 | * Detach without Attach |
| 430 | * SM procedures without attach / RAU |
| 431 | * ATTACH / RAU |
| 432 | ** with / without authentication |
| 433 | ** with / without P-TMSI allocation |
| 434 | * re-transmissions of LLC frames |
| 435 | * PDP Context activation |
| 436 | ** with different GGSN config in SGSN VTY |
| 437 | ** with different PDP context type (v4/v6/v46) |
| 438 | ** timeout from GGSN |
| 439 | ** multiple / secondary PDP context |
| 440 | */ |
| 441 | |
| 442 | private function f_TC_BVC_bringup(charstring id) runs on BSSGP_ConnHdlr { |
| 443 | f_sleep(5.0); |
| 444 | setverdict(pass); |
| 445 | } |
| 446 | |
| 447 | testcase TC_BVC_bringup() runs on test_CT { |
| 448 | var BSSGP_ConnHdlr vc_conn; |
| 449 | f_init(); |
| 450 | |
| 451 | vc_conn := f_start_handler(refers(f_TC_BVC_bringup), testcasename(), g_pcu, g_sgsn, 51); |
| 452 | vc_conn.done; |
| 453 | |
| 454 | f_cleanup(); |
| 455 | } |
| 456 | |
| 457 | friend function f_bssgp_suspend(integer ran_idx := 0) runs on BSSGP_ConnHdlr return OCT1 { |
| 458 | timer T := 5.0; |
| 459 | var PDU_BSSGP rx_pdu; |
| 460 | PCU_SIG[ran_idx].send(ts_BSSGP_SUSPEND(g_pars.tlli, g_pars.bssgp_cell_id[ran_idx].ra_id)); |
| 461 | T.start; |
| 462 | alt { |
| 463 | [] PCU_SIG[ran_idx].receive(tr_BSSGP_SUSPEND_ACK(g_pars.tlli, g_pars.bssgp_cell_id[ran_idx].ra_id, ?)) -> value rx_pdu { |
| 464 | return rx_pdu.pDU_BSSGP_SUSPEND_ACK.suspend_Reference_Number.suspend_Reference_Number_value; |
| 465 | } |
| 466 | [] PCU_SIG[ran_idx].receive(tr_BSSGP_SUSPEND_NACK(g_pars.tlli, g_pars.bssgp_cell_id[ran_idx].ra_id, ?)) -> value rx_pdu { |
| 467 | setverdict(fail, "SUSPEND-NACK in response to SUSPEND for TLLI ", g_pars.tlli); |
| 468 | mtc.stop; |
| 469 | } |
| 470 | [] T.timeout { |
| 471 | setverdict(fail, "No SUSPEND-ACK in response to SUSPEND for TLLI ", g_pars.tlli); |
| 472 | mtc.stop; |
| 473 | } |
| 474 | } |
| 475 | return '00'O; |
| 476 | } |
| 477 | |
| 478 | friend function f_bssgp_resume(OCT1 susp_ref, integer ran_idx := 0) runs on BSSGP_ConnHdlr { |
| 479 | timer T := 5.0; |
| 480 | PCU_SIG[ran_idx].send(ts_BSSGP_RESUME(g_pars.tlli, g_pars.bssgp_cell_id[ran_idx].ra_id, susp_ref)); |
| 481 | T.start; |
| 482 | alt { |
| 483 | [] PCU_SIG[ran_idx].receive(tr_BSSGP_RESUME_ACK(g_pars.tlli, g_pars.bssgp_cell_id[ran_idx].ra_id)); |
| 484 | [] PCU_SIG[ran_idx].receive(tr_BSSGP_RESUME_NACK(g_pars.tlli, g_pars.bssgp_cell_id[ran_idx].ra_id, |
| 485 | ?)) { |
| 486 | setverdict(fail, "RESUME-NACK in response to RESUME for TLLI ", g_pars.tlli); |
| 487 | mtc.stop; |
| 488 | } |
| 489 | [] T.timeout { |
| 490 | setverdict(fail, "No RESUME-ACK in response to SUSPEND for TLLI ", g_pars.tlli); |
| 491 | mtc.stop; |
| 492 | } |
| 493 | } |
| 494 | } |
| 495 | |
| 496 | |
| 497 | control { |
| 498 | execute( TC_BVC_bringup() ); |
| 499 | } |
| 500 | |
| 501 | |
| 502 | } |