Pau Espin Pedrol | b54acca | 2021-11-22 20:35:44 +0100 | [diff] [blame] | 1 | module HNB_Tests { |
| 2 | |
| 3 | /* Integration Tests for OsmoHNodeB |
| 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 OsmoHNodB while emulating both multiple UE as |
| 13 | * well as the HNBGW. See README for more details. |
| 14 | * |
| 15 | * There are test cases that run in so-called 'handler mode' and test cases |
| 16 | * that run directly on top of the BSSAP and RSL CodecPorts. The "handler mode" |
| 17 | * tests abstract the multiplexing/demultiplexing of multiple SCCP connections |
| 18 | * and/or RSL channels and are hence suitable for higher-level test cases, while |
| 19 | * the "raw" tests directly on top of the CodecPorts are more suitable for lower- |
| 20 | * level testing. |
| 21 | */ |
| 22 | |
| 23 | import from Misc_Helpers all; |
| 24 | import from General_Types all; |
| 25 | import from Osmocom_Types all; |
| 26 | import from IPL4asp_Types all; |
Pau Espin Pedrol | 32fb54e | 2021-11-29 16:21:26 +0100 | [diff] [blame^] | 27 | import from Native_Functions all; |
Pau Espin Pedrol | b54acca | 2021-11-22 20:35:44 +0100 | [diff] [blame] | 28 | |
| 29 | import from Osmocom_CTRL_Functions all; |
| 30 | import from Osmocom_CTRL_Types all; |
| 31 | import from Osmocom_CTRL_Adapter all; |
| 32 | |
| 33 | import from StatsD_Types all; |
| 34 | import from StatsD_CodecPort all; |
| 35 | import from StatsD_CodecPort_CtrlFunct all; |
| 36 | import from StatsD_Checker all; |
| 37 | |
| 38 | import from Osmocom_VTY_Functions all; |
| 39 | import from TELNETasp_PortType all; |
| 40 | |
| 41 | import from HNBAP_Templates all; |
Pau Espin Pedrol | a6bbb8c | 2021-11-24 17:00:03 +0100 | [diff] [blame] | 42 | import from RUA_IEs all; |
| 43 | import from RUA_Templates all; |
Pau Espin Pedrol | b54acca | 2021-11-22 20:35:44 +0100 | [diff] [blame] | 44 | |
| 45 | import from HNBGW_ConnectionHandler all; |
| 46 | import from Iuh_Emulation all; |
| 47 | |
Pau Espin Pedrol | 32fb54e | 2021-11-29 16:21:26 +0100 | [diff] [blame^] | 48 | import from RTP_Types all; |
| 49 | import from RTP_Emulation all; |
| 50 | |
Pau Espin Pedrol | a6bbb8c | 2021-11-24 17:00:03 +0100 | [diff] [blame] | 51 | import from HNBLLIF_CodecPort all; |
| 52 | import from HNBLLIF_Types all; |
| 53 | import from HNBLLIF_Templates all; |
| 54 | |
Pau Espin Pedrol | b54acca | 2021-11-22 20:35:44 +0100 | [diff] [blame] | 55 | modulepar { |
| 56 | /* IP address at which the HNodeB can be reached */ |
| 57 | charstring mp_hnodeb_ip := "127.0.0.1"; |
| 58 | |
| 59 | /* IP address at which the test binds */ |
| 60 | charstring mp_hnbgw_iuh_ip := "127.0.0.1"; |
| 61 | integer mp_hnbgw_iuh_port := 29169; |
Pau Espin Pedrol | a6bbb8c | 2021-11-24 17:00:03 +0100 | [diff] [blame] | 62 | |
| 63 | charstring mp_hnbllif_sk_path := HNBLL_SOCK_DEFAULT; |
Pau Espin Pedrol | b54acca | 2021-11-22 20:35:44 +0100 | [diff] [blame] | 64 | } |
| 65 | |
Pau Espin Pedrol | a6bbb8c | 2021-11-24 17:00:03 +0100 | [diff] [blame] | 66 | const hexstring ranap_cm_service_req := '001340400000060003400100000f40060000f11028b6003a40080000f110ffffffff0010400e0d052411035758a605f44e9d4aef004f400300001c0056400500f1100017'H; |
| 67 | const hexstring ranap_auth_req := '00144032000002001040262505120217dc146aeac56cb5ff6d5fb51f47f19220108ca5a6d0c8110000b9e9272498872764003b400100'H; |
| 68 | const hexstring ranap_auth_resp := '001440140000010010400d0c0554ccbdd0302104002f3ae4'H; |
| 69 | const hexstring ranap_paging := '000e401e0000030003400100001740095000010100000000f10040400500b6cf4773'H; |
Pau Espin Pedrol | 32fb54e | 2021-11-29 16:21:26 +0100 | [diff] [blame^] | 70 | const hexstring ranap_rab_ass_req := '0000005900000100364052000001003500487824cd80102fa7201a2c0000f44c080a028000514000272028140067400000222814003c40000000503d02000227c03500010a0901a200000000000000000000000000401f4a0000400100'H; |
Pau Espin Pedrol | a6bbb8c | 2021-11-24 17:00:03 +0100 | [diff] [blame] | 71 | const hexstring iu_release_compl := '20010003000000'H; |
| 72 | |
Pau Espin Pedrol | b54acca | 2021-11-22 20:35:44 +0100 | [diff] [blame] | 73 | type component test_CT extends CTRL_Adapter_CT { |
| 74 | port TELNETasp_PT HNBVTY; |
| 75 | |
Pau Espin Pedrol | a6bbb8c | 2021-11-24 17:00:03 +0100 | [diff] [blame] | 76 | /* HNBLLIF Interface of HNodeB */ |
| 77 | port HNBLLIF_CODEC_PT LLSK; |
| 78 | var integer g_llsk_conn_id; |
| 79 | |
Pau Espin Pedrol | b54acca | 2021-11-22 20:35:44 +0100 | [diff] [blame] | 80 | /* global test case guard timer (actual timeout value is set in f_init()) */ |
| 81 | timer T_guard := 30.0; |
| 82 | } |
| 83 | |
| 84 | /* global altstep for global guard timer; */ |
| 85 | altstep as_Tguard() runs on test_CT { |
| 86 | [] T_guard.timeout { |
| 87 | setverdict(fail, "Timeout of T_guard"); |
| 88 | mtc.stop; |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | friend function f_logp(TELNETasp_PT pt, charstring log_msg) |
| 93 | { |
| 94 | // log on TTCN3 log output |
| 95 | log(log_msg); |
| 96 | // log in stderr log |
| 97 | f_vty_transceive(pt, "logp lglobal notice TTCN3 f_logp(): " & log_msg); |
| 98 | } |
| 99 | |
| 100 | function f_init_vty(charstring id := "foo") runs on test_CT { |
| 101 | if (HNBVTY.checkstate("Mapped")) { |
| 102 | /* skip initialization if already executed once */ |
| 103 | return; |
| 104 | } |
| 105 | map(self:HNBVTY, system:HNBVTY); |
| 106 | f_vty_set_prompts(HNBVTY); |
| 107 | f_vty_transceive(HNBVTY, "enable"); |
| 108 | } |
Pau Espin Pedrol | a6bbb8c | 2021-11-24 17:00:03 +0100 | [diff] [blame] | 109 | |
| 110 | private function f_init_hnbllif() runs on test_CT { |
| 111 | map(self:LLSK, system:LLSK); |
| 112 | f_start_hnbllif(LLSK, testcasename(), mp_hnbllif_sk_path, g_llsk_conn_id); |
| 113 | } |
| 114 | |
Pau Espin Pedrol | b54acca | 2021-11-22 20:35:44 +0100 | [diff] [blame] | 115 | /* global initialization function */ |
| 116 | function f_init(float guard_timeout := 30.0) runs on test_CT { |
| 117 | var integer bssap_idx; |
| 118 | |
| 119 | T_guard.start(guard_timeout); |
| 120 | activate(as_Tguard()); |
| 121 | |
| 122 | f_init_vty("VirtHNBGW"); |
Pau Espin Pedrol | b54acca | 2021-11-22 20:35:44 +0100 | [diff] [blame] | 123 | } |
| 124 | |
| 125 | friend function f_shutdown_helper() runs on test_CT { |
| 126 | all component.stop; |
| 127 | setverdict(pass); |
| 128 | mtc.stop; |
| 129 | } |
| 130 | |
Pau Espin Pedrol | a6bbb8c | 2021-11-24 17:00:03 +0100 | [diff] [blame] | 131 | private function f_gen_test_hdlr_pars() runs on test_CT return TestHdlrParams { |
Pau Espin Pedrol | b54acca | 2021-11-22 20:35:44 +0100 | [diff] [blame] | 132 | |
| 133 | var TestHdlrParams pars := valueof(t_def_TestHdlrPars); |
Pau Espin Pedrol | a6bbb8c | 2021-11-24 17:00:03 +0100 | [diff] [blame] | 134 | pars.hnbllif_sk_path := mp_hnbllif_sk_path; |
Pau Espin Pedrol | b54acca | 2021-11-22 20:35:44 +0100 | [diff] [blame] | 135 | pars.hnodeb_addr := mp_hnodeb_ip; |
| 136 | pars.hnbgw_addr := mp_hnbgw_iuh_ip; |
| 137 | pars.hnbgw_port := mp_hnbgw_iuh_port; |
| 138 | return pars; |
| 139 | } |
| 140 | |
| 141 | type function void_fn(charstring id) runs on HNBGW_ConnHdlr; |
| 142 | |
| 143 | /* helper function to create and connect a HNBGW_ConnHdlr component */ |
Pau Espin Pedrol | a6bbb8c | 2021-11-24 17:00:03 +0100 | [diff] [blame] | 144 | private function f_connect_handler(inout HNBGW_ConnHdlr vc_conn, TestHdlrParams pars) runs on test_CT { |
| 145 | if (pars.hnbllif_sk_path != "") { |
| 146 | map(vc_conn:LLSK, system:LLSK); |
Pau Espin Pedrol | b54acca | 2021-11-22 20:35:44 +0100 | [diff] [blame] | 147 | } |
Pau Espin Pedrol | b54acca | 2021-11-22 20:35:44 +0100 | [diff] [blame] | 148 | } |
| 149 | |
| 150 | function f_start_handler_create(TestHdlrParams pars) |
| 151 | runs on test_CT return HNBGW_ConnHdlr { |
| 152 | var charstring id := testcasename(); |
| 153 | var HNBGW_ConnHdlr vc_conn; |
| 154 | vc_conn := HNBGW_ConnHdlr.create(id); |
Pau Espin Pedrol | a6bbb8c | 2021-11-24 17:00:03 +0100 | [diff] [blame] | 155 | f_connect_handler(vc_conn, pars); |
Pau Espin Pedrol | b54acca | 2021-11-22 20:35:44 +0100 | [diff] [blame] | 156 | return vc_conn; |
| 157 | } |
| 158 | |
| 159 | function f_start_handler_run(HNBGW_ConnHdlr vc_conn, void_fn fn, TestHdlrParams pars) |
| 160 | runs on test_CT return HNBGW_ConnHdlr { |
| 161 | var charstring id := testcasename(); |
| 162 | /* Emit a marker to appear in the SUT's own logging output */ |
| 163 | f_logp(HNBVTY, id & "() start"); |
| 164 | vc_conn.start(f_handler_init(fn, id, pars)); |
| 165 | return vc_conn; |
| 166 | } |
| 167 | |
| 168 | function f_start_handler(void_fn fn, template (omit) TestHdlrParams pars_tmpl := omit) |
| 169 | runs on test_CT return HNBGW_ConnHdlr { |
| 170 | var TestHdlrParams pars; |
| 171 | if (isvalue(pars)) { |
| 172 | pars := valueof(pars_tmpl); |
| 173 | } else { |
| 174 | pars := valueof(f_gen_test_hdlr_pars()); |
| 175 | } |
| 176 | return f_start_handler_run(f_start_handler_create(pars), fn, pars); |
| 177 | } |
| 178 | |
| 179 | /* first function inside ConnHdlr component; sets g_pars + starts function */ |
| 180 | private function f_handler_init(void_fn fn, charstring id, TestHdlrParams pars) |
| 181 | runs on HNBGW_ConnHdlr { |
Pau Espin Pedrol | a6bbb8c | 2021-11-24 17:00:03 +0100 | [diff] [blame] | 182 | f_HNBGW_ConnHdlr_init(id, pars); |
Pau Espin Pedrol | b54acca | 2021-11-22 20:35:44 +0100 | [diff] [blame] | 183 | HNBAP.receive(IUHEM_Event:{up_down:=IUHEM_EVENT_UP}); /* Wait for HNB to connect to us */ |
| 184 | fn.apply(id); |
| 185 | } |
| 186 | |
Pau Espin Pedrol | a6bbb8c | 2021-11-24 17:00:03 +0100 | [diff] [blame] | 187 | private function f_tc_hnb_register_request_accept(charstring id) runs on HNBGW_ConnHdlr { |
Pau Espin Pedrol | b54acca | 2021-11-22 20:35:44 +0100 | [diff] [blame] | 188 | f_handle_hnbap_hnb_register_req(); |
Pau Espin Pedrol | a6bbb8c | 2021-11-24 17:00:03 +0100 | [diff] [blame] | 189 | LLSK.receive(f_llsk_rx(tr_HNBLLIF_IUH_CONFIGURE_IND(g_pars.mcc, g_pars.mnc, g_pars.cell_identity, |
| 190 | g_pars.lac, g_pars.rac, g_pars.sac, g_pars.rnc_id))); |
Pau Espin Pedrol | b54acca | 2021-11-22 20:35:44 +0100 | [diff] [blame] | 191 | f_sleep(1.0); |
| 192 | } |
| 193 | testcase TC_hnb_register_request_accept() runs on test_CT { |
| 194 | var HNBGW_ConnHdlr vc_conn; |
| 195 | |
| 196 | f_init(); |
Pau Espin Pedrol | a6bbb8c | 2021-11-24 17:00:03 +0100 | [diff] [blame] | 197 | vc_conn := f_start_handler(refers(f_tc_hnb_register_request_accept)); |
Pau Espin Pedrol | b54acca | 2021-11-22 20:35:44 +0100 | [diff] [blame] | 198 | vc_conn.done; |
| 199 | f_shutdown_helper(); |
| 200 | } |
| 201 | |
| 202 | private function f_tc_hnb_register_reject(charstring id) runs on HNBGW_ConnHdlr { |
| 203 | HNBAP.receive(tr_HNBAP_HNBRegisterRequest(char2oct(g_pars.hNB_Identity_Info), |
Pau Espin Pedrol | a6bbb8c | 2021-11-24 17:00:03 +0100 | [diff] [blame] | 204 | f_enc_mcc_mnc(g_pars.mcc, g_pars.mnc), |
Pau Espin Pedrol | b54acca | 2021-11-22 20:35:44 +0100 | [diff] [blame] | 205 | int2bit(g_pars.cell_identity, 28), |
| 206 | int2oct(g_pars.lac, 2), |
| 207 | int2oct(g_pars.rac, 1), |
| 208 | int2oct(g_pars.sac, 2) |
| 209 | )); |
| 210 | HNBAP.send(ts_HNBAP_HNBRegisterReject(ts_HnbapCause(overload))); |
| 211 | f_sleep(1.0); |
| 212 | } |
| 213 | testcase TC_hnb_register_request_reject() runs on test_CT { |
| 214 | var HNBGW_ConnHdlr vc_conn; |
| 215 | |
| 216 | f_init(); |
| 217 | vc_conn := f_start_handler(refers(f_tc_hnb_register_reject)); |
| 218 | vc_conn.done; |
| 219 | f_shutdown_helper(); |
| 220 | } |
| 221 | |
Pau Espin Pedrol | a6bbb8c | 2021-11-24 17:00:03 +0100 | [diff] [blame] | 222 | private function f_tc_mo_conn(charstring id) runs on HNBGW_ConnHdlr { |
| 223 | const integer context_id := 30; |
| 224 | const bitstring context_id_bstr := '000000000000000000011110'B; /* encoded context_id */ |
| 225 | const Establishment_Cause est_cause := normal_call; |
| 226 | f_handle_hnbap_hnb_register_req(); |
| 227 | |
| 228 | LLSK.receive(f_llsk_rx(tr_HNBLLIF_IUH_CONFIGURE_IND(g_pars.mcc, g_pars.mnc, g_pars.cell_identity, |
| 229 | g_pars.lac, g_pars.rac, g_pars.sac, g_pars.rnc_id))); |
| 230 | |
| 231 | /* Now an UE attempts CM Service Request: */ |
| 232 | LLSK.send(f_llsk_tx(ts_HNBLLIF_IUH_CONN_ESTABLISH_REQ(context_id, 1, enum2int(est_cause), hex2oct(ranap_cm_service_req)))); |
| 233 | /* The related RUA Connect + RANAP message is received on Iuh: */ |
| 234 | RUA.receive(tr_RUA_Connect(ps_domain, context_id_bstr, est_cause, hex2oct(ranap_cm_service_req))); |
| 235 | |
| 236 | /* Now HNBGW answers with RUA-DirectTransfer(RANAP-AuthenticationRequest) */ |
| 237 | RUA.send(ts_RUA_DirectTransfer(ps_domain, context_id_bstr, hex2oct(ranap_auth_req))); |
| 238 | |
| 239 | /* Now on LLSK first the Conn establishment is confirmed and then we receive data */ |
| 240 | LLSK.receive(f_llsk_rx(tr_HNBLLIF_IUH_CONN_ESTABLISH_CNF(context_id, 1, 0))); |
| 241 | LLSK.receive(f_llsk_rx(tr_HNBLLIF_IUH_CONN_DATA_IND(context_id, 1, hex2oct(ranap_auth_req)))); |
| 242 | |
| 243 | /* UE answers with RANAPAuthenticationResponse: */ |
| 244 | LLSK.send(f_llsk_tx(ts_HNBLLIF_IUH_CONN_DATA_REQ(context_id, 1, hex2oct(ranap_auth_resp)))); |
| 245 | RUA.receive(tr_RUA_DirectTransfer(ps_domain, context_id_bstr, hex2oct(ranap_auth_resp))); |
| 246 | |
| 247 | /* UE sends Iu Release Complete to release the conn */ |
| 248 | LLSK.send(f_llsk_tx(ts_HNBLLIF_IUH_CONN_RELEASE_REQ(context_id, 1, 0, 0, hex2oct(iu_release_compl)))); |
| 249 | RUA.receive(tr_RUA_Disconnect(ps_domain, context_id_bstr, ts_RUA_Cause(normal), hex2oct(iu_release_compl))); |
| 250 | } |
| 251 | testcase TC_mo_conn() runs on test_CT { |
| 252 | var HNBGW_ConnHdlr vc_conn; |
| 253 | |
| 254 | f_init(); |
| 255 | vc_conn := f_start_handler(refers(f_tc_mo_conn)); |
| 256 | vc_conn.done; |
| 257 | f_shutdown_helper(); |
| 258 | } |
| 259 | |
| 260 | |
| 261 | private function f_tc_paging(charstring id) runs on HNBGW_ConnHdlr { |
| 262 | const integer context_id := 30; |
| 263 | const bitstring context_id_bstr := '000000000000000000011110'B; /* encoded context_id */ |
| 264 | f_handle_hnbap_hnb_register_req(); |
| 265 | |
| 266 | LLSK.receive(f_llsk_rx(tr_HNBLLIF_IUH_CONFIGURE_IND(g_pars.mcc, g_pars.mnc, g_pars.cell_identity, |
| 267 | g_pars.lac, g_pars.rac, g_pars.sac, g_pars.rnc_id))); |
| 268 | |
| 269 | /* HNBGW sends RUA-ConnectionlessTransfer(RANAP-Paging) */ |
| 270 | RUA.send(ts_RUA_ConnectionlessTransfer(hex2oct(ranap_paging))); |
| 271 | |
| 272 | LLSK.receive(f_llsk_rx(tr_HNBLLIF_IUH_UNITDATA_IND(hex2oct(ranap_paging)))); |
| 273 | |
| 274 | /* Here it would continue with UE-side answers with RUA-Connect(RANAP-PagingResponse) */ |
| 275 | } |
| 276 | testcase TC_paging() runs on test_CT { |
| 277 | var HNBGW_ConnHdlr vc_conn; |
| 278 | |
| 279 | f_init(); |
| 280 | vc_conn := f_start_handler(refers(f_tc_paging)); |
| 281 | vc_conn.done; |
| 282 | f_shutdown_helper(); |
| 283 | } |
| 284 | |
Pau Espin Pedrol | 32fb54e | 2021-11-29 16:21:26 +0100 | [diff] [blame^] | 285 | private function f_tc_cs_mo_call(charstring id) runs on HNBGW_ConnHdlr { |
| 286 | const integer context_id := 30; |
| 287 | const bitstring context_id_bstr := '000000000000000000011110'B; /* encoded context_id */ |
| 288 | const Establishment_Cause est_cause := normal_call; |
| 289 | var HNBLLIF_send_data sd; |
| 290 | var PDU_RTP rtp_pdu; |
| 291 | var octetstring rtp_payload; |
| 292 | var HostName hnodeb_rtp_addr; |
| 293 | var PortNumber hnodeb_rtp_port; |
| 294 | timer Tu; |
| 295 | |
| 296 | f_handle_hnbap_hnb_register_req(); |
| 297 | |
| 298 | LLSK.receive(f_llsk_rx(tr_HNBLLIF_IUH_CONFIGURE_IND(g_pars.mcc, g_pars.mnc, g_pars.cell_identity, |
| 299 | g_pars.lac, g_pars.rac, g_pars.sac, g_pars.rnc_id))); |
| 300 | |
| 301 | /* Now an UE attempts CM Service Request: */ |
| 302 | LLSK.send(f_llsk_tx(ts_HNBLLIF_IUH_CONN_ESTABLISH_REQ(context_id, 0, enum2int(est_cause), hex2oct(ranap_cm_service_req)))); |
| 303 | /* The related RUA Connect + RANAP message is received on Iuh: */ |
| 304 | RUA.receive(tr_RUA_Connect(cs_domain, context_id_bstr, est_cause, hex2oct(ranap_cm_service_req))); |
| 305 | |
| 306 | /* Now HNBGW answers with RUA-DirectTransfer(RANAP-RabASsReq) */ |
| 307 | RUA.send(ts_RUA_DirectTransfer(cs_domain, context_id_bstr, hex2oct(ranap_rab_ass_req))); |
| 308 | |
| 309 | /* Now on LLSK first the Conn establishment is confirmed and then we receive data */ |
| 310 | LLSK.receive(f_llsk_rx(tr_HNBLLIF_IUH_CONN_ESTABLISH_CNF(context_id, 0, 0))); |
| 311 | LLSK.receive(f_llsk_rx(tr_HNBLLIF_IUH_CONN_DATA_IND(context_id, 0, hex2oct(ranap_rab_ass_req)))); |
| 312 | |
| 313 | /* Now LLSK provides the remote TransportLayerAddress from RabAssReq and asks SUT to provide a local address: */ |
| 314 | LLSK.send(f_llsk_tx(ts_HNBLLIF_AUDIO_CONN_ESTABLISH_REQ(context_id, g_pars.hnbgw_rtp_port, HNBLL_IF_ADDR_TYPE_IPV4, |
| 315 | f_HNBLLIF_Addr(HNBLL_IF_ADDR_TYPE_IPV4, g_pars.hnbgw_addr)))); |
| 316 | LLSK.receive(f_llsk_rx(tr_HNBLLIF_AUDIO_CONN_ESTABLISH_CNF(context_id, 0, ?, HNBLL_IF_ADDR_TYPE_IPV4, ?))) -> value sd; |
| 317 | |
| 318 | hnodeb_rtp_addr := f_inet_ntoa(sd.data.u.audio.u.conn_establish.u.cnf.local_addr); |
| 319 | if (not match(g_pars.hnodeb_addr, hnodeb_rtp_addr)) { |
| 320 | Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "hnodeb RTP local address doesn't match expectations"); |
| 321 | } |
| 322 | hnodeb_rtp_port := sd.data.u.audio.u.conn_establish.u.cnf.local_rtp_port; |
| 323 | rtp_payload := f_rnd_octstring(6); |
| 324 | f_HNBGW_rtpem_activate(rtp_payload, hnodeb_rtp_addr, hnodeb_rtp_port); |
| 325 | /* Make sure that Uplink frames are received at the HNBGW */ |
| 326 | RTPEM_DATA.clear; |
| 327 | LLSK.send(f_llsk_tx(ts_HNBLLIF_AUDIO_CONN_DATA_REQ(context_id, rtp_payload))); |
| 328 | Tu.start(2.0); |
| 329 | alt { |
| 330 | [] RTPEM_DATA.receive(PDU_RTP:?) -> value rtp_pdu { |
| 331 | if (rtp_pdu.data != rtp_payload) { |
| 332 | log("Unexpected RTP payload received!"); |
| 333 | repeat; |
| 334 | } |
| 335 | } |
| 336 | [] RTPEM_DATA.receive { repeat; } |
| 337 | [] Tu.timeout { |
| 338 | Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Timeout waiting for Uplink speech frames"); |
| 339 | } |
| 340 | } |
| 341 | Tu.stop; |
| 342 | /* We should also have received some RTP from the HNBGW: */ |
| 343 | LLSK.receive(f_llsk_rx(tr_HNBLLIF_AUDIO_CONN_DATA_IND(context_id, rtp_payload))); |
| 344 | |
| 345 | f_rtpem_mode(RTPEM_CTRL, RTPEM_MODE_NONE); |
| 346 | |
| 347 | LLSK.send(f_llsk_tx(ts_HNBLLIF_AUDIO_CONN_RELEASE_REQ(context_id))); |
| 348 | |
| 349 | /* UE sends Iu Release Complete to release the conn */ |
| 350 | LLSK.send(f_llsk_tx(ts_HNBLLIF_IUH_CONN_RELEASE_REQ(context_id, 0, 0, 0, hex2oct(iu_release_compl)))); |
| 351 | RUA.receive(tr_RUA_Disconnect(cs_domain, context_id_bstr, ts_RUA_Cause(normal), hex2oct(iu_release_compl))); |
| 352 | } |
| 353 | testcase TC_cs_mo_call() runs on test_CT { |
| 354 | var HNBGW_ConnHdlr vc_conn; |
| 355 | |
| 356 | f_init(); |
| 357 | vc_conn := f_start_handler(refers(f_tc_cs_mo_call)); |
| 358 | vc_conn.done; |
| 359 | f_shutdown_helper(); |
| 360 | } |
| 361 | |
Pau Espin Pedrol | b54acca | 2021-11-22 20:35:44 +0100 | [diff] [blame] | 362 | control { |
| 363 | execute( TC_hnb_register_request_accept() ); |
| 364 | execute( TC_hnb_register_request_reject() ); |
Pau Espin Pedrol | a6bbb8c | 2021-11-24 17:00:03 +0100 | [diff] [blame] | 365 | execute( TC_mo_conn() ); |
| 366 | execute( TC_paging() ); |
Pau Espin Pedrol | 32fb54e | 2021-11-29 16:21:26 +0100 | [diff] [blame^] | 367 | execute( TC_cs_mo_call() ); |
Pau Espin Pedrol | b54acca | 2021-11-22 20:35:44 +0100 | [diff] [blame] | 368 | } |
| 369 | |
| 370 | } |