Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1 | module HNBGW_Tests { |
| 2 | |
| 3 | /* Integration Tests for OsmoHNBGW |
| 4 | * (C) 2021 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de> |
| 5 | * All rights reserved. |
| 6 | * |
| 7 | * Released under the terms of GNU General Public License, Version 2 or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 11 | * |
| 12 | * This test suite tests OsmoHNBGW while emulating the hNodeB as well as MSC, SGSN, MGW |
| 13 | * See README for more details. |
| 14 | */ |
| 15 | |
| 16 | import from Misc_Helpers all; |
| 17 | import from General_Types all; |
| 18 | import from GSM_Types all; |
| 19 | import from Osmocom_Types all; |
| 20 | import from IPL4asp_Types all; |
Neels Hofmeyr | 1e31146 | 2023-01-11 01:19:12 +0100 | [diff] [blame] | 21 | import from Native_Functions all; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 22 | |
| 23 | import from Osmocom_CTRL_Functions all; |
| 24 | import from Osmocom_CTRL_Types all; |
| 25 | import from Osmocom_CTRL_Adapter all; |
| 26 | |
| 27 | import from StatsD_Types all; |
| 28 | import from StatsD_CodecPort all; |
| 29 | import from StatsD_CodecPort_CtrlFunct all; |
| 30 | import from StatsD_Checker all; |
| 31 | |
| 32 | import from Osmocom_VTY_Functions all; |
| 33 | import from TELNETasp_PortType all; |
| 34 | |
| 35 | import from HNBAP_Templates all; |
| 36 | import from HNBAP_PDU_Descriptions all; |
| 37 | |
| 38 | import from RUA_IEs all; |
| 39 | import from RUA_Templates all; |
| 40 | import from RUA_Emulation all; |
| 41 | |
| 42 | import from Iuh_Emulation all; |
| 43 | |
| 44 | import from RANAP_Types all; |
| 45 | import from RANAP_PDU_Descriptions all; |
| 46 | import from RANAP_PDU_Contents all; |
| 47 | import from RANAP_IEs all; |
| 48 | import from RANAP_Templates all; |
| 49 | |
| 50 | import from RAN_Adapter all; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 51 | import from RAN_Emulation all; |
| 52 | |
| 53 | import from MGCP_Emulation all; |
| 54 | import from MGCP_Types all; |
| 55 | import from MGCP_Templates all; |
| 56 | import from MGCP_CodecPort all; |
| 57 | import from SDP_Types all; |
| 58 | |
Neels Hofmeyr | a56e8fd | 2022-05-08 01:16:55 +0200 | [diff] [blame] | 59 | import from PFCP_Types all; |
| 60 | import from PFCP_Emulation all; |
| 61 | import from PFCP_Templates all; |
| 62 | import from PFCP_CodecPort all; |
| 63 | |
Neels Hofmeyr | 75d905b | 2023-04-27 00:30:25 +0200 | [diff] [blame] | 64 | import from TCCConversion_Functions all; |
Neels Hofmeyr | 7a48df1 | 2023-04-20 20:43:43 +0200 | [diff] [blame] | 65 | import from MobileL3_Types all; |
Neels Hofmeyr | 7d0e680 | 2023-04-20 20:43:55 +0200 | [diff] [blame] | 66 | import from MobileL3_CommonIE_Types all; |
| 67 | import from MobileL3_GMM_SM_Types all; |
Neels Hofmeyr | 7a48df1 | 2023-04-20 20:43:43 +0200 | [diff] [blame] | 68 | import from L3_Templates all; |
Neels Hofmeyr | 7d0e680 | 2023-04-20 20:43:55 +0200 | [diff] [blame] | 69 | import from L3_Common all; |
Neels Hofmeyr | 7a48df1 | 2023-04-20 20:43:43 +0200 | [diff] [blame] | 70 | |
| 71 | const integer NUM_MSC := 4; |
| 72 | const integer NUM_SGSN := 4; |
| 73 | |
| 74 | const integer FIRST_MSC_IDX := 0; |
| 75 | const integer FIRST_SGSN_IDX := NUM_MSC; |
Neels Hofmeyr | 75d905b | 2023-04-27 00:30:25 +0200 | [diff] [blame] | 76 | |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 77 | modulepar { |
| 78 | /* IP address at which the HNodeB can be reached */ |
| 79 | charstring mp_hnodeb_ip := "127.0.0.1"; |
| 80 | integer mp_hnodeb_port := -1; |
| 81 | |
| 82 | /* IP address at which the test binds */ |
| 83 | charstring mp_hnbgw_ip := "127.0.0.1"; |
| 84 | integer mp_hnbgw_iuh_port := 29169; |
Neels Hofmeyr | ffcb889 | 2023-06-27 01:09:57 +0200 | [diff] [blame] | 85 | integer mp_hnbgw_ctrl_port := 4262; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 86 | |
| 87 | charstring mp_mgw_ip := "127.0.0.1"; |
| 88 | integer mp_mgw_port := 2427; |
| 89 | |
Neels Hofmeyr | 7a48df1 | 2023-04-20 20:43:43 +0200 | [diff] [blame] | 90 | RAN_Configurations mp_cn_cfg := { |
| 91 | /* MSCs (NUM_MSC entries) */ |
| 92 | { |
| 93 | transport := RANAP_TRANSPORT_IuCS, |
| 94 | sccp_service_type := "mtp3_itu", |
| 95 | sctp_addr := { 23905, "127.0.0.1", 2905, "127.0.0.1" }, |
| 96 | own_pc := 188, /* 0.23.4 first MSC emulation */ |
| 97 | own_ssn := 142, |
| 98 | peer_pc := 189, /* 0.23.5 osmo-hnbgw */ |
| 99 | peer_ssn := 142, |
| 100 | sio := '83'O, |
| 101 | rctx := 1 |
| 102 | }, |
| 103 | { |
| 104 | transport := RANAP_TRANSPORT_IuCS, |
| 105 | sccp_service_type := "mtp3_itu", |
| 106 | sctp_addr := { 23907, "127.0.0.1", 2905, "127.0.0.1" }, |
| 107 | own_pc := 2, /* 0.0.2 second MSC emulation */ |
| 108 | own_ssn := 142, |
| 109 | peer_pc := 189, /* 0.23.5 osmo-hnbgw */ |
| 110 | peer_ssn := 142, |
| 111 | sio := '83'O, |
| 112 | rctx := 3 |
| 113 | }, |
| 114 | { |
| 115 | transport := RANAP_TRANSPORT_IuCS, |
| 116 | sccp_service_type := "mtp3_itu", |
| 117 | sctp_addr := { 23909, "127.0.0.1", 2905, "127.0.0.1" }, |
| 118 | own_pc := 3, /* 0.0.3 third MSC emulation */ |
| 119 | own_ssn := 142, |
| 120 | peer_pc := 189, /* 0.23.5 osmo-hnbgw */ |
| 121 | peer_ssn := 142, |
| 122 | sio := '83'O, |
| 123 | rctx := 5 |
| 124 | }, |
| 125 | { |
| 126 | transport := RANAP_TRANSPORT_IuCS, |
| 127 | sccp_service_type := "mtp3_itu", |
| 128 | sctp_addr := { 23911, "127.0.0.1", 2905, "127.0.0.1" }, |
| 129 | own_pc := 4, /* 0.0.4 fourth MSC emulation */ |
| 130 | own_ssn := 142, |
| 131 | peer_pc := 189, /* 0.23.5 osmo-hnbgw */ |
| 132 | peer_ssn := 142, |
| 133 | sio := '83'O, |
| 134 | rctx := 7 |
| 135 | }, |
| 136 | |
| 137 | /* SGSNs (NUM_SGSN entries) */ |
| 138 | { |
| 139 | transport := RANAP_TRANSPORT_IuCS, |
| 140 | sccp_service_type := "mtp3_itu", |
| 141 | sctp_addr := { /* local */ 23906, "127.0.0.1", /* remote */ 2905, "127.0.0.1" }, |
| 142 | own_pc := 185, /* 0.23.1 first SGSN emulation */ |
| 143 | own_ssn := 142, |
| 144 | peer_pc := 189, /* 2237, 1.23.5 osmo-hnbgw */ |
| 145 | peer_ssn := 142, |
| 146 | sio := '83'O, |
| 147 | rctx := 2 |
| 148 | }, |
| 149 | { |
| 150 | transport := RANAP_TRANSPORT_IuCS, |
| 151 | sccp_service_type := "mtp3_itu", |
| 152 | sctp_addr := { /* local */ 23908, "127.0.0.1", /* remote */ 2905, "127.0.0.1" }, |
| 153 | own_pc := 10, /* 0.1.2 second SGSN emulation */ |
| 154 | own_ssn := 142, |
| 155 | peer_pc := 189, /* 2237, 1.23.5 osmo-hnbgw */ |
| 156 | peer_ssn := 142, |
| 157 | sio := '83'O, |
| 158 | rctx := 4 |
| 159 | }, |
| 160 | { |
| 161 | transport := RANAP_TRANSPORT_IuCS, |
| 162 | sccp_service_type := "mtp3_itu", |
| 163 | sctp_addr := { /* local */ 23910, "127.0.0.1", /* remote */ 2905, "127.0.0.1" }, |
| 164 | own_pc := 11, /* 0.1.3 third SGSN emulation */ |
| 165 | own_ssn := 142, |
| 166 | peer_pc := 189, /* 2237, 1.23.5 osmo-hnbgw */ |
| 167 | peer_ssn := 142, |
| 168 | sio := '83'O, |
| 169 | rctx := 6 |
| 170 | }, |
| 171 | { |
| 172 | transport := RANAP_TRANSPORT_IuCS, |
| 173 | sccp_service_type := "mtp3_itu", |
| 174 | sctp_addr := { /* local */ 23912, "127.0.0.1", /* remote */ 2905, "127.0.0.1" }, |
| 175 | own_pc := 12, /* 0.1.4 fourth SGSN emulation */ |
| 176 | own_ssn := 142, |
| 177 | peer_pc := 189, /* 2237, 1.23.5 osmo-hnbgw */ |
| 178 | peer_ssn := 142, |
| 179 | sio := '83'O, |
| 180 | rctx := 8 |
| 181 | } |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 182 | }; |
Neels Hofmeyr | a56e8fd | 2022-05-08 01:16:55 +0200 | [diff] [blame] | 183 | |
Neels Hofmeyr | bacb74f | 2022-08-29 16:24:12 +0200 | [diff] [blame] | 184 | boolean mp_enable_pfcp_tests := false; |
| 185 | |
Neels Hofmeyr | a56e8fd | 2022-05-08 01:16:55 +0200 | [diff] [blame] | 186 | /* IP address at which we listen for PFCP to emulate a UPF in ttcn3 */ |
| 187 | charstring mp_pfcp_ip_local := "127.0.0.1"; |
| 188 | |
| 189 | /* IP address from which the SUT (osmo-hnbgw) sends PFCP requests, and to which the ttcn3 UPF emulation sends |
| 190 | * PFCP responses. */ |
| 191 | charstring mp_pfcp_ip_remote := "127.0.0.2"; |
Pau Espin Pedrol | 6c87ad9 | 2023-07-18 11:24:25 +0200 | [diff] [blame] | 192 | |
| 193 | boolean mp_validate_talloc_asn1 := true; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 194 | } |
| 195 | |
| 196 | function MSC_UnitdataCallback(RANAP_PDU ranap) runs on RAN_Emulation_CT return template RANAP_PDU { |
| 197 | // TODO: Actually implement unitdata handling |
Neels Hofmeyr | cf6dc49 | 2023-06-27 00:51:08 +0200 | [diff] [blame] | 198 | return omit; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 199 | } |
| 200 | |
| 201 | const RanOps MSC_RanOps := { |
| 202 | ranap_create_cb := refers(RAN_Emulation.RanapExpectedCreateCallback), |
| 203 | ranap_unitdata_cb := refers(MSC_UnitdataCallback), |
| 204 | ps_domain := false, |
| 205 | decode_dtap := false, |
| 206 | role_ms := false, |
| 207 | protocol := RAN_PROTOCOL_RANAP, |
| 208 | transport := RANAP_TRANSPORT_IuCS, |
| 209 | use_osmux := false, |
Eric Wild | 6e511ce | 2022-04-02 21:35:56 +0200 | [diff] [blame] | 210 | bssap_reset_retries := 1, |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 211 | sccp_addr_local := omit, |
| 212 | sccp_addr_peer := omit |
| 213 | } |
| 214 | |
| 215 | type record CrcxResponse { |
| 216 | integer resp, |
| 217 | HostName mgw_rtp_ip, |
| 218 | PortNumber mgw_rtp_port, |
| 219 | MgcpConnectionId mgcp_connection_id |
| 220 | } |
| 221 | type record MgcpParameters { |
| 222 | integer got_crcx_count, |
| 223 | integer got_dlcx_count, |
| 224 | MgcpCallId mgcp_call_id optional, |
| 225 | MgcpEndpoint mgcp_ep, |
| 226 | CrcxResponse mgw_conn_1, |
| 227 | CrcxResponse mgw_conn_2, |
| 228 | uint7_t rtp_payload_type, |
| 229 | charstring rtp_sdp_format, |
| 230 | HostName hnb_rtp_ip, |
| 231 | PortNumber hnb_rtp_port, |
| 232 | HostName cn_rtp_ip, |
| 233 | PortNumber cn_rtp_port, |
| 234 | boolean use_osmux, |
| 235 | integer got_osmux_count |
| 236 | } |
| 237 | |
| 238 | template (value) MgcpParameters t_MgcpParams := { |
| 239 | got_crcx_count := 0, |
| 240 | got_dlcx_count := 0, |
| 241 | mgcp_call_id := omit, |
| 242 | mgcp_ep := "rtpbridge/1@mgw", |
| 243 | mgw_conn_1 := { |
| 244 | resp := 1, |
| 245 | mgw_rtp_ip := "127.1.2.1", |
| 246 | mgw_rtp_port := 10000, |
| 247 | mgcp_connection_id := '11111'H |
| 248 | }, |
| 249 | mgw_conn_2 := { |
| 250 | resp := 1, |
| 251 | mgw_rtp_ip := "127.1.2.2", |
| 252 | mgw_rtp_port := 20000, |
| 253 | mgcp_connection_id := '22222'H |
| 254 | }, |
Philipp Maier | 6c5ba075 | 2023-07-04 16:53:40 +0200 | [diff] [blame] | 255 | rtp_payload_type := 112, |
| 256 | rtp_sdp_format := "VND.3GPP.IUFP", |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 257 | hnb_rtp_ip := "127.1.1.1", |
| 258 | hnb_rtp_port := 10001, |
| 259 | cn_rtp_ip := "127.1.3.1", |
| 260 | cn_rtp_port := 20001, |
| 261 | use_osmux := false, |
| 262 | got_osmux_count := 0 |
| 263 | } |
| 264 | |
| 265 | type record TestHdlrParams { |
| 266 | integer hnb_idx, |
Neels Hofmeyr | 7a48df1 | 2023-04-20 20:43:43 +0200 | [diff] [blame] | 267 | /* cn_idx indicates which CN link from g_cn[] to connect to the test component. |
| 268 | * See also f_cn_idx(). */ |
| 269 | integer cn_idx, |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 270 | hexstring imsi, |
| 271 | boolean ps_domain, |
| 272 | MgcpParameters mgcp_pars optional, |
Neels Hofmeyr | f0b9ed1 | 2022-06-07 17:46:32 +0200 | [diff] [blame] | 273 | HnbConfig hnb optional, |
Neels Hofmeyr | f2c9502 | 2023-04-19 01:24:39 +0200 | [diff] [blame] | 274 | boolean expect_separate_sccp_cr, |
| 275 | integer tx_sccp_cr_data_len, |
Neels Hofmeyr | 7d0e680 | 2023-04-20 20:43:55 +0200 | [diff] [blame] | 276 | charstring pfcp_local_addr, |
| 277 | octetstring nas_pdu optional |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 278 | } |
| 279 | |
| 280 | /* We extend: |
| 281 | * RUA_ConnHdlr (for the Iuh side, emulating the HNB) |
| 282 | * RAN_ConnHdlr (for the Iu side, emulating the MSC) |
| 283 | * MGCP_ConnHdlr (for the MGCP side, emulating the MGW) |
| 284 | */ |
Neels Hofmeyr | a56e8fd | 2022-05-08 01:16:55 +0200 | [diff] [blame] | 285 | type component ConnHdlr extends RAN_ConnHdlr, MGCP_ConnHdlr, RUA_ConnHdlr, PFCP_ConnHdlr { |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 286 | var integer g_sccp_conn_id; |
| 287 | var TestHdlrParams g_pars; |
| 288 | timer g_Tguard; |
Neels Hofmeyr | 72a8d62 | 2023-01-26 13:47:01 +0100 | [diff] [blame] | 289 | |
| 290 | port TELNETasp_PT HNBGWVTY; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 291 | } |
| 292 | |
| 293 | |
| 294 | const MGCPOps MSC_MGCPOps := { |
| 295 | create_cb := refers(MGCP_Emulation.ExpectedCreateCallback), |
| 296 | unitdata_cb := refers(MGCP_Emulation.DummyUnitdataCallback) |
| 297 | } |
| 298 | |
| 299 | function f_create_ranap_exp(octetstring l3_enc) runs on ConnHdlr { |
| 300 | BSSAP_PROC.call(RAN_register:{l3_enc, self}) { |
| 301 | [] BSSAP_PROC.getreply(RAN_register:{?, ?}) {}; |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | |
Daniel Willmann | c79679a | 2022-08-23 17:48:39 +0200 | [diff] [blame] | 306 | const integer NUM_HNB := 2; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 307 | |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 308 | type record HnbConfig { |
| 309 | LocationAreaIdentification lai, |
| 310 | integer sac |
| 311 | } |
| 312 | |
| 313 | type component test_CT extends CTRL_Adapter_CT { |
| 314 | var boolean g_initialized := false; |
| 315 | |
| 316 | /********************* Iu side */ |
Neels Hofmeyr | 7a48df1 | 2023-04-20 20:43:43 +0200 | [diff] [blame] | 317 | var RAN_Adapter g_cn[NUM_MSC + NUM_SGSN]; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 318 | |
| 319 | /********************* Iuh side */ |
| 320 | var HnbConfig g_hnb_cfg[NUM_HNB]; |
| 321 | var Iuh_Emulation_CT vc_Iuh[NUM_HNB]; |
| 322 | var RUA_Emulation_CT vc_RUA[NUM_HNB]; |
| 323 | port HNBAP_PT HNBAP[NUM_HNB]; |
Pau Espin Pedrol | 83a4961 | 2022-09-12 21:11:05 +0200 | [diff] [blame] | 324 | /* Number of HNBs to be used/started by the test */ |
| 325 | var integer g_num_hnbs := NUM_HNB; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 326 | |
| 327 | var MGCP_Emulation_CT vc_MGCP; |
| 328 | port TELNETasp_PT HNBGWVTY; |
| 329 | /* global test case guard timer (actual timeout value is set in f_init()) */ |
| 330 | timer T_guard := 30.0; |
Neels Hofmeyr | 7d0e680 | 2023-04-20 20:43:55 +0200 | [diff] [blame] | 331 | |
| 332 | /* The cnlink type 'msc' or 'sgsn', to be used in CTRL commands to obtain counters */ |
| 333 | var charstring g_ctr_cn_node_name; |
| 334 | /* Counter state */ |
| 335 | var CounterNameValsList g_ctr_cn; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 336 | } |
| 337 | |
| 338 | /* global altstep for global guard timer; */ |
| 339 | altstep as_Tguard() runs on test_CT { |
| 340 | [] T_guard.timeout { |
| 341 | setverdict(fail, "Timeout of T_guard"); |
| 342 | mtc.stop; |
| 343 | } |
| 344 | } |
| 345 | |
| 346 | friend function f_logp(TELNETasp_PT pt, charstring log_msg) |
| 347 | { |
| 348 | // log on TTCN3 log output |
| 349 | log(log_msg); |
| 350 | // log in stderr log |
| 351 | f_vty_transceive(pt, "logp lglobal notice TTCN3 f_logp(): " & log_msg); |
| 352 | } |
| 353 | |
| 354 | function f_init_vty(charstring id := "foo") runs on test_CT { |
| 355 | if (HNBGWVTY.checkstate("Mapped")) { |
| 356 | /* skip initialization if already executed once */ |
| 357 | return; |
| 358 | } |
| 359 | map(self:HNBGWVTY, system:HNBGWVTY); |
| 360 | f_vty_set_prompts(HNBGWVTY); |
| 361 | f_vty_transceive(HNBGWVTY, "enable"); |
| 362 | } |
| 363 | |
| 364 | function f_init_mgcp(charstring id) runs on test_CT { |
| 365 | id := id & "-MGCP"; |
| 366 | var MGCPOps ops := { |
| 367 | create_cb := refers(MGCP_Emulation.ExpectedCreateCallback), |
| 368 | unitdata_cb := refers(MGCP_Emulation.DummyUnitdataCallback) |
| 369 | } |
| 370 | var MGCP_conn_parameters pars := { |
| 371 | callagent_ip := mp_hnbgw_ip, |
| 372 | callagent_udp_port := -1, |
| 373 | mgw_ip := mp_mgw_ip, |
| 374 | mgw_udp_port := mp_mgw_port, |
| 375 | multi_conn_mode := false |
| 376 | } |
| 377 | |
| 378 | vc_MGCP := MGCP_Emulation_CT.create(id); |
| 379 | map(vc_MGCP:MGCP, system:MGCP_CODEC_PT); |
| 380 | vc_MGCP.start(MGCP_Emulation.main(ops, pars, id)); |
| 381 | } |
| 382 | |
Neels Hofmeyr | a56e8fd | 2022-05-08 01:16:55 +0200 | [diff] [blame] | 383 | function f_init_pfcp(charstring id) runs on ConnHdlr { |
| 384 | id := id & "-PFCP"; |
| 385 | |
| 386 | var PFCP_Emulation_Cfg pfcp_cfg := { |
| 387 | pfcp_bind_ip := mp_pfcp_ip_local, |
| 388 | pfcp_bind_port := PFCP_PORT, |
| 389 | pfcp_remote_ip := mp_pfcp_ip_remote, |
| 390 | pfcp_remote_port := PFCP_PORT, |
| 391 | role := UPF |
| 392 | }; |
| 393 | |
| 394 | vc_PFCP := PFCP_Emulation_CT.create(id) alive; |
| 395 | connect(self:PFCP, vc_PFCP:CLIENT); |
| 396 | connect(self:PFCP_PROC, vc_PFCP:CLIENT_PROC); |
| 397 | vc_PFCP.start(PFCP_Emulation.main(pfcp_cfg)); |
| 398 | } |
| 399 | |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 400 | function f_init_hnodeb(charstring id, integer hnb_idx, RuaOps rua_ops) runs on test_CT { |
| 401 | id := id & "-Iuh" & int2str(hnb_idx); |
| 402 | |
| 403 | /* Iuh lower layer (RUA/HNBAP demux) */ |
| 404 | var Iuh_conn_parameters iuh_pars; |
| 405 | iuh_pars.remote_ip := mp_hnbgw_ip; |
| 406 | iuh_pars.remote_sctp_port := mp_hnbgw_iuh_port; |
| 407 | iuh_pars.local_ip := mp_hnodeb_ip; |
| 408 | iuh_pars.local_sctp_port := mp_hnodeb_port + hnb_idx; |
| 409 | vc_Iuh[hnb_idx] := Iuh_Emulation_CT.create(id); |
| 410 | connect(self:HNBAP[hnb_idx], vc_Iuh[hnb_idx]:HNBAP); |
| 411 | |
| 412 | vc_RUA[hnb_idx] := RUA_Emulation_CT.create(id & "-RUA"); |
| 413 | connect(vc_RUA[hnb_idx]:RUA, vc_Iuh[hnb_idx]:RUA); |
| 414 | |
| 415 | /* Start Iuh side components */ |
| 416 | vc_Iuh[hnb_idx].start(Iuh_Emulation.main(iuh_pars, id)); |
| 417 | vc_RUA[hnb_idx].start(RUA_Emulation.main(rua_ops, id & "-RUA")); |
| 418 | } |
| 419 | |
Neels Hofmeyr | 3d5a0da | 2023-06-27 00:57:46 +0200 | [diff] [blame] | 420 | private type record of boolean BooleanList; |
| 421 | |
| 422 | private function f_vty_cnlink_allow_attach(TELNETasp_PT pt, boolean ps_domain, BooleanList allow_attach_list) |
| 423 | { |
| 424 | var charstring config := f_vty_transceive_ret(pt, "show running-config"); |
| 425 | |
| 426 | var charstring msc_sgsn; |
| 427 | if (ps_domain) { |
| 428 | msc_sgsn := "sgsn"; |
| 429 | } else { |
| 430 | msc_sgsn := "msc"; |
| 431 | } |
| 432 | |
| 433 | f_vty_enter_config(pt); |
| 434 | for (var integer cn_nr := 0; cn_nr < sizeof(allow_attach_list); cn_nr := cn_nr+1) { |
| 435 | if (f_strstr(config, "\n" & msc_sgsn & " " & int2str(cn_nr) & "\n") < 0) { |
| 436 | /* There is no 'msc N' for this cn_nr in the running config, so don't create an empty cn by |
| 437 | * stepping into that config node. */ |
| 438 | log(msc_sgsn, cn_nr, " is not configured, skipping"); |
| 439 | continue; |
| 440 | } |
| 441 | f_vty_transceive(pt, msc_sgsn & " " & int2str(cn_nr)); |
| 442 | |
| 443 | if (allow_attach_list[cn_nr]) { |
| 444 | /* strict := false: ignore if osmo-hnbgw does not support this config option (latest build) */ |
| 445 | f_vty_transceive(pt, "allow-attach", strict := false); |
| 446 | } else { |
| 447 | f_vty_transceive(pt, "no allow-attach", strict := false); |
| 448 | } |
| 449 | f_vty_transceive(pt, "exit"); |
| 450 | } |
| 451 | f_vty_transceive(pt, "exit"); |
| 452 | } |
| 453 | |
| 454 | /* Start RAN adapter for CN link N. |
| 455 | * e.g. link for 'msc 0' = (ps_domain := false, cn_nr := 0) |
| 456 | * link for 'sgsn 3' = (ps_domain := true, cn_nr := 3) |
| 457 | */ |
| 458 | private function f_cn_nr_init(boolean ps_domain, integer cn_nr) runs on test_CT { |
| 459 | var RanOps ranops := MSC_RanOps; |
| 460 | ranops.ps_domain := ps_domain; |
| 461 | var integer cn_idx := f_cn_idx(ps_domain, cn_nr); |
| 462 | var charstring msc_sgsn := "msc"; |
| 463 | if (ps_domain) { |
| 464 | msc_sgsn := "sgsn"; |
| 465 | } |
| 466 | f_ran_adapter_init(g_cn[cn_idx], mp_cn_cfg[cn_idx], "HNBGW_Test." & msc_sgsn & int2str(cn_nr), ranops); |
| 467 | f_ran_adapter_start(g_cn[cn_idx]); |
| 468 | } |
| 469 | |
| 470 | private function f_cn_idx_disconnect(integer cn_idx) runs on test_CT { |
| 471 | f_ran_adapter_cleanup(g_cn[cn_idx]); |
| 472 | } |
| 473 | |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 474 | /* global initialization function */ |
Neels Hofmeyr | 333ea39 | 2023-06-27 00:58:05 +0200 | [diff] [blame] | 475 | function f_init(charstring id := "HNBGW", float guard_timeout := 30.0, integer nr_msc := 1, integer nr_sgsn := 1, |
| 476 | boolean start_hnb := true) runs on test_CT { |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 477 | |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 478 | T_guard.start(guard_timeout); |
| 479 | activate(as_Tguard()); |
| 480 | |
| 481 | /* RUA/RANAP emulation on top of lower-layer Iuh */ |
| 482 | var RuaOps rua_ops := { |
| 483 | create_cb := refers(IuhRanapCreateCallback), |
| 484 | unitdata_cb := refers(IuhRanapUnitdataCallback) |
| 485 | }; |
Pau Espin Pedrol | 83a4961 | 2022-09-12 21:11:05 +0200 | [diff] [blame] | 486 | for (var integer i := 0; i < g_num_hnbs; i := i+1) { |
Daniel Willmann | c79679a | 2022-08-23 17:48:39 +0200 | [diff] [blame] | 487 | g_hnb_cfg[i] := { |
| 488 | lai := { |
Neels Hofmeyr | 497216f | 2023-06-27 00:59:26 +0200 | [diff] [blame] | 489 | mcc_mnc := '00F110'H, |
Daniel Willmann | c79679a | 2022-08-23 17:48:39 +0200 | [diff] [blame] | 490 | lac := 2342 + i |
| 491 | }, |
| 492 | sac := 55 |
| 493 | }; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 494 | f_init_hnodeb(testcasename(), i, rua_ops); |
| 495 | } |
| 496 | |
Neels Hofmeyr | 3d5a0da | 2023-06-27 00:57:46 +0200 | [diff] [blame] | 497 | f_init_vty("VirtHNBGW"); |
Neels Hofmeyr | ffcb889 | 2023-06-27 01:09:57 +0200 | [diff] [blame] | 498 | f_ipa_ctrl_start_client(mp_hnbgw_ip, mp_hnbgw_ctrl_port); |
| 499 | |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 500 | /* MSC emulation */ |
Neels Hofmeyr | 3d5a0da | 2023-06-27 00:57:46 +0200 | [diff] [blame] | 501 | |
| 502 | /* Make sure each MSC's internal state is "DISCONNECTED" at first */ |
| 503 | for (var integer i := 0; i < NUM_MSC; i := i + 1) { |
| 504 | f_vty_transceive(HNBGWVTY, "msc " & int2str(i) & " ranap reset", strict := false); |
| 505 | } |
| 506 | |
| 507 | var BooleanList allow_attach := { false, false, false, false }; |
Neels Hofmeyr | 7a48df1 | 2023-04-20 20:43:43 +0200 | [diff] [blame] | 508 | for (var integer i := 0; i < nr_msc; i := i + 1) { |
| 509 | var integer cn_idx := FIRST_MSC_IDX + i; |
Neels Hofmeyr | 3d5a0da | 2023-06-27 00:57:46 +0200 | [diff] [blame] | 510 | allow_attach[i] := true; |
| 511 | f_cn_nr_init(ps_domain := false, cn_nr := i); |
Neels Hofmeyr | 7a48df1 | 2023-04-20 20:43:43 +0200 | [diff] [blame] | 512 | } |
Neels Hofmeyr | 3d5a0da | 2023-06-27 00:57:46 +0200 | [diff] [blame] | 513 | /* start the test with exactly all enabled MSCs allowed to attach */ |
| 514 | f_vty_cnlink_allow_attach(HNBGWVTY, false, allow_attach); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 515 | |
| 516 | /* SGSN emulation */ |
Neels Hofmeyr | 3d5a0da | 2023-06-27 00:57:46 +0200 | [diff] [blame] | 517 | |
| 518 | /* Make sure each SGSN's internal state is "DISCONNECTED" at first */ |
| 519 | for (var integer i := 0; i < NUM_SGSN; i := i + 1) { |
| 520 | f_vty_transceive(HNBGWVTY, "sgsn " & int2str(i) & " ranap reset", strict := false); |
Neels Hofmeyr | 7a48df1 | 2023-04-20 20:43:43 +0200 | [diff] [blame] | 521 | } |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 522 | |
Neels Hofmeyr | 3d5a0da | 2023-06-27 00:57:46 +0200 | [diff] [blame] | 523 | allow_attach := { false, false, false, false }; |
| 524 | for (var integer i := 0; i < nr_sgsn; i := i + 1) { |
| 525 | var integer cn_idx := FIRST_SGSN_IDX + i; |
| 526 | allow_attach[i] := true; |
| 527 | f_cn_nr_init(ps_domain := true, cn_nr := i); |
| 528 | } |
| 529 | f_vty_cnlink_allow_attach(HNBGWVTY, true, allow_attach); |
| 530 | |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 531 | f_init_mgcp(id); |
Neels Hofmeyr | 333ea39 | 2023-06-27 00:58:05 +0200 | [diff] [blame] | 532 | |
| 533 | if (start_hnb) { |
| 534 | f_start_hnbs(); |
| 535 | } |
Neels Hofmeyr | 467eb7e | 2023-08-10 03:38:07 +0200 | [diff] [blame^] | 536 | |
| 537 | /* Sometimes, the RUA InitialUE-Message from a test happens too quickly, before the RANAP RESET from |
| 538 | * RAN_Emulation is through, after above f_cn_nr_init(). In the pcap it seems to be a matter of 50 ms. Give some |
| 539 | * grace. */ |
| 540 | f_sleep(1.0); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 541 | } |
| 542 | |
| 543 | friend function f_shutdown_helper() runs on test_CT { |
Pau Espin Pedrol | 6c87ad9 | 2023-07-18 11:24:25 +0200 | [diff] [blame] | 544 | if (mp_validate_talloc_asn1) { |
| 545 | f_verify_talloc_bytes(HNBGWVTY, {"asn1_context"}, 1); |
| 546 | } |
Neels Hofmeyr | 75d905b | 2023-04-27 00:30:25 +0200 | [diff] [blame] | 547 | |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 548 | all component.stop; |
| 549 | setverdict(pass); |
| 550 | mtc.stop; |
| 551 | } |
| 552 | |
| 553 | /* helper function to start all of the simulated hNodeBs */ |
| 554 | function f_start_hnbs() runs on test_CT { |
Pau Espin Pedrol | 83a4961 | 2022-09-12 21:11:05 +0200 | [diff] [blame] | 555 | for (var integer i:= 0; i < g_num_hnbs; i := i+1) { |
Daniel Willmann | c79679a | 2022-08-23 17:48:39 +0200 | [diff] [blame] | 556 | f_hnbap_register(i, i); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 557 | } |
| 558 | } |
| 559 | |
| 560 | /*********************************************************************** |
| 561 | * code running in test_CT, preparing start of per-UE ConnHdlr |
| 562 | ***********************************************************************/ |
| 563 | |
| 564 | /* inbound RUA connection establishment on Iuh side */ |
| 565 | function IuhRanapCreateCallback(ContextId context_id, RUA_IEs.CN_DomainIndicator domain, charstring id) |
| 566 | runs on RUA_Emulation_CT return RUA_ConnHdlr { |
| 567 | log("CreateCallback"); |
| 568 | return null; |
| 569 | } |
| 570 | |
| 571 | /* inbound RUA connectionless data on Iuh side */ |
| 572 | function IuhRanapUnitdataCallback(RANAP_PDU ranap) |
| 573 | runs on RUA_Emulation_CT return template RANAP_PDU { |
| 574 | log("UnitdataCallback"); |
| 575 | return omit; |
| 576 | } |
| 577 | |
| 578 | private function f_start_handler_create(TestHdlrParams pars) runs on test_CT return ConnHdlr { |
| 579 | var ConnHdlr vc_conn; |
| 580 | var charstring id := testcasename() & int2str(pars.hnb_idx); |
| 581 | |
| 582 | vc_conn := ConnHdlr.create(id); |
| 583 | |
| 584 | /* Iuh RUA part */ |
| 585 | connect(vc_conn:RUA, vc_RUA[pars.hnb_idx]:CLIENT); |
| 586 | |
Neels Hofmeyr | 7a48df1 | 2023-04-20 20:43:43 +0200 | [diff] [blame] | 587 | /* MSC or SGSN */ |
| 588 | connect(vc_conn:BSSAP, g_cn[pars.cn_idx].vc_RAN:CLIENT); |
| 589 | connect(vc_conn:BSSAP_PROC, g_cn[pars.cn_idx].vc_RAN:PROC); |
| 590 | |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 591 | /* MGCP part */ |
| 592 | connect(vc_conn:MGCP, vc_MGCP:MGCP_CLIENT); |
| 593 | connect(vc_conn:MGCP_PROC, vc_MGCP:MGCP_PROC); |
| 594 | |
| 595 | return vc_conn; |
| 596 | } |
| 597 | |
| 598 | private function f_start_handler_run(ConnHdlr vc_conn, void_fn fn, TestHdlrParams pars) runs on test_CT { |
| 599 | var charstring id := testcasename(); // & int2str(pars.ran_idx); |
| 600 | /* We cannot use vc_conn.start(f_init_handler(fn, id, pars)); as we cannot have |
| 601 | * a stand-alone 'derefers()' call, see https://www.eclipse.org/forums/index.php/t/1091364/ */ |
| 602 | pars.hnb := g_hnb_cfg[pars.hnb_idx]; |
| 603 | pars.mgcp_pars := valueof(t_MgcpParams); |
| 604 | vc_conn.start(derefers(fn)(id, pars)); |
| 605 | } |
| 606 | |
| 607 | function f_start_handler_with_pars(void_fn fn, template (value) TestHdlrParams pars) |
| 608 | runs on test_CT return ConnHdlr { |
| 609 | var ConnHdlr vc_conn; |
| 610 | vc_conn := f_start_handler_create(valueof(pars)); |
| 611 | f_start_handler_run(vc_conn, fn, valueof(pars)); |
| 612 | return vc_conn; |
| 613 | } |
| 614 | |
| 615 | /*********************************************************************** |
| 616 | * code running inside per-UE ConnHdlr |
| 617 | ***********************************************************************/ |
| 618 | |
| 619 | type function void_fn(charstring id, TestHdlrParams pars) runs on ConnHdlr; |
| 620 | |
| 621 | function f_init_handler(TestHdlrParams pars, float t_guard := 20.0) runs on ConnHdlr { |
| 622 | /* make parameters available via component variable */ |
| 623 | g_pars := pars; |
Neels Hofmeyr | a56e8fd | 2022-05-08 01:16:55 +0200 | [diff] [blame] | 624 | |
| 625 | f_init_pfcp(testcasename()); |
| 626 | |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 627 | /* start guard timer and activate it as default */ |
| 628 | g_Tguard.start(t_guard); |
| 629 | activate(as_Tguard_ConnHdlr()); |
| 630 | |
Neels Hofmeyr | 72a8d62 | 2023-01-26 13:47:01 +0100 | [diff] [blame] | 631 | map(self:HNBGWVTY, system:HNBGWVTY); |
| 632 | f_vty_set_prompts(HNBGWVTY); |
| 633 | f_vty_transceive(HNBGWVTY, "enable"); |
| 634 | |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 635 | /* TODO: CTRL? */ |
Neels Hofmeyr | 5951722 | 2023-06-23 04:46:59 +0200 | [diff] [blame] | 636 | |
| 637 | f_sleep(1.0); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 638 | } |
| 639 | |
| 640 | /* global altstep for global guard timer; */ |
| 641 | private altstep as_Tguard_ConnHdlr() runs on ConnHdlr { |
| 642 | [] g_Tguard.timeout { |
| 643 | setverdict(fail, "Timeout of T_guard"); |
| 644 | mtc.stop; |
| 645 | } |
| 646 | } |
| 647 | |
Neels Hofmeyr | dc416c9 | 2023-03-09 02:47:50 +0100 | [diff] [blame] | 648 | private function f_bssap_expect(template (present) RANAP_PDU exp_rx) runs on ConnHdlr return RANAP_PDU |
| 649 | { |
| 650 | var RANAP_PDU rx; |
| 651 | timer T := 5.0; |
| 652 | T.start; |
| 653 | alt { |
| 654 | [] BSSAP.receive(exp_rx) -> value rx { |
| 655 | setverdict(pass); |
| 656 | } |
| 657 | [] BSSAP.receive(RANAP_PDU:?) { |
| 658 | setverdict(fail, "Got an unexpected RANAP message on BSSAP port, was waiting for ", exp_rx); |
| 659 | mtc.stop; |
| 660 | } |
| 661 | [] T.timeout { |
| 662 | setverdict(fail, "Timeout waiting for RANAP on BSSAP port: ", exp_rx); |
| 663 | mtc.stop; |
| 664 | } |
| 665 | } |
| 666 | T.stop; |
| 667 | return rx; |
| 668 | } |
| 669 | |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 670 | /* send RANAP on Iuh and expect it to show up on Iu */ |
| 671 | function f_iuh2iu(template (present) RANAP_PDU tx, template RANAP_PDU exp_rx := omit) |
| 672 | runs on ConnHdlr return RANAP_PDU { |
| 673 | var RANAP_PDU rx; |
| 674 | timer T := 5.0; |
| 675 | |
| 676 | if (istemplatekind(exp_rx, "omit")) { |
| 677 | exp_rx := tx; |
| 678 | } |
| 679 | |
| 680 | RUA.send(tx); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 681 | |
Neels Hofmeyr | dc416c9 | 2023-03-09 02:47:50 +0100 | [diff] [blame] | 682 | return f_bssap_expect(exp_rx); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 683 | } |
| 684 | |
| 685 | /* send RANAP on Iu and expect it to show up on Iuh */ |
| 686 | function f_iu2iuh(template (present) RANAP_PDU tx, template RANAP_PDU exp_rx := omit) |
| 687 | runs on ConnHdlr return RANAP_PDU { |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 688 | if (istemplatekind(exp_rx, "omit")) { |
| 689 | exp_rx := tx; |
| 690 | } |
| 691 | |
| 692 | BSSAP.send(tx); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 693 | |
Neels Hofmeyr | 735b656 | 2023-03-09 02:51:28 +0100 | [diff] [blame] | 694 | return f_rua_expect(exp_rx) |
| 695 | } |
| 696 | |
| 697 | /* expect to receive a specific RUA message on Iuh */ |
| 698 | private function f_rua_expect(template (present) RANAP_PDU exp_rx) runs on ConnHdlr return RANAP_PDU |
| 699 | { |
| 700 | var RANAP_PDU rx; |
| 701 | timer T := 5.0; |
| 702 | T.start; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 703 | alt { |
| 704 | [] RUA.receive(exp_rx) -> value rx { |
| 705 | setverdict(pass); |
| 706 | } |
Neels Hofmeyr | 735b656 | 2023-03-09 02:51:28 +0100 | [diff] [blame] | 707 | [] RUA.receive(RANAP_PDU:?) { |
| 708 | setverdict(fail, "Got an unexpected RUA message, was waiting for ", exp_rx); |
| 709 | mtc.stop; |
| 710 | } |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 711 | [] T.timeout { |
| 712 | setverdict(fail, "Timeout waiting for Iuh ", exp_rx); |
Neels Hofmeyr | 735b656 | 2023-03-09 02:51:28 +0100 | [diff] [blame] | 713 | mtc.stop; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 714 | } |
| 715 | } |
Neels Hofmeyr | 735b656 | 2023-03-09 02:51:28 +0100 | [diff] [blame] | 716 | T.stop; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 717 | return rx; |
| 718 | } |
| 719 | |
| 720 | /* send RANAP on Iuh and expect it to show up on Iu */ |
| 721 | function f_iuh2iu_connect(template (present) RANAP_PDU tx, template RANAP_PDU exp_rx := omit) |
| 722 | runs on ConnHdlr return RANAP_PDU { |
| 723 | var RANAP_PDU rx; |
| 724 | timer T := 5.0; |
| 725 | |
| 726 | if (istemplatekind(exp_rx, "omit")) { |
| 727 | exp_rx := tx; |
| 728 | } |
| 729 | |
| 730 | /* create an expect on the Iu side for the random NAS portion */ |
Neels Hofmeyr | f2c9502 | 2023-04-19 01:24:39 +0200 | [diff] [blame] | 731 | if (g_pars.expect_separate_sccp_cr) { |
Neels Hofmeyr | f0b9ed1 | 2022-06-07 17:46:32 +0200 | [diff] [blame] | 732 | f_ran_register_sccp_cr_without_payload(); |
| 733 | } else { |
| 734 | var template (omit) octetstring nas := f_ranap_extract_l3(valueof(tx)); |
| 735 | f_ran_register_exp(valueof(nas)); |
| 736 | } |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 737 | |
| 738 | /* send it via Iuh (creating a RUA connection) */ |
| 739 | RUA.send(RUA_Conn_Req:{g_pars.ps_domain, tx}); |
| 740 | |
Neels Hofmeyr | f2c9502 | 2023-04-19 01:24:39 +0200 | [diff] [blame] | 741 | if (g_pars.expect_separate_sccp_cr) { |
Neels Hofmeyr | f0b9ed1 | 2022-06-07 17:46:32 +0200 | [diff] [blame] | 742 | /* Acknowledge the empty SCCP CR. RAN_Emulation does the confirmation, no need to respond. */ |
| 743 | BSSAP.receive(tr_RANAP_Conn_Req()); |
| 744 | } |
| 745 | |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 746 | /* expect to receive it on the Iu side */ |
Neels Hofmeyr | dc416c9 | 2023-03-09 02:47:50 +0100 | [diff] [blame] | 747 | return f_bssap_expect(exp_rx); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 748 | } |
| 749 | |
Neels Hofmeyr | 99b7d40 | 2023-02-20 14:26:31 +0100 | [diff] [blame] | 750 | /* 3GPP TS 48.006 9.2 Connection release: |
| 751 | * |
| 752 | * The MSC sends a SCCP released message. This message shall not contain |
| 753 | * any user data field. |
| 754 | * |
| 755 | * So what we expect normally is: |
| 756 | * |
| 757 | * HNBGW MSC |
| 758 | * RUA --id-Disconnect-------> | ---Data-Form-1(!)---> | Iu-ReleaseComplete |
| 759 | * | <--Released---------- | (no data) |
| 760 | * |
| 761 | * This function tests osmo-hnbgw behavior if the CN fails to send a RLSD: |
| 762 | * after some timeout, osmo-hnbgw should send a RLSD to the CN. |
| 763 | */ |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 764 | function f_iuh2iu_disconnect(template (present) RANAP_PDU tx, RUA_IEs.Cause cause, |
| 765 | template RANAP_PDU exp_rx := omit) |
| 766 | runs on ConnHdlr return RANAP_PDU { |
| 767 | var RANAP_PDU rx |
Neels Hofmeyr | 99b7d40 | 2023-02-20 14:26:31 +0100 | [diff] [blame] | 768 | timer T := 10.0; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 769 | |
| 770 | if (istemplatekind(exp_rx, "omit")) { |
| 771 | exp_rx := tx; |
| 772 | } |
| 773 | |
| 774 | /* send it via Iuh (creating a RUA connection) */ |
| 775 | RUA.send(RUA_Disc_Req:{tx, cause}); |
| 776 | |
| 777 | /* expect to receive it on the Iu side */ |
Neels Hofmeyr | dc416c9 | 2023-03-09 02:47:50 +0100 | [diff] [blame] | 778 | rx := f_bssap_expect(exp_rx); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 779 | |
| 780 | /* expect disconnect on the Iu side */ |
Neels Hofmeyr | dc416c9 | 2023-03-09 02:47:50 +0100 | [diff] [blame] | 781 | T.start; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 782 | alt { |
| 783 | [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { |
| 784 | setverdict(pass); |
| 785 | } |
| 786 | [] T.timeout { |
| 787 | setverdict(fail, "Timeout waiting for Iu disconnect"); |
| 788 | return rx; |
| 789 | } |
| 790 | |
| 791 | } |
| 792 | return rx; |
| 793 | } |
| 794 | |
Neels Hofmeyr | f2c9502 | 2023-04-19 01:24:39 +0200 | [diff] [blame] | 795 | private function f_build_initial_ue_with_nas(TestHdlrParams pars, octetstring nas) |
| 796 | return RANAP_PDU { |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 797 | var LAI lai := { |
| 798 | pLMNidentity := hex2oct(pars.hnb.lai.mcc_mnc), |
| 799 | lAC := int2oct(pars.hnb.lai.lac, 2), |
| 800 | iE_Extensions := omit |
| 801 | }; |
| 802 | var SAI sai := { |
| 803 | pLMNidentity := lai.pLMNidentity, |
| 804 | lAC := lai.lAC, |
| 805 | sAC := int2oct(pars.hnb.sac, 2), |
| 806 | iE_Extensions := omit |
| 807 | } |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 808 | var IuSignallingConnectionIdentifier sigc_id := int2bit(f_rnd_int(1000), 24); |
| 809 | var GlobalRNC_ID grnc_id := { |
| 810 | pLMNidentity := lai.pLMNidentity, |
| 811 | rNC_ID := 2342 |
| 812 | } |
Neels Hofmeyr | f2c9502 | 2023-04-19 01:24:39 +0200 | [diff] [blame] | 813 | var template RANAP_PDU ret; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 814 | if (pars.ps_domain) { |
| 815 | var RAC rac := '00'O; |
Neels Hofmeyr | f2c9502 | 2023-04-19 01:24:39 +0200 | [diff] [blame] | 816 | ret := ts_RANAP_initialUE_PS(lai, rac, sai, nas, sigc_id, grnc_id); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 817 | } else { |
Neels Hofmeyr | f2c9502 | 2023-04-19 01:24:39 +0200 | [diff] [blame] | 818 | ret := ts_RANAP_initialUE_CS(lai, sai, nas, sigc_id, grnc_id); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 819 | } |
Neels Hofmeyr | f2c9502 | 2023-04-19 01:24:39 +0200 | [diff] [blame] | 820 | return valueof(ret); |
| 821 | } |
| 822 | |
| 823 | /* build a RANAP InitialUE based on the TestHdlrParams */ |
| 824 | friend function f_build_initial_ue(TestHdlrParams pars) return RANAP_PDU { |
| 825 | |
| 826 | var octetstring nas; |
| 827 | |
| 828 | if (pars.tx_sccp_cr_data_len == 0) { |
| 829 | nas := f_rnd_octstring(10); |
| 830 | } else { |
| 831 | /* The test asks for an exact number of Optional Data bytes. */ |
| 832 | |
| 833 | /* First see what size the RANAP part of the payload data is, |
| 834 | * to adjust the NAS PDU size to the size requested by the test (pars.tx_sccp_cr_data_len). */ |
| 835 | var RANAP_PDU initial_ue := f_build_initial_ue_with_nas(pars, '00'O); |
| 836 | |
| 837 | var octetstring ranap_plus_one_byte_nas := enc_RANAP_PDU(initial_ue); |
| 838 | var integer ranap_length := lengthof(ranap_plus_one_byte_nas) - 1; |
| 839 | |
| 840 | log("ranap_plus_one_byte_nas = ", lengthof(ranap_plus_one_byte_nas), " bytes, ", initial_ue, " = ", |
| 841 | ranap_plus_one_byte_nas); |
| 842 | log("ranap_length = ", ranap_length); |
| 843 | |
| 844 | /* SCCP CR has a payload length limit of 130 bytes. To trigger this limit, the RANAP + NAS PDU has to be |
| 845 | * > 130 bytes. It doesn't need to be 131 bytes in the NAS PDU alone, but let's just make it definitely |
| 846 | * large enough. To test for this limit, pars.tx_sccp_cr_data_len asks for a specific amount of data len. */ |
| 847 | nas := f_rnd_octstring(pars.tx_sccp_cr_data_len - ranap_length); |
| 848 | } |
| 849 | |
| 850 | var RANAP_PDU ret := f_build_initial_ue_with_nas(pars, nas); |
| 851 | |
| 852 | if (pars.tx_sccp_cr_data_len != 0) { |
| 853 | for (var integer attempts := 0; attempts < 2; attempts := attempts + 1) { |
| 854 | var octetstring check_len := enc_RANAP_PDU(ret); |
| 855 | log("final RANAP PDU length = ", lengthof(check_len)); |
| 856 | if (lengthof(check_len) == pars.tx_sccp_cr_data_len) { |
| 857 | return ret; |
| 858 | } |
| 859 | nas := f_rnd_octstring(lengthof(nas) + (pars.tx_sccp_cr_data_len - lengthof(check_len))); |
| 860 | log("that was off, changed NAS length to ", lengthof(nas), " and trying again"); |
| 861 | ret := f_build_initial_ue_with_nas(pars, nas); |
| 862 | } |
| 863 | setverdict(fail, "Ended up with wrong Optional Data length"); |
| 864 | mtc.stop; |
| 865 | } |
| 866 | return ret; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 867 | } |
| 868 | |
| 869 | /* build a RANAP RAB AssignmentResponse based on the TestHdlrParams */ |
| 870 | friend function f_build_rab_ass_resp(TestHdlrParams pars) return RANAP_PDU { |
| 871 | var template RAB_SetupOrModifiedList rab_sml; |
| 872 | |
| 873 | rab_sml := ts_RAB_SMdL(t_RAB_id(23), f_ts_RAB_TLA("192.168.1.23"), t_RAB_binding_port(1234)); |
| 874 | |
| 875 | return valueof(ts_RANAP_RabAssResp(rab_sml)); |
| 876 | } |
| 877 | |
| 878 | |
| 879 | /*********************************************************************** |
| 880 | * HNBAP Testing |
| 881 | ***********************************************************************/ |
| 882 | |
| 883 | |
Daniel Willmann | c79679a | 2022-08-23 17:48:39 +0200 | [diff] [blame] | 884 | function f_hnbap_register(integer hnb_idx := 0, integer cell_id := 0, boolean expect_reject := false) runs on test_CT |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 885 | { |
| 886 | timer T := 2.0; |
| 887 | |
Neels Hofmeyr | fffe79b | 2023-06-27 01:16:15 +0200 | [diff] [blame] | 888 | HNBAP[hnb_idx].send(ts_HNBAP_HNBRegisterRequest(char2oct("TTCN3-HNB-" & int2str(hnb_idx)), |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 889 | '00F110'O, |
Daniel Willmann | c79679a | 2022-08-23 17:48:39 +0200 | [diff] [blame] | 890 | int2bit(1 + cell_id, 28), |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 891 | int2oct(2, 2), |
| 892 | int2oct(3, 1), |
| 893 | int2oct(4, 2))); |
| 894 | |
| 895 | T.start; |
| 896 | alt { |
| 897 | [] HNBAP[hnb_idx].receive(tr_HNBAP_HNBRegisterAccept(?)) { |
Daniel Willmann | c79679a | 2022-08-23 17:48:39 +0200 | [diff] [blame] | 898 | if (expect_reject) { |
| 899 | setverdict(fail, "Rx HNB Register Accept while expecting reject"); |
| 900 | } else { |
| 901 | setverdict(pass); |
| 902 | } |
| 903 | } |
| 904 | [] HNBAP[hnb_idx].receive(tr_HNBAP_HNBRegisterReject(?)) { |
| 905 | if (expect_reject) { |
| 906 | setverdict(pass); |
| 907 | } else { |
| 908 | setverdict(fail, "Rx HNB Register Reject while expecting accept"); |
| 909 | } |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 910 | } |
| 911 | [] HNBAP[hnb_idx].receive(IUHEM_Event:?) { |
| 912 | repeat; |
| 913 | } |
| 914 | [] T.timeout { |
Daniel Willmann | c79679a | 2022-08-23 17:48:39 +0200 | [diff] [blame] | 915 | setverdict(fail, "Timeout waiting for HNB Register response"); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 916 | } |
| 917 | } |
| 918 | } |
| 919 | |
| 920 | testcase TC_hnb_register() runs on test_CT { |
Pau Espin Pedrol | 83a4961 | 2022-09-12 21:11:05 +0200 | [diff] [blame] | 921 | g_num_hnbs := 1; |
Neels Hofmeyr | 333ea39 | 2023-06-27 00:58:05 +0200 | [diff] [blame] | 922 | f_init(start_hnb := false); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 923 | f_hnbap_register(0); |
| 924 | f_shutdown_helper(); |
| 925 | } |
| 926 | |
Pau Espin Pedrol | acf4f22 | 2022-09-27 14:33:40 +0200 | [diff] [blame] | 927 | /* Try to register the same HNB from 2 different concurrent connections. Second |
| 928 | * one should be rejected. */ |
Daniel Willmann | c79679a | 2022-08-23 17:48:39 +0200 | [diff] [blame] | 929 | testcase TC_hnb_register_duplicate() runs on test_CT { |
Pau Espin Pedrol | 83a4961 | 2022-09-12 21:11:05 +0200 | [diff] [blame] | 930 | g_num_hnbs := 2; |
Neels Hofmeyr | 333ea39 | 2023-06-27 00:58:05 +0200 | [diff] [blame] | 931 | f_init(start_hnb := false); |
Daniel Willmann | c79679a | 2022-08-23 17:48:39 +0200 | [diff] [blame] | 932 | f_hnbap_register(0); |
| 933 | f_hnbap_register(1, 0, expect_reject := true); |
| 934 | f_verify_talloc_count(HNBGWVTY, {"struct hnb_context"}, expect_count := 1); |
| 935 | f_shutdown_helper(); |
| 936 | } |
| 937 | |
Pau Espin Pedrol | acf4f22 | 2022-09-27 14:33:40 +0200 | [diff] [blame] | 938 | /* Try to register the same HNB in the same connection already established, aka |
| 939 | * duplicate HNB Register Request. It should be accepted and new configuration |
| 940 | * applied. TS 25.469 8.2.4 */ |
| 941 | testcase TC_hnb_register_duplicate_reuse_sctp_assoc() runs on test_CT { |
| 942 | g_num_hnbs := 1; |
Neels Hofmeyr | 333ea39 | 2023-06-27 00:58:05 +0200 | [diff] [blame] | 943 | f_init(start_hnb := false); |
Pau Espin Pedrol | acf4f22 | 2022-09-27 14:33:40 +0200 | [diff] [blame] | 944 | f_hnbap_register(0); |
| 945 | f_hnbap_register(0); |
| 946 | f_verify_talloc_count(HNBGWVTY, {"struct hnb_context"}, expect_count := 1); |
| 947 | f_shutdown_helper(); |
| 948 | } |
| 949 | |
Pau Espin Pedrol | f0b9fa0 | 2022-09-12 13:31:07 +0200 | [diff] [blame] | 950 | /* Drop HNBAP conn (HNBAP DEREG) and reconnect it (HNBAP REG) using same SCTP association. |
| 951 | * Related: OS#5676, SYS#6113 */ |
| 952 | testcase TC_hnb_reregister_reuse_sctp_assoc() runs on test_CT { |
| 953 | g_num_hnbs := 1; |
Neels Hofmeyr | 333ea39 | 2023-06-27 00:58:05 +0200 | [diff] [blame] | 954 | f_init(start_hnb := false); |
Pau Espin Pedrol | f0b9fa0 | 2022-09-12 13:31:07 +0200 | [diff] [blame] | 955 | f_hnbap_register(0); |
| 956 | HNBAP[0].send(ts_HNBAP_HNBDe_Register(ts_HnbapCause(unspecified))); |
| 957 | f_hnbap_register(0); |
| 958 | f_verify_talloc_count(HNBGWVTY, {"struct hnb_context"}, expect_count := 1); |
| 959 | f_shutdown_helper(); |
| 960 | } |
| 961 | |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 962 | /*********************************************************************** |
| 963 | * RUA / RANAP Testing |
| 964 | ***********************************************************************/ |
| 965 | |
Neels Hofmeyr | 7a48df1 | 2023-04-20 20:43:43 +0200 | [diff] [blame] | 966 | /* Translate from {msc,sgsn}x{0..n} to the proper index to use in g_cn[]. |
| 967 | * g_cn[] stores CN links, MSCs and SGSNs in the same array. |
| 968 | * For example, for 'sgsn 23', use g_cn[ f_cn_idx(ps_domain := true, cn_nr := 23) ]. |
| 969 | * |
| 970 | * Note the naming: |
| 971 | * cn_nr is the number used in the cfg file, as in 'msc 0'. |
| 972 | * cn_idx is the array index in g_cn[]. |
| 973 | */ |
| 974 | private function f_cn_idx(boolean ps_domain, integer cn_nr := 0) return integer |
| 975 | { |
| 976 | if (ps_domain) { |
| 977 | return FIRST_SGSN_IDX + cn_nr; |
| 978 | } |
| 979 | return FIRST_MSC_IDX + cn_nr; |
| 980 | } |
| 981 | |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 982 | private template (value) TestHdlrParams |
Neels Hofmeyr | f0b9ed1 | 2022-06-07 17:46:32 +0200 | [diff] [blame] | 983 | t_pars(integer imsi_suffix, boolean ps_domain := false, integer hnb_idx := 0, |
Neels Hofmeyr | 7a48df1 | 2023-04-20 20:43:43 +0200 | [diff] [blame] | 984 | boolean expect_separate_sccp_cr := false, integer tx_sccp_cr_data_len := 0, |
| 985 | integer cn_nr := 0) := { |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 986 | hnb_idx := hnb_idx, |
Neels Hofmeyr | 7a48df1 | 2023-04-20 20:43:43 +0200 | [diff] [blame] | 987 | cn_idx := f_cn_idx(ps_domain, cn_nr), |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 988 | imsi := f_gen_imsi(imsi_suffix), |
| 989 | ps_domain := ps_domain, |
Neels Hofmeyr | f0b9ed1 | 2022-06-07 17:46:32 +0200 | [diff] [blame] | 990 | hnb := omit, /* filled in later */ |
Neels Hofmeyr | f2c9502 | 2023-04-19 01:24:39 +0200 | [diff] [blame] | 991 | expect_separate_sccp_cr := expect_separate_sccp_cr, |
| 992 | tx_sccp_cr_data_len := tx_sccp_cr_data_len, |
Neels Hofmeyr | 7d0e680 | 2023-04-20 20:43:55 +0200 | [diff] [blame] | 993 | pfcp_local_addr := mp_pfcp_ip_local, |
| 994 | nas_pdu := omit |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 995 | } |
| 996 | |
| 997 | /* Create an Iuh connection; send InitialUE; expect it to appear on new SCCP conenction */ |
| 998 | friend function f_tc_initial_ue(charstring id, TestHdlrParams pars) runs on ConnHdlr { |
| 999 | f_init_handler(pars); |
| 1000 | var RANAP_PDU tx := f_build_initial_ue(g_pars); |
| 1001 | f_iuh2iu_connect(tx); |
| 1002 | } |
| 1003 | testcase TC_ranap_cs_initial_ue() runs on test_CT { |
| 1004 | var ConnHdlr vc_conn; |
| 1005 | |
Pau Espin Pedrol | 83a4961 | 2022-09-12 21:11:05 +0200 | [diff] [blame] | 1006 | g_num_hnbs := 1; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1007 | f_init(); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1008 | |
| 1009 | vc_conn := f_start_handler_with_pars(refers(f_tc_initial_ue), t_pars(1)); |
| 1010 | vc_conn.done; |
Neels Hofmeyr | 3a9140e | 2023-06-23 04:50:39 +0200 | [diff] [blame] | 1011 | |
| 1012 | f_shutdown_helper(); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1013 | } |
| 1014 | testcase TC_ranap_ps_initial_ue() runs on test_CT { |
| 1015 | var ConnHdlr vc_conn; |
| 1016 | |
Pau Espin Pedrol | 83a4961 | 2022-09-12 21:11:05 +0200 | [diff] [blame] | 1017 | g_num_hnbs := 1; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1018 | f_init(); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1019 | |
| 1020 | vc_conn := f_start_handler_with_pars(refers(f_tc_initial_ue), t_pars(2, true)); |
| 1021 | vc_conn.done; |
Neels Hofmeyr | 3a9140e | 2023-06-23 04:50:39 +0200 | [diff] [blame] | 1022 | |
| 1023 | f_shutdown_helper(); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1024 | } |
| 1025 | |
Neels Hofmeyr | f2c9502 | 2023-04-19 01:24:39 +0200 | [diff] [blame] | 1026 | private function f_vty_set_sccp_max_optional_data(TELNETasp_PT pt, integer val := -1) |
Neels Hofmeyr | f0b9ed1 | 2022-06-07 17:46:32 +0200 | [diff] [blame] | 1027 | { |
Neels Hofmeyr | f2c9502 | 2023-04-19 01:24:39 +0200 | [diff] [blame] | 1028 | var charstring valstr; |
| 1029 | if (val < 0) { |
| 1030 | valstr := "standard"; |
| 1031 | } else { |
| 1032 | valstr := int2str(val); |
| 1033 | } |
Neels Hofmeyr | f0b9ed1 | 2022-06-07 17:46:32 +0200 | [diff] [blame] | 1034 | f_vty_enter_config(pt); |
Neels Hofmeyr | f2c9502 | 2023-04-19 01:24:39 +0200 | [diff] [blame] | 1035 | f_vty_transceive(pt, "cs7 instance 0"); |
| 1036 | f_vty_transceive(pt, "sccp max-optional-data " & valstr); |
Neels Hofmeyr | f0b9ed1 | 2022-06-07 17:46:32 +0200 | [diff] [blame] | 1037 | f_vty_transceive(pt, "end"); |
| 1038 | } |
| 1039 | |
| 1040 | testcase TC_ranap_cs_initial_ue_empty_cr() runs on test_CT { |
| 1041 | var ConnHdlr vc_conn; |
| 1042 | |
Pau Espin Pedrol | 83a4961 | 2022-09-12 21:11:05 +0200 | [diff] [blame] | 1043 | g_num_hnbs := 1; |
Neels Hofmeyr | f0b9ed1 | 2022-06-07 17:46:32 +0200 | [diff] [blame] | 1044 | f_init(); |
Neels Hofmeyr | f0b9ed1 | 2022-06-07 17:46:32 +0200 | [diff] [blame] | 1045 | |
Neels Hofmeyr | f2c9502 | 2023-04-19 01:24:39 +0200 | [diff] [blame] | 1046 | f_vty_set_sccp_max_optional_data(HNBGWVTY, 0); |
Neels Hofmeyr | f0b9ed1 | 2022-06-07 17:46:32 +0200 | [diff] [blame] | 1047 | |
Neels Hofmeyr | f2c9502 | 2023-04-19 01:24:39 +0200 | [diff] [blame] | 1048 | vc_conn := f_start_handler_with_pars(refers(f_tc_initial_ue), t_pars(1, expect_separate_sccp_cr := true)); |
Neels Hofmeyr | f0b9ed1 | 2022-06-07 17:46:32 +0200 | [diff] [blame] | 1049 | vc_conn.done; |
| 1050 | |
| 1051 | /* reset */ |
Neels Hofmeyr | f2c9502 | 2023-04-19 01:24:39 +0200 | [diff] [blame] | 1052 | f_vty_set_sccp_max_optional_data(HNBGWVTY); |
Neels Hofmeyr | 3a9140e | 2023-06-23 04:50:39 +0200 | [diff] [blame] | 1053 | |
| 1054 | f_shutdown_helper(); |
Neels Hofmeyr | f0b9ed1 | 2022-06-07 17:46:32 +0200 | [diff] [blame] | 1055 | } |
| 1056 | testcase TC_ranap_ps_initial_ue_empty_cr() runs on test_CT { |
| 1057 | var ConnHdlr vc_conn; |
| 1058 | |
Pau Espin Pedrol | 83a4961 | 2022-09-12 21:11:05 +0200 | [diff] [blame] | 1059 | g_num_hnbs := 1; |
Neels Hofmeyr | f0b9ed1 | 2022-06-07 17:46:32 +0200 | [diff] [blame] | 1060 | f_init(); |
Neels Hofmeyr | f0b9ed1 | 2022-06-07 17:46:32 +0200 | [diff] [blame] | 1061 | |
Neels Hofmeyr | f2c9502 | 2023-04-19 01:24:39 +0200 | [diff] [blame] | 1062 | f_vty_set_sccp_max_optional_data(HNBGWVTY, 0); |
Neels Hofmeyr | f0b9ed1 | 2022-06-07 17:46:32 +0200 | [diff] [blame] | 1063 | |
Neels Hofmeyr | f2c9502 | 2023-04-19 01:24:39 +0200 | [diff] [blame] | 1064 | vc_conn := f_start_handler_with_pars(refers(f_tc_initial_ue), t_pars(2, true, expect_separate_sccp_cr := true)); |
Neels Hofmeyr | f0b9ed1 | 2022-06-07 17:46:32 +0200 | [diff] [blame] | 1065 | vc_conn.done; |
| 1066 | |
| 1067 | /* reset */ |
Neels Hofmeyr | f2c9502 | 2023-04-19 01:24:39 +0200 | [diff] [blame] | 1068 | f_vty_set_sccp_max_optional_data(HNBGWVTY); |
Neels Hofmeyr | 3a9140e | 2023-06-23 04:50:39 +0200 | [diff] [blame] | 1069 | |
| 1070 | f_shutdown_helper(); |
Neels Hofmeyr | f2c9502 | 2023-04-19 01:24:39 +0200 | [diff] [blame] | 1071 | } |
| 1072 | |
| 1073 | type record Testdata_CR_Limit { |
| 1074 | integer data_len, |
| 1075 | integer max_optional_data, |
| 1076 | boolean expect_separate_sccp_cr |
| 1077 | }; |
| 1078 | type record of Testdata_CR_Limit Testdata_CR_Limits; |
| 1079 | |
| 1080 | testcase TC_sccp_cr_limit() runs on test_CT { |
| 1081 | g_num_hnbs := 1; |
| 1082 | f_init(); |
Neels Hofmeyr | f2c9502 | 2023-04-19 01:24:39 +0200 | [diff] [blame] | 1083 | |
| 1084 | const Testdata_CR_Limits tests := { |
| 1085 | { data_len := 130, max_optional_data := -1, expect_separate_sccp_cr := false }, |
| 1086 | { data_len := 131, max_optional_data := -1, expect_separate_sccp_cr := true }, |
| 1087 | |
| 1088 | { data_len := 100, max_optional_data := 100, expect_separate_sccp_cr := false }, |
| 1089 | { data_len := 101, max_optional_data := 100, expect_separate_sccp_cr := true }, |
| 1090 | |
| 1091 | { data_len := 200, max_optional_data := 200, expect_separate_sccp_cr := false }, |
| 1092 | { data_len := 201, max_optional_data := 200, expect_separate_sccp_cr := true } |
| 1093 | }; |
| 1094 | |
| 1095 | var integer csps; |
| 1096 | for (csps := 0; csps < 2; csps := csps + 1) { |
| 1097 | var boolean ps_domain := (csps > 0); |
| 1098 | |
| 1099 | var integer i; |
| 1100 | for (i := 0; i < lengthof(tests); i := i + 1) { |
| 1101 | var Testdata_CR_Limit t := tests[i]; |
| 1102 | f_logp(HNBGWVTY, |
| 1103 | "TEST PART TC_sccp_cr_limit ps_domain=" & f_bool2str(ps_domain) |
| 1104 | & " data_len=" & int2str(t.data_len) |
| 1105 | & " max_optional_data=" & int2str(t.max_optional_data) |
| 1106 | & " expect_separate_sccp_cr=" & f_bool2str(t.expect_separate_sccp_cr) |
| 1107 | ); |
| 1108 | |
| 1109 | f_vty_set_sccp_max_optional_data(HNBGWVTY, t.max_optional_data); |
| 1110 | var ConnHdlr vc_conn; |
| 1111 | vc_conn := f_start_handler_with_pars(refers(f_tc_initial_ue), |
| 1112 | t_pars(100 + i, |
| 1113 | ps_domain := ps_domain, |
| 1114 | expect_separate_sccp_cr := t.expect_separate_sccp_cr, |
| 1115 | tx_sccp_cr_data_len := t.data_len)); |
| 1116 | vc_conn.done; |
| 1117 | } |
| 1118 | } |
| 1119 | |
| 1120 | /* reset */ |
| 1121 | f_vty_set_sccp_max_optional_data(HNBGWVTY); |
Neels Hofmeyr | 3a9140e | 2023-06-23 04:50:39 +0200 | [diff] [blame] | 1122 | |
| 1123 | f_shutdown_helper(); |
Neels Hofmeyr | f0b9ed1 | 2022-06-07 17:46:32 +0200 | [diff] [blame] | 1124 | } |
| 1125 | |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1126 | /* Reply to a received CRCX with an OK (or the reply configured in cpars), using the given parameters. |
| 1127 | * Return true when an OK reply was sent, false otherwise. |
| 1128 | * Count occurrence of Osmux, include Osmux parameters in the reply if necessary. */ |
| 1129 | function f_handle_crcx(inout MgcpParameters pars, MgcpCommand mgcp_cmd) return template MgcpResponse { |
| 1130 | var CrcxResponse conn := pars.mgw_conn_1; |
| 1131 | if (pars.got_crcx_count > 0) { |
| 1132 | conn := pars.mgw_conn_2; |
| 1133 | } |
| 1134 | pars.got_crcx_count := pars.got_crcx_count + 1; |
| 1135 | |
| 1136 | var MgcpMessage mgcp_msg := { |
| 1137 | command := mgcp_cmd |
| 1138 | } |
| 1139 | var template MgcpResponse mgcp_resp; |
| 1140 | var MgcpOsmuxCID osmux_cid; |
| 1141 | var MgcpCallId call_id := f_MgcpCmd_extract_call_id(mgcp_cmd); |
| 1142 | if (ispresent(pars.mgcp_call_id)) { |
| 1143 | if (pars.mgcp_call_id != call_id) { |
| 1144 | setverdict(fail, "CRCX contained unexpected call id. Expected:", pars.mgcp_call_id, " got:", call_id); |
| 1145 | mtc.stop; |
| 1146 | } |
| 1147 | } else { |
| 1148 | pars.mgcp_call_id := call_id; |
| 1149 | } |
| 1150 | |
| 1151 | /* When the endpoint contains a wildcard we keep the endpoint |
| 1152 | * identifier we have set up in pars. Otherwise we use the |
| 1153 | * endpoint name that the call agent has supplied */ |
| 1154 | if (match(mgcp_cmd.line.ep, t_MGCP_EP_wildcard) == false) { |
| 1155 | pars.mgcp_ep := mgcp_cmd.line.ep; |
| 1156 | } |
| 1157 | |
| 1158 | if (conn.resp == -1) { |
| 1159 | /* Reply with rror */ |
| 1160 | var MgcpResponse mgcp_rsp := { |
| 1161 | line := { |
| 1162 | code := "542", |
| 1163 | trans_id := mgcp_cmd.line.trans_id, |
| 1164 | string := "FORCED_FAIL" |
| 1165 | }, |
| 1166 | sdp := omit |
| 1167 | |
| 1168 | } |
| 1169 | var MgcpParameter mgcp_rsp_param := { |
| 1170 | code := "Z", |
| 1171 | val := pars.mgcp_ep |
| 1172 | }; |
| 1173 | mgcp_rsp.params[0] := mgcp_rsp_param; |
| 1174 | return mgcp_rsp; |
| 1175 | } |
| 1176 | |
| 1177 | if (conn.resp == 0) { |
| 1178 | /* Do not reply at all */ |
| 1179 | return omit; |
| 1180 | } |
| 1181 | |
| 1182 | if (conn.resp != 1) { |
| 1183 | setverdict(fail, "Unexpected value for pars.mgw_conn_*.resp, expect -1, 0 or 1"); |
| 1184 | mtc.stop; |
| 1185 | } |
| 1186 | |
| 1187 | var SDP_Message sdp := valueof(ts_SDP(conn.mgw_rtp_ip, conn.mgw_rtp_ip, |
| 1188 | hex2str(pars.mgcp_call_id), "42", |
| 1189 | conn.mgw_rtp_port, |
| 1190 | { int2str(pars.rtp_payload_type) }, |
| 1191 | { valueof(ts_SDP_rtpmap(pars.rtp_payload_type, |
| 1192 | pars.rtp_sdp_format)), |
| 1193 | valueof(ts_SDP_ptime(20)) })); |
| 1194 | |
| 1195 | if (f_mgcp_contains_par(mgcp_msg, "X-OSMUX")) { |
| 1196 | if (not pars.use_osmux) { |
| 1197 | setverdict(fail, "MSC sent X-Osmux parameter in MGCP, but not expecting any Osmux"); |
| 1198 | mtc.stop; |
| 1199 | } |
| 1200 | pars.got_osmux_count := pars.got_osmux_count + 1; |
| 1201 | /* we expect MSC to use wildcard here, i.e. osmux_cid == -1 */ |
| 1202 | osmux_cid := f_MgcpCmd_extract_osmux_cid(mgcp_cmd); |
| 1203 | log("f_handle_crcx(): got Osmux CID: ", osmux_cid); |
| 1204 | if (osmux_cid != -1) { |
| 1205 | setverdict(fail, "MSC using unexpected CID " & int2str(osmux_cid) & " != -1"); |
| 1206 | mtc.stop; |
| 1207 | } |
| 1208 | |
| 1209 | osmux_cid := 0; |
| 1210 | mgcp_resp := ts_CRCX_ACK_osmux(mgcp_cmd.line.trans_id, conn.mgcp_connection_id, osmux_cid, sdp); |
| 1211 | } else { |
| 1212 | mgcp_resp := ts_CRCX_ACK(mgcp_cmd.line.trans_id, conn.mgcp_connection_id, sdp); |
| 1213 | } |
| 1214 | |
| 1215 | f_mgcp_par_append(mgcp_resp.params, ts_MgcpParSpecEP(pars.mgcp_ep)); |
| 1216 | |
| 1217 | return mgcp_resp; |
| 1218 | } |
| 1219 | |
Daniel Willmann | 3e15b7b | 2022-02-21 17:07:02 +0100 | [diff] [blame] | 1220 | friend function f_create_rab(inout MgcpParameters pars) runs on ConnHdlr { |
| 1221 | f_rab_ass_req(pars); |
| 1222 | f_rab_ass_resp(pars); |
| 1223 | } |
| 1224 | |
| 1225 | friend function f_rab_ass_req(inout MgcpParameters pars) runs on ConnHdlr { |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1226 | var MgcpCommand mgcp_cmd; |
| 1227 | var RANAP_PDU tx; |
| 1228 | var template RAB_SetupOrModifyList rab_sml; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1229 | timer T := 5.0; |
| 1230 | |
| 1231 | /* Send RAB Assignment Request */ |
| 1232 | rab_sml := ts_RAB_SML(t_RAB_id(23), f_ts_RAB_TLA(pars.cn_rtp_ip), t_RAB_binding_port(pars.cn_rtp_port)); |
| 1233 | tx := valueof(ts_RANAP_RabAssReq(rab_sml)); |
| 1234 | BSSAP.send(tx); |
| 1235 | T.start; |
| 1236 | |
| 1237 | /* Handle MGCP CRCX */ |
| 1238 | alt { |
| 1239 | [] MGCP.receive(tr_CRCX) -> value mgcp_cmd { |
| 1240 | log("CRCX1", mgcp_cmd); |
| 1241 | var template MgcpResponse mgcp_rsp := f_handle_crcx(pars, mgcp_cmd); |
| 1242 | MGCP.send(valueof(mgcp_rsp)); |
| 1243 | } |
| 1244 | [] T.timeout { |
| 1245 | setverdict(fail, "Timeout waiting for MGCP"); |
| 1246 | } |
| 1247 | } |
Neels Hofmeyr | 735b656 | 2023-03-09 02:51:28 +0100 | [diff] [blame] | 1248 | T.stop; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1249 | |
| 1250 | /* Expect RAB Assignment Request with IP/port from CRCX ACK via Iuh */ |
| 1251 | rab_sml := ts_RAB_SML(t_RAB_id(23), f_ts_RAB_TLA(pars.mgw_conn_1.mgw_rtp_ip), t_RAB_binding_port(pars.mgw_conn_1.mgw_rtp_port)); |
| 1252 | tx := valueof(ts_RANAP_RabAssReq(rab_sml)); |
| 1253 | |
Neels Hofmeyr | 735b656 | 2023-03-09 02:51:28 +0100 | [diff] [blame] | 1254 | f_rua_expect(tx); |
Daniel Willmann | 3e15b7b | 2022-02-21 17:07:02 +0100 | [diff] [blame] | 1255 | } |
| 1256 | |
| 1257 | friend function f_rab_ass_resp(inout MgcpParameters pars) runs on ConnHdlr { |
| 1258 | var MgcpCommand mgcp_cmd; |
| 1259 | var RANAP_PDU tx; |
| 1260 | var template RAB_SetupOrModifiedList rab_smdl; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1261 | |
| 1262 | /* Send back RAB Assignment Response via Iuh */ |
| 1263 | rab_smdl := ts_RAB_SMdL(t_RAB_id(23), f_ts_RAB_TLA(pars.hnb_rtp_ip), t_RAB_binding_port(pars.hnb_rtp_port)); |
| 1264 | tx := valueof(ts_RANAP_RabAssResp(rab_smdl)); |
| 1265 | RUA.send(tx); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1266 | |
| 1267 | interleave { |
| 1268 | /* Expect MDCX with IP/port from RAB Assignment Response */ |
| 1269 | [] MGCP.receive(tr_MDCX(tr_SDP(pars.hnb_rtp_ip, pars.hnb_rtp_port))) -> value mgcp_cmd { |
| 1270 | log("MDCX1", mgcp_cmd); |
| 1271 | /* Verify SDP of MDCX */ |
| 1272 | var SDP_Message sdp := valueof(ts_SDP(pars.mgw_conn_1.mgw_rtp_ip, pars.mgw_conn_1.mgw_rtp_ip, hex2str(pars.mgcp_call_id), "42", pars.mgw_conn_1.mgw_rtp_port, |
| 1273 | { int2str(pars.rtp_payload_type) }, { valueof(ts_SDP_rtpmap(pars.rtp_payload_type, pars.rtp_sdp_format)), valueof(ts_SDP_ptime(20)) } )); |
| 1274 | var template MgcpResponse mgcp_rsp := ts_MDCX_ACK(mgcp_cmd.line.trans_id, pars.mgw_conn_1.mgcp_connection_id, sdp); |
| 1275 | MGCP.send(valueof(mgcp_rsp)); |
| 1276 | } |
| 1277 | /* Handle CRCX for second leg of endpoint, answer with IP/port */ |
| 1278 | [] MGCP.receive(tr_CRCX(pars.mgcp_ep, tr_SDP(pars.cn_rtp_ip, pars.cn_rtp_port))) -> value mgcp_cmd { |
| 1279 | log("CRCX2", mgcp_cmd); |
| 1280 | /* Verify SDP of CRCX */ |
| 1281 | var template MgcpResponse mgcp_rsp := f_handle_crcx(pars, mgcp_cmd); |
| 1282 | MGCP.send(valueof(mgcp_rsp)); |
| 1283 | } |
| 1284 | } |
| 1285 | |
| 1286 | /* Expect RAB Assignment Response with IP/port from second CRCX ACK */ |
| 1287 | rab_smdl := ts_RAB_SMdL(t_RAB_id(23), f_ts_RAB_TLA(pars.mgw_conn_2.mgw_rtp_ip), t_RAB_binding_port(pars.mgw_conn_2.mgw_rtp_port)); |
| 1288 | tx := valueof(ts_RANAP_RabAssResp(rab_smdl)); |
| 1289 | |
Neels Hofmeyr | dc416c9 | 2023-03-09 02:47:50 +0100 | [diff] [blame] | 1290 | f_bssap_expect(tx); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1291 | } |
| 1292 | |
| 1293 | private altstep as_mgcp_dlcx(inout TestHdlrParams pars) runs on ConnHdlr { |
| 1294 | var MgcpCommand mgcp_cmd; |
| 1295 | |
| 1296 | [] MGCP.receive(tr_DLCX(pars.mgcp_pars.mgcp_ep)) -> value mgcp_cmd { |
| 1297 | log("DLCX", mgcp_cmd); |
| 1298 | MGCP.send(ts_DLCX_ACK2(mgcp_cmd.line.trans_id)); |
| 1299 | pars.mgcp_pars.got_dlcx_count := pars.mgcp_pars.got_dlcx_count + 1; |
Daniel Willmann | 3e15b7b | 2022-02-21 17:07:02 +0100 | [diff] [blame] | 1300 | if (pars.mgcp_pars.got_dlcx_count != pars.mgcp_pars.got_crcx_count) { |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1301 | repeat; |
| 1302 | } |
| 1303 | setverdict(pass); |
| 1304 | } |
| 1305 | } |
| 1306 | |
| 1307 | friend function f_tc_rab_assignment(charstring id, TestHdlrParams pars) runs on ConnHdlr { |
| 1308 | var MgcpCommand mgcp_cmd; |
| 1309 | var RANAP_PDU tx; |
| 1310 | timer T := 5.0; |
| 1311 | |
| 1312 | f_init_handler(pars); |
| 1313 | f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); |
| 1314 | |
| 1315 | tx := f_build_initial_ue(g_pars); |
| 1316 | f_iuh2iu_connect(tx); |
| 1317 | |
| 1318 | f_create_rab(pars.mgcp_pars); |
| 1319 | |
| 1320 | /* Send Iu Release */ |
| 1321 | tx := valueof(ts_RANAP_IuReleaseCommand(ts_RanapCause_om_intervention)); |
| 1322 | f_iu2iuh(tx); |
| 1323 | |
| 1324 | T.start; |
| 1325 | alt { |
| 1326 | [] as_mgcp_dlcx(pars) {} |
| 1327 | [] T.timeout { |
| 1328 | setverdict(fail, "Timeout waiting for DLCX"); |
| 1329 | } |
| 1330 | } |
| 1331 | |
| 1332 | tx := valueof(ts_RANAP_IuReleaseComplete()); |
| 1333 | f_iuh2iu(tx); |
| 1334 | } |
| 1335 | |
| 1336 | testcase TC_rab_assignment() runs on test_CT { |
| 1337 | var ConnHdlr vc_conn; |
Pau Espin Pedrol | 83a4961 | 2022-09-12 21:11:05 +0200 | [diff] [blame] | 1338 | g_num_hnbs := 1; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1339 | f_init(); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1340 | |
| 1341 | vc_conn := f_start_handler_with_pars(refers(f_tc_rab_assignment), t_pars(3)); |
| 1342 | vc_conn.done; |
Neels Hofmeyr | 3a9140e | 2023-06-23 04:50:39 +0200 | [diff] [blame] | 1343 | |
| 1344 | f_shutdown_helper(); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1345 | } |
| 1346 | |
Daniel Willmann | 3e15b7b | 2022-02-21 17:07:02 +0100 | [diff] [blame] | 1347 | friend function f_tc_rab_assign_fail(charstring id, TestHdlrParams pars) runs on ConnHdlr { |
| 1348 | var MgcpCommand mgcp_cmd; |
| 1349 | var RANAP_PDU tx; |
| 1350 | timer T := 5.0; |
| 1351 | |
| 1352 | f_init_handler(pars); |
| 1353 | f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); |
| 1354 | |
| 1355 | tx := f_build_initial_ue(g_pars); |
| 1356 | f_iuh2iu_connect(tx); |
| 1357 | |
| 1358 | f_rab_ass_req(pars.mgcp_pars); |
| 1359 | |
| 1360 | /* Send RAB failed list in response */ |
| 1361 | tx := valueof(ts_RANAP_RabAssResp(rab_fl := ts_RAB_FL(t_RAB_id(23), ts_RanapCause_om_intervention))); |
| 1362 | f_iuh2iu(tx); |
| 1363 | |
| 1364 | T.start; |
| 1365 | alt { |
| 1366 | [] as_mgcp_dlcx(pars) {} |
| 1367 | [] T.timeout { |
| 1368 | setverdict(fail, "Timeout waiting for DLCX"); |
| 1369 | } |
| 1370 | } |
| 1371 | } |
| 1372 | |
| 1373 | testcase TC_rab_assign_fail() runs on test_CT { |
| 1374 | var ConnHdlr vc_conn; |
Pau Espin Pedrol | 83a4961 | 2022-09-12 21:11:05 +0200 | [diff] [blame] | 1375 | g_num_hnbs := 1; |
Daniel Willmann | 3e15b7b | 2022-02-21 17:07:02 +0100 | [diff] [blame] | 1376 | f_init(); |
Daniel Willmann | 3e15b7b | 2022-02-21 17:07:02 +0100 | [diff] [blame] | 1377 | |
| 1378 | vc_conn := f_start_handler_with_pars(refers(f_tc_rab_assign_fail), t_pars(4)); |
| 1379 | vc_conn.done; |
Neels Hofmeyr | 3a9140e | 2023-06-23 04:50:39 +0200 | [diff] [blame] | 1380 | |
| 1381 | f_shutdown_helper(); |
Daniel Willmann | 3e15b7b | 2022-02-21 17:07:02 +0100 | [diff] [blame] | 1382 | } |
| 1383 | |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1384 | friend function f_tc_rab_release(charstring id, TestHdlrParams pars) runs on ConnHdlr { |
| 1385 | var MgcpCommand mgcp_cmd; |
| 1386 | var RANAP_PDU tx; |
| 1387 | timer T := 15.0; |
| 1388 | |
| 1389 | f_init_handler(pars); |
| 1390 | f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); |
| 1391 | |
| 1392 | tx := f_build_initial_ue(g_pars); |
| 1393 | f_iuh2iu_connect(tx); |
| 1394 | |
| 1395 | f_create_rab(pars.mgcp_pars); |
| 1396 | |
| 1397 | /* Send RAB Release */ |
Daniel Willmann | 9e789be | 2022-02-22 13:30:51 +0100 | [diff] [blame] | 1398 | tx := valueof(ts_RANAP_RabAssReq(rab_rl := ts_RAB_RL(t_RAB_id(23), ts_RanapCause_om_intervention))); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1399 | BSSAP.send(tx); |
| 1400 | |
| 1401 | T.start; |
| 1402 | |
| 1403 | alt { |
| 1404 | [] as_mgcp_dlcx(pars) {} |
| 1405 | [] T.timeout { |
| 1406 | setverdict(fail, "Timeout waiting for DLCX"); |
| 1407 | } |
| 1408 | } |
Neels Hofmeyr | 735b656 | 2023-03-09 02:51:28 +0100 | [diff] [blame] | 1409 | T.stop; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1410 | |
Neels Hofmeyr | 735b656 | 2023-03-09 02:51:28 +0100 | [diff] [blame] | 1411 | f_rua_expect(tx); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1412 | } |
| 1413 | |
| 1414 | testcase TC_rab_release() runs on test_CT { |
| 1415 | var ConnHdlr vc_conn; |
Pau Espin Pedrol | 83a4961 | 2022-09-12 21:11:05 +0200 | [diff] [blame] | 1416 | g_num_hnbs := 1; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1417 | f_init(); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1418 | |
| 1419 | vc_conn := f_start_handler_with_pars(refers(f_tc_rab_release), t_pars(5)); |
| 1420 | vc_conn.done; |
Neels Hofmeyr | 3a9140e | 2023-06-23 04:50:39 +0200 | [diff] [blame] | 1421 | |
| 1422 | f_shutdown_helper(); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1423 | } |
| 1424 | |
Daniel Willmann | 37c877f | 2022-02-22 16:47:06 +0100 | [diff] [blame] | 1425 | friend function f_tc_rab_assign_mgcp_to(charstring id, TestHdlrParams pars) runs on ConnHdlr { |
| 1426 | var MgcpCommand mgcp_cmd; |
| 1427 | var RANAP_PDU tx; |
| 1428 | var template RAB_SetupOrModifyList rab_sml; |
| 1429 | timer T := 15.0; |
| 1430 | |
| 1431 | T.start; |
| 1432 | f_init_handler(pars); |
| 1433 | f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); |
| 1434 | |
| 1435 | tx := f_build_initial_ue(g_pars); |
| 1436 | f_iuh2iu_connect(tx); |
| 1437 | |
| 1438 | |
| 1439 | /* Send RAB Assignment Request */ |
| 1440 | rab_sml := ts_RAB_SML(t_RAB_id(23), f_ts_RAB_TLA(pars.mgcp_pars.cn_rtp_ip), t_RAB_binding_port(pars.mgcp_pars.cn_rtp_port)); |
| 1441 | tx := valueof(ts_RANAP_RabAssReq(rab_sml)); |
| 1442 | BSSAP.send(tx); |
| 1443 | |
| 1444 | /* Ignore MGCP CRCX */ |
| 1445 | alt { |
| 1446 | [] MGCP.receive(tr_CRCX) -> value mgcp_cmd { |
| 1447 | log("Ignoreing CRCX1", mgcp_cmd); |
| 1448 | repeat; |
| 1449 | } |
| 1450 | [] BSSAP.receive(tr_RANAP_IuReleaseRequest(?)) { } |
| 1451 | [] T.timeout { |
| 1452 | setverdict(fail, "Timeout waiting for IuRelease"); |
| 1453 | } |
| 1454 | } |
| 1455 | |
| 1456 | /* Send Iu Release */ |
| 1457 | tx := valueof(ts_RANAP_IuReleaseCommand(ts_RanapCause_om_intervention)); |
| 1458 | f_iu2iuh(tx); |
| 1459 | |
| 1460 | tx := valueof(ts_RANAP_IuReleaseComplete()); |
| 1461 | f_iuh2iu(tx); |
| 1462 | } |
| 1463 | |
| 1464 | testcase TC_rab_assign_mgcp_to() runs on test_CT { |
| 1465 | var ConnHdlr vc_conn; |
Pau Espin Pedrol | 83a4961 | 2022-09-12 21:11:05 +0200 | [diff] [blame] | 1466 | g_num_hnbs := 1; |
Daniel Willmann | 37c877f | 2022-02-22 16:47:06 +0100 | [diff] [blame] | 1467 | f_init(); |
Daniel Willmann | 37c877f | 2022-02-22 16:47:06 +0100 | [diff] [blame] | 1468 | |
| 1469 | vc_conn := f_start_handler_with_pars(refers(f_tc_rab_assign_mgcp_to), t_pars(6)); |
| 1470 | vc_conn.done; |
Neels Hofmeyr | 3a9140e | 2023-06-23 04:50:39 +0200 | [diff] [blame] | 1471 | |
| 1472 | f_shutdown_helper(); |
Daniel Willmann | 37c877f | 2022-02-22 16:47:06 +0100 | [diff] [blame] | 1473 | } |
| 1474 | |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1475 | /* Create an Iuh connection; send InitialUE; transceive data both directions */ |
| 1476 | friend function f_tc_ranap_bidir(charstring id, TestHdlrParams pars) runs on ConnHdlr { |
| 1477 | f_init_handler(pars); |
| 1478 | |
| 1479 | /* HNB -> MSC: InitialUE */ |
| 1480 | f_iuh2iu_connect(f_build_initial_ue(g_pars)); |
| 1481 | |
| 1482 | /* MSC <- HNB: DirectTransfer */ |
| 1483 | f_iu2iuh(ts_RANAP_DirectTransfer(f_rnd_octstring(10))); |
| 1484 | /* MSC -> HNB: DirectTransfer */ |
| 1485 | f_iuh2iu(ts_RANAP_DirectTransfer(f_rnd_octstring(10))); |
| 1486 | |
| 1487 | /* HNB <- MSC: CommonID */ |
| 1488 | f_iu2iuh(ts_RANAP_CommonId(hex2oct(pars.imsi))); |
| 1489 | } |
| 1490 | testcase TC_ranap_cs_bidir() runs on test_CT { |
| 1491 | var ConnHdlr vc_conn; |
Pau Espin Pedrol | 83a4961 | 2022-09-12 21:11:05 +0200 | [diff] [blame] | 1492 | g_num_hnbs := 1; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1493 | f_init(); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1494 | |
| 1495 | vc_conn := f_start_handler_with_pars(refers(f_tc_ranap_bidir), t_pars(3)); |
| 1496 | vc_conn.done; |
Neels Hofmeyr | 3a9140e | 2023-06-23 04:50:39 +0200 | [diff] [blame] | 1497 | |
| 1498 | f_shutdown_helper(); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1499 | } |
| 1500 | testcase TC_ranap_ps_bidir() runs on test_CT { |
| 1501 | var ConnHdlr vc_conn; |
Pau Espin Pedrol | 83a4961 | 2022-09-12 21:11:05 +0200 | [diff] [blame] | 1502 | g_num_hnbs := 1; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1503 | f_init(); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1504 | |
| 1505 | vc_conn := f_start_handler_with_pars(refers(f_tc_ranap_bidir), t_pars(4, true)); |
| 1506 | vc_conn.done; |
Neels Hofmeyr | 3a9140e | 2023-06-23 04:50:39 +0200 | [diff] [blame] | 1507 | |
| 1508 | f_shutdown_helper(); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1509 | } |
| 1510 | |
| 1511 | |
| 1512 | private function f_tc_ranap_mo_disconnect(charstring id, TestHdlrParams pars) runs on ConnHdlr { |
| 1513 | f_init_handler(pars); |
| 1514 | |
| 1515 | /* HNB -> MSC: InitialUE */ |
| 1516 | f_iuh2iu_connect(f_build_initial_ue(g_pars)); |
| 1517 | |
| 1518 | /* MSC <- HNB: DirectTransfer */ |
| 1519 | f_iu2iuh(ts_RANAP_DirectTransfer(f_rnd_octstring(10))); |
| 1520 | /* MSC -> HNB: DirectTransfer */ |
| 1521 | f_iuh2iu(ts_RANAP_DirectTransfer(f_rnd_octstring(10))); |
| 1522 | |
| 1523 | /* MSC <- HNB: RUA disconnect */ |
| 1524 | f_iuh2iu_disconnect(ts_RANAP_IuReleaseComplete, RUA_IEs.Cause:{misc:=processing_overload}); |
| 1525 | } |
| 1526 | testcase TC_ranap_cs_mo_disconnect() runs on test_CT { |
| 1527 | var ConnHdlr vc_conn; |
Pau Espin Pedrol | 83a4961 | 2022-09-12 21:11:05 +0200 | [diff] [blame] | 1528 | g_num_hnbs := 1; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1529 | f_init(); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1530 | |
| 1531 | vc_conn := f_start_handler_with_pars(refers(f_tc_ranap_mo_disconnect), t_pars(5)); |
| 1532 | vc_conn.done; |
Neels Hofmeyr | 3a9140e | 2023-06-23 04:50:39 +0200 | [diff] [blame] | 1533 | |
| 1534 | f_shutdown_helper(); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1535 | } |
| 1536 | testcase TC_ranap_ps_mo_disconnect() runs on test_CT { |
| 1537 | var ConnHdlr vc_conn; |
Pau Espin Pedrol | 83a4961 | 2022-09-12 21:11:05 +0200 | [diff] [blame] | 1538 | g_num_hnbs := 1; |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1539 | f_init(); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1540 | |
| 1541 | vc_conn := f_start_handler_with_pars(refers(f_tc_ranap_mo_disconnect), t_pars(6)); |
| 1542 | vc_conn.done; |
Neels Hofmeyr | 3a9140e | 2023-06-23 04:50:39 +0200 | [diff] [blame] | 1543 | |
| 1544 | f_shutdown_helper(); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1545 | } |
| 1546 | |
Neels Hofmeyr | a56e8fd | 2022-05-08 01:16:55 +0200 | [diff] [blame] | 1547 | type record FTeid { |
| 1548 | HostName addr, |
| 1549 | OCT4 teid |
| 1550 | } |
| 1551 | |
| 1552 | type record FTeids { |
| 1553 | FTeid local, |
| 1554 | FTeid remote |
| 1555 | } |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1556 | |
| 1557 | |
Neels Hofmeyr | a56e8fd | 2022-05-08 01:16:55 +0200 | [diff] [blame] | 1558 | /* 'local' and 'remote' refer to the GTP information from the UPF's point of view: |
| 1559 | * HNB UPF CN |
| 1560 | * access.remote <---> access.local | core.local <---> core.remote |
| 1561 | */ |
| 1562 | type record GtpParameters { |
| 1563 | FTeids core, |
| 1564 | FTeids access |
| 1565 | } |
| 1566 | |
| 1567 | /* HNB UPF CN |
| 1568 | * access.remote <---> access.local | core.local <---> core.remote |
| 1569 | * 127.0.0.4 127.0.0.3 127.0.0.2 127.0.0.1 |
| 1570 | * 0x44004400 0x30303030 0x22002200 0x10101010 |
| 1571 | */ |
| 1572 | template GtpParameters t_GtpParameters := { |
| 1573 | core := { |
| 1574 | local := { |
| 1575 | addr := "127.0.0.2", |
| 1576 | teid := '22002200'O |
| 1577 | }, |
| 1578 | remote := { |
| 1579 | addr := "127.0.0.1", |
| 1580 | teid := '10101010'O |
| 1581 | } |
| 1582 | }, |
| 1583 | access := { |
| 1584 | local := { |
| 1585 | addr := "127.0.0.3", |
| 1586 | teid := '30303030'O |
| 1587 | }, |
| 1588 | remote := { |
| 1589 | addr := "127.0.0.4", |
| 1590 | teid := '44004400'O |
| 1591 | } |
| 1592 | } |
| 1593 | } |
| 1594 | |
Neels Hofmeyr | 6549928 | 2023-04-25 02:31:51 +0200 | [diff] [blame] | 1595 | private function f_pfcp_expect(template (present) PDU_PFCP exp_rx, float wait_time := 5.0) runs on ConnHdlr return PDU_PFCP |
Neels Hofmeyr | 6bbfe05 | 2023-03-09 02:51:46 +0100 | [diff] [blame] | 1596 | { |
| 1597 | var PDU_PFCP rx; |
Neels Hofmeyr | 6549928 | 2023-04-25 02:31:51 +0200 | [diff] [blame] | 1598 | timer T := wait_time; |
Neels Hofmeyr | 6bbfe05 | 2023-03-09 02:51:46 +0100 | [diff] [blame] | 1599 | T.start; |
| 1600 | alt { |
| 1601 | [] PFCP.receive(exp_rx) -> value rx { |
| 1602 | setverdict(pass); |
| 1603 | } |
| 1604 | [] PFCP.receive(PDU_PFCP:?) { |
| 1605 | setverdict(fail, "Got an unexpected PFCP message, was waiting for ", exp_rx); |
| 1606 | mtc.stop; |
| 1607 | } |
| 1608 | [] T.timeout { |
| 1609 | setverdict(fail, "Timeout waiting for PFCP ", exp_rx); |
| 1610 | mtc.stop; |
| 1611 | } |
| 1612 | } |
| 1613 | T.stop; |
| 1614 | return rx; |
| 1615 | } |
| 1616 | |
Neels Hofmeyr | bacb74f | 2022-08-29 16:24:12 +0200 | [diff] [blame] | 1617 | friend function f_tc_ps_rab_assignment_with_pfcp(charstring id, TestHdlrParams pars) runs on ConnHdlr { |
Neels Hofmeyr | a56e8fd | 2022-05-08 01:16:55 +0200 | [diff] [blame] | 1618 | var RANAP_PDU tx; |
| 1619 | var RANAP_PDU rx; |
Neels Hofmeyr | a56e8fd | 2022-05-08 01:16:55 +0200 | [diff] [blame] | 1620 | |
| 1621 | f_init_handler(pars); |
| 1622 | |
| 1623 | f_pfcp_register(); |
| 1624 | |
| 1625 | var PDU_PFCP m; |
| 1626 | var Node_ID upf_node_id := valueof(ts_PFCP_Node_ID_fqdn("\07osmocom\03org")); |
| 1627 | |
Neels Hofmeyr | 6549928 | 2023-04-25 02:31:51 +0200 | [diff] [blame] | 1628 | m := f_pfcp_expect(tr_PFCP_Assoc_Setup_Req(), wait_time := 15.0); |
Neels Hofmeyr | a56e8fd | 2022-05-08 01:16:55 +0200 | [diff] [blame] | 1629 | PFCP.send(ts_PFCP_Assoc_Setup_Resp(m.sequence_number, upf_node_id, |
| 1630 | ts_PFCP_Cause(REQUEST_ACCEPTED), 1234)); |
| 1631 | |
| 1632 | tx := f_build_initial_ue(g_pars); |
| 1633 | f_iuh2iu_connect(tx); |
| 1634 | |
| 1635 | var GtpParameters gtp_pars := valueof(t_GtpParameters); |
| 1636 | var template RAB_SetupOrModifyList rab_sml; |
| 1637 | |
| 1638 | /* Send RAB Assignment Request */ |
| 1639 | rab_sml := ts_RAB_SML_ps(t_RAB_id(23), f_ts_RAB_TLA(gtp_pars.core.remote.addr), gtp_pars.core.remote.teid); |
| 1640 | tx := valueof(ts_RANAP_RabAssReq(rab_sml)); |
| 1641 | BSSAP.send(tx); |
| 1642 | |
| 1643 | /* Expect PFCP Session Establishment Request. */ |
Neels Hofmeyr | 6bbfe05 | 2023-03-09 02:51:46 +0100 | [diff] [blame] | 1644 | m := f_pfcp_expect(tr_PFCP_Session_Est_Req()); |
Neels Hofmeyr | a56e8fd | 2022-05-08 01:16:55 +0200 | [diff] [blame] | 1645 | var F_SEID hnbgw_f_seid := m.message_body.pfcp_session_establishment_request.CP_F_SEID; |
| 1646 | var PFCP_Session_Establishment_Request serq := m.message_body.pfcp_session_establishment_request; |
| 1647 | |
| 1648 | /* Acting as UPF, invent a new PFCP SEID to send to HNBGW. Respond to the Session Establishment. |
| 1649 | * The PFCP response must have the same sequence_number as the request. */ |
Neels Hofmeyr | 1e31146 | 2023-01-11 01:19:12 +0100 | [diff] [blame] | 1650 | var F_SEID up_f_seid := valueof(ts_PFCP_F_SEID_ipv4(f_inet_addr("127.0.0.1"), '1111111111111111'O)); |
Neels Hofmeyr | a56e8fd | 2022-05-08 01:16:55 +0200 | [diff] [blame] | 1651 | var template PDU_PFCP r := ts_PFCP_Session_Est_Resp(m.sequence_number, upf_node_id, hnbgw_f_seid.seid); |
| 1652 | r.message_body.pfcp_session_establishment_response := { |
| 1653 | offending_ie := omit, |
| 1654 | UP_F_SEID := up_f_seid, |
| 1655 | created_PDR_list := { |
| 1656 | ts_PFCP_Created_PDR(pdr_id := serq.create_PDR_list[0].grouped_ie.pdr_id, |
| 1657 | local_F_TEID := ts_PFCP_F_TEID_ipv4(gtp_pars.core.local.teid, |
Neels Hofmeyr | 1e31146 | 2023-01-11 01:19:12 +0100 | [diff] [blame] | 1658 | f_inet_addr(gtp_pars.core.local.addr))), |
Neels Hofmeyr | a56e8fd | 2022-05-08 01:16:55 +0200 | [diff] [blame] | 1659 | ts_PFCP_Created_PDR(pdr_id := serq.create_PDR_list[1].grouped_ie.pdr_id, |
| 1660 | local_F_TEID := ts_PFCP_F_TEID_ipv4(gtp_pars.access.local.teid, |
Neels Hofmeyr | 1e31146 | 2023-01-11 01:19:12 +0100 | [diff] [blame] | 1661 | f_inet_addr(gtp_pars.access.local.addr))) |
Neels Hofmeyr | a56e8fd | 2022-05-08 01:16:55 +0200 | [diff] [blame] | 1662 | }, |
| 1663 | load_control_information := omit, |
| 1664 | overload_control_information := omit, |
| 1665 | node_list := omit, |
| 1666 | failed_rule_id := omit, |
| 1667 | created_traffic_endpoint_list := omit |
| 1668 | }; |
| 1669 | PFCP.send(r); |
| 1670 | |
| 1671 | /* Expect on Iuh: RAB Assignment Request with IP/port from PFCP Session Est Resp */ |
| 1672 | rab_sml := ts_RAB_SML_ps(t_RAB_id(23), f_ts_RAB_TLA(gtp_pars.access.local.addr), |
| 1673 | gtp_pars.access.local.teid); |
| 1674 | rx := valueof(ts_RANAP_RabAssReq(rab_sml)); |
Neels Hofmeyr | 735b656 | 2023-03-09 02:51:28 +0100 | [diff] [blame] | 1675 | f_rua_expect(rx); |
Neels Hofmeyr | a56e8fd | 2022-05-08 01:16:55 +0200 | [diff] [blame] | 1676 | |
| 1677 | /* Send back RAB Assignment Response via Iuh */ |
| 1678 | var template RAB_SetupOrModifiedList rab_smdl; |
| 1679 | rab_smdl := ts_RAB_SMdL_ps(t_RAB_id(23), f_ts_RAB_TLA(gtp_pars.access.remote.addr), |
| 1680 | gtp_pars.access.remote.teid); |
| 1681 | tx := valueof(ts_RANAP_RabAssResp(rab_smdl)); |
| 1682 | RUA.send(tx); |
Neels Hofmeyr | a56e8fd | 2022-05-08 01:16:55 +0200 | [diff] [blame] | 1683 | |
Neels Hofmeyr | 6bbfe05 | 2023-03-09 02:51:46 +0100 | [diff] [blame] | 1684 | m := f_pfcp_expect(tr_PFCP_Session_Mod_Req(up_f_seid.seid)); |
Neels Hofmeyr | a56e8fd | 2022-05-08 01:16:55 +0200 | [diff] [blame] | 1685 | r := ts_PFCP_Session_Mod_Resp(m.sequence_number, hnbgw_f_seid.seid); |
| 1686 | PFCP.send(r); |
| 1687 | |
| 1688 | rab_smdl := ts_RAB_SMdL_ps(t_RAB_id(23), f_ts_RAB_TLA(gtp_pars.core.local.addr), gtp_pars.core.local.teid); |
Neels Hofmeyr | dc416c9 | 2023-03-09 02:47:50 +0100 | [diff] [blame] | 1689 | f_bssap_expect(tr_RANAP_RabAssResp(rab_smdl)); |
Neels Hofmeyr | a56e8fd | 2022-05-08 01:16:55 +0200 | [diff] [blame] | 1690 | |
| 1691 | f_sleep(2.0); |
| 1692 | tx := valueof(ts_RANAP_IuReleaseCommand(ts_RanapCause_om_intervention)); |
| 1693 | f_iu2iuh(tx); |
| 1694 | |
| 1695 | tx := valueof(ts_RANAP_IuReleaseComplete()); |
| 1696 | f_iuh2iu(tx); |
| 1697 | |
Neels Hofmeyr | 6bbfe05 | 2023-03-09 02:51:46 +0100 | [diff] [blame] | 1698 | m := f_pfcp_expect(tr_PFCP_Session_Del_Req(up_f_seid.seid)); |
Neels Hofmeyr | a56e8fd | 2022-05-08 01:16:55 +0200 | [diff] [blame] | 1699 | PFCP.send(ts_PFCP_Session_Del_Resp(m.sequence_number, hnbgw_f_seid.seid)); |
| 1700 | |
| 1701 | f_sleep(2.0); |
| 1702 | } |
| 1703 | |
Neels Hofmeyr | bacb74f | 2022-08-29 16:24:12 +0200 | [diff] [blame] | 1704 | testcase TC_ps_rab_assignment_with_pfcp() runs on test_CT { |
Neels Hofmeyr | a56e8fd | 2022-05-08 01:16:55 +0200 | [diff] [blame] | 1705 | var ConnHdlr vc_conn; |
Pau Espin Pedrol | 83a4961 | 2022-09-12 21:11:05 +0200 | [diff] [blame] | 1706 | g_num_hnbs := 1; |
Neels Hofmeyr | a56e8fd | 2022-05-08 01:16:55 +0200 | [diff] [blame] | 1707 | f_init(); |
Neels Hofmeyr | a56e8fd | 2022-05-08 01:16:55 +0200 | [diff] [blame] | 1708 | f_sleep(1.0); |
| 1709 | |
Neels Hofmeyr | bacb74f | 2022-08-29 16:24:12 +0200 | [diff] [blame] | 1710 | vc_conn := f_start_handler_with_pars(refers(f_tc_ps_rab_assignment_with_pfcp), t_pars(7, ps_domain := true)); |
| 1711 | vc_conn.done; |
Neels Hofmeyr | 3a9140e | 2023-06-23 04:50:39 +0200 | [diff] [blame] | 1712 | |
| 1713 | f_shutdown_helper(); |
Neels Hofmeyr | bacb74f | 2022-08-29 16:24:12 +0200 | [diff] [blame] | 1714 | } |
| 1715 | |
| 1716 | altstep as_disallow_pfcp() runs on ConnHdlr { |
| 1717 | [] PFCP.receive(PDU_PFCP:?) { |
| 1718 | setverdict(fail, "Received PFCP message, but no PFCP communication expected"); |
| 1719 | mtc.stop; |
| 1720 | } |
| 1721 | } |
| 1722 | |
| 1723 | friend function f_tc_ps_rab_assignment_without_pfcp(charstring id, TestHdlrParams pars) runs on ConnHdlr { |
| 1724 | var RANAP_PDU tx; |
| 1725 | var RANAP_PDU rx; |
| 1726 | timer T := 5.0; |
| 1727 | |
| 1728 | f_init_handler(pars); |
| 1729 | |
| 1730 | f_pfcp_register(); |
| 1731 | activate(as_disallow_pfcp()); |
| 1732 | |
| 1733 | tx := f_build_initial_ue(g_pars); |
| 1734 | f_iuh2iu_connect(tx); |
| 1735 | |
| 1736 | var GtpParameters gtp_pars := valueof(t_GtpParameters); |
| 1737 | var template RAB_SetupOrModifyList rab_sml; |
| 1738 | |
| 1739 | /* Send RAB Assignment Request */ |
| 1740 | rab_sml := ts_RAB_SML_ps(t_RAB_id(23), f_ts_RAB_TLA(gtp_pars.core.remote.addr), gtp_pars.core.remote.teid); |
| 1741 | tx := valueof(ts_RANAP_RabAssReq(rab_sml)); |
| 1742 | BSSAP.send(tx); |
| 1743 | |
| 1744 | /* Expect on Iuh: unmodified RAB Assignment Request */ |
| 1745 | rx := valueof(ts_RANAP_RabAssReq(rab_sml)); |
Neels Hofmeyr | 735b656 | 2023-03-09 02:51:28 +0100 | [diff] [blame] | 1746 | f_rua_expect(rx); |
Neels Hofmeyr | bacb74f | 2022-08-29 16:24:12 +0200 | [diff] [blame] | 1747 | |
| 1748 | /* Send back RAB Assignment Response via Iuh */ |
| 1749 | var template RAB_SetupOrModifiedList rab_smdl; |
| 1750 | rab_smdl := ts_RAB_SMdL_ps(t_RAB_id(23), f_ts_RAB_TLA(gtp_pars.access.remote.addr), |
| 1751 | gtp_pars.access.remote.teid); |
| 1752 | tx := valueof(ts_RANAP_RabAssResp(rab_smdl)); |
| 1753 | RUA.send(tx); |
| 1754 | |
| 1755 | /* Expect on IuPS: unmodified RAB Assignment Response */ |
Neels Hofmeyr | dc416c9 | 2023-03-09 02:47:50 +0100 | [diff] [blame] | 1756 | f_bssap_expect(tr_RANAP_RabAssResp(rab_smdl)); |
Neels Hofmeyr | bacb74f | 2022-08-29 16:24:12 +0200 | [diff] [blame] | 1757 | |
| 1758 | f_sleep(2.0); |
| 1759 | tx := valueof(ts_RANAP_IuReleaseCommand(ts_RanapCause_om_intervention)); |
| 1760 | f_iu2iuh(tx); |
| 1761 | |
| 1762 | tx := valueof(ts_RANAP_IuReleaseComplete()); |
| 1763 | f_iuh2iu(tx); |
| 1764 | |
| 1765 | f_sleep(2.0); |
| 1766 | } |
| 1767 | |
| 1768 | testcase TC_ps_rab_assignment_without_pfcp() runs on test_CT { |
| 1769 | var ConnHdlr vc_conn; |
| 1770 | f_init(); |
Neels Hofmeyr | bacb74f | 2022-08-29 16:24:12 +0200 | [diff] [blame] | 1771 | f_sleep(1.0); |
| 1772 | |
| 1773 | vc_conn := f_start_handler_with_pars(refers(f_tc_ps_rab_assignment_without_pfcp), t_pars(7, ps_domain := true)); |
Neels Hofmeyr | a56e8fd | 2022-05-08 01:16:55 +0200 | [diff] [blame] | 1774 | vc_conn.done; |
Neels Hofmeyr | 3a9140e | 2023-06-23 04:50:39 +0200 | [diff] [blame] | 1775 | |
| 1776 | f_shutdown_helper(); |
Neels Hofmeyr | a56e8fd | 2022-05-08 01:16:55 +0200 | [diff] [blame] | 1777 | } |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 1778 | |
Neels Hofmeyr | 7d0e680 | 2023-04-20 20:43:55 +0200 | [diff] [blame] | 1779 | /* Default list of counters for a 'cn' entity to test the cnpool feature. */ |
| 1780 | const CounterNameVals counternames_cnpool := { |
| 1781 | { "cnpool:subscr:new", 0 }, |
| 1782 | { "cnpool:subscr:known", 0 }, |
| 1783 | { "cnpool:subscr:reattach", 0 }, |
| 1784 | { "cnpool:subscr:attach_lost", 0 }, |
| 1785 | { "cnpool:subscr:paged", 0 } |
| 1786 | }; |
| 1787 | private function f_ctrs_cn_init(boolean ps_domain, integer cn_count := 0, |
| 1788 | CounterNameVals counternames := counternames_cnpool) runs on test_CT { |
| 1789 | if (ps_domain) { |
| 1790 | g_ctr_cn_node_name := "sgsn"; |
| 1791 | if (cn_count == 0) { |
| 1792 | cn_count := NUM_SGSN; |
| 1793 | } |
| 1794 | } else { |
| 1795 | g_ctr_cn_node_name := "msc"; |
| 1796 | if (cn_count == 0) { |
| 1797 | cn_count := NUM_MSC; |
| 1798 | } |
| 1799 | } |
| 1800 | g_ctr_cn := f_counter_name_vals_get_n(IPA_CTRL, g_ctr_cn_node_name, cn_count, counternames); |
| 1801 | log("initial " & g_ctr_cn_node_name & " rate counters: ", g_ctr_cn); |
| 1802 | } |
| 1803 | |
| 1804 | /* f_ctrs_cn_init(); |
| 1805 | * f_do_thing(on_cn := 0); |
| 1806 | * f_do_thing(on_cn := 0); |
| 1807 | * f_do_other(on_cn := 1); |
| 1808 | * f_ctrs_cn_add(0, "thing", 2); |
| 1809 | * f_ctrs_cn_add(1, "other"); |
| 1810 | * f_ctrs_cn_verify(); |
| 1811 | */ |
| 1812 | private function f_ctrs_cn_verify() runs on test_CT { |
| 1813 | log("verifying", g_ctr_cn_node_name, " rate counters: ", g_ctr_cn); |
| 1814 | f_counter_name_vals_expect_n(IPA_CTRL, g_ctr_cn_node_name, g_ctr_cn); |
| 1815 | } |
| 1816 | |
| 1817 | /* convenience: f_ctrs_cn_add() and f_ctrs_cn_verify() in one call. |
| 1818 | * f_ctrs_cn_init(); |
| 1819 | * f_do_thing(on_cn := 0); |
| 1820 | * f_do_thing(on_cn := 0); |
| 1821 | * f_do_thing(on_cn := 0); |
| 1822 | * f_ctrs_cn_expect(0, "thing", 3); |
| 1823 | */ |
| 1824 | private function f_ctrs_cn_expect(integer cn_nr, charstring countername, integer val := 1) runs on test_CT { |
| 1825 | f_ctrs_cn_add(cn_nr, countername, val); |
| 1826 | f_ctrs_cn_verify(); |
| 1827 | } |
| 1828 | |
| 1829 | private function f_ctrs_cn_add(integer cn_nr, charstring countername, integer val := 1) runs on test_CT { |
| 1830 | f_counter_name_vals_list_add(g_ctr_cn, cn_nr, countername, val); |
| 1831 | } |
| 1832 | |
| 1833 | private function f_perform_compl_l3(octetstring nas, boolean do_clear := true, boolean expect_iu_l3 := true) |
| 1834 | runs on ConnHdlr { |
| 1835 | timer T := 10.0; |
| 1836 | |
| 1837 | /* create an expect on the Iu side for the random NAS portion */ |
| 1838 | if (g_pars.expect_separate_sccp_cr) { |
| 1839 | f_ran_register_sccp_cr_without_payload(); |
| 1840 | } else { |
| 1841 | f_ran_register_exp(nas); |
| 1842 | } |
| 1843 | |
| 1844 | /* send Connect via Iuh (creating a RUA connection) */ |
| 1845 | var RANAP_PDU tx := f_build_initial_ue_with_nas(g_pars, nas); |
| 1846 | RUA.send(RUA_Conn_Req:{g_pars.ps_domain, tx}); |
| 1847 | |
| 1848 | if (expect_iu_l3) { |
| 1849 | /* Expect same message to arrive at CN */ |
| 1850 | f_bssap_expect(tx); |
| 1851 | } |
| 1852 | } |
| 1853 | |
| 1854 | private function f_tc_cnpool_compl_l3(charstring id, TestHdlrParams pars) runs on ConnHdlr { |
| 1855 | f_init_handler(pars); |
| 1856 | f_perform_compl_l3(g_pars.nas_pdu); |
| 1857 | } |
| 1858 | |
| 1859 | private function f_TC_cnpool_compl_l3(boolean ps_domain, octetstring nas_pdu, integer cn_nr, |
| 1860 | template (omit) charstring inc_countername := omit) runs on test_CT { |
| 1861 | var ConnHdlr vc_conn; |
| 1862 | var template (value) TestHdlrParams pars := t_pars(0, ps_domain := ps_domain, cn_nr := cn_nr); |
| 1863 | pars.nas_pdu := nas_pdu; |
| 1864 | log("XXX ", pars); |
| 1865 | vc_conn := f_start_handler_with_pars(refers(f_tc_cnpool_compl_l3), pars); |
| 1866 | vc_conn.done; |
| 1867 | |
| 1868 | if (not istemplatekind(inc_countername, "omit")) { |
| 1869 | f_ctrs_cn_expect(cn_nr, valueof(inc_countername)); |
| 1870 | } |
| 1871 | } |
| 1872 | |
| 1873 | function f_TC_cnpool_compl_l3_list(boolean ps_domain, ro_octetstring compl3, Osmocom_Types.ro_integer cn_nrs, |
| 1874 | charstring inc_countername) runs on test_CT { |
| 1875 | var integer n := lengthof(compl3); |
| 1876 | if (n < lengthof(cn_nrs)) { |
| 1877 | n := lengthof(cn_nrs); |
| 1878 | } |
| 1879 | for (var integer i := 0; i < n; i := i + 1) { |
| 1880 | var integer cn_nr := cn_nrs[i mod lengthof(cn_nrs)]; |
| 1881 | f_TC_cnpool_compl_l3(ps_domain, compl3[i mod lengthof(compl3)], cn_nr, inc_countername); |
| 1882 | } |
| 1883 | } |
| 1884 | |
| 1885 | type enumerated Compl3Type { |
| 1886 | /* CS */ |
| 1887 | LU, |
| 1888 | CMSERV, |
| 1889 | PAGRESP, |
| 1890 | IMSIDETACH, |
| 1891 | |
| 1892 | /* PS */ |
| 1893 | ATTACHREQ, |
| 1894 | RAUREQ, |
| 1895 | DETREQ |
| 1896 | }; |
| 1897 | |
| 1898 | private function f_gen_one_compl_l3(Compl3Type compl3type, template (value) MobileIdentityLV mi, |
| 1899 | integer ps_nri := -1 |
| 1900 | ) return octetstring |
| 1901 | { |
| 1902 | /* CS */ |
| 1903 | if (compl3type == LU) { |
| 1904 | return enc_PDU_ML3_MS_NW(valueof(ts_LU_REQ(LU_Type_IMSI_Attach, valueof(mi), '00F110'O))); |
| 1905 | } |
| 1906 | if (compl3type == CMSERV) { |
| 1907 | return enc_PDU_ML3_MS_NW(valueof(ts_CM_SERV_REQ(CM_TYPE_MO_CALL, valueof(mi)))); |
| 1908 | } |
| 1909 | if (compl3type == PAGRESP) { |
| 1910 | return enc_PDU_ML3_MS_NW(valueof(ts_PAG_RESP(valueof(mi)))); |
| 1911 | } |
| 1912 | if (compl3type == IMSIDETACH) { |
| 1913 | return enc_PDU_ML3_MS_NW(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(valueof(mi)))); |
| 1914 | } |
| 1915 | |
| 1916 | /* PS */ |
| 1917 | var template (omit) NetworkResourceIdentifierContainerTLV nri := omit; |
| 1918 | if (ps_nri >= 0) { |
| 1919 | nri := valueof(ts_GMM_NRI(ps_nri)); |
| 1920 | } |
| 1921 | |
| 1922 | if (compl3type == ATTACHREQ) { |
| 1923 | return enc_PDU_L3_MS_SGSN(valueof(ts_GMM_ATTACH_REQ(valueof(mi), f_RAI('001'H, '01'H, '2a2a'O, '17'O), |
| 1924 | nri := nri))); |
| 1925 | } |
| 1926 | if (compl3type == RAUREQ) { |
| 1927 | return enc_PDU_L3_MS_SGSN(valueof(ts_GMM_RAU_REQ(valueof(mi), GPRS_UPD_T_PERIODIC, |
| 1928 | f_RAI('001'H, '01'H, '2a2a'O, '17'O), |
| 1929 | nri := nri))); |
| 1930 | } |
| 1931 | if (compl3type == DETREQ) { |
| 1932 | return enc_PDU_L3_MS_SGSN(valueof(ts_GMM_DET_REQ_MO_mi(c_GMM_DTT_MO_GPRS, power_off := false, |
| 1933 | p_tmsi := valueof(ts_MI_TLV(mi.mobileIdentityV))))); |
| 1934 | } |
| 1935 | |
| 1936 | setverdict(fail, "unknown complete layer 3 type"); |
| 1937 | mtc.stop; |
| 1938 | } |
| 1939 | |
| 1940 | type record of Compl3Type ro_Compl3Type; |
| 1941 | type record of MobileIdentityLV ro_MobileIdentityLV; |
| 1942 | type record of octetstring ro_octetstring; |
| 1943 | |
| 1944 | /* Generate a list of n Complete Layer 3 NAS PDUs, |
| 1945 | * rotating through the message kinds listed in 'types' and the mobile identities in mis. |
| 1946 | */ |
| 1947 | private function f_gen_compl_l3(ro_Compl3Type types, ro_MobileIdentityLV mis, integer n) return ro_octetstring |
| 1948 | { |
| 1949 | var ro_octetstring res := {}; |
| 1950 | for (var integer i := 0; i < n; i := i + 1) { |
| 1951 | var integer ti := i mod lengthof(types); |
| 1952 | var integer mi := i mod lengthof(mis); |
| 1953 | res[i] := f_gen_one_compl_l3(types[ti], mis[mi]); |
| 1954 | } |
| 1955 | return res; |
| 1956 | } |
| 1957 | |
| 1958 | private function f_gen_mi_imsi(integer n) return MobileIdentityLV |
| 1959 | { |
| 1960 | return valueof(ts_MI_IMSI_LV(f_gen_imsi(n))); |
| 1961 | } |
| 1962 | |
| 1963 | private function f_gen_mi_imsis(integer n) return ro_MobileIdentityLV |
| 1964 | { |
| 1965 | var ro_MobileIdentityLV mis := {}; |
| 1966 | for (var integer i := 0; i < n; i := i + 1) { |
| 1967 | mis[i] := f_gen_mi_imsi(n); |
| 1968 | } |
| 1969 | return mis; |
| 1970 | } |
| 1971 | |
| 1972 | function f_vty_set_roundrobin_next(TELNETasp_PT VTY, boolean ps_domain, integer cn_nr) |
| 1973 | { |
| 1974 | var charstring msc_sgsn; |
| 1975 | if (ps_domain) { |
| 1976 | msc_sgsn := "sgsn"; |
| 1977 | } else { |
| 1978 | msc_sgsn := "msc"; |
| 1979 | } |
| 1980 | f_vty_transceive(VTY, "cnpool roundrobin next " & msc_sgsn & " " & int2str(cn_nr)); |
| 1981 | } |
| 1982 | |
| 1983 | private function f_gen_compl3_by_domain(boolean ps_domain, integer n, template (omit) ro_MobileIdentityLV mis := omit) return ro_octetstring{ |
| 1984 | var ro_Compl3Type types; |
| 1985 | if (ps_domain) { |
| 1986 | types := { ATTACHREQ, RAUREQ, DETREQ }; |
| 1987 | } else { |
| 1988 | types := { LU, CMSERV, PAGRESP, IMSIDETACH }; |
| 1989 | } |
| 1990 | if (istemplatekind(mis, "omit")) { |
| 1991 | mis := f_gen_mi_imsis(n); |
| 1992 | } |
| 1993 | return f_gen_compl_l3(types, valueof(mis), n); |
| 1994 | } |
| 1995 | |
| 1996 | /* Various Complete Layer 3 by IMSI all end up with the first MSC, because the other MSCs are not connected. */ |
| 1997 | testcase TC_mscpool_L3Compl_on_1_cnlink() runs on test_CT { |
| 1998 | f_TC_cnpool_L3Compl_on_1_cnlink(ps_domain := false); |
| 1999 | } |
| 2000 | testcase TC_sgsnpool_L3Compl_on_1_cnlink() runs on test_CT { |
| 2001 | f_TC_cnpool_L3Compl_on_1_cnlink(ps_domain := true); |
| 2002 | } |
| 2003 | function f_TC_cnpool_L3Compl_on_1_cnlink(boolean ps_domain) runs on test_CT { |
| 2004 | |
| 2005 | f_init(); |
| 2006 | |
| 2007 | f_ctrs_cn_init(ps_domain := ps_domain); |
| 2008 | |
| 2009 | var ro_octetstring compl3 := f_gen_compl3_by_domain(ps_domain, 4); |
| 2010 | f_TC_cnpool_compl_l3_list(ps_domain, compl3, {0, 0, 0, 0}, "cnpool:subscr:new"); |
| 2011 | |
| 2012 | f_shutdown_helper(); |
| 2013 | } |
| 2014 | |
| 2015 | /* Three Layer 3 Complete by IMSI are round-robin'ed across two connected MSCs */ |
| 2016 | testcase TC_mscpool_L3Complete_by_imsi_round_robin() runs on test_CT { |
| 2017 | f_TC_cnpool_L3Complete_by_imsi_round_robin(ps_domain := false); |
| 2018 | } |
| 2019 | testcase TC_sgsnpool_L3Complete_no_nri_round_robin() runs on test_CT { |
| 2020 | f_TC_cnpool_L3Complete_by_imsi_round_robin(ps_domain := true); |
| 2021 | } |
| 2022 | function f_TC_cnpool_L3Complete_by_imsi_round_robin(boolean ps_domain) runs on test_CT { |
| 2023 | |
| 2024 | f_init(nr_msc := 2, nr_sgsn := 2); |
| 2025 | f_sleep(1.0); |
| 2026 | |
| 2027 | /* Control which MSC gets chosen next by the round-robin, otherwise |
| 2028 | * would be randomly affected by which other tests ran before this. */ |
| 2029 | f_vty_set_roundrobin_next(HNBGWVTY, ps_domain, 0); |
| 2030 | |
| 2031 | f_ctrs_cn_init(ps_domain := ps_domain); |
| 2032 | |
| 2033 | var ro_octetstring compl3 := f_gen_compl3_by_domain(ps_domain, 3); |
| 2034 | |
| 2035 | f_TC_cnpool_compl_l3_list(ps_domain, compl3, |
| 2036 | /* Third Complete Layer 3 wraps back to msc 0 */ |
| 2037 | cn_nrs := {0, 1, 0}, |
| 2038 | inc_countername := "cnpool:subscr:new"); |
| 2039 | |
| 2040 | f_shutdown_helper(); |
| 2041 | } |
| 2042 | |
| 2043 | /* Three LU by TMSI are round-robin'ed across two connected MSCs, because they contain a NULL-NRI (0, 1) |
| 2044 | * (configured in osmo-hnbgw.cfg). */ |
| 2045 | testcase TC_mscpool_LU_by_tmsi_null_nri_0_round_robin() runs on test_CT { |
| 2046 | f_TC_cnpool_LU_by_tmsi_null_nri_N_round_robin(ps_domain := false, nri_val := 0); |
| 2047 | } |
| 2048 | /* For NRI == 1, one of the MSC also has the NULL-NRI as part of its owned NRIs, but the NULL-NRI setting is stronger |
| 2049 | * than that. */ |
| 2050 | testcase TC_mscpool_LU_by_tmsi_null_nri_1_round_robin() runs on test_CT { |
| 2051 | f_TC_cnpool_LU_by_tmsi_null_nri_N_round_robin(ps_domain := false, nri_val := 1); |
| 2052 | } |
| 2053 | function f_TC_cnpool_LU_by_tmsi_null_nri_N_round_robin(boolean ps_domain, integer nri_val) runs on test_CT { |
| 2054 | |
| 2055 | f_init(nr_msc := 2, nr_sgsn := 2); |
| 2056 | f_sleep(1.0); |
| 2057 | |
| 2058 | /* Control which MSC gets chosen next by the round-robin, otherwise |
| 2059 | * would be randomly affected by which other tests ran before this. */ |
| 2060 | f_vty_set_roundrobin_next(HNBGWVTY, ps_domain, 0); |
| 2061 | |
| 2062 | f_ctrs_cn_init(ps_domain := ps_domain); |
| 2063 | |
| 2064 | var ro_MobileIdentityLV mis := { valueof(ts_MI_TMSI_NRI_LV(nri_val)) }; |
| 2065 | var ro_octetstring compl3; |
| 2066 | if (ps_domain) { |
| 2067 | compl3 := { |
| 2068 | f_gen_one_compl_l3(ATTACHREQ, mis[0], nri_val) |
| 2069 | }; |
| 2070 | } else { |
| 2071 | compl3 := f_gen_compl_l3({LU}, mis, 1); |
| 2072 | } |
| 2073 | |
| 2074 | f_TC_cnpool_compl_l3_list(ps_domain, compl3, |
| 2075 | /* The third Complete Layer 3 wraps back to msc 0 */ |
| 2076 | {0, 1, 0}, |
| 2077 | "cnpool:subscr:reattach"); |
| 2078 | f_shutdown_helper(); |
| 2079 | } |
| 2080 | |
| 2081 | /* Three Layer 3 Complete by TMSI are round-robin'ed across two connected MSCs, because they contain an NRI not |
| 2082 | * assigned to any MSC (configured in osmo-hnbgw.cfg). */ |
| 2083 | testcase TC_mscpool_L3Complete_by_tmsi_unassigned_nri_round_robin() runs on test_CT { |
| 2084 | f_TC_cnpool_L3Complete_by_tmsi_unassigned_nri_round_robin(ps_domain := false); |
| 2085 | } |
| 2086 | function f_TC_cnpool_L3Complete_by_tmsi_unassigned_nri_round_robin(boolean ps_domain) runs on test_CT { |
| 2087 | |
| 2088 | f_init(nr_msc := 2, nr_sgsn := 2); |
| 2089 | f_sleep(1.0); |
| 2090 | |
| 2091 | /* Control which MSC gets chosen next by the round-robin, otherwise |
| 2092 | * would be randomly affected by which other tests ran before this. */ |
| 2093 | f_vty_set_roundrobin_next(HNBGWVTY, ps_domain, 0); |
| 2094 | |
| 2095 | f_ctrs_cn_init(ps_domain := ps_domain); |
| 2096 | |
| 2097 | /* 3 NRIs that are not assigned to any MSC */ |
| 2098 | var ro_MobileIdentityLV mis := { |
| 2099 | valueof(ts_MI_TMSI_NRI_LV(1000)), |
| 2100 | valueof(ts_MI_TMSI_NRI_LV(768)), |
| 2101 | valueof(ts_MI_TMSI_NRI_LV(819)) |
| 2102 | }; |
| 2103 | |
| 2104 | var ro_octetstring compl3 := f_gen_compl3_by_domain(ps_domain, 3, mis); |
| 2105 | f_TC_cnpool_compl_l3_list(ps_domain, compl3, { 0, 1, 0 }, "cnpool:subscr:new"); |
| 2106 | |
| 2107 | f_shutdown_helper(); |
| 2108 | } |
| 2109 | |
| 2110 | /* Three Layer 3 Complete by TMSI are round-robin'ed across two connected MSCs, because they contain an NRI |
| 2111 | * assigned to a CN link that is currently not connected (configured in osmo-hnbgw.cfg). */ |
| 2112 | testcase TC_mscpool_L3Complete_by_tmsi_valid_nri_msc_not_connected_round_robin() runs on test_CT { |
| 2113 | f_TC_cnpool_L3Complete_by_tmsi_valid_nri_msc_not_connected_round_robin(ps_domain := false); |
| 2114 | } |
| 2115 | function f_TC_cnpool_L3Complete_by_tmsi_valid_nri_msc_not_connected_round_robin(boolean ps_domain) runs on test_CT { |
| 2116 | |
| 2117 | f_init(nr_msc := 2, nr_sgsn := 2); |
| 2118 | f_sleep(1.0); |
| 2119 | |
| 2120 | /* Control which MSC gets chosen next by the round-robin, otherwise |
| 2121 | * would be randomly affected by which other tests ran before this. */ |
| 2122 | f_vty_set_roundrobin_next(HNBGWVTY, ps_domain, 0); |
| 2123 | |
| 2124 | f_ctrs_cn_init(ps_domain := ps_domain); |
| 2125 | |
| 2126 | /* 3 NRIs that are assigned to an unconnected MSC */ |
| 2127 | var ro_MobileIdentityLV mis := { |
| 2128 | valueof(ts_MI_TMSI_NRI_LV(512)), |
| 2129 | valueof(ts_MI_TMSI_NRI_LV(767)), |
| 2130 | valueof(ts_MI_TMSI_NRI_LV(750)) |
| 2131 | }; |
| 2132 | |
| 2133 | var ro_octetstring compl3 := f_gen_compl3_by_domain(ps_domain, 3, mis); |
| 2134 | |
| 2135 | f_TC_cnpool_compl_l3(ps_domain, compl3[0], cn_nr := 0); |
| 2136 | f_ctrs_cn_add(2, "cnpool:subscr:attach_lost"); |
| 2137 | f_ctrs_cn_add(0, "cnpool:subscr:new"); |
| 2138 | f_ctrs_cn_verify(); |
| 2139 | |
| 2140 | f_TC_cnpool_compl_l3(ps_domain, compl3[1], cn_nr := 1); |
| 2141 | f_ctrs_cn_add(2, "cnpool:subscr:attach_lost"); |
| 2142 | f_ctrs_cn_add(1, "cnpool:subscr:new"); |
| 2143 | f_ctrs_cn_verify(); |
| 2144 | |
| 2145 | f_TC_cnpool_compl_l3(ps_domain, compl3[2], cn_nr := 0); |
| 2146 | f_ctrs_cn_add(2, "cnpool:subscr:attach_lost"); |
| 2147 | f_ctrs_cn_add(0, "cnpool:subscr:new"); |
| 2148 | f_ctrs_cn_verify(); |
| 2149 | |
| 2150 | f_shutdown_helper(); |
| 2151 | } |
| 2152 | |
| 2153 | /* Three Layer 3 Complete by TMSI with valid NRI for the second MSC are all directed to the second MSC (configured in |
| 2154 | * osmo-hnbgw.cfg). */ |
| 2155 | testcase TC_mscpool_L3Complete_by_tmsi_valid_nri_1() runs on test_CT { |
| 2156 | f_TC_cnpool_L3Complete_valid_nri_1(ps_domain := false); |
| 2157 | } |
| 2158 | testcase TC_sgsnpool_L3Complete_valid_nri_1() runs on test_CT { |
| 2159 | f_TC_cnpool_L3Complete_valid_nri_1(ps_domain := true); |
| 2160 | } |
| 2161 | function f_TC_cnpool_L3Complete_valid_nri_1(boolean ps_domain) runs on test_CT { |
| 2162 | |
| 2163 | f_init(nr_msc := 2, nr_sgsn := 2); |
| 2164 | f_sleep(1.0); |
| 2165 | |
| 2166 | /* All TMSIs in this test point at the second MSC, set the round robin to point at the first MSC to make sure |
| 2167 | * this is not using round-robin. */ |
| 2168 | f_vty_set_roundrobin_next(HNBGWVTY, ps_domain, 0); |
| 2169 | |
| 2170 | f_ctrs_cn_init(ps_domain := ps_domain); |
| 2171 | |
| 2172 | var ro_octetstring compl3; |
| 2173 | |
| 2174 | /* 3 NRIs of the second MSC's range (256-511) */ |
| 2175 | var ro_MobileIdentityLV mis := { |
| 2176 | valueof(ts_MI_TMSI_NRI_LV(256)), |
| 2177 | valueof(ts_MI_TMSI_NRI_LV(260)), |
| 2178 | valueof(ts_MI_TMSI_NRI_LV(511)) |
| 2179 | }; |
| 2180 | if (ps_domain) { |
| 2181 | compl3 := { |
| 2182 | f_gen_one_compl_l3(RAUREQ, mis[0], 256), |
| 2183 | f_gen_one_compl_l3(RAUREQ, mis[1], 260), |
| 2184 | f_gen_one_compl_l3(RAUREQ, mis[2], 511) |
| 2185 | }; |
| 2186 | } else { |
| 2187 | compl3 := f_gen_compl3_by_domain(ps_domain, 3, mis); |
| 2188 | } |
| 2189 | |
| 2190 | f_TC_cnpool_compl_l3_list(ps_domain, compl3, {1, 1, 1}, "cnpool:subscr:known"); |
| 2191 | |
| 2192 | f_shutdown_helper(); |
| 2193 | } |
| 2194 | |
| 2195 | /* Layer 3 Complete by TMSI with valid NRI for the third MSC are directed to the third MSC (configured in osmo-hnbgw.cfg), |
| 2196 | * while a round-robin remains unaffected by that. */ |
| 2197 | testcase TC_mscpool_L3Complete_by_tmsi_valid_nri_2() runs on test_CT { |
| 2198 | f_TC_cnpool_L3Complete_valid_nri_2(ps_domain := false); |
| 2199 | } |
| 2200 | testcase TC_sgsnpool_L3Complete_valid_nri_2() runs on test_CT { |
| 2201 | f_TC_cnpool_L3Complete_valid_nri_2(ps_domain := true); |
| 2202 | } |
| 2203 | function f_TC_cnpool_L3Complete_valid_nri_2(boolean ps_domain) runs on test_CT { |
| 2204 | |
| 2205 | f_init(nr_msc := 3, nr_sgsn := 3); |
| 2206 | f_sleep(1.0); |
| 2207 | |
| 2208 | /* All TMSIs in this test point at the third MSC, set the round robin to point at the second MSC to make sure |
| 2209 | * this is not using round-robin. */ |
| 2210 | f_vty_set_roundrobin_next(HNBGWVTY, ps_domain, 1); |
| 2211 | |
| 2212 | f_ctrs_cn_init(ps_domain := ps_domain); |
| 2213 | |
| 2214 | var ro_octetstring compl3; |
| 2215 | |
| 2216 | /* 2 NRIs of the third MSC's range (512-767) */ |
| 2217 | var ro_MobileIdentityLV mis := { |
| 2218 | valueof(ts_MI_TMSI_NRI_LV(512)), |
| 2219 | valueof(ts_MI_TMSI_NRI_LV(678)) |
| 2220 | }; |
| 2221 | if (ps_domain) { |
| 2222 | compl3 := { |
| 2223 | f_gen_one_compl_l3(ATTACHREQ, mis[0], 512), |
| 2224 | f_gen_one_compl_l3(ATTACHREQ, mis[1], 678) |
| 2225 | }; |
| 2226 | } else { |
| 2227 | compl3 := f_gen_compl3_by_domain(ps_domain, 2, mis); |
| 2228 | } |
| 2229 | |
| 2230 | f_TC_cnpool_compl_l3_list(ps_domain, compl3, {2, 2}, "cnpool:subscr:known"); |
| 2231 | |
| 2232 | /* The above forwardings to third MSC have not affected the round robin, which still points at the second MSC */ |
| 2233 | f_TC_cnpool_compl_l3_list(ps_domain, f_gen_compl3_by_domain(ps_domain, 1), {1}, "cnpool:subscr:new"); |
| 2234 | |
| 2235 | f_shutdown_helper(); |
| 2236 | } |
| 2237 | |
| 2238 | /* LU with a TMSI but indicating a different PLMN in its previous LAI: ignore the NRI. */ |
| 2239 | testcase TC_mscpool_LU_by_tmsi_from_other_PLMN() runs on test_CT { |
| 2240 | f_TC_cnpool_nri_from_other_PLMN(ps_domain := false); |
| 2241 | } |
| 2242 | testcase TC_sgsnpool_nri_from_other_PLMN() runs on test_CT { |
| 2243 | f_TC_cnpool_nri_from_other_PLMN(ps_domain := true); |
| 2244 | } |
| 2245 | function f_TC_cnpool_nri_from_other_PLMN(boolean ps_domain) runs on test_CT { |
| 2246 | |
| 2247 | f_init(nr_msc := 3, nr_sgsn := 3); |
| 2248 | f_sleep(1.0); |
| 2249 | |
| 2250 | /* The TMSIs in this test points at the second MSC, but since it is from a different PLMN, round-robin is used |
| 2251 | * instead, and hits msc 0. */ |
| 2252 | f_vty_set_roundrobin_next(HNBGWVTY, ps_domain, 0); |
| 2253 | |
| 2254 | f_ctrs_cn_init(ps_domain := ps_domain); |
| 2255 | |
| 2256 | var ro_octetstring compl3; |
| 2257 | |
| 2258 | var ro_MobileIdentityLV mis := { |
| 2259 | valueof(ts_MI_TMSI_NRI_LV(260)), |
| 2260 | valueof(ts_MI_TMSI_NRI_LV(555)) |
| 2261 | }; |
| 2262 | if (ps_domain) { |
| 2263 | compl3 := { |
| 2264 | /* An NRI of the second MSC's range (256-511), but a PLMN that doesn't match with osmo-hnbgw.cfg */ |
| 2265 | enc_PDU_L3_MS_SGSN(valueof(ts_GMM_ATTACH_REQ(mis[0], f_RAI('999'H, '99'H, '2a2a'O, |
| 2266 | '17'O), |
| 2267 | nri := ts_GMM_NRI(260) |
| 2268 | ))), |
| 2269 | /* An NRI of the third MSC's range (512-767) and a matching PLMN gets directed by NRI. */ |
| 2270 | f_gen_one_compl_l3(ATTACHREQ, mis[1], 555) |
| 2271 | } |
| 2272 | } else { |
| 2273 | compl3 := { |
| 2274 | /* An NRI of the second MSC's range (256-511), but a PLMN that doesn't match with osmo-hnbgw.cfg */ |
| 2275 | enc_PDU_ML3_MS_NW(valueof(ts_LU_REQ(LU_Type_IMSI_Attach, mis[0], '99F999'O))), |
| 2276 | /* An NRI of the third MSC's range (512-767) and a matching PLMN gets directed by NRI. */ |
| 2277 | enc_PDU_ML3_MS_NW(valueof(ts_LU_REQ(LU_Type_IMSI_Attach, mis[1], '00F110'O))) |
| 2278 | }; |
| 2279 | } |
| 2280 | |
| 2281 | /* Foreign NRI: roundrobin */ |
| 2282 | f_TC_cnpool_compl_l3(ps_domain, compl3[0], cn_nr := 0, inc_countername := "cnpool:subscr:new"); |
| 2283 | |
| 2284 | /* Local NRI: matching msc */ |
| 2285 | f_TC_cnpool_compl_l3(ps_domain, compl3[1], cn_nr := 2, inc_countername := "cnpool:subscr:known"); |
| 2286 | |
| 2287 | f_shutdown_helper(); |
| 2288 | } |
| 2289 | |
| 2290 | /* For round-robin, skip a CN link that has 'no allow-attach' set. */ |
| 2291 | testcase TC_mscpool_no_allow_attach_round_robin() runs on test_CT { |
| 2292 | |
| 2293 | f_init(nr_msc := 3); |
| 2294 | f_sleep(1.0); |
| 2295 | |
| 2296 | var boolean ps_domain := false; |
| 2297 | |
| 2298 | /* Mark the second MSC as offloading, round-robin should skip this MSC now. */ |
| 2299 | f_vty_cnlink_allow_attach(HNBGWVTY, ps_domain, {true, false, true}); |
| 2300 | |
| 2301 | /* Control which MSC gets chosen next by the round-robin, otherwise |
| 2302 | * would be randomly affected by which other tests ran before this. */ |
| 2303 | f_vty_set_roundrobin_next(HNBGWVTY, ps_domain, 0); |
| 2304 | |
| 2305 | f_ctrs_cn_init(ps_domain := ps_domain); |
| 2306 | |
| 2307 | f_TC_cnpool_compl_l3_list(ps_domain, f_gen_compl3_by_domain(ps_domain, 3), |
| 2308 | /* msc 1 is skipped */ |
| 2309 | {0, 2, 0}, |
| 2310 | "cnpool:subscr:new"); |
| 2311 | |
| 2312 | f_shutdown_helper(); |
| 2313 | } |
| 2314 | |
| 2315 | /* An MSC that has 'no allow-attach' set should still serve subscribers that are already attached according to their |
| 2316 | * TMSI NRI. */ |
| 2317 | testcase TC_mscpool_no_allow_attach_valid_nri() runs on test_CT { |
| 2318 | |
| 2319 | f_init(nr_msc := 3); |
| 2320 | f_sleep(1.0); |
| 2321 | |
| 2322 | var boolean ps_domain := false; |
| 2323 | |
| 2324 | /* Mark the second MSC as offloading, round-robin should skip this MSC now. */ |
| 2325 | f_vty_cnlink_allow_attach(HNBGWVTY, ps_domain, {true, false, true}); |
| 2326 | |
| 2327 | /* Control which MSC gets chosen next by the round-robin, otherwise |
| 2328 | * would be randomly affected by which other tests ran before this. */ |
| 2329 | f_vty_set_roundrobin_next(HNBGWVTY, ps_domain, 0); |
| 2330 | |
| 2331 | f_ctrs_cn_init(ps_domain := ps_domain); |
| 2332 | |
| 2333 | var ro_MobileIdentityLV mis := { |
| 2334 | valueof(ts_MI_TMSI_NRI_LV(260)), |
| 2335 | valueof(ts_MI_IMSI_LV('001010000000002'H)), |
| 2336 | valueof(ts_MI_IMSI_LV('001010000000003'H)) |
| 2337 | }; |
| 2338 | |
| 2339 | var ro_octetstring compl3 := f_gen_compl3_by_domain(ps_domain, 3, mis); |
| 2340 | |
| 2341 | /* Round robin points at msc 0, but the valid NRI directs to msc 1, even though msc 1 has 'no allow-attach'. */ |
| 2342 | f_TC_cnpool_compl_l3(ps_domain, compl3[0], cn_nr := 1, inc_countername := "cnpool:subscr:known"); |
| 2343 | |
| 2344 | /* Normal round robin skips msc 1, because it has 'no allow-attach' */ |
| 2345 | f_TC_cnpool_compl_l3(ps_domain, compl3[1], cn_nr := 0, inc_countername := "cnpool:subscr:new"); |
| 2346 | f_TC_cnpool_compl_l3(ps_domain, compl3[2], cn_nr := 2, inc_countername := "cnpool:subscr:new"); |
| 2347 | |
| 2348 | f_shutdown_helper(); |
| 2349 | } |
| 2350 | |
| 2351 | /* When a peer point-code gets an SCCP N-PCSTATE saying it is unreachable, immediately mark the CN link as unusable. */ |
| 2352 | testcase TC_mscpool_sccp_n_pcstate_detaches_cnlink() runs on test_CT { |
| 2353 | f_TC_cnpool_sccp_n_pcstate_detaches_cnlink(ps_domain := false); |
| 2354 | } |
| 2355 | testcase TC_sgsnpool_sccp_n_pcstate_detaches_cnlink() runs on test_CT { |
| 2356 | f_TC_cnpool_sccp_n_pcstate_detaches_cnlink(ps_domain := true); |
| 2357 | } |
| 2358 | function f_TC_cnpool_sccp_n_pcstate_detaches_cnlink(boolean ps_domain) runs on test_CT |
| 2359 | { |
| 2360 | |
| 2361 | f_init(nr_msc := 2, nr_sgsn := 2); |
| 2362 | f_sleep(1.0); |
| 2363 | |
| 2364 | /* Control which MSC gets chosen next by the round-robin, otherwise |
| 2365 | * would be randomly affected by which other tests ran before this. */ |
| 2366 | f_vty_set_roundrobin_next(HNBGWVTY, ps_domain, 0); |
| 2367 | |
| 2368 | f_ctrs_cn_init(ps_domain := ps_domain); |
| 2369 | |
| 2370 | var ro_octetstring compl3 := f_gen_compl3_by_domain(ps_domain, 3); |
| 2371 | |
| 2372 | f_TC_cnpool_compl_l3(ps_domain, compl3[0], cn_nr := 0, inc_countername := "cnpool:subscr:new"); |
| 2373 | f_TC_cnpool_compl_l3(ps_domain, compl3[1], cn_nr := 1, inc_countername := "cnpool:subscr:new"); |
| 2374 | |
| 2375 | f_logp(HNBGWVTY, "disconnecting msc0"); |
| 2376 | f_cn_idx_disconnect(f_cn_idx(ps_domain, 0)); |
| 2377 | |
| 2378 | /* Now round-robin would wrap to the first MSC, but since the first MSC is disconnected, it wraps around to the |
| 2379 | * second. */ |
| 2380 | f_TC_cnpool_compl_l3(ps_domain, compl3[2], cn_nr := 1, inc_countername := "cnpool:subscr:new"); |
| 2381 | |
| 2382 | f_shutdown_helper(); |
| 2383 | } |
| 2384 | |
| 2385 | /* When a CN link point-code gets an SCCP N-PCSTATE saying it is now reachable, immediately trigger RESET and bring up the |
| 2386 | * MSC. */ |
| 2387 | testcase TC_mscpool_sccp_n_pcstate_attaches_cnlink() runs on test_CT { |
| 2388 | f_TC_cnpool_sccp_n_pcstate_attaches_cnlink(ps_domain := false); |
| 2389 | } |
| 2390 | testcase TC_sgsnpool_sccp_n_pcstate_attaches_cnlink() runs on test_CT { |
| 2391 | f_TC_cnpool_sccp_n_pcstate_attaches_cnlink(ps_domain := true); |
| 2392 | } |
| 2393 | function f_TC_cnpool_sccp_n_pcstate_attaches_cnlink(boolean ps_domain) runs on test_CT |
| 2394 | { |
| 2395 | f_init(nr_msc := 1, nr_sgsn := 1); |
| 2396 | f_sleep(1.0); |
| 2397 | |
| 2398 | /* Control which MSC gets chosen next by the round-robin, otherwise |
| 2399 | * would be randomly affected by which other tests ran before this. */ |
| 2400 | f_vty_set_roundrobin_next(HNBGWVTY, ps_domain, 0); |
| 2401 | |
| 2402 | var ro_octetstring compl3 := f_gen_compl3_by_domain(ps_domain, 3); |
| 2403 | |
| 2404 | f_ctrs_cn_init(ps_domain := ps_domain); |
| 2405 | |
| 2406 | /* There is only one MSC, round robin stays on msc0 */ |
| 2407 | f_TC_cnpool_compl_l3(ps_domain := ps_domain, nas_pdu := compl3[0], cn_nr := 0, inc_countername := "cnpool:subscr:new"); |
| 2408 | f_TC_cnpool_compl_l3(ps_domain := ps_domain, nas_pdu := compl3[1], cn_nr := 0, inc_countername := "cnpool:subscr:new"); |
| 2409 | |
| 2410 | f_logp(HNBGWVTY, "connecting cnlink 1"); |
| 2411 | f_cn_nr_init(ps_domain, 1); |
| 2412 | f_vty_cnlink_allow_attach(HNBGWVTY, ps_domain, { true, true }); |
| 2413 | f_sleep(1.0); |
| 2414 | |
| 2415 | /* This time round-robin wraps to the second MSC, because it is now online. */ |
| 2416 | f_TC_cnpool_compl_l3(ps_domain := ps_domain, nas_pdu := compl3[2], cn_nr := 1, inc_countername := "cnpool:subscr:new"); |
| 2417 | |
| 2418 | f_shutdown_helper(); |
| 2419 | } |
| 2420 | |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 2421 | control { |
| 2422 | execute(TC_hnb_register()); |
Daniel Willmann | c79679a | 2022-08-23 17:48:39 +0200 | [diff] [blame] | 2423 | execute(TC_hnb_register_duplicate()); |
Pau Espin Pedrol | acf4f22 | 2022-09-27 14:33:40 +0200 | [diff] [blame] | 2424 | execute(TC_hnb_register_duplicate_reuse_sctp_assoc()); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 2425 | execute(TC_ranap_cs_initial_ue()); |
| 2426 | execute(TC_ranap_ps_initial_ue()); |
Neels Hofmeyr | f0b9ed1 | 2022-06-07 17:46:32 +0200 | [diff] [blame] | 2427 | execute(TC_ranap_cs_initial_ue_empty_cr()); |
| 2428 | execute(TC_ranap_ps_initial_ue_empty_cr()); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 2429 | execute(TC_ranap_cs_bidir()); |
| 2430 | execute(TC_ranap_ps_bidir()); |
| 2431 | execute(TC_rab_assignment()); |
| 2432 | execute(TC_rab_release()); |
Daniel Willmann | 3e15b7b | 2022-02-21 17:07:02 +0100 | [diff] [blame] | 2433 | execute(TC_rab_assign_fail()); |
Daniel Willmann | 37c877f | 2022-02-22 16:47:06 +0100 | [diff] [blame] | 2434 | execute(TC_rab_assign_mgcp_to()); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 2435 | execute(TC_ranap_cs_mo_disconnect()); |
| 2436 | execute(TC_ranap_ps_mo_disconnect()); |
Neels Hofmeyr | bacb74f | 2022-08-29 16:24:12 +0200 | [diff] [blame] | 2437 | |
| 2438 | if (mp_enable_pfcp_tests) { |
| 2439 | execute(TC_ps_rab_assignment_with_pfcp()); |
| 2440 | } else { |
| 2441 | execute(TC_ps_rab_assignment_without_pfcp()); |
| 2442 | } |
Pau Espin Pedrol | f0b9fa0 | 2022-09-12 13:31:07 +0200 | [diff] [blame] | 2443 | |
Neels Hofmeyr | 7d0e680 | 2023-04-20 20:43:55 +0200 | [diff] [blame] | 2444 | execute( TC_mscpool_L3Compl_on_1_cnlink() ); |
| 2445 | execute( TC_mscpool_L3Complete_by_imsi_round_robin() ); |
| 2446 | execute( TC_mscpool_LU_by_tmsi_null_nri_0_round_robin() ); |
| 2447 | execute( TC_mscpool_LU_by_tmsi_null_nri_1_round_robin() ); |
| 2448 | execute( TC_mscpool_L3Complete_by_tmsi_unassigned_nri_round_robin() ); |
| 2449 | execute( TC_mscpool_L3Complete_by_tmsi_valid_nri_msc_not_connected_round_robin() ); |
| 2450 | execute( TC_mscpool_L3Complete_by_tmsi_valid_nri_1() ); |
| 2451 | execute( TC_mscpool_L3Complete_by_tmsi_valid_nri_2() ); |
| 2452 | execute( TC_mscpool_LU_by_tmsi_from_other_PLMN() ); |
| 2453 | execute( TC_mscpool_no_allow_attach_round_robin() ); |
| 2454 | execute( TC_mscpool_no_allow_attach_valid_nri() ); |
| 2455 | execute( TC_mscpool_sccp_n_pcstate_detaches_cnlink() ); |
| 2456 | execute( TC_mscpool_sccp_n_pcstate_attaches_cnlink() ); |
| 2457 | |
| 2458 | execute( TC_sgsnpool_L3Compl_on_1_cnlink() ); |
| 2459 | execute( TC_sgsnpool_L3Complete_no_nri_round_robin() ); |
| 2460 | execute( TC_sgsnpool_L3Complete_valid_nri_1() ); |
| 2461 | execute( TC_sgsnpool_L3Complete_valid_nri_2() ); |
| 2462 | execute( TC_sgsnpool_nri_from_other_PLMN() ); |
| 2463 | execute( TC_sgsnpool_sccp_n_pcstate_detaches_cnlink() ); |
| 2464 | execute( TC_sgsnpool_sccp_n_pcstate_attaches_cnlink() ); |
| 2465 | |
Pau Espin Pedrol | f0b9fa0 | 2022-09-12 13:31:07 +0200 | [diff] [blame] | 2466 | /* Run at the end since it makes osmo-hnbgw <= 1.3.0 crash: OS#5676 */ |
| 2467 | execute(TC_hnb_reregister_reuse_sctp_assoc()); |
Daniel Willmann | 19b8d90 | 2022-01-05 09:12:34 +0100 | [diff] [blame] | 2468 | } |
| 2469 | |
| 2470 | } |