Harald Welte | 801ed1a | 2023-04-30 15:07:00 +1000 | [diff] [blame] | 1 | module BSC_Tests_ASCI { |
| 2 | |
| 3 | /* Integration Tests for OsmoBSC |
| 4 | * (C) 2023 by Harald Welte <laforge@gnumonks.org> |
| 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 OsmoBSC while emulating both multiple BTS + MS as |
| 13 | * well as the MSC. See README for more details. |
| 14 | */ |
| 15 | |
| 16 | import from General_Types all; |
| 17 | import from Osmocom_Types all; |
| 18 | import from GSM_Types all; |
| 19 | import from Misc_Helpers all; |
| 20 | |
| 21 | import from BSC_Tests all; |
| 22 | import from BSSAP_Types all; |
| 23 | import from BSSAP_CodecPort all; |
| 24 | import from BSSMAP_Templates all; |
| 25 | import from RSL_Types all; |
| 26 | import from RSL_Emulation all; |
| 27 | import from MGCP_Emulation all; |
| 28 | |
| 29 | import from MobileL3_CommonIE_Types all; |
| 30 | import from MobileL3_Types all; |
| 31 | import from L3_Templates all; |
| 32 | import from GSM_RR_Types all; |
| 33 | |
| 34 | import from MSC_ConnectionHandler all; |
| 35 | import from RAN_Adapter all; |
| 36 | import from RAN_Emulation all; |
| 37 | |
| 38 | const charstring COORD_VGCS_CALL_EST := "VGCS_CALL_EST"; |
| 39 | const charstring COORD_VGCS_CALL_REL := "VGCS_CALL_REL"; |
| 40 | const charstring COORD_VGCS_CHANNEL_REL := "VGCS_CHANNEL_REL"; |
| 41 | const charstring COORD_VGCS_UPLINK_FREE := "VGCS_UPLINK_FREE"; |
| 42 | const charstring COORD_VGCS_UPLINK_BUSY := "VGCS_UPLINK_BUSY"; |
| 43 | const charstring COORD_VGCS_ASSIGN_RES := "VGCS_ASSIGN_RES"; |
| 44 | const charstring COORD_VGCS_ASSIGN_FAIL := "VGCS_ASSIGN_FAIL"; |
| 45 | |
| 46 | template (value) DescriptiveGroupOrBroadcastCallReference_V |
| 47 | ts_BSSMAP_IE_GroupCallRef(integer cr, |
| 48 | BIT1 sf, |
| 49 | BIT1 af, |
| 50 | BIT3 prio, |
| 51 | BIT4 ci) := { |
| 52 | binaryCodingOfGroupOrBroadcastCallReference := int2bit(cr, 27), |
| 53 | sF := sf, |
| 54 | aF := af, |
| 55 | callPriority := prio, |
| 56 | cipheringInformation := ci, |
| 57 | spare := '0000'B |
| 58 | } |
| 59 | |
| 60 | function f_gen_asci_ass_req(integer bssap_idx := 0, |
| 61 | template (value) BSSMAP_IE_ChannelType ch_type := ts_BSSMAP_IE_ChannelType, |
| 62 | template (value) OCT1 ass_requirement := '00'O, |
| 63 | template (value) BSSMAP_IE_CellIdentifier cell_id := ts_CellId_CI(0), |
| 64 | template (value) GroupCallRef group_call_ref := '0000001000'O, |
| 65 | charstring aoip_tla :="1.2.3.4") |
| 66 | runs on MSC_ConnHdlr return template (value) PDU_BSSAP { |
| 67 | if (mp_bssap_cfg[bssap_idx].transport == BSSAP_TRANSPORT_AoIP) { |
| 68 | var template (value) BSSMAP_IE_AoIP_TransportLayerAddress tla := |
| 69 | f_ts_BSSMAP_IE_AoIP_TLA(aoip_tla, 2342); |
| 70 | var template (value) BSSMAP_IE_SpeechCodecList codec_list := |
| 71 | ts_BSSMAP_IE_CodecList({ts_CodecFR}); |
| 72 | return ts_BSSMAP_VGCS_VBS_AssignmentReq(ch_type, ass_requirement, cell_id, |
| 73 | group_call_ref, omit, tla, omit, codec_list); |
| 74 | } else { |
| 75 | var template (value) BSSMAP_IE_CircuitIdentityCode cic := ts_BSSMAP_IE_CIC(0,1); |
| 76 | return ts_BSSMAP_VGCS_VBS_AssignmentReq(ch_type, ass_requirement, cell_id, |
| 77 | group_call_ref, cic, omit, omit, omit); |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | /* |
| 82 | * VGCS/VBS call controling connection |
| 83 | */ |
| 84 | |
| 85 | private function f_tc_vgcs_vbs_setup(charstring id) runs on MSC_ConnHdlr { |
| 86 | var PDU_BSSAP rx_bssap; |
| 87 | var template (value) DescriptiveGroupOrBroadcastCallReference_V callref := |
| 88 | ts_BSSMAP_IE_GroupCallRef(11, '1'B, '0'B, '000'B, '0000'B); |
| 89 | var template (value) PDU_BSSAP setup_req := ts_BSSMAP_VGCS_VBS_Setup(bit2oct(encvalue(callref)), omit); |
| 90 | var boolean uplink_free := false; |
| 91 | var boolean uplink_busy := false; |
| 92 | var boolean uplink_req := false; |
| 93 | var boolean uplink_req_conf := false; |
| 94 | var boolean uplink_rel_ind := false; |
| 95 | var boolean assign_res := false; |
| 96 | var boolean assign_fail := false; |
| 97 | /* Note: This timer is used to receive messages after the expected event. |
Andreas Eversberg | 3587492 | 2023-07-07 13:44:04 +0200 | [diff] [blame] | 98 | * After timeout, the outcome of the test is checked. |
| 99 | * The timeout must be large enough, so all the messages pass before checking the outcome. */ |
| 100 | timer T := 1.0; |
Harald Welte | 801ed1a | 2023-04-30 15:07:00 +1000 | [diff] [blame] | 101 | |
| 102 | /* Wait for the COORD ports to be connected. */ |
| 103 | f_sleep(1.0); |
| 104 | |
| 105 | /* VGCS/VBS SETUP REQ in SCCP CR (must be the first message) */ |
| 106 | BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_bsc, g_pars.sccp_addr_msc, setup_req)); |
| 107 | BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_CONF_IND); |
| 108 | |
| 109 | alt { |
| 110 | [] BSSAP.receive(tr_BSSMAP_VGCS_VBS_SetupAck) -> value rx_bssap { |
| 111 | log("VGCS: got setup ack"); |
| 112 | if (not g_pars.asci_test.vgcs_setup_ok) { |
| 113 | COORD.send(COORD_VGCS_CALL_EST); |
| 114 | repeat; |
| 115 | } |
| 116 | BSSAP.send(ts_BSSMAP_ClearCommand(0)); |
| 117 | BSSAP.receive(tr_BSSMAP_ClearComplete); |
| 118 | BSSAP.send(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_REQ); |
| 119 | setverdict(pass); |
| 120 | return; |
| 121 | } |
| 122 | [] BSSAP.receive(tr_BSSMAP_VGCS_VBS_SetupRefuse) -> value rx_bssap { |
| 123 | log("VGCS: got setup refuse"); |
| 124 | Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, |
| 125 | "Expected ASCI Setup to succeed, but got fail"); |
| 126 | return; |
| 127 | } |
| 128 | [] BSSAP.receive(tr_BSSMAP_UplinkReq) -> value rx_bssap { |
| 129 | log("VGCS: received uplink req"); |
| 130 | uplink_req := true; |
| 131 | BSSAP.send(ts_BSSMAP_UplinkReqAck(omit)); |
| 132 | if (g_pars.asci_test.vgcs_talker_req) { |
| 133 | T.start; |
| 134 | } |
| 135 | repeat; |
| 136 | } |
| 137 | [] BSSAP.receive(tr_BSSMAP_UplinkReqConf(?, omit, '1234'O)) -> value rx_bssap { |
| 138 | log("VGCS: received uplink req confirm"); |
| 139 | uplink_req_conf := true; |
| 140 | if (g_pars.asci_test.vgcs_talker_est) { |
| 141 | T.start; |
| 142 | } |
| 143 | repeat; |
| 144 | } |
| 145 | [] BSSAP.receive(tr_BSSMAP_UplinkRelInd(GSM0808_CAUSE_CALL_CONTROL, omit)) -> value rx_bssap { |
| 146 | log("VGCS: received uplink rel ind"); |
| 147 | uplink_rel_ind := true; |
| 148 | if (g_pars.asci_test.vgcs_talker_rel) { |
| 149 | T.start; |
| 150 | } |
| 151 | repeat; |
| 152 | } |
| 153 | [] COORD.receive(COORD_VGCS_ASSIGN_RES) { |
| 154 | log("VGCS: got assignment result at call control"); |
| 155 | assign_res := true; |
| 156 | if (g_pars.asci_test.vgcs_assign_ok) { |
| 157 | T.start; |
| 158 | } |
Andreas Eversberg | 3587492 | 2023-07-07 13:44:04 +0200 | [diff] [blame] | 159 | if (g_pars.asci_test.vgcs_uplink_seized or |
| 160 | g_pars.asci_test.vgcs_uplink_release) { |
| 161 | log("VGCS: sending Uplink Seized Cmd"); |
| 162 | BSSAP.send(ts_BSSMAP_UplinkSeizedCmd(9, omit, omit, omit)); |
| 163 | } |
| 164 | if (g_pars.asci_test.vgcs_uplink_release) { |
| 165 | log("VGCS: sending Uplink Release Cmd"); |
| 166 | BSSAP.send(ts_BSSMAP_UplinkRelCmd(9)); |
| 167 | } |
| 168 | if (g_pars.asci_test.vgcs_uplink_seized or |
| 169 | g_pars.asci_test.vgcs_uplink_release) { |
| 170 | T.start; |
| 171 | } |
Harald Welte | 801ed1a | 2023-04-30 15:07:00 +1000 | [diff] [blame] | 172 | repeat; |
| 173 | } |
| 174 | [] COORD.receive(COORD_VGCS_ASSIGN_FAIL) { |
| 175 | log("VGCS: got assignment failure at call control"); |
| 176 | assign_fail := true; |
| 177 | if (g_pars.asci_test.vgcs_assign_fail) { |
| 178 | T.start; |
| 179 | } |
| 180 | repeat; |
| 181 | } |
| 182 | [] COORD.receive(COORD_VGCS_UPLINK_FREE) { |
| 183 | log("VGCS: Got UPLINK FREE at call control"); |
| 184 | uplink_busy := false; |
| 185 | uplink_free := true; |
| 186 | repeat; |
| 187 | } |
| 188 | [] COORD.receive(COORD_VGCS_UPLINK_BUSY) { |
| 189 | log("VGCS: Got UPLINK BUSY at call control"); |
| 190 | uplink_busy := true; |
| 191 | uplink_free := false; |
| 192 | repeat; |
| 193 | } |
| 194 | [] T.timeout { } |
| 195 | } |
| 196 | |
| 197 | /* After timeout: Release Channel and Call and see if the outcome of the test is as expected. */ |
| 198 | COORD.send(COORD_VGCS_CHANNEL_REL); |
| 199 | BSSAP.send(ts_BSSMAP_ClearCommand(0)); |
| 200 | BSSAP.receive(tr_BSSMAP_ClearComplete); |
| 201 | BSSAP.send(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_REQ); |
| 202 | |
| 203 | if (g_pars.asci_test.vgcs_assign_ok) { |
| 204 | if (not assign_res) { |
| 205 | setverdict(fail, "VGCS: Assignment did not pass as expected!"); |
| 206 | return; |
| 207 | } |
| 208 | if (not uplink_free) { |
| 209 | setverdict(fail, "VGCS: Uplink not free as expected!"); |
| 210 | return; |
| 211 | } |
| 212 | log("VGCS: Channel assigned and uplink marked free as expected!"); |
| 213 | setverdict(pass); |
| 214 | return; |
| 215 | } |
| 216 | if (g_pars.asci_test.vgcs_assign_fail) { |
| 217 | if (not assign_fail) { |
| 218 | setverdict(fail, "VGCS: Assignment did not fail as expected!"); |
| 219 | return; |
| 220 | } |
| 221 | log("VGCS: Channel assignment failed as expected!"); |
| 222 | setverdict(pass); |
| 223 | return; |
| 224 | } |
| 225 | if (g_pars.asci_test.vgcs_talker_req) { |
| 226 | if (not uplink_req) { |
| 227 | setverdict(fail, "VGCS: No uplink request as expected!"); |
| 228 | return; |
| 229 | } |
Andreas Eversberg | 5e3dd36 | 2023-07-07 12:09:00 +0200 | [diff] [blame] | 230 | /* UPLINK BUSY is automatically sent by BTS, but not by BSC. */ |
| 231 | if (uplink_busy) { |
| 232 | setverdict(fail, "VGCS: Uplink set to busy, this is not expected!"); |
Harald Welte | 801ed1a | 2023-04-30 15:07:00 +1000 | [diff] [blame] | 233 | return; |
| 234 | } |
| 235 | log("VGCS: Uplink requested and uplink marked busy as expected!"); |
| 236 | setverdict(pass); |
| 237 | return; |
| 238 | } |
| 239 | if (g_pars.asci_test.vgcs_talker_est) { |
| 240 | if (not uplink_req_conf) { |
| 241 | setverdict(fail, "VGCS: No uplink request confirm as expected!"); |
| 242 | return; |
| 243 | } |
Andreas Eversberg | 5e3dd36 | 2023-07-07 12:09:00 +0200 | [diff] [blame] | 244 | /* UPLINK BUSY is automatically sent by BTS, but not by BSC. */ |
| 245 | if (uplink_busy) { |
| 246 | setverdict(fail, "VGCS: Uplink set to busy, this is not expected!"); |
Harald Welte | 801ed1a | 2023-04-30 15:07:00 +1000 | [diff] [blame] | 247 | return; |
| 248 | } |
| 249 | log("VGCS: Uplink established and uplink marked busy as expected!"); |
| 250 | setverdict(pass); |
| 251 | return; |
| 252 | } |
| 253 | if (g_pars.asci_test.vgcs_talker_rel) { |
| 254 | if (not uplink_rel_ind) { |
| 255 | setverdict(fail, "VGCS: No uplink release indication as expected!"); |
| 256 | return; |
| 257 | } |
| 258 | if (not uplink_free) { |
| 259 | setverdict(fail, "VGCS: Uplink not free as expected!"); |
| 260 | return; |
| 261 | } |
| 262 | log("VGCS: Uplink established+released and uplink marked free as expected!"); |
| 263 | setverdict(pass); |
| 264 | return; |
| 265 | } |
Andreas Eversberg | 3587492 | 2023-07-07 13:44:04 +0200 | [diff] [blame] | 266 | if (g_pars.asci_test.vgcs_uplink_seized) { |
| 267 | if (not uplink_busy) { |
| 268 | setverdict(fail, "VGCS: Uplink not busy as expected!"); |
| 269 | return; |
| 270 | } |
| 271 | log("VGCS: Uplink established+released and uplink marked free as expected!"); |
| 272 | setverdict(pass); |
| 273 | return; |
| 274 | } |
| 275 | if (g_pars.asci_test.vgcs_uplink_release) { |
| 276 | if (not uplink_free) { |
| 277 | setverdict(fail, "VGCS: Uplink not free as expected!"); |
| 278 | return; |
| 279 | } |
| 280 | log("VGCS: Uplink established+released and uplink marked free as expected!"); |
| 281 | setverdict(pass); |
| 282 | return; |
| 283 | } |
Harald Welte | 801ed1a | 2023-04-30 15:07:00 +1000 | [diff] [blame] | 284 | } |
| 285 | |
| 286 | /* |
| 287 | * VGCS/VBS resource controling connection |
| 288 | */ |
| 289 | |
| 290 | private altstep as_eat_rsl_data() runs on MSC_ConnHdlr { |
Andreas Eversberg | c0870e5 | 2023-07-07 12:06:24 +0200 | [diff] [blame] | 291 | [] RSL.receive(tr_RSL_UNITDATA_REQ(g_chan_nr, ?, ?)) { |
| 292 | log("VGCS: Got RSL UNITDATA REQ on channel"); |
| 293 | repeat; |
| 294 | } |
Harald Welte | 801ed1a | 2023-04-30 15:07:00 +1000 | [diff] [blame] | 295 | [] RSL.receive(tr_RSL_DATA_REQ(g_chan_nr, ?, ?)) { |
| 296 | log("VGCS: Got RSL DATA REQ on channel"); |
| 297 | repeat; |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | private function f_tc_asci_assignment(charstring id) runs on MSC_ConnHdlr { |
| 302 | var PDU_BSSAP rx_bssap; |
| 303 | /* Hack: the proper way would be to wait for the BSSMAP VGCS Assignment Result and extract the |
| 304 | * actual assigned chan_nr from it. But osmo-bsc starts acting on the lchan even before we get a |
| 305 | * chance to evaluate the BSSMAP Handover Request ACK. So we need to assume that osmo-bsc will |
| 306 | * activate TS 1 and already set up this lchan's RSL emulation |
| 307 | * before we get started. */ |
| 308 | var RslChannelNr new_chan_nr := valueof(t_RslChanNr0(1, RSL_CHAN_NR_Bm_ACCH)); |
| 309 | f_rslem_register(0, new_chan_nr); |
| 310 | g_chan_nr := new_chan_nr; |
| 311 | var uint3_t expect_target_tsc := c_BtsParams[0].tsc; |
| 312 | var default eat_rsl_data; |
| 313 | |
| 314 | /* Wait for the COORD ports to be connected. */ |
| 315 | f_sleep(1.0); |
| 316 | |
| 317 | f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); |
| 318 | f_MscConnHdlr_init(g_pars.media_nr, "127.0.0.2", "127.0.0.3", FR_AMR); |
| 319 | var default as_media := activate(as_Media()); |
| 320 | |
| 321 | log("VGCS: wait for establishment of call controling connection"); |
| 322 | COORD.receive(COORD_VGCS_CALL_EST); |
| 323 | log("VGCS: got establishment of call controling connection"); |
| 324 | |
| 325 | /* TODO: Encryption */ |
| 326 | var template (value) BSSMAP_IE_ChannelType req_ch_type := ts_BSSMAP_IE_ChannelType; |
| 327 | var template BSSMAP_IE_ChannelType res_ch_type := tr_BSSMAP_IE_ChannelType('0001'B, ChRate_TCHF, Spdi_TCHF_FR); |
| 328 | var template (value) BSSMAP_IE_CellIdentifier req_cell_id := ts_CellId_CI(0); |
| 329 | var template BSSMAP_IE_CellIdentifier res_cell_id := tr_CellId_CI(0); |
| 330 | var template (value) DescriptiveGroupOrBroadcastCallReference_V callref := |
| 331 | ts_BSSMAP_IE_GroupCallRef(11, '1'B, '0'B, '000'B, '0000'B); |
| 332 | if (g_pars.asci_test.vgcs_assign_fail) { |
| 333 | callref := ts_BSSMAP_IE_GroupCallRef(10, '1'B, '0'B, '000'B, '0000'B); |
| 334 | } |
| 335 | var template (value) PDU_BSSAP ass_req := f_gen_asci_ass_req(ch_type := req_ch_type, cell_id := req_cell_id, |
| 336 | group_call_ref := bit2oct(encvalue(callref))); |
| 337 | /* VGCS/VBS ASS REQ in SCCP CR (must be the first message) */ |
| 338 | BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_bsc, g_pars.sccp_addr_msc, ass_req)); |
| 339 | BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_CONF_IND); |
| 340 | |
| 341 | alt { |
| 342 | [] BSSAP.receive(tr_BSSMAP_VGCS_VBS_AssignmentRes(res_ch_type, res_cell_id)) -> value rx_bssap { |
| 343 | log("VGCS: got assignment result on channel"); |
| 344 | COORD.send(COORD_VGCS_ASSIGN_RES); |
| 345 | if (g_pars.asci_test.vgcs_talker_req or |
| 346 | g_pars.asci_test.vgcs_talker_est or |
| 347 | g_pars.asci_test.vgcs_talker_rel) { |
| 348 | log("VGCS: sending talker det"); |
| 349 | RSL.send(ts_RSL_TALKER_DET(g_chan_nr)); |
| 350 | } |
| 351 | if (g_pars.asci_test.vgcs_talker_est or |
| 352 | g_pars.asci_test.vgcs_talker_rel) { |
| 353 | log("VGCS: sending RSL etabish ind"); |
| 354 | RSL.send(ts_RSL_EST_IND(g_chan_nr, ts_RslLinkID_DCCH(0), '1234'O)); |
| 355 | } |
| 356 | if (g_pars.asci_test.vgcs_talker_rel) { |
| 357 | log("VGCS: sending RSL release ind"); |
| 358 | RSL.send(ts_RSL_REL_IND(g_chan_nr, ts_RslLinkID_DCCH(0))); |
| 359 | } |
| 360 | repeat; |
| 361 | } |
| 362 | [] BSSAP.receive(tr_BSSMAP_VGCS_VBS_AssignmentFail) -> value rx_bssap { |
| 363 | log("VGCS: got assignment failure on channel"); |
| 364 | COORD.send(COORD_VGCS_ASSIGN_FAIL); |
| 365 | log("VGCS: got release order after assignment failure"); |
| 366 | COORD.receive(COORD_VGCS_CHANNEL_REL); |
| 367 | BSSAP.send(ts_BSSMAP_ClearCommand(0)); |
| 368 | BSSAP.receive(tr_BSSMAP_ClearComplete); |
| 369 | BSSAP.send(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_REQ); |
| 370 | return; |
| 371 | } |
| 372 | [] COORD.receive(COORD_VGCS_CHANNEL_REL) { |
| 373 | log("VGCS: got release order of resource controling connection"); |
| 374 | eat_rsl_data := activate(as_eat_rsl_data()); |
| 375 | f_perform_clear_no_rr_rel(); |
| 376 | deactivate(eat_rsl_data); |
| 377 | return; |
| 378 | } |
Andreas Eversberg | c0870e5 | 2023-07-07 12:06:24 +0200 | [diff] [blame] | 379 | [] RSL.receive(tr_RSL_UNITDATA_REQ(g_chan_nr, ?, '082B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B'O)) { |
Harald Welte | 801ed1a | 2023-04-30 15:07:00 +1000 | [diff] [blame] | 380 | log("VGCS: Got UPLINK FREE on channel"); |
| 381 | COORD.send(COORD_VGCS_UPLINK_FREE); |
| 382 | repeat; |
| 383 | } |
Andreas Eversberg | c0870e5 | 2023-07-07 12:06:24 +0200 | [diff] [blame] | 384 | [] RSL.receive(tr_RSL_UNITDATA_REQ(g_chan_nr, ?, '062A'O)) { |
Harald Welte | 801ed1a | 2023-04-30 15:07:00 +1000 | [diff] [blame] | 385 | log("VGCS: Got UPLINK BUSY on channel"); |
| 386 | COORD.send(COORD_VGCS_UPLINK_BUSY); |
| 387 | repeat; |
| 388 | } |
| 389 | } |
| 390 | |
| 391 | /* The RSL Emulation magically accepts the Chan Activ behind the scenes. */ |
| 392 | |
| 393 | /* we're sure that the channel activation is done now, verify the parameters in it */ |
| 394 | var RSL_Message chan_act := f_rslem_get_last_act(RSL_PROC, 0, g_chan_nr); |
| 395 | /* TODO: Encryption */ |
| 396 | f_chan_act_verify_tsc(chan_act, expect_target_tsc); |
| 397 | |
| 398 | if (ispresent(rx_bssap.pdu.bssmap.vGCS_VBSAssignmentResult.speechCodec)) { |
| 399 | if (not g_pars.aoip) { |
| 400 | Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, |
| 401 | "Expected no Speech Codec (Chosen)"); |
| 402 | } |
| 403 | } else { |
| 404 | if (g_pars.aoip) { |
| 405 | Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, |
| 406 | "Expected Speech Codec (Chosen)"); |
| 407 | } |
| 408 | } |
| 409 | |
| 410 | } |
| 411 | |
| 412 | testcase TC_vgcs_vbs_setup_only() runs on test_CT { |
| 413 | var MSC_ConnHdlr call_conn; |
| 414 | var TestHdlrParams pars := f_gen_test_hdlr_pars(); |
| 415 | |
| 416 | f_init(1, true); |
| 417 | |
| 418 | pars.sccp_addr_msc := g_bssap[0].sccp_addr_own; |
| 419 | pars.sccp_addr_bsc := g_bssap[0].sccp_addr_peer; |
| 420 | |
| 421 | pars.asci_test.vgcs_setup_ok := true; |
| 422 | |
| 423 | call_conn := f_start_handler(refers(f_tc_vgcs_vbs_setup), pars); |
| 424 | |
| 425 | call_conn.done; |
| 426 | |
| 427 | f_shutdown_helper(); |
| 428 | } |
| 429 | |
| 430 | testcase TC_vgcs_vbs_assignment() runs on test_CT { |
| 431 | var MSC_ConnHdlr call_conn, chan_conn; |
| 432 | var TestHdlrParams pars := f_gen_test_hdlr_pars(); |
| 433 | |
| 434 | f_init(1, true); |
| 435 | |
| 436 | pars.sccp_addr_msc := g_bssap[0].sccp_addr_own; |
| 437 | pars.sccp_addr_bsc := g_bssap[0].sccp_addr_peer; |
| 438 | |
| 439 | pars.asci_test.vgcs_assign_ok := true; |
| 440 | |
| 441 | call_conn := f_start_handler(refers(f_tc_vgcs_vbs_setup), pars); |
| 442 | chan_conn := f_start_handler(refers(f_tc_asci_assignment), pars); |
| 443 | /* Connect COORD ports of both functions. The functions will delay before using them. */ |
| 444 | connect(call_conn:COORD, chan_conn:COORD); |
| 445 | |
| 446 | call_conn.done; |
| 447 | chan_conn.done; |
| 448 | |
| 449 | f_shutdown_helper(); |
| 450 | } |
| 451 | |
| 452 | testcase TC_vgcs_vbs_assignment_fail() runs on test_CT { |
| 453 | var MSC_ConnHdlr call_conn, chan_conn; |
| 454 | var TestHdlrParams pars := f_gen_test_hdlr_pars(); |
| 455 | |
| 456 | f_init(1, true); |
| 457 | |
| 458 | pars.sccp_addr_msc := g_bssap[0].sccp_addr_own; |
| 459 | pars.sccp_addr_bsc := g_bssap[0].sccp_addr_peer; |
| 460 | |
| 461 | pars.asci_test.vgcs_assign_fail := true; |
| 462 | |
| 463 | call_conn := f_start_handler(refers(f_tc_vgcs_vbs_setup), pars); |
| 464 | chan_conn := f_start_handler(refers(f_tc_asci_assignment), pars); |
| 465 | /* Connect COORD ports of both functions. The functions will delay before using them. */ |
| 466 | connect(call_conn:COORD, chan_conn:COORD); |
| 467 | |
| 468 | call_conn.done; |
| 469 | chan_conn.done; |
| 470 | |
| 471 | f_shutdown_helper(); |
| 472 | } |
| 473 | |
| 474 | testcase TC_vgcs_vbs_talker_req() runs on test_CT { |
| 475 | var MSC_ConnHdlr call_conn, chan_conn; |
| 476 | var TestHdlrParams pars := f_gen_test_hdlr_pars(); |
| 477 | |
| 478 | f_init(1, true); |
| 479 | |
| 480 | pars.sccp_addr_msc := g_bssap[0].sccp_addr_own; |
| 481 | pars.sccp_addr_bsc := g_bssap[0].sccp_addr_peer; |
| 482 | |
| 483 | pars.asci_test.vgcs_talker_req := true; |
| 484 | |
| 485 | call_conn := f_start_handler(refers(f_tc_vgcs_vbs_setup), pars); |
| 486 | chan_conn := f_start_handler(refers(f_tc_asci_assignment), pars); |
| 487 | /* Connect COORD ports of both functions. The functions will delay before using them. */ |
| 488 | connect(call_conn:COORD, chan_conn:COORD); |
| 489 | |
| 490 | call_conn.done; |
| 491 | chan_conn.done; |
| 492 | |
| 493 | f_shutdown_helper(); |
| 494 | } |
| 495 | |
| 496 | testcase TC_vgcs_vbs_talker_est() runs on test_CT { |
| 497 | var MSC_ConnHdlr call_conn, chan_conn; |
| 498 | var TestHdlrParams pars := f_gen_test_hdlr_pars(); |
| 499 | |
| 500 | f_init(1, true); |
| 501 | |
| 502 | pars.sccp_addr_msc := g_bssap[0].sccp_addr_own; |
| 503 | pars.sccp_addr_bsc := g_bssap[0].sccp_addr_peer; |
| 504 | |
| 505 | pars.asci_test.vgcs_talker_est := true; |
| 506 | |
| 507 | call_conn := f_start_handler(refers(f_tc_vgcs_vbs_setup), pars); |
| 508 | chan_conn := f_start_handler(refers(f_tc_asci_assignment), pars); |
| 509 | /* Connect COORD ports of both functions. The functions will delay before using them. */ |
| 510 | connect(call_conn:COORD, chan_conn:COORD); |
| 511 | |
| 512 | call_conn.done; |
| 513 | chan_conn.done; |
| 514 | |
| 515 | f_shutdown_helper(); |
| 516 | } |
| 517 | |
| 518 | testcase TC_vgcs_vbs_talker_rel() runs on test_CT { |
| 519 | var MSC_ConnHdlr call_conn, chan_conn; |
| 520 | var TestHdlrParams pars := f_gen_test_hdlr_pars(); |
| 521 | |
| 522 | f_init(1, true); |
| 523 | |
| 524 | pars.sccp_addr_msc := g_bssap[0].sccp_addr_own; |
| 525 | pars.sccp_addr_bsc := g_bssap[0].sccp_addr_peer; |
| 526 | |
| 527 | pars.asci_test.vgcs_talker_rel := true; |
| 528 | |
| 529 | call_conn := f_start_handler(refers(f_tc_vgcs_vbs_setup), pars); |
| 530 | chan_conn := f_start_handler(refers(f_tc_asci_assignment), pars); |
| 531 | /* Connect COORD ports of both functions. The functions will delay before using them. */ |
| 532 | connect(call_conn:COORD, chan_conn:COORD); |
| 533 | |
| 534 | call_conn.done; |
| 535 | chan_conn.done; |
| 536 | |
| 537 | f_shutdown_helper(); |
| 538 | } |
| 539 | |
Andreas Eversberg | 3587492 | 2023-07-07 13:44:04 +0200 | [diff] [blame] | 540 | testcase TC_vgcs_vbs_uplink_seized() runs on test_CT { |
| 541 | var MSC_ConnHdlr call_conn, chan_conn; |
| 542 | var TestHdlrParams pars := f_gen_test_hdlr_pars(); |
| 543 | |
| 544 | f_init(1, true); |
| 545 | |
| 546 | pars.sccp_addr_msc := g_bssap[0].sccp_addr_own; |
| 547 | pars.sccp_addr_bsc := g_bssap[0].sccp_addr_peer; |
| 548 | |
| 549 | pars.asci_test.vgcs_uplink_seized := true; |
| 550 | |
| 551 | call_conn := f_start_handler(refers(f_tc_vgcs_vbs_setup), pars); |
| 552 | chan_conn := f_start_handler(refers(f_tc_asci_assignment), pars); |
| 553 | /* Connect COORD ports of both functions. The functions will delay before using them. */ |
| 554 | connect(call_conn:COORD, chan_conn:COORD); |
| 555 | |
| 556 | call_conn.done; |
| 557 | chan_conn.done; |
| 558 | |
| 559 | f_shutdown_helper(); |
| 560 | } |
| 561 | |
| 562 | testcase TC_vgcs_vbs_uplink_release() runs on test_CT { |
| 563 | var MSC_ConnHdlr call_conn, chan_conn; |
| 564 | var TestHdlrParams pars := f_gen_test_hdlr_pars(); |
| 565 | |
| 566 | f_init(1, true); |
| 567 | |
| 568 | pars.sccp_addr_msc := g_bssap[0].sccp_addr_own; |
| 569 | pars.sccp_addr_bsc := g_bssap[0].sccp_addr_peer; |
| 570 | |
| 571 | pars.asci_test.vgcs_uplink_release := true; |
| 572 | |
| 573 | call_conn := f_start_handler(refers(f_tc_vgcs_vbs_setup), pars); |
| 574 | chan_conn := f_start_handler(refers(f_tc_asci_assignment), pars); |
| 575 | /* Connect COORD ports of both functions. The functions will delay before using them. */ |
| 576 | connect(call_conn:COORD, chan_conn:COORD); |
| 577 | |
| 578 | call_conn.done; |
| 579 | chan_conn.done; |
| 580 | |
| 581 | f_shutdown_helper(); |
| 582 | } |
| 583 | |
Harald Welte | 801ed1a | 2023-04-30 15:07:00 +1000 | [diff] [blame] | 584 | control { |
| 585 | execute( TC_vgcs_vbs_setup_only() ); |
| 586 | execute( TC_vgcs_vbs_assignment() ); |
| 587 | execute( TC_vgcs_vbs_assignment_fail() ); |
| 588 | execute( TC_vgcs_vbs_talker_req() ); |
| 589 | execute( TC_vgcs_vbs_talker_est() ); |
| 590 | execute( TC_vgcs_vbs_talker_rel() ); |
Andreas Eversberg | 3587492 | 2023-07-07 13:44:04 +0200 | [diff] [blame] | 591 | execute( TC_vgcs_vbs_uplink_seized() ); |
| 592 | execute( TC_vgcs_vbs_uplink_release() ); |
Harald Welte | 801ed1a | 2023-04-30 15:07:00 +1000 | [diff] [blame] | 593 | } |
| 594 | |
| 595 | |
| 596 | } |