Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 1 | module BSC_Tests { |
| 2 | |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 3 | /* Integration Tests for OsmoBSC |
Harald Welte | a063003 | 2018-03-20 21:09:55 +0100 | [diff] [blame] | 4 | * (C) 2017-2018 by Harald Welte <laforge@gnumonks.org> |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 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 | * This test suite tests OsmoBSC while emulating both multiple BTS + MS as |
| 11 | * well as the MSC. See README for more details. |
| 12 | * |
| 13 | * There are test cases that run in so-called 'handler mode' and test cases |
| 14 | * that run directly on top of the BSSAP and RSL CodecPorts. The "handler mode" |
| 15 | * tests abstract the multiplexing/demultiplexing of multiple SCCP connections |
| 16 | * and/or RSL channels and are hence suitable for higher-level test cases, while |
| 17 | * the "raw" tests directly on top of the CodecPorts are more suitable for lower- |
| 18 | * level testing. |
| 19 | */ |
| 20 | |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 21 | import from General_Types all; |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 22 | import from Osmocom_Types all; |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 23 | import from GSM_Types all; |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 24 | import from IPL4asp_Types all; |
| 25 | |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 26 | import from BSSAP_Types all; |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 27 | import from BSSAP_Adapter all; |
| 28 | import from BSSAP_CodecPort all; |
| 29 | import from BSSMAP_Templates all; |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 30 | import from IPA_Emulation all; |
Stefan Sperling | 830dc9d | 2018-02-12 21:08:28 +0100 | [diff] [blame] | 31 | import from IPA_CodecPort all; |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 32 | import from IPA_Types all; |
| 33 | import from RSL_Types all; |
Harald Welte | 624f963 | 2017-12-16 19:26:04 +0100 | [diff] [blame] | 34 | import from RSL_Emulation all; |
Daniel Willmann | 191e0d9 | 2018-01-17 12:44:35 +0100 | [diff] [blame] | 35 | import from MGCP_Emulation all; |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 36 | |
Harald Welte | 96c9441 | 2017-12-09 03:12:45 +0100 | [diff] [blame] | 37 | import from Osmocom_CTRL_Functions all; |
Harald Welte | a5d2ab2 | 2017-12-09 14:21:42 +0100 | [diff] [blame] | 38 | import from Osmocom_CTRL_Types all; |
Harald Welte | ffe55fc | 2018-01-17 22:39:54 +0100 | [diff] [blame] | 39 | import from Osmocom_CTRL_Adapter all; |
Harald Welte | 96c9441 | 2017-12-09 03:12:45 +0100 | [diff] [blame] | 40 | |
Harald Welte | bc03c76 | 2018-02-12 18:09:38 +0100 | [diff] [blame] | 41 | import from Osmocom_VTY_Functions all; |
| 42 | import from TELNETasp_PortType all; |
| 43 | |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 44 | import from MobileL3_CommonIE_Types all; |
Harald Welte | e3bd658 | 2018-01-31 22:51:25 +0100 | [diff] [blame] | 45 | import from MobileL3_Types all; |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 46 | import from L3_Templates all; |
| 47 | import from GSM_RR_Types all; |
| 48 | |
Neels Hofmeyr | 4ff9328 | 2018-03-12 04:25:35 +0100 | [diff] [blame] | 49 | import from BSSMAP_Templates all; |
| 50 | |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 51 | const integer NUM_BTS := 3; |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 52 | const float T3101_MAX := 12.0; |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 53 | |
Harald Welte | 799c97b | 2017-12-14 17:50:30 +0100 | [diff] [blame] | 54 | /* make sure to sync this with the osmo-bts.cfg you're using */ |
Philipp Maier | cb6cc48 | 2018-03-26 13:08:00 +0200 | [diff] [blame] | 55 | const integer NUM_TCHH_PER_BTS := 2; |
| 56 | const integer NUM_TCHF_PER_BTS := 4; |
Harald Welte | dd8cbf3 | 2018-01-28 12:07:52 +0100 | [diff] [blame] | 57 | const integer NUM_SDCCH_PER_BTS := 4; |
Harald Welte | 799c97b | 2017-12-14 17:50:30 +0100 | [diff] [blame] | 58 | |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 59 | |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 60 | /* per-BTS state which we keep */ |
Harald Welte | 96c9441 | 2017-12-09 03:12:45 +0100 | [diff] [blame] | 61 | type record BTS_State { |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 62 | /* component reference to the IPA_Client component used for RSL */ |
Harald Welte | a5d2ab2 | 2017-12-09 14:21:42 +0100 | [diff] [blame] | 63 | IPA_Client rsl |
Harald Welte | 96c9441 | 2017-12-09 03:12:45 +0100 | [diff] [blame] | 64 | } |
| 65 | |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 66 | type component test_CT extends CTRL_Adapter_CT { |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 67 | /* Array of per-BTS state */ |
Harald Welte | 96c9441 | 2017-12-09 03:12:45 +0100 | [diff] [blame] | 68 | var BTS_State bts[NUM_BTS]; |
Harald Welte | 89ab191 | 2018-02-23 18:56:29 +0100 | [diff] [blame] | 69 | /* RSL common Channel Port (for RSL_Emulation) */ |
| 70 | port RSL_CCHAN_PT RSL_CCHAN[NUM_BTS]; |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 71 | /* array of per-BTS RSL test ports */ |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 72 | port IPA_RSL_PT IPA_RSL[NUM_BTS]; |
Stefan Sperling | 830dc9d | 2018-02-12 21:08:28 +0100 | [diff] [blame] | 73 | port IPA_CODEC_PT IPA; /* Required for compilation of TC_rsl_unknown_unit_id() */ |
Harald Welte | a5d2ab2 | 2017-12-09 14:21:42 +0100 | [diff] [blame] | 74 | |
Daniel Willmann | 191e0d9 | 2018-01-17 12:44:35 +0100 | [diff] [blame] | 75 | var MGCP_Emulation_CT vc_MGCP; |
Harald Welte | bc03c76 | 2018-02-12 18:09:38 +0100 | [diff] [blame] | 76 | port TELNETasp_PT BSCVTY; |
Daniel Willmann | 191e0d9 | 2018-01-17 12:44:35 +0100 | [diff] [blame] | 77 | |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 78 | var BSSAP_Adapter g_bssap; |
| 79 | /* for old legacy-tests only */ |
| 80 | port BSSAP_CODEC_PT BSSAP; |
| 81 | |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 82 | /* are we initialized yet */ |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 83 | var boolean g_initialized := false; |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 84 | |
| 85 | /* global test case guard timer */ |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 86 | timer T_guard := 30.0; |
| 87 | |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 88 | } |
| 89 | |
| 90 | modulepar { |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 91 | /* IP address at which the BSC can be reached */ |
Harald Welte | 696ddb6 | 2017-12-08 14:01:43 +0100 | [diff] [blame] | 92 | charstring mp_bsc_ip := "127.0.0.1"; |
Stefan Sperling | 830dc9d | 2018-02-12 21:08:28 +0100 | [diff] [blame] | 93 | /* port number to which to establish the IPA OML connections */ |
| 94 | integer mp_bsc_oml_port := 3002; |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 95 | /* port number to which to establish the IPA RSL connections */ |
Harald Welte | 696ddb6 | 2017-12-08 14:01:43 +0100 | [diff] [blame] | 96 | integer mp_bsc_rsl_port := 3003; |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 97 | /* port number to which to establish the IPA CTRL connection */ |
Harald Welte | 96c9441 | 2017-12-09 03:12:45 +0100 | [diff] [blame] | 98 | integer mp_bsc_ctrl_port := 4249; |
Daniel Willmann | 191e0d9 | 2018-01-17 12:44:35 +0100 | [diff] [blame] | 99 | /* IP address at which the test binds */ |
| 100 | charstring mp_test_ip := "127.0.0.1"; |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 101 | |
| 102 | BSSAP_Configuration mp_bssap_cfg := { |
Harald Welte | 7ef51aa | 2018-04-16 19:16:01 +0200 | [diff] [blame] | 103 | transport := BSSAP_TRANSPORT_AoIP, |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 104 | sccp_service_type := "mtp3_itu", |
| 105 | sctp_addr := { 23905, "127.0.0.1", 2905, "127.0.0.1" }, |
| 106 | own_pc := 185, |
| 107 | own_ssn := 254, |
| 108 | peer_pc := 187, |
| 109 | peer_ssn := 254, |
Philipp Maier | 38d6894 | 2018-03-29 15:38:09 +0200 | [diff] [blame] | 110 | sio := '83'O, |
| 111 | rctx := 0 |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 112 | }; |
| 113 | } |
| 114 | |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame] | 115 | private function f_shutdown_helper() runs on test_CT { |
Harald Welte | 1205547 | 2018-03-17 20:10:08 +0100 | [diff] [blame] | 116 | for (var integer i := 0; i < NUM_BTS; i := i+1) { |
| 117 | if (isbound(bts[i]) and isbound(bts[i].rsl)) { |
| 118 | f_ipa_rsl_stop(bts[i].rsl); |
| 119 | } |
| 120 | } |
| 121 | f_ipa_ctrl_stop(); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame] | 122 | all port.stop; |
| 123 | setverdict(pass); |
| 124 | } |
| 125 | |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 126 | private function f_legacy_bssap_reset() runs on test_CT { |
| 127 | var BSSAP_N_UNITDATA_ind ud_ind; |
| 128 | timer T := 5.0; |
| 129 | BSSAP.send(ts_BSSAP_UNITDATA_req(g_bssap.sccp_addr_peer, g_bssap.sccp_addr_own, ts_BSSMAP_Reset(0))); |
| 130 | T.start; |
| 131 | alt { |
| 132 | [] BSSAP.receive(tr_BSSAP_UNITDATA_ind(g_bssap.sccp_addr_own, g_bssap.sccp_addr_peer, tr_BSSMAP_ResetAck)) { |
| 133 | log("Received RESET-ACK in response to RESET, we're ready to go!"); |
| 134 | } |
| 135 | [] BSSAP.receive(tr_BSSAP_UNITDATA_ind(?, ?, tr_BSSMAP_Reset)) -> value ud_ind { |
| 136 | log("Respoding to inbound RESET with RESET-ACK"); |
| 137 | BSSAP.send(ts_BSSAP_UNITDATA_req(ud_ind.callingAddress, ud_ind.calledAddress, |
| 138 | ts_BSSMAP_ResetAck)); |
| 139 | repeat; |
| 140 | } |
| 141 | [] BSSAP.receive { repeat; } |
| 142 | [] T.timeout { setverdict(fail, "Waiting for RESET-ACK after sending RESET"); } |
| 143 | } |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 144 | } |
| 145 | |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 146 | type record IPA_Client { |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 147 | /* IPA Emulation component reference */ |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 148 | IPA_Emulation_CT vc_IPA, |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 149 | /* Unit-ID and other CCM parameters to use for IPA client emulation */ |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 150 | IPA_CCM_Parameters ccm_pars, |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 151 | /* String identifier for this IPA Client */ |
Harald Welte | 624f963 | 2017-12-16 19:26:04 +0100 | [diff] [blame] | 152 | charstring id, |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 153 | /* Associated RSL Emulation Component (if any). Only used in "Handler mode" */ |
Harald Welte | 624f963 | 2017-12-16 19:26:04 +0100 | [diff] [blame] | 154 | RSL_Emulation_CT vc_RSL optional |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 155 | } |
| 156 | |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 157 | /*! Start the IPA/RSL related bits for one IPA_Client. |
| 158 | * \param clnt IPA_Client for which to establish |
| 159 | * \param bsc_host IP address / hostname of the BSC |
| 160 | * \param bsc_port TCP port number of the BSC |
| 161 | * \param i number identifying this BTS |
| 162 | * \param handler_mode Start an RSL_Emulation_CT component (true) or not (false) */ |
Harald Welte | 624f963 | 2017-12-16 19:26:04 +0100 | [diff] [blame] | 163 | function f_ipa_rsl_start(inout IPA_Client clnt, charstring bsc_host, PortNumber bsc_port, integer i, |
| 164 | boolean handler_mode := false) |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 165 | runs on test_CT { |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 166 | timer T := 10.0; |
| 167 | |
Harald Welte | 96c9441 | 2017-12-09 03:12:45 +0100 | [diff] [blame] | 168 | clnt.id := "IPA" & int2str(i) & "-RSL"; |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 169 | clnt.vc_IPA := IPA_Emulation_CT.create(clnt.id & "-IPA"); |
| 170 | clnt.ccm_pars := c_IPA_default_ccm_pars; |
| 171 | clnt.ccm_pars.name := "Osmocom TTCN-3 BTS Simulator"; |
| 172 | clnt.ccm_pars.unit_id := int2str(1234+i) & "/0/0"; |
Harald Welte | 624f963 | 2017-12-16 19:26:04 +0100 | [diff] [blame] | 173 | if (handler_mode) { |
| 174 | clnt.vc_RSL := RSL_Emulation_CT.create(clnt.id & "-RSL"); |
Harald Welte | 89ab191 | 2018-02-23 18:56:29 +0100 | [diff] [blame] | 175 | connect(clnt.vc_RSL:CCHAN_PT, self:RSL_CCHAN[i]); |
Harald Welte | 624f963 | 2017-12-16 19:26:04 +0100 | [diff] [blame] | 176 | } |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 177 | |
| 178 | map(clnt.vc_IPA:IPA_PORT, system:IPA_CODEC_PT); |
Harald Welte | 624f963 | 2017-12-16 19:26:04 +0100 | [diff] [blame] | 179 | if (handler_mode) { |
| 180 | connect(clnt.vc_IPA:IPA_RSL_PORT, clnt.vc_RSL:IPA_PT); |
| 181 | } else { |
| 182 | connect(clnt.vc_IPA:IPA_RSL_PORT, self:IPA_RSL[i]); |
| 183 | } |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 184 | |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 185 | clnt.vc_IPA.start(IPA_Emulation.main_client(bsc_host, bsc_port, "", 10000+i, clnt.ccm_pars)); |
Harald Welte | 624f963 | 2017-12-16 19:26:04 +0100 | [diff] [blame] | 186 | if (handler_mode) { |
| 187 | clnt.vc_RSL.start(RSL_Emulation.main()); |
| 188 | return; |
| 189 | } |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 190 | |
| 191 | /* wait for IPA RSL link to connect and send ID ACK */ |
| 192 | T.start; |
| 193 | alt { |
| 194 | [] IPA_RSL[i].receive(ASP_IPA_Event:{up_down := ASP_IPA_EVENT_ID_ACK}) { |
| 195 | T.stop; |
| 196 | IPA_RSL[i].send(ts_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,ts_RSL_PAGING_LOAD_IND(23))); |
| 197 | } |
Harald Welte | 60e823a | 2017-12-10 14:10:59 +0100 | [diff] [blame] | 198 | [] IPA_RSL[i].receive(ASP_IPA_Event:?) { repeat } |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 199 | [] IPA_RSL[i].receive { repeat } |
| 200 | [] T.timeout { |
Harald Welte | 96c9441 | 2017-12-09 03:12:45 +0100 | [diff] [blame] | 201 | setverdict(fail, "Timeout RSL waiting for ASP_IPA_EVENT_ID_ACK"); |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 202 | self.stop; |
| 203 | } |
| 204 | } |
| 205 | } |
| 206 | |
Harald Welte | 1205547 | 2018-03-17 20:10:08 +0100 | [diff] [blame] | 207 | function f_ipa_rsl_stop(inout IPA_Client clnt) runs on test_CT { |
| 208 | if (not isbound(clnt) or not isbound(clnt.vc_IPA)) { |
| 209 | return; |
| 210 | } |
| 211 | clnt.vc_IPA.stop; |
| 212 | if (isbound(clnt.vc_RSL)) { |
| 213 | clnt.vc_RSL.stop; |
| 214 | } |
| 215 | } |
| 216 | |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 217 | /* Wait for the OML connection to be brought up by the external osmo-bts-omldummy */ |
Harald Welte | a5d2ab2 | 2017-12-09 14:21:42 +0100 | [diff] [blame] | 218 | function f_wait_oml(integer bts_nr, charstring status, float secs_max) runs on test_CT { |
| 219 | timer T := secs_max; |
| 220 | T.start; |
| 221 | while (true) { |
| 222 | if (f_ctrl_get_bts(IPA_CTRL, bts_nr, "oml-connection-state") == status) { |
| 223 | T.stop; |
Harald Welte | bd868bd | 2017-12-10 18:28:40 +0100 | [diff] [blame] | 224 | /* the 'degraded' state exists from OML connection time, and we have to wait |
| 225 | * until all MO's are initialized */ |
| 226 | T.start(1.0); |
| 227 | T.timeout; |
Harald Welte | a5d2ab2 | 2017-12-09 14:21:42 +0100 | [diff] [blame] | 228 | return; |
| 229 | } |
Harald Welte | f0d6ac6 | 2017-12-17 17:02:21 +0100 | [diff] [blame] | 230 | f_sleep(0.1); |
Harald Welte | a5d2ab2 | 2017-12-09 14:21:42 +0100 | [diff] [blame] | 231 | if (not T.running) { |
| 232 | setverdict(fail, "Timeout waiting for oml-connection-state ", status); |
| 233 | self.stop; |
| 234 | } |
| 235 | } |
| 236 | } |
| 237 | |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 238 | /* global altstep for global guard timer; also takes care of responding RESET witH RESET-ACK */ |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 239 | altstep as_Tguard() runs on test_CT { |
Harald Welte | 60e823a | 2017-12-10 14:10:59 +0100 | [diff] [blame] | 240 | var BSSAP_N_UNITDATA_ind ud_ind; |
Neels Hofmeyr | cc3f76a | 2018-03-12 01:43:25 +0100 | [diff] [blame] | 241 | [] T_guard.timeout { |
| 242 | setverdict(fail, "Timeout of T_guard"); |
| 243 | self.stop; |
| 244 | } |
Harald Welte | 60e823a | 2017-12-10 14:10:59 +0100 | [diff] [blame] | 245 | /* always respond with RESET ACK to RESET */ |
| 246 | [] BSSAP.receive(tr_BSSAP_UNITDATA_ind(?, ?, tr_BSSMAP_Reset)) -> value ud_ind { |
| 247 | BSSAP.send(ts_BSSAP_UNITDATA_req(ud_ind.callingAddress, ud_ind.calledAddress, |
| 248 | ts_BSSMAP_ResetAck)); |
Harald Welte | 69c1c26 | 2017-12-13 21:02:08 +0100 | [diff] [blame] | 249 | repeat; |
Harald Welte | 60e823a | 2017-12-10 14:10:59 +0100 | [diff] [blame] | 250 | } |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 251 | } |
| 252 | |
Neels Hofmeyr | cdc2d76 | 2018-03-12 01:48:11 +0100 | [diff] [blame] | 253 | altstep no_bssmap_reset() runs on test_CT { |
| 254 | [] BSSAP.receive(tr_BSSAP_UNITDATA_ind(?, ?, tr_BSSMAP_Reset)) { |
| 255 | setverdict(fail, "unexpected BSSMAP Reset"); |
| 256 | self.stop; |
| 257 | } |
| 258 | } |
| 259 | |
Daniel Willmann | 191e0d9 | 2018-01-17 12:44:35 +0100 | [diff] [blame] | 260 | function f_init_mgcp(charstring id) runs on test_CT { |
| 261 | id := id & "-MGCP"; |
| 262 | |
| 263 | var MGCPOps ops := { |
| 264 | create_cb := refers(MGCP_Emulation.ExpectedCreateCallback), |
| 265 | unitdata_cb := refers(MGCP_Emulation.DummyUnitdataCallback) |
| 266 | }; |
| 267 | var MGCP_conn_parameters mgcp_pars := { |
| 268 | callagent_ip := mp_bsc_ip, |
Harald Welte | 9e4273e | 2018-01-29 22:01:22 +0100 | [diff] [blame] | 269 | callagent_udp_port := -1, |
Daniel Willmann | 191e0d9 | 2018-01-17 12:44:35 +0100 | [diff] [blame] | 270 | mgw_ip := mp_test_ip, |
| 271 | mgw_udp_port := 2427 |
| 272 | }; |
| 273 | |
| 274 | vc_MGCP := MGCP_Emulation_CT.create(id); |
| 275 | vc_MGCP.start(MGCP_Emulation.main(ops, mgcp_pars, id)); |
| 276 | } |
| 277 | |
Harald Welte | 94e0c34 | 2018-04-07 11:33:23 +0200 | [diff] [blame] | 278 | private function f_init_vty(charstring id := "foo") runs on test_CT { |
| 279 | if (BSCVTY.checkstate("Mapped")) { |
| 280 | /* skip initialization if already executed once */ |
| 281 | return; |
| 282 | } |
Harald Welte | bc03c76 | 2018-02-12 18:09:38 +0100 | [diff] [blame] | 283 | map(self:BSCVTY, system:BSCVTY); |
| 284 | f_vty_set_prompts(BSCVTY); |
| 285 | f_vty_transceive(BSCVTY, "enable"); |
| 286 | } |
| 287 | |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 288 | /* global initialization function |
| 289 | * \param nr_bts Number of BTSs we should start/bring up |
| 290 | * \param handler_mode Start an RSL_Emulation_CT component (true) or not (false) */ |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 291 | function f_init(integer nr_bts := NUM_BTS, boolean handler_mode := false) runs on test_CT { |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 292 | var integer i; |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 293 | |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 294 | if (g_initialized) { |
| 295 | return; |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 296 | } |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 297 | g_initialized := true; |
| 298 | |
| 299 | /* Call a function of our 'parent component' BSSAP_Adapter_CT to start the |
| 300 | * MSC-side BSSAP emulation */ |
Harald Welte | 67089ee | 2018-01-17 22:19:03 +0100 | [diff] [blame] | 301 | if (handler_mode) { |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 302 | f_bssap_init(g_bssap, mp_bssap_cfg, "VirtMSC", MSC_BssmapOps); |
Harald Welte | 4bcbd17 | 2018-05-27 19:47:44 +0200 | [diff] [blame] | 303 | f_bssap_start(g_bssap); |
Harald Welte | 67089ee | 2018-01-17 22:19:03 +0100 | [diff] [blame] | 304 | } else { |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 305 | f_bssap_init(g_bssap, mp_bssap_cfg, "VirtMSC", omit); |
| 306 | connect(self:BSSAP, g_bssap.vc_SCCP:SCCP_SP_PORT); |
Harald Welte | 4bcbd17 | 2018-05-27 19:47:44 +0200 | [diff] [blame] | 307 | f_bssap_start(g_bssap); |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 308 | f_legacy_bssap_reset(); |
Harald Welte | 67089ee | 2018-01-17 22:19:03 +0100 | [diff] [blame] | 309 | } |
Harald Welte | d5833a8 | 2018-05-27 16:52:56 +0200 | [diff] [blame] | 310 | |
Harald Welte | ffe55fc | 2018-01-17 22:39:54 +0100 | [diff] [blame] | 311 | f_ipa_ctrl_start(mp_bsc_ip, mp_bsc_ctrl_port); |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 312 | |
Daniel Willmann | 191e0d9 | 2018-01-17 12:44:35 +0100 | [diff] [blame] | 313 | f_init_mgcp("VirtMSC"); |
Harald Welte | bc03c76 | 2018-02-12 18:09:38 +0100 | [diff] [blame] | 314 | f_init_vty("VirtMSC"); |
Daniel Willmann | 191e0d9 | 2018-01-17 12:44:35 +0100 | [diff] [blame] | 315 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 316 | for (i := 0; i < nr_bts; i := i+1) { |
Harald Welte | a5d2ab2 | 2017-12-09 14:21:42 +0100 | [diff] [blame] | 317 | /* wait until osmo-bts-omldummy has respawned */ |
| 318 | f_wait_oml(i, "degraded", 5.0); |
| 319 | /* start RSL connection */ |
Harald Welte | 624f963 | 2017-12-16 19:26:04 +0100 | [diff] [blame] | 320 | f_ipa_rsl_start(bts[i].rsl, mp_bsc_ip, mp_bsc_rsl_port, i, handler_mode); |
Harald Welte | a5d2ab2 | 2017-12-09 14:21:42 +0100 | [diff] [blame] | 321 | /* wait until BSC tells us "connected" */ |
| 322 | f_wait_oml(i, "connected", 5.0); |
Harald Welte | 696ddb6 | 2017-12-08 14:01:43 +0100 | [diff] [blame] | 323 | } |
| 324 | |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 325 | T_guard.start; |
| 326 | activate(as_Tguard()); |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 327 | } |
| 328 | |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 329 | /* expect to receive a RSL message matching a specified templaten on a given BTS / stream */ |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 330 | function f_exp_ipa_rx(integer bts_nr, template RSL_Message t_rx, float t_secs := 2.0, IpaStreamId sid := IPAC_PROTO_RSL_TRX0) |
| 331 | runs on test_CT return RSL_Message { |
| 332 | var ASP_RSL_Unitdata rx_rsl_ud; |
| 333 | timer T := t_secs; |
| 334 | |
| 335 | T.start; |
| 336 | alt { |
| 337 | [] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(sid, t_rx)) -> value rx_rsl_ud { |
| 338 | T.stop; |
| 339 | } |
| 340 | [] IPA_RSL[bts_nr].receive { repeat; } |
Harald Welte | b291770 | 2017-12-10 15:48:52 +0100 | [diff] [blame] | 341 | [] T.timeout { |
| 342 | setverdict(fail, "Timeout expecting ", t_rx); |
| 343 | self.stop; |
| 344 | } |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 345 | } |
| 346 | return rx_rsl_ud.rsl; |
| 347 | } |
| 348 | |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 349 | /* helper function to transmit RSL on a given BTS/stream */ |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 350 | function f_ipa_tx(integer bts_nr, template RSL_Message t_tx, IpaStreamId sid := IPAC_PROTO_RSL_TRX0) |
| 351 | runs on test_CT { |
| 352 | IPA_RSL[bts_nr].send(ts_ASP_RSL_UD(sid, t_tx)); |
| 353 | } |
| 354 | |
| 355 | |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 356 | /* verify we get a CHAN_ACT after CHAN RQD */ |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 357 | testcase TC_chan_act_noreply() runs on test_CT { |
| 358 | var BSSAP_N_UNITDATA_ind ud_ind; |
Harald Welte | 930d0a7 | 2018-03-22 22:08:40 +0100 | [diff] [blame] | 359 | var RSL_Message rsl_unused; |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 360 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 361 | f_init(1); |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 362 | |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 363 | IPA_RSL[0].send(ts_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,ts_RSL_CHAN_RQD('23'O, 23))); |
Harald Welte | 930d0a7 | 2018-03-22 22:08:40 +0100 | [diff] [blame] | 364 | rsl_unused := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV)); |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 365 | setverdict(pass); |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 366 | } |
| 367 | |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 368 | /* verify if the "chreq:total" counter increments as expected */ |
| 369 | testcase TC_chan_act_counter() runs on test_CT { |
| 370 | var BSSAP_N_UNITDATA_ind ud_ind; |
| 371 | var integer chreq_total; |
Harald Welte | 930d0a7 | 2018-03-22 22:08:40 +0100 | [diff] [blame] | 372 | var RSL_Message rsl_unused; |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 373 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 374 | f_init(1); |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 375 | |
| 376 | chreq_total := f_ctrl_get_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:total"); |
| 377 | IPA_RSL[0].send(ts_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,ts_RSL_CHAN_RQD('23'O, 23))); |
Harald Welte | 930d0a7 | 2018-03-22 22:08:40 +0100 | [diff] [blame] | 378 | rsl_unused := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV)); |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 379 | f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:total", chreq_total+1); |
| 380 | |
| 381 | setverdict(pass); |
| 382 | } |
| 383 | |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 384 | /* CHAN RQD -> CHAN ACT -> CHAN ACT ACK -> RF CHAN REL */ |
| 385 | testcase TC_chan_act_ack_noest() runs on test_CT { |
| 386 | var RSL_Message rx_rsl; |
| 387 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 388 | f_init(1); |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 389 | |
| 390 | /* Send CHAN RQD and wait for allocation; acknowledge it */ |
Harald Welte | d693965 | 2017-12-13 21:02:46 +0100 | [diff] [blame] | 391 | var RslChannelNr chan_nr := f_chreq_act_ack(); |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 392 | |
| 393 | /* expect BSC to disable the channel again if there's no RLL EST IND */ |
| 394 | rx_rsl := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL), T3101_MAX); |
| 395 | |
| 396 | setverdict(pass); |
| 397 | } |
| 398 | |
| 399 | /* Test behavior if MSC never answers to CR */ |
| 400 | testcase TC_chan_act_ack_est_ind_noreply() runs on test_CT { |
Harald Welte | f77aef6 | 2018-01-28 15:35:42 +0100 | [diff] [blame] | 401 | var RslLinkId main_dcch := valueof(ts_RslLinkID_DCCH(0)); |
| 402 | var IpaStreamId sid := IPAC_PROTO_RSL_TRX0; |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 403 | var RSL_Message rx_rsl; |
Harald Welte | f77aef6 | 2018-01-28 15:35:42 +0100 | [diff] [blame] | 404 | var ASP_RSL_Unitdata rx_rsl_ud; |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 405 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 406 | f_init(1); |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 407 | |
| 408 | /* Send CHAN RQD and wait for allocation; acknowledge it */ |
Harald Welte | d693965 | 2017-12-13 21:02:46 +0100 | [diff] [blame] | 409 | var RslChannelNr chan_nr := f_chreq_act_ack(); |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 410 | |
| 411 | var octetstring l3 := '00010203040506'O |
| 412 | f_ipa_tx(0, ts_RSL_EST_IND(chan_nr, valueof(ts_RslLinkID_DCCH(0)), l3)); |
| 413 | |
| 414 | BSSAP.receive(tr_BSSAP_CONNECT_ind(?, ?, tr_BSSMAP_ComplL3(l3))); |
| 415 | |
| 416 | /* expect BSC to disable the channel again if there's no response from MSC */ |
Harald Welte | f77aef6 | 2018-01-28 15:35:42 +0100 | [diff] [blame] | 417 | /* MS waits 20s (T3210) at LU; 10s (T3230) at CM SERV REQ and 5s (T3220) AT detach */ |
| 418 | IPA_RSL[0].clear; |
| 419 | alt { |
| 420 | [] IPA_RSL[0].receive(tr_ASP_RSL_UD(sid, tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL))) -> value rx_rsl_ud { } |
| 421 | [] IPA_RSL[0].receive(tr_ASP_RSL_UD(sid, tr_RSL_REL_REQ(chan_nr, ?))) -> value rx_rsl_ud { |
| 422 | f_ipa_tx(0, ts_RSL_REL_CONF(chan_nr, main_dcch)); |
| 423 | repeat; |
| 424 | } |
| 425 | } |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 426 | |
| 427 | setverdict(pass); |
| 428 | } |
| 429 | |
| 430 | /* Test behavior if MSC answers with CREF to CR */ |
| 431 | testcase TC_chan_act_ack_est_ind_refused() runs on test_CT { |
| 432 | var BSSAP_N_CONNECT_ind rx_c_ind; |
| 433 | var RSL_Message rx_rsl; |
| 434 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 435 | f_init(1); |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 436 | |
| 437 | /* Send CHAN RQD and wait for allocation; acknowledge it */ |
Harald Welte | d693965 | 2017-12-13 21:02:46 +0100 | [diff] [blame] | 438 | var RslChannelNr chan_nr := f_chreq_act_ack(); |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 439 | |
| 440 | var octetstring l3 := '00010203040506'O |
| 441 | f_ipa_tx(0, ts_RSL_EST_IND(chan_nr, valueof(ts_RslLinkID_DCCH(0)), l3)); |
| 442 | |
| 443 | BSSAP.receive(tr_BSSAP_CONNECT_ind(?, ?, tr_BSSMAP_ComplL3(l3))) -> value rx_c_ind; |
| 444 | BSSAP.send(ts_BSSAP_DISC_req(rx_c_ind.connectionId, 0)); |
| 445 | |
| 446 | /* expect BSC to disable the channel */ |
Harald Welte | 725844b | 2018-01-28 16:18:32 +0100 | [diff] [blame] | 447 | f_expect_chan_rel(0, chan_nr); |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 448 | setverdict(pass); |
| 449 | } |
| 450 | |
Harald Welte | 618ef64 | 2017-12-14 14:58:20 +0100 | [diff] [blame] | 451 | /* CHAN RQD -> CHAN ACT -> CHAN ACT NACK -> RF CHAN REL */ |
| 452 | testcase TC_chan_act_nack() runs on test_CT { |
| 453 | var RSL_Message rx_rsl; |
| 454 | var integer chact_nack; |
| 455 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 456 | f_init(1); |
Harald Welte | 618ef64 | 2017-12-14 14:58:20 +0100 | [diff] [blame] | 457 | |
| 458 | chact_nack := f_ctrl_get_ratectr_abs(IPA_CTRL, "bts", 0, "chan_act:nack"); |
| 459 | |
| 460 | f_ipa_tx(0, ts_RSL_CHAN_RQD('33'O, 33)); |
| 461 | rx_rsl := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV)); |
| 462 | var RslChannelNr chan_nr := rx_rsl.ies[0].body.chan_nr; |
| 463 | |
| 464 | f_ipa_tx(0, ts_RSL_CHAN_ACT_NACK(chan_nr, RSL_ERR_EQUIPMENT_FAIL)); |
| 465 | |
| 466 | /* wait for some time to hope the NACK arrives before the CTRL GET below */ |
| 467 | f_sleep(0.5); |
| 468 | |
| 469 | f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "chan_act:nack", chact_nack+1); |
| 470 | |
| 471 | setverdict(pass); |
| 472 | } |
| 473 | |
Harald Welte | 799c97b | 2017-12-14 17:50:30 +0100 | [diff] [blame] | 474 | /* Test for channel exhaustion due to RACH overload */ |
| 475 | testcase TC_chan_exhaustion() runs on test_CT { |
| 476 | var ASP_RSL_Unitdata rsl_ud; |
| 477 | var integer i; |
| 478 | var integer chreq_total, chreq_nochan; |
| 479 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 480 | f_init(1); |
Harald Welte | 799c97b | 2017-12-14 17:50:30 +0100 | [diff] [blame] | 481 | |
| 482 | chreq_total := f_ctrl_get_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:total"); |
| 483 | chreq_nochan := f_ctrl_get_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:no_channel"); |
| 484 | |
| 485 | /* expect 5xTCH/F to succeed */ |
Philipp Maier | cb6cc48 | 2018-03-26 13:08:00 +0200 | [diff] [blame] | 486 | for (i := 0; i < NUM_TCHF_PER_BTS + NUM_TCHH_PER_BTS + NUM_SDCCH_PER_BTS; i := i+1) { |
Harald Welte | 930d0a7 | 2018-03-22 22:08:40 +0100 | [diff] [blame] | 487 | var RslChannelNr chan_nr := f_chreq_act_ack('23'O, i); |
Harald Welte | 799c97b | 2017-12-14 17:50:30 +0100 | [diff] [blame] | 488 | } |
| 489 | |
| 490 | IPA_RSL[0].clear; |
| 491 | |
Harald Welte | dd8cbf3 | 2018-01-28 12:07:52 +0100 | [diff] [blame] | 492 | f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:total", |
Philipp Maier | cb6cc48 | 2018-03-26 13:08:00 +0200 | [diff] [blame] | 493 | chreq_total + NUM_TCHF_PER_BTS + NUM_TCHH_PER_BTS + NUM_SDCCH_PER_BTS); |
Harald Welte | 799c97b | 2017-12-14 17:50:30 +0100 | [diff] [blame] | 494 | |
| 495 | /* now expect additional channel activations to fail */ |
| 496 | f_ipa_tx(0, ts_RSL_CHAN_RQD('42'O, 42)); |
| 497 | |
| 498 | alt { |
| 499 | [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, |
| 500 | tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV))) { |
| 501 | setverdict(fail, "Received CHAN ACT ACK without resources?!?"); |
| 502 | } |
| 503 | [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_IMM_ASSIGN(?))) -> value rsl_ud { |
| 504 | var GsmRrMessage rr; |
| 505 | /* match on IMM ASS REJ */ |
| 506 | rr := dec_GsmRrMessage(rsl_ud.rsl.ies[1].body.full_imm_ass_info.payload); |
| 507 | if (rr.header.message_type == IMMEDIATE_ASSIGNMENT_REJECT) { |
| 508 | f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:total", |
Philipp Maier | cb6cc48 | 2018-03-26 13:08:00 +0200 | [diff] [blame] | 509 | chreq_total + NUM_TCHF_PER_BTS + NUM_TCHH_PER_BTS + NUM_SDCCH_PER_BTS+1); |
Harald Welte | 799c97b | 2017-12-14 17:50:30 +0100 | [diff] [blame] | 510 | f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:no_channel", |
| 511 | chreq_nochan+1); |
| 512 | setverdict(pass); |
| 513 | } else { |
| 514 | repeat; |
| 515 | } |
| 516 | } |
| 517 | [] IPA_RSL[0].receive { repeat; } |
| 518 | } |
| 519 | } |
| 520 | |
Harald Welte | cfe2c96 | 2017-12-15 12:09:32 +0100 | [diff] [blame] | 521 | /*********************************************************************** |
| 522 | * Assignment Testing |
| 523 | ***********************************************************************/ |
| 524 | |
| 525 | /* Verify that the BSC refuses any BSSAP connection from the MSC (They are all BSC->MSC direction) */ |
| 526 | testcase TC_outbound_connect() runs on test_CT { |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 527 | f_init(1); |
Harald Welte | cfe2c96 | 2017-12-15 12:09:32 +0100 | [diff] [blame] | 528 | |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 529 | BSSAP.send(ts_BSSAP_CONNECT_req(g_bssap.sccp_addr_peer, g_bssap.sccp_addr_own, 2342, ts_BSSMAP_AssignmentReq)); |
Harald Welte | cfe2c96 | 2017-12-15 12:09:32 +0100 | [diff] [blame] | 530 | BSSAP.receive(tr_BSSAP_DISC_ind(2342, ?, ?)); |
| 531 | setverdict(pass); |
| 532 | } |
| 533 | |
Harald Welte | 16a4adf | 2017-12-14 18:54:01 +0100 | [diff] [blame] | 534 | /* Test behavior if MSC answers with CREF to CR */ |
| 535 | testcase TC_assignment_cic_only() runs on test_CT { |
| 536 | var BSSAP_N_CONNECT_ind rx_c_ind; |
| 537 | var RSL_Message rx_rsl; |
| 538 | var DchanTuple dt; |
| 539 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 540 | f_init(1); |
Harald Welte | 16a4adf | 2017-12-14 18:54:01 +0100 | [diff] [blame] | 541 | |
| 542 | dt := f_est_dchan('23'O, 23, '00000000'O); |
Harald Welte | 17b27da | 2018-05-25 20:33:53 +0200 | [diff] [blame] | 543 | if (mp_bssap_cfg.transport == BSSAP_TRANSPORT_AoIP) { |
| 544 | /* send assignment without AoIP IEs */ |
| 545 | BSSAP.send(ts_BSSAP_DATA_req(dt.sccp_conn_id, ts_BSSMAP_AssignmentReq(ts_BSSMAP_IE_CIC(0, 1)))); |
| 546 | } else { |
| 547 | /* Send assignmetn without CIC in IPA case */ |
| 548 | var BSSMAP_IE_AoIP_TransportLayerAddress tla := |
| 549 | valueof(ts_BSSMAP_IE_AoIP_TLA4('01020304'O, 2342)); |
| 550 | BSSAP.send(ts_BSSAP_DATA_req(dt.sccp_conn_id, ts_BSSMAP_AssignmentReq(omit, tla))); |
| 551 | } |
Harald Welte | 16a4adf | 2017-12-14 18:54:01 +0100 | [diff] [blame] | 552 | alt { |
| 553 | [] BSSAP.receive(tr_BSSAP_DATA_ind(dt.sccp_conn_id, tr_BSSMAP_AssignmentComplete)) { |
| 554 | setverdict(fail, "AoIP BSC cannot accept ASSIGNMENT without AoIP Transport IE"); |
| 555 | } |
Harald Welte | 235ebf1 | 2017-12-15 14:18:16 +0100 | [diff] [blame] | 556 | /* TODO: Actually expect GSM0808_CAUSE_REQ_A_IF_TYPE_NOT_SUPP */ |
Harald Welte | 16a4adf | 2017-12-14 18:54:01 +0100 | [diff] [blame] | 557 | [] BSSAP.receive(tr_BSSAP_DATA_ind(dt.sccp_conn_id, tr_BSSMAP_AssignmentFail)) { |
| 558 | setverdict(pass); |
| 559 | } |
| 560 | [] BSSAP.receive { repeat; } |
| 561 | } |
| 562 | } |
| 563 | |
Harald Welte | ed84851 | 2018-05-24 22:27:58 +0200 | [diff] [blame] | 564 | /* generate an assignment request for either AoIP or SCCPlite */ |
Harald Welte | e102eae | 2018-05-31 21:03:47 +0200 | [diff] [blame] | 565 | function f_gen_ass_req() return PDU_BSSAP { |
Harald Welte | ed84851 | 2018-05-24 22:27:58 +0200 | [diff] [blame] | 566 | var PDU_BSSAP ass_cmd; |
| 567 | if (mp_bssap_cfg.transport == BSSAP_TRANSPORT_AoIP) { |
| 568 | var BSSMAP_IE_AoIP_TransportLayerAddress tla := |
| 569 | valueof(ts_BSSMAP_IE_AoIP_TLA4('01020304'O, 2342)); |
| 570 | ass_cmd := valueof(ts_BSSMAP_AssignmentReq(omit, tla)); |
| 571 | } else { |
| 572 | var BSSMAP_IE_CircuitIdentityCode cic := valueof(ts_BSSMAP_IE_CIC(0,1)); |
| 573 | ass_cmd := valueof(ts_BSSMAP_AssignmentReq(cic, omit)); |
| 574 | } |
| 575 | return ass_cmd; |
| 576 | } |
| 577 | |
| 578 | /* generate an assignment complete template for either AoIP or SCCPlite */ |
Harald Welte | e102eae | 2018-05-31 21:03:47 +0200 | [diff] [blame] | 579 | function f_gen_exp_compl() return template PDU_BSSAP { |
Harald Welte | ed84851 | 2018-05-24 22:27:58 +0200 | [diff] [blame] | 580 | var template PDU_BSSAP exp_compl; |
| 581 | if (mp_bssap_cfg.transport == BSSAP_TRANSPORT_AoIP) { |
| 582 | exp_compl := tr_BSSMAP_AssignmentComplete(omit, ?); |
| 583 | } else { |
| 584 | /* CIC is optional "*" as the MSC allocated it */ |
| 585 | exp_compl := tr_BSSMAP_AssignmentComplete(*, omit); |
| 586 | } |
| 587 | return exp_compl; |
| 588 | } |
| 589 | |
Harald Welte | 235ebf1 | 2017-12-15 14:18:16 +0100 | [diff] [blame] | 590 | /* Run everything required up to sending a caller-specified assignment command and expect response */ |
| 591 | function f_assignment_exp(PDU_BSSAP ass_cmd, template PDU_BSSAP exp, charstring fail_text) |
| 592 | runs on test_CT { |
| 593 | var BSSAP_N_CONNECT_ind rx_c_ind; |
| 594 | var RSL_Message rx_rsl; |
| 595 | var DchanTuple dt; |
| 596 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 597 | f_init(1); |
Harald Welte | 235ebf1 | 2017-12-15 14:18:16 +0100 | [diff] [blame] | 598 | |
| 599 | dt := f_est_dchan('23'O, 23, '00000000'O); |
| 600 | /* send assignment without AoIP IEs */ |
| 601 | BSSAP.send(ts_BSSAP_DATA_req(dt.sccp_conn_id, ass_cmd)); |
| 602 | alt { |
| 603 | [] BSSAP.receive(tr_BSSAP_DATA_ind(dt.sccp_conn_id, tr_BSSMAP_AssignmentComplete)) { |
| 604 | if (ischosen(exp.pdu.bssmap.assignmentComplete)) { |
| 605 | setverdict(pass); |
| 606 | } else { |
| 607 | setverdict(fail, fail_text); |
| 608 | } |
| 609 | } |
| 610 | [] BSSAP.receive(tr_BSSAP_DATA_ind(dt.sccp_conn_id, tr_BSSMAP_AssignmentFail)) { |
| 611 | if (ischosen(exp.pdu.bssmap.assignmentFailure)) { |
| 612 | setverdict(pass); |
| 613 | } else { |
| 614 | setverdict(fail, fail_text); |
| 615 | } |
| 616 | } |
| 617 | [] BSSAP.receive { repeat; } |
| 618 | } |
| 619 | } |
| 620 | testcase TC_assignment_csd() runs on test_CT { |
| 621 | var template PDU_BSSAP exp_fail := tr_BSSMAP_AssignmentFail; |
Harald Welte | ed84851 | 2018-05-24 22:27:58 +0200 | [diff] [blame] | 622 | var PDU_BSSAP ass_cmd := f_gen_ass_req(); |
Harald Welte | 235ebf1 | 2017-12-15 14:18:16 +0100 | [diff] [blame] | 623 | ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelTypeCSD); |
| 624 | //exp_fail.pdu.bssmap.assignmentFailure.cause.causeValue := int2bit(enum2int(GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_UNAVAIL), 7); |
| 625 | f_assignment_exp(ass_cmd, exp_fail, "BSC accepted Assignment for CSD"); |
| 626 | } |
| 627 | |
| 628 | testcase TC_assignment_ctm() runs on test_CT { |
| 629 | var template PDU_BSSAP exp_fail := tr_BSSMAP_AssignmentFail; |
Harald Welte | ed84851 | 2018-05-24 22:27:58 +0200 | [diff] [blame] | 630 | var PDU_BSSAP ass_cmd := f_gen_ass_req(); |
Harald Welte | 235ebf1 | 2017-12-15 14:18:16 +0100 | [diff] [blame] | 631 | ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelTypeCTM); |
| 632 | //exp_fail.pdu.bssmap.assignmentFailure.cause.causeValue := int2bit(enum2int(GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_UNAVAIL), 7); |
| 633 | f_assignment_exp(ass_cmd, exp_fail, "BSC accepted Assignment for Speech+CTM"); |
| 634 | } |
| 635 | |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 636 | type record DchanTuple { |
| 637 | integer sccp_conn_id, |
| 638 | RslChannelNr rsl_chan_nr |
Harald Welte | a5d2ab2 | 2017-12-09 14:21:42 +0100 | [diff] [blame] | 639 | } |
| 640 | |
Harald Welte | d693965 | 2017-12-13 21:02:46 +0100 | [diff] [blame] | 641 | /* Send CHAN RQD and wait for allocation; acknowledge it */ |
| 642 | private function f_chreq_act_ack(OCT1 ra := '23'O, GsmFrameNumber fn := 23) |
| 643 | runs on test_CT return RslChannelNr { |
| 644 | var RSL_Message rx_rsl; |
| 645 | f_ipa_tx(0, ts_RSL_CHAN_RQD(ra, fn)); |
| 646 | rx_rsl := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV)); |
| 647 | var RslChannelNr chan_nr := rx_rsl.ies[0].body.chan_nr; |
| 648 | f_ipa_tx(0, ts_RSL_CHAN_ACT_ACK(chan_nr, fn+10)); |
| 649 | return chan_nr; |
| 650 | } |
| 651 | |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 652 | /* helper function to establish a dedicated channel via BTS and MSC */ |
| 653 | function f_est_dchan(OCT1 ra, GsmFrameNumber fn, octetstring l3) |
| 654 | runs on test_CT return DchanTuple { |
| 655 | var BSSAP_N_CONNECT_ind rx_c_ind; |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 656 | var DchanTuple dt; |
Harald Welte | a5d2ab2 | 2017-12-09 14:21:42 +0100 | [diff] [blame] | 657 | |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 658 | /* Send CHAN RQD and wait for allocation; acknowledge it */ |
Harald Welte | d693965 | 2017-12-13 21:02:46 +0100 | [diff] [blame] | 659 | dt.rsl_chan_nr := f_chreq_act_ack(ra, fn); |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 660 | |
| 661 | f_ipa_tx(0, ts_RSL_EST_IND(dt.rsl_chan_nr, valueof(ts_RslLinkID_DCCH(0)), l3)); |
| 662 | |
| 663 | BSSAP.receive(tr_BSSAP_CONNECT_ind(?, ?, tr_BSSMAP_ComplL3(l3))) -> value rx_c_ind; |
| 664 | dt.sccp_conn_id := rx_c_ind.connectionId; |
| 665 | BSSAP.send(ts_BSSAP_CONNECT_res(dt.sccp_conn_id)); |
| 666 | |
| 667 | return dt; |
Harald Welte | a5d2ab2 | 2017-12-09 14:21:42 +0100 | [diff] [blame] | 668 | } |
| 669 | |
Harald Welte | 641fcbe | 2018-06-14 10:58:35 +0200 | [diff] [blame] | 670 | /* expect RF CAN REL from BTS, acknowledge it and clear the MSC side */ |
| 671 | private function f_exp_chan_rel_and_clear(DchanTuple dt, integer bts_nr := 0) runs on test_CT { |
| 672 | var RSL_Message rx_rsl; |
| 673 | /* expect BSC to disable the channel */ |
| 674 | rx_rsl := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL), T3101_MAX); |
| 675 | /* respond with CHAN REL ACK */ |
| 676 | f_ipa_tx(0, ts_RSL_RF_CHAN_REL_ACK(dt.rsl_chan_nr)); |
| 677 | |
| 678 | /* expect Clear Complete from BSC */ |
| 679 | BSSAP.receive(tr_BSSAP_DATA_ind(dt.sccp_conn_id, tr_BSSMAP_ClearComplete)); |
| 680 | |
| 681 | /* MSC disconnects as instructed. */ |
| 682 | BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0)); |
| 683 | } |
| 684 | |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 685 | /* Test behavior of channel release after unilateral RLL REL IND (DISC from MS) */ |
| 686 | testcase TC_chan_rel_rll_rel_ind() runs on test_CT { |
Neels Hofmeyr | 27f6436 | 2018-03-12 01:44:00 +0100 | [diff] [blame] | 687 | var BSSAP_N_DATA_ind rx_di; |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 688 | var DchanTuple dt; |
Harald Welte | 96c9441 | 2017-12-09 03:12:45 +0100 | [diff] [blame] | 689 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 690 | f_init(1); |
Harald Welte | 96c9441 | 2017-12-09 03:12:45 +0100 | [diff] [blame] | 691 | |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 692 | dt := f_est_dchan('23'O, 23, '00010203040506'O); |
| 693 | |
| 694 | /* simulate RLL REL IND */ |
| 695 | f_ipa_tx(0, ts_RSL_REL_IND(dt.rsl_chan_nr, valueof(ts_RslLinkID_DCCH(0)))); |
| 696 | |
Neels Hofmeyr | 27f6436 | 2018-03-12 01:44:00 +0100 | [diff] [blame] | 697 | /* expect Clear Request on MSC side */ |
| 698 | BSSAP.receive(tr_BSSAP_DATA_ind(dt.sccp_conn_id, tr_BSSMAP_ClearRequest)) -> value rx_di; |
| 699 | |
| 700 | /* Instruct BSC to clear channel */ |
| 701 | var BssmapCause cause := bit2int(rx_di.userData.pdu.bssmap.clearRequest.cause.causeValue); |
| 702 | BSSAP.send(ts_BSSAP_DATA_req(dt.sccp_conn_id, ts_BSSMAP_ClearCommand(cause))); |
| 703 | |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 704 | /* expect BSC to disable the channel */ |
Harald Welte | 641fcbe | 2018-06-14 10:58:35 +0200 | [diff] [blame] | 705 | f_exp_chan_rel_and_clear(dt, 0); |
Neels Hofmeyr | 27f6436 | 2018-03-12 01:44:00 +0100 | [diff] [blame] | 706 | |
| 707 | /* wait for SCCP emulation to do its job */ |
| 708 | f_sleep(1.0); |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 709 | |
| 710 | setverdict(pass); |
| 711 | } |
| 712 | |
| 713 | /* Test behavior of channel release after CONN FAIL IND from BTS */ |
| 714 | testcase TC_chan_rel_conn_fail() runs on test_CT { |
| 715 | var BSSAP_N_DATA_ind rx_di; |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 716 | var DchanTuple dt; |
| 717 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 718 | f_init(1); |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 719 | |
| 720 | dt := f_est_dchan('23'O, 23, '00010203040506'O); |
| 721 | |
| 722 | /* simulate CONN FAIL IND */ |
Harald Welte | a8ed906 | 2017-12-14 09:46:01 +0100 | [diff] [blame] | 723 | f_ipa_tx(0, ts_RSL_CONN_FAIL_IND(dt.rsl_chan_nr, RSL_ERR_RADIO_LINK_FAIL)); |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 724 | /* TODO: different cause values? */ |
| 725 | |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 726 | /* expect Clear Request from BSC */ |
| 727 | BSSAP.receive(tr_BSSAP_DATA_ind(dt.sccp_conn_id, tr_BSSMAP_ClearRequest)) -> value rx_di; |
| 728 | |
| 729 | /* Instruct BSC to clear channel */ |
| 730 | var BssmapCause cause := bit2int(rx_di.userData.pdu.bssmap.clearRequest.cause.causeValue); |
| 731 | BSSAP.send(ts_BSSAP_DATA_req(dt.sccp_conn_id, ts_BSSMAP_ClearCommand(cause))); |
| 732 | |
Harald Welte | 6ff76ea | 2018-01-28 13:08:01 +0100 | [diff] [blame] | 733 | /* expect BSC to disable the channel */ |
Harald Welte | 641fcbe | 2018-06-14 10:58:35 +0200 | [diff] [blame] | 734 | f_exp_chan_rel_and_clear(dt, 0); |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 735 | |
| 736 | /* wait for SCCP emulation to do its job */ |
| 737 | f_sleep(1.0); |
| 738 | |
| 739 | setverdict(pass); |
| 740 | } |
| 741 | |
Harald Welte | 99f3ca0 | 2018-06-14 13:40:29 +0200 | [diff] [blame] | 742 | /* Test behavior of early CONN FAIL IND from BTS (before EST IND!) */ |
| 743 | /* See also https://www.osmocom.org/issues/3182 */ |
| 744 | testcase TC_early_conn_fail() runs on test_CT { |
| 745 | var RSL_Message rx_rsl; |
| 746 | var DchanTuple dt; |
| 747 | |
| 748 | f_init(1); |
| 749 | |
| 750 | /* BTS->BSC: Send CHAN RQD and wait for allocation; acknowledge it */ |
| 751 | dt.rsl_chan_nr := f_chreq_act_ack(f_rnd_octstring(1), 23); |
| 752 | |
| 753 | /* BTS->BSC: simulate CONN FAIL IND */ |
| 754 | f_ipa_tx(0, ts_RSL_CONN_FAIL_IND(dt.rsl_chan_nr, RSL_ERR_RADIO_LINK_FAIL)); |
| 755 | |
| 756 | /* BTS->BSC: Expect RF channel release from BSC on Abis */ |
| 757 | rx_rsl := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL), 10.0); |
| 758 | |
| 759 | /* BTS<-BSC: respond with CHAN REL ACK */ |
| 760 | f_ipa_tx(0, ts_RSL_RF_CHAN_REL_ACK(dt.rsl_chan_nr)); |
| 761 | |
| 762 | setverdict(pass); |
| 763 | } |
| 764 | |
| 765 | /* Test behavior of late CONN FAIL IND from BTS (ater REL IND!) */ |
| 766 | /* See also https://www.osmocom.org/issues/3182 */ |
| 767 | testcase TC_late_conn_fail() runs on test_CT { |
| 768 | var RSL_Message rx_rsl; |
| 769 | var DchanTuple dt; |
| 770 | |
| 771 | f_init(1); |
| 772 | |
| 773 | dt := f_est_dchan('23'O, 23, '00010203040506'O); |
| 774 | |
| 775 | /* BSC<-MSC: Instruct BSC to clear connection */ |
| 776 | BSSAP.send(ts_BSSAP_DATA_req(dt.sccp_conn_id, ts_BSSMAP_ClearCommand(0))); |
| 777 | |
| 778 | /* BTS->BSC: expect BSC to deactivate SACCH */ |
| 779 | rx_rsl := f_exp_ipa_rx(0, tr_RSL_DEACT_SACCH(dt.rsl_chan_nr)); |
| 780 | |
| 781 | /* BTS->BSC: simulate a late CONN FAIL IND from BTS */ |
| 782 | f_ipa_tx(0, ts_RSL_CONN_FAIL_IND(dt.rsl_chan_nr, RSL_ERR_RADIO_LINK_FAIL)); |
| 783 | |
| 784 | /* BTS<-BSC: Expect RF channel release from BSC on Abis */ |
| 785 | rx_rsl := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL), 10.0); |
| 786 | /* BTS->BSC: respond with CHAN REL ACK */ |
| 787 | f_ipa_tx(0, ts_RSL_RF_CHAN_REL_ACK(dt.rsl_chan_nr)); |
| 788 | |
| 789 | /* BSC->MSC: expect Clear Complete from BSC */ |
| 790 | BSSAP.receive(tr_BSSAP_DATA_ind(dt.sccp_conn_id, tr_BSSMAP_ClearComplete)); |
| 791 | |
| 792 | /* BSC<-MSC: MSC disconnects as requested. */ |
| 793 | BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0)); |
| 794 | |
| 795 | setverdict(pass); |
| 796 | } |
| 797 | |
Harald Welte | 91d54a5 | 2018-01-28 15:35:07 +0100 | [diff] [blame] | 798 | function f_expect_chan_rel(integer bts_nr, RslChannelNr rsl_chan_nr, boolean flush := true, |
| 799 | boolean handle_rll_rel := true) runs on test_CT { |
| 800 | |
| 801 | var RslLinkId main_dcch := valueof(ts_RslLinkID_DCCH(0)); |
| 802 | if (flush) { |
| 803 | /* Clear the queue, it might still contain stuff like IMMEDIATE ASSIGN */ |
| 804 | IPA_RSL[bts_nr].clear; |
| 805 | } |
| 806 | alt { |
| 807 | /* ignore DEACTIVATE SACCH (if any) */ |
| 808 | [] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, |
| 809 | tr_RSL_DEACT_SACCH(rsl_chan_nr))) { |
| 810 | repeat; |
| 811 | } |
| 812 | /* acknowledge RLL release (if any)*/ |
| 813 | [handle_rll_rel] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, |
| 814 | tr_RSL_REL_REQ(rsl_chan_nr, ?))) { |
| 815 | /* FIXME: Why are we getting this for LinkID SACCH? */ |
| 816 | f_ipa_tx(0, ts_RSL_REL_CONF(rsl_chan_nr, main_dcch)); |
| 817 | repeat; |
| 818 | } |
Neels Hofmeyr | 92d4842 | 2018-06-14 04:05:07 +0200 | [diff] [blame] | 819 | [not handle_rll_rel] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, |
| 820 | tr_RSL_REL_REQ(rsl_chan_nr, ?))) { |
| 821 | /* Do not reply, just continue */ |
| 822 | repeat; |
| 823 | } |
Harald Welte | 91d54a5 | 2018-01-28 15:35:07 +0100 | [diff] [blame] | 824 | /* Expect RF channel release from BSC on Abis */ |
| 825 | [] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, |
| 826 | tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL))) { |
| 827 | /* respond with CHAN REL ACK */ |
| 828 | f_ipa_tx(0, ts_RSL_RF_CHAN_REL_ACK(rsl_chan_nr)); |
| 829 | } |
| 830 | /* ignore any user data */ |
| 831 | [] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_MsgTypeR(?))) { |
| 832 | repeat; |
| 833 | } |
| 834 | } |
| 835 | } |
| 836 | |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 837 | /* Test behavior of channel release after hard Clear Command from MSC */ |
| 838 | testcase TC_chan_rel_hard_clear() runs on test_CT { |
| 839 | var BSSAP_N_DATA_ind rx_di; |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 840 | var DchanTuple dt; |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 841 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 842 | f_init(1); |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 843 | |
| 844 | dt := f_est_dchan('23'O, 23, '00010203040506'O); |
| 845 | |
| 846 | /* Instruct BSC to clear channel */ |
| 847 | var BssmapCause cause := 0; |
| 848 | BSSAP.send(ts_BSSAP_DATA_req(dt.sccp_conn_id, ts_BSSMAP_ClearCommand(cause))); |
| 849 | |
| 850 | /* expect Clear Complete from BSC on A */ |
| 851 | BSSAP.receive(tr_BSSAP_DATA_ind(dt.sccp_conn_id, tr_BSSMAP_ClearComplete)) { |
| 852 | /* release the SCCP connection */ |
| 853 | BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0)); |
| 854 | } |
| 855 | |
Harald Welte | 91d54a5 | 2018-01-28 15:35:07 +0100 | [diff] [blame] | 856 | f_expect_chan_rel(0, dt.rsl_chan_nr); |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 857 | setverdict(pass); |
| 858 | } |
| 859 | |
Harald Welte | d8c36cd | 2017-12-09 23:05:31 +0100 | [diff] [blame] | 860 | /* Test behavior of channel release after hard RLSD from MSC */ |
| 861 | testcase TC_chan_rel_hard_rlsd() runs on test_CT { |
Harald Welte | d8c36cd | 2017-12-09 23:05:31 +0100 | [diff] [blame] | 862 | var DchanTuple dt; |
Harald Welte | d8c36cd | 2017-12-09 23:05:31 +0100 | [diff] [blame] | 863 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 864 | f_init(1); |
Harald Welte | d8c36cd | 2017-12-09 23:05:31 +0100 | [diff] [blame] | 865 | |
| 866 | dt := f_est_dchan('23'O, 23, '00010203040506'O); |
| 867 | |
| 868 | /* release the SCCP connection */ |
| 869 | BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0)); |
| 870 | |
Harald Welte | 91d54a5 | 2018-01-28 15:35:07 +0100 | [diff] [blame] | 871 | f_expect_chan_rel(0, dt.rsl_chan_nr); |
Harald Welte | d8c36cd | 2017-12-09 23:05:31 +0100 | [diff] [blame] | 872 | setverdict(pass); |
| 873 | } |
| 874 | |
Harald Welte | 550daf9 | 2018-06-11 19:22:13 +0200 | [diff] [blame] | 875 | /* Test behavior of channel release after hard RLSD from MSC and MS is not responding to RLL REL REQ */ |
| 876 | testcase TC_chan_rel_hard_rlsd_ms_dead() runs on test_CT { |
| 877 | var DchanTuple dt; |
| 878 | |
| 879 | f_init(1); |
| 880 | |
| 881 | dt := f_est_dchan('23'O, 23, '00010203040506'O); |
| 882 | |
| 883 | /* release the SCCP connection */ |
| 884 | BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0)); |
| 885 | |
| 886 | f_expect_chan_rel(0, dt.rsl_chan_nr, true, false); |
| 887 | setverdict(pass); |
| 888 | } |
| 889 | |
Harald Welte | 85804d4 | 2017-12-10 14:11:58 +0100 | [diff] [blame] | 890 | /* Test behavior of channel release after BSSMAP RESET from MSC */ |
| 891 | testcase TC_chan_rel_a_reset() runs on test_CT { |
Harald Welte | 85804d4 | 2017-12-10 14:11:58 +0100 | [diff] [blame] | 892 | var DchanTuple dt; |
Harald Welte | 85804d4 | 2017-12-10 14:11:58 +0100 | [diff] [blame] | 893 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 894 | f_init(1); |
Harald Welte | 85804d4 | 2017-12-10 14:11:58 +0100 | [diff] [blame] | 895 | |
| 896 | dt := f_est_dchan('23'O, 23, '00010203040506'O); |
| 897 | |
| 898 | /* Clear the queue, it might still contain stuff like IMMEDIATE ASSIGN */ |
| 899 | IPA_RSL[0].clear; |
| 900 | |
| 901 | /* perform BSSAP RESET, expect RESET ACK and DISC.ind on connection */ |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 902 | BSSAP.send(ts_BSSAP_UNITDATA_req(g_bssap.sccp_addr_peer, g_bssap.sccp_addr_own, ts_BSSMAP_Reset(0))); |
Harald Welte | 85804d4 | 2017-12-10 14:11:58 +0100 | [diff] [blame] | 903 | interleave { |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 904 | [] BSSAP.receive(tr_BSSAP_UNITDATA_ind(g_bssap.sccp_addr_own, g_bssap.sccp_addr_peer, tr_BSSMAP_ResetAck)) { } |
Harald Welte | 85804d4 | 2017-12-10 14:11:58 +0100 | [diff] [blame] | 905 | [] BSSAP.receive(tr_BSSAP_DISC_ind(dt.sccp_conn_id, ?, ?)) { } |
| 906 | } |
| 907 | |
Philipp Maier | e8f38ed | 2018-02-09 10:30:31 +0100 | [diff] [blame] | 908 | f_expect_chan_rel(0, dt.rsl_chan_nr, false); |
Harald Welte | 85804d4 | 2017-12-10 14:11:58 +0100 | [diff] [blame] | 909 | setverdict(pass); |
| 910 | } |
| 911 | |
Harald Welte | 5cd20ed | 2017-12-13 21:03:20 +0100 | [diff] [blame] | 912 | /* Test behavior if RSL EST IND for non-active channel */ |
| 913 | testcase TC_rll_est_ind_inact_lchan() runs on test_CT { |
| 914 | timer T := 2.0; |
| 915 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 916 | f_init(1); |
Harald Welte | 5cd20ed | 2017-12-13 21:03:20 +0100 | [diff] [blame] | 917 | |
| 918 | var octetstring l3 := '00010203040506'O; |
| 919 | var RslChannelNr chan_nr := valueof(t_RslChanNr_Bm(6)); |
| 920 | f_ipa_tx(0, ts_RSL_EST_IND(chan_nr, valueof(ts_RslLinkID_DCCH(0)), l3)); |
| 921 | |
| 922 | T.start; |
| 923 | alt { |
| 924 | [] BSSAP.receive(tr_BSSAP_CONNECT_ind(?, ?, tr_BSSMAP_ComplL3(l3))) { |
| 925 | setverdict(fail, "MSC received COMPL L3 for non-active lchan"); |
| 926 | } |
| 927 | [] BSSAP.receive {} |
| 928 | [] IPA_RSL[0].receive {} |
| 929 | [] T.timeout {} |
| 930 | } |
| 931 | |
| 932 | setverdict(pass); |
| 933 | } |
| 934 | |
| 935 | /* Test behavior if RSL EST IND for invalid SAPI */ |
| 936 | testcase TC_rll_est_ind_inval_sapi1() runs on test_CT { |
| 937 | var RslChannelNr chan_nr; |
| 938 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 939 | f_init(1); |
Harald Welte | 5cd20ed | 2017-12-13 21:03:20 +0100 | [diff] [blame] | 940 | |
| 941 | chan_nr := f_chreq_act_ack() |
| 942 | |
| 943 | var octetstring l3 := '00010203040506'O; |
| 944 | f_ipa_tx(0, ts_RSL_EST_IND(chan_nr, valueof(ts_RslLinkID_DCCH(1)), l3)); |
| 945 | |
| 946 | timer T := 2.0; |
| 947 | T.start; |
| 948 | alt { |
| 949 | [] BSSAP.receive(tr_BSSAP_CONNECT_ind(?, ?, tr_BSSMAP_ComplL3(l3))) { |
| 950 | setverdict(fail, "MSC received COMPL L3 for invalid SAPI 1"); |
| 951 | } |
| 952 | [] BSSAP.receive { repeat; } |
| 953 | [] IPA_RSL[0].receive { repeat; } |
| 954 | [] T.timeout {} |
| 955 | } |
| 956 | |
| 957 | setverdict(pass); |
| 958 | } |
| 959 | |
| 960 | /* Test behavior if RSL EST IND for invalid SAPI */ |
| 961 | testcase TC_rll_est_ind_inval_sapi3() runs on test_CT { |
| 962 | timer T := 2.0; |
| 963 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 964 | f_init(1); |
Harald Welte | 5cd20ed | 2017-12-13 21:03:20 +0100 | [diff] [blame] | 965 | |
| 966 | var RslChannelNr chan_nr := f_chreq_act_ack(); |
| 967 | |
| 968 | var octetstring l3 := '00010203040506'O; |
| 969 | f_ipa_tx(0, ts_RSL_EST_IND(chan_nr, valueof(ts_RslLinkID_DCCH(3)), l3)); |
| 970 | |
| 971 | T.start; |
| 972 | alt { |
| 973 | [] BSSAP.receive(tr_BSSAP_CONNECT_ind(?, ?, tr_BSSMAP_ComplL3(l3))) { |
| 974 | setverdict(fail, "MSC received COMPL L3 for invalid SAPI 3"); |
| 975 | } |
| 976 | [] BSSAP.receive { repeat; } |
| 977 | [] IPA_RSL[0].receive { repeat; } |
| 978 | [] T.timeout {} |
| 979 | } |
| 980 | |
| 981 | setverdict(pass); |
| 982 | } |
| 983 | |
| 984 | /* Test behavior if RSL EST IND for invalid SACCH */ |
| 985 | testcase TC_rll_est_ind_inval_sacch() runs on test_CT { |
| 986 | timer T := 2.0; |
| 987 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 988 | f_init(1); |
Harald Welte | 5cd20ed | 2017-12-13 21:03:20 +0100 | [diff] [blame] | 989 | |
| 990 | var RslChannelNr chan_nr := f_chreq_act_ack(); |
| 991 | |
| 992 | var octetstring l3 := '00010203040506'O; |
| 993 | f_ipa_tx(0, ts_RSL_EST_IND(chan_nr, valueof(ts_RslLinkID_SACCH(0)), l3)); |
| 994 | |
| 995 | T.start; |
| 996 | alt { |
| 997 | [] BSSAP.receive(tr_BSSAP_CONNECT_ind(?, ?, tr_BSSMAP_ComplL3(l3))) { |
| 998 | setverdict(fail, "MSC received COMPL L3 for invalid Link SACCH"); |
| 999 | } |
| 1000 | [] BSSAP.receive { repeat; } |
| 1001 | [] IPA_RSL[0].receive { repeat; } |
| 1002 | [] T.timeout {} |
| 1003 | } |
| 1004 | |
| 1005 | setverdict(pass); |
| 1006 | } |
| 1007 | |
| 1008 | |
| 1009 | |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 1010 | |
| 1011 | testcase TC_ctrl_msc_connection_status() runs on test_CT { |
| 1012 | var charstring ctrl_resp; |
| 1013 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 1014 | f_init(1); |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 1015 | |
| 1016 | /* See https://osmocom.org/issues/2729 */ |
| 1017 | f_ctrl_get_exp(IPA_CTRL, "msc_connection_status", "connected"); |
| 1018 | setverdict(pass); |
| 1019 | } |
| 1020 | |
Stefan Sperling | b041b3d | 2018-01-03 17:14:55 +0100 | [diff] [blame] | 1021 | testcase TC_ctrl_msc0_connection_status() runs on test_CT { |
| 1022 | var charstring ctrl_resp; |
| 1023 | |
| 1024 | f_init(1); |
Stefan Sperling | b041b3d | 2018-01-03 17:14:55 +0100 | [diff] [blame] | 1025 | |
| 1026 | f_ctrl_get_exp(IPA_CTRL, "msc.0.connection_status", "connected"); |
| 1027 | setverdict(pass); |
| 1028 | } |
| 1029 | |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 1030 | testcase TC_ctrl() runs on test_CT { |
| 1031 | var charstring ctrl_resp; |
| 1032 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 1033 | f_init(1); |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 1034 | |
| 1035 | /* all below values must match the osmo-bsc.cfg config file used */ |
| 1036 | |
Harald Welte | 6a12969 | 2018-03-17 17:30:14 +0100 | [diff] [blame] | 1037 | f_ctrl_get_exp(IPA_CTRL, "mcc", "001"); |
| 1038 | f_ctrl_get_exp(IPA_CTRL, "mnc", "01"); |
Harald Welte | 44bdaa5 | 2017-12-17 17:01:47 +0100 | [diff] [blame] | 1039 | f_ctrl_get_exp(IPA_CTRL, "number-of-bts", "3"); |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 1040 | |
| 1041 | var integer bts_nr := 0; |
| 1042 | f_ctrl_get_exp_bts(IPA_CTRL, bts_nr, "location-area-code", "1"); |
| 1043 | f_ctrl_get_exp_bts(IPA_CTRL, bts_nr, "cell-identity", "0"); |
| 1044 | f_ctrl_get_exp_bts(IPA_CTRL, bts_nr, "oml-connection-state", "connected"); |
| 1045 | f_ctrl_get_exp_bts(IPA_CTRL, bts_nr, "gprs-mode", "gprs"); |
| 1046 | f_ctrl_get_exp_bts(IPA_CTRL, bts_nr, "rf_state", "operational,unlocked,on"); |
| 1047 | f_ctrl_get_exp_trx(IPA_CTRL, bts_nr, 0, "arfcn", "871"); |
| 1048 | f_ctrl_get_exp_trx(IPA_CTRL, bts_nr, 0, "max-power-reduction", "20"); |
| 1049 | |
| 1050 | var integer uptime := str2int(f_ctrl_get_bts(IPA_CTRL, bts_nr, "oml-uptime")); |
| 1051 | f_sleep(2.0); |
| 1052 | if (str2int(f_ctrl_get_bts(IPA_CTRL, bts_nr, "oml-uptime")) < uptime+1) { |
| 1053 | setverdict(fail, "oml-uptime not incrementing as expected"); |
| 1054 | } |
| 1055 | /* TODO: Disconnect RSL, imply that OML is disconnected and check for uptime zero? */ |
| 1056 | |
| 1057 | f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bsc", 0, "paging:attempted", 0); |
| 1058 | |
| 1059 | setverdict(pass); |
Harald Welte | 96c9441 | 2017-12-09 03:12:45 +0100 | [diff] [blame] | 1060 | } |
| 1061 | |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1062 | function f_bssap_tx_ud(template PDU_BSSAP bssap) runs on test_CT { |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 1063 | BSSAP.send(ts_BSSAP_UNITDATA_req(g_bssap.sccp_addr_peer, g_bssap.sccp_addr_own, bssap)); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1064 | } |
| 1065 | |
| 1066 | |
| 1067 | /*********************************************************************** |
| 1068 | * Paging Testing |
| 1069 | ***********************************************************************/ |
| 1070 | |
| 1071 | type record Cell_Identity { |
| 1072 | GsmMcc mcc, |
| 1073 | GsmMnc mnc, |
| 1074 | GsmLac lac, |
| 1075 | GsmCellId ci |
| 1076 | }; |
Harald Welte | 24135bd | 2018-03-17 19:27:53 +0100 | [diff] [blame] | 1077 | private const Cell_Identity cid := { '001'H, '01'H, 1, 0 }; |
Stefan Sperling | 049a86e | 2018-03-20 15:51:00 +0100 | [diff] [blame] | 1078 | private const Cell_Identity unknown_cid := { '678'H, 'f90'H, 1, 0 }; |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1079 | |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1080 | type set of integer BtsIdList; |
| 1081 | |
| 1082 | private function f_bts_in_list(integer bts_id, BtsIdList bts_ids) return boolean { |
| 1083 | for (var integer j := 0; j < sizeof(bts_ids); j := j + 1) { |
| 1084 | if (bts_id == bts_ids[j]) { |
| 1085 | return true; |
| 1086 | } |
| 1087 | } |
| 1088 | return false; |
| 1089 | } |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1090 | |
| 1091 | /* core paging test helper function; used by most paging test cases */ |
| 1092 | private function f_pageing_helper(hexstring imsi, |
| 1093 | template BSSMAP_FIELD_CellIdentificationList cid_list, |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1094 | BtsIdList bts_ids := { 0 }, |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1095 | template RSL_ChanNeeded rsl_chneed := omit, |
| 1096 | template OCT4 tmsi := omit) runs on test_CT |
| 1097 | { |
| 1098 | var template BSSMAP_IE_ChannelNeeded bssmap_chneed; |
| 1099 | var MobileIdentity mi; |
| 1100 | var template octetstring id_enc; /* FIXME */ |
| 1101 | var RSL_Message rx_rsl; |
| 1102 | var integer paging_group := hex2int(imsi[lengthof(imsi)-1]); |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1103 | var integer i; |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1104 | |
| 1105 | f_init(); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1106 | |
| 1107 | /* Clear the queue, it might still contain stuff like BCCH FILLING */ |
Harald Welte | c306859 | 2018-03-17 19:55:31 +0100 | [diff] [blame] | 1108 | for (i := 0; i < NUM_BTS; i := i + 1) { |
| 1109 | IPA_RSL[i].clear; |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1110 | } |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1111 | |
| 1112 | if (isvalue(rsl_chneed)) { |
| 1113 | /* The values of 08.08 3.2.2.36 and 08.58 9.3.40 are luckily identical */ |
| 1114 | bssmap_chneed := ts_BSSMAP_IE_ChanNeeded(int2bit(enum2int(valueof(rsl_chneed)),2)); |
| 1115 | } else { |
| 1116 | bssmap_chneed := omit; |
| 1117 | } |
| 1118 | |
| 1119 | f_bssap_tx_ud(ts_BSSMAP_Paging(imsi, cid_list, tmsi, bssmap_chneed)); |
| 1120 | |
| 1121 | /* FIXME: Disabled due to bugs in both GSM_RR_Types and MobileL3_CommonIE_Types IMSI encoder |
| 1122 | if (isvalue(tmsi)) { |
| 1123 | mi := valueof(t_Osmo_MI_TMSI(oct2int(valueof(tmsi)))); |
| 1124 | } else { |
| 1125 | mi := valueof(ts_Osmo_MI_IMSI(imsi)); |
| 1126 | } |
| 1127 | id_enc := enc_MobileIdentity(mi); |
| 1128 | */ |
| 1129 | id_enc := ?; |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1130 | for (i := 0; i < sizeof(bts_ids); i := i + 1) { |
| 1131 | rx_rsl := f_exp_ipa_rx(bts_ids[i], tr_RSL_PAGING_CMD(id_enc)); |
| 1132 | /* check channel type, paging group */ |
| 1133 | if (rx_rsl.ies[1].body.paging_group != paging_group) { |
| 1134 | setverdict(fail, "Paging for wrong paging group"); |
| 1135 | } |
| 1136 | if (ispresent(rsl_chneed) and |
| 1137 | rx_rsl.ies[3].body.chan_needed.chan_needed != valueof(rsl_chneed)) { |
| 1138 | setverdict(fail, "RSL Channel Needed != BSSMAP Channel Needed"); |
| 1139 | } |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1140 | } |
Harald Welte | 2fccd98 | 2018-01-31 15:48:19 +0100 | [diff] [blame] | 1141 | f_sleep(2.0); |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1142 | /* do a quick check on all not-included BTSs if they received paging */ |
| 1143 | for (i := 0; i < NUM_BTS; i := i + 1) { |
| 1144 | timer T := 0.1; |
| 1145 | if (f_bts_in_list(i, bts_ids)) { |
| 1146 | continue; |
| 1147 | } |
| 1148 | T.start; |
| 1149 | alt { |
| 1150 | [] IPA_RSL[i].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_PAGING_CMD(id_enc))) { |
| 1151 | setverdict(fail, "Paging on BTS ", i, " which is not part of ", bts_ids); |
| 1152 | } |
| 1153 | [] IPA_RSL[i].receive { repeat; } |
| 1154 | [] T.timeout { } |
| 1155 | } |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1156 | } |
| 1157 | |
| 1158 | setverdict(pass); |
| 1159 | } |
| 1160 | |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1161 | const BtsIdList c_BtsId_all := { 0, 1, 2 }; |
Harald Welte | 751d3eb | 2018-01-31 15:51:06 +0100 | [diff] [blame] | 1162 | const BtsIdList c_BtsId_none := { }; |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1163 | const BtsIdList c_BtsId_LAC1 := { 0, 1 }; |
| 1164 | const BtsIdList c_BtsId_LAC2 := { 2 }; |
| 1165 | |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1166 | /* PAGING by IMSI + TMSI */ |
| 1167 | testcase TC_paging_imsi_nochan() runs on test_CT { |
| 1168 | var BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1169 | cid_list := valueof(ts_BSSMAP_CIL_noCell); |
Philipp Maier | 8c04b0a | 2018-02-23 13:48:48 +0100 | [diff] [blame] | 1170 | f_pageing_helper('001010100000001'H, cid_list, c_BtsId_all, omit, omit); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame] | 1171 | f_shutdown_helper(); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1172 | } |
| 1173 | |
| 1174 | /* PAGING by IMSI + TMSI */ |
| 1175 | testcase TC_paging_tmsi_nochan() runs on test_CT { |
| 1176 | var BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1177 | cid_list := valueof(ts_BSSMAP_CIL_noCell); |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1178 | f_pageing_helper('001010100000001'H, cid_list, c_BtsId_all, omit, 'A1B2C301'O); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame] | 1179 | f_shutdown_helper(); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1180 | } |
| 1181 | |
| 1182 | /* Paging with different "channel needed' values */ |
| 1183 | testcase TC_paging_tmsi_any() runs on test_CT { |
| 1184 | var BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1185 | cid_list := valueof(ts_BSSMAP_CIL_noCell); |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1186 | f_pageing_helper('001010100000002'H, cid_list, c_BtsId_all, RSL_CHANNEED_ANY, 'A1B2C302'O); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame] | 1187 | f_shutdown_helper(); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1188 | } |
| 1189 | testcase TC_paging_tmsi_sdcch() runs on test_CT { |
| 1190 | var BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1191 | cid_list := valueof(ts_BSSMAP_CIL_noCell); |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1192 | f_pageing_helper('001010100000003'H, cid_list, c_BtsId_all, RSL_CHANNEED_SDCCH, 'A1B2C303'O); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame] | 1193 | f_shutdown_helper(); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1194 | } |
| 1195 | testcase TC_paging_tmsi_tch_f() runs on test_CT { |
| 1196 | var BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1197 | cid_list := valueof(ts_BSSMAP_CIL_noCell); |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1198 | f_pageing_helper('001010000000004'H, cid_list, c_BtsId_all, RSL_CHANNEED_TCH_F, 'A1B2C304'O); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame] | 1199 | f_shutdown_helper(); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1200 | } |
| 1201 | testcase TC_paging_tmsi_tch_hf() runs on test_CT { |
| 1202 | var BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1203 | cid_list := valueof(ts_BSSMAP_CIL_noCell); |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1204 | f_pageing_helper('001010000000005'H, cid_list, c_BtsId_all, RSL_CHANNEED_TCH_ForH, 'A1B2C305'O); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame] | 1205 | f_shutdown_helper(); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1206 | } |
| 1207 | |
| 1208 | /* Paging by CGI */ |
| 1209 | testcase TC_paging_imsi_nochan_cgi() runs on test_CT { |
| 1210 | var template BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1211 | cid_list := { cIl_CGI := { ts_BSSMAP_CI_CGI(cid.mcc, cid.mnc, cid.lac, cid.ci) } }; |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1212 | f_pageing_helper('001010000000006'H, cid_list, { 0 }); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame] | 1213 | f_shutdown_helper(); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1214 | } |
| 1215 | |
| 1216 | /* Paging by LAC+CI */ |
| 1217 | testcase TC_paging_imsi_nochan_lac_ci() runs on test_CT { |
| 1218 | var template BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1219 | cid_list := { cIl_LAC_CI := { ts_BSSMAP_CI_LAC_CI(cid.lac, cid.ci) } }; |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1220 | f_pageing_helper('001010000000007'H, cid_list, { 0 }); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame] | 1221 | f_shutdown_helper(); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1222 | } |
| 1223 | |
| 1224 | /* Paging by CI */ |
| 1225 | testcase TC_paging_imsi_nochan_ci() runs on test_CT { |
| 1226 | var template BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1227 | cid_list := { cIl_CI := { ts_BSSMAP_CI_CI(cid.ci) } }; |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1228 | f_pageing_helper('001010000000008'H, cid_list, { 0 }); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame] | 1229 | f_shutdown_helper(); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1230 | } |
| 1231 | |
| 1232 | /* Paging by LAI */ |
| 1233 | testcase TC_paging_imsi_nochan_lai() runs on test_CT { |
| 1234 | var template BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1235 | cid_list := { cIl_LAI := { ts_BSSMAP_CI_LAI(cid.mcc, cid.mnc, cid.lac) } }; |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1236 | f_pageing_helper('001010000000009'H, cid_list, c_BtsId_LAC1); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame] | 1237 | f_shutdown_helper(); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1238 | } |
| 1239 | |
| 1240 | /* Paging by LAC */ |
| 1241 | testcase TC_paging_imsi_nochan_lac() runs on test_CT { |
| 1242 | var template BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1243 | cid_list := { cIl_LAC := { ts_BSSMAP_CI_LAC(cid.lac) } }; |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1244 | f_pageing_helper('001010000000010'H, cid_list, c_BtsId_LAC1); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame] | 1245 | f_shutdown_helper(); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1246 | } |
| 1247 | |
| 1248 | /* Paging by "all in BSS" */ |
| 1249 | testcase TC_paging_imsi_nochan_all() runs on test_CT { |
| 1250 | var template BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1251 | cid_list := { cIl_allInBSS := ''O }; |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1252 | f_pageing_helper('001010000000011'H, cid_list, c_BtsId_all); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame] | 1253 | f_shutdown_helper(); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1254 | } |
| 1255 | |
Stefan Sperling | 7b5e178 | 2018-03-20 19:32:43 +0100 | [diff] [blame] | 1256 | /* Paging by PLMN+LAC+RNC; We do not implement this; Verify nothing is paged */ |
Harald Welte | 751d3eb | 2018-01-31 15:51:06 +0100 | [diff] [blame] | 1257 | testcase TC_paging_imsi_nochan_plmn_lac_rnc() runs on test_CT { |
| 1258 | var template BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1259 | cid_list := { cIl_PLMN_LAC_RNC := { ts_BSSMAP_CI_PLMN_LAC_RNC(cid.mcc, cid.mnc, cid.lac, 12) } }; |
Stefan Sperling | 7b5e178 | 2018-03-20 19:32:43 +0100 | [diff] [blame] | 1260 | f_pageing_helper('001010000000012'H, cid_list, c_BtsId_none); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame] | 1261 | f_shutdown_helper(); |
Harald Welte | 751d3eb | 2018-01-31 15:51:06 +0100 | [diff] [blame] | 1262 | } |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1263 | |
Stefan Sperling | 7b5e178 | 2018-03-20 19:32:43 +0100 | [diff] [blame] | 1264 | /* Paging by RNC; We do not implement this; Verify nothing is paged */ |
Harald Welte | 751d3eb | 2018-01-31 15:51:06 +0100 | [diff] [blame] | 1265 | testcase TC_paging_imsi_nochan_rnc() runs on test_CT { |
| 1266 | var template BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1267 | cid_list := { cIl_RNC := { int2oct(13, 2) } }; |
Stefan Sperling | 7b5e178 | 2018-03-20 19:32:43 +0100 | [diff] [blame] | 1268 | f_pageing_helper('001010000000013'H, cid_list, c_BtsId_none); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame] | 1269 | f_shutdown_helper(); |
Harald Welte | 751d3eb | 2018-01-31 15:51:06 +0100 | [diff] [blame] | 1270 | } |
| 1271 | |
Stefan Sperling | 7b5e178 | 2018-03-20 19:32:43 +0100 | [diff] [blame] | 1272 | /* Paging by LAC+RNC; We do not implement; Verify nothing is paged */ |
Harald Welte | 751d3eb | 2018-01-31 15:51:06 +0100 | [diff] [blame] | 1273 | testcase TC_paging_imsi_nochan_lac_rnc() runs on test_CT { |
| 1274 | var template BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1275 | cid_list := { cIl_LAC_RNC := { ts_BSSMAP_CI_LAC_RNC(cid.lac, 14) } }; |
Stefan Sperling | 7b5e178 | 2018-03-20 19:32:43 +0100 | [diff] [blame] | 1276 | f_pageing_helper('001010000000014'H, cid_list, c_BtsId_none); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame] | 1277 | f_shutdown_helper(); |
Harald Welte | 751d3eb | 2018-01-31 15:51:06 +0100 | [diff] [blame] | 1278 | } |
| 1279 | |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1280 | /* Paging on multiple cells (multiple entries in list): Verify all of them page */ |
Harald Welte | 751d3eb | 2018-01-31 15:51:06 +0100 | [diff] [blame] | 1281 | testcase TC_paging_imsi_nochan_lacs() runs on test_CT { |
| 1282 | var template BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1283 | cid_list := { cIl_LAC := { ts_BSSMAP_CI_LAC(1), ts_BSSMAP_CI_LAC(2) } }; |
| 1284 | f_pageing_helper('001010000000015'H, cid_list, c_BtsId_all); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame] | 1285 | f_shutdown_helper(); |
Harald Welte | 751d3eb | 2018-01-31 15:51:06 +0100 | [diff] [blame] | 1286 | } |
| 1287 | |
| 1288 | /* Paging on empty list: Verify none of them page */ |
| 1289 | testcase TC_paging_imsi_nochan_lacs_empty() runs on test_CT { |
| 1290 | var template BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1291 | cid_list := { cIl_LAC := { } }; |
| 1292 | f_pageing_helper('001010000000016'H, cid_list, c_BtsId_none); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame] | 1293 | f_shutdown_helper(); |
Harald Welte | 751d3eb | 2018-01-31 15:51:06 +0100 | [diff] [blame] | 1294 | } |
| 1295 | |
Stefan Sperling | 049a86e | 2018-03-20 15:51:00 +0100 | [diff] [blame] | 1296 | /* Paging by CGI with unknown MCC/MNC: Verify nothing is paged. */ |
| 1297 | testcase TC_paging_imsi_nochan_cgi_unknown_cid() runs on test_CT { |
| 1298 | var template BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1299 | cid_list := { cIl_CGI := { ts_BSSMAP_CI_CGI(unknown_cid.mcc, unknown_cid.mnc, unknown_cid.lac, unknown_cid.ci) } }; |
| 1300 | f_pageing_helper('001010000000006'H, cid_list, c_BtsId_none); |
| 1301 | f_shutdown_helper(); |
| 1302 | } |
| 1303 | |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1304 | /* Verify paging retransmission interval + count */ |
| 1305 | /* Verify paging stops after channel establishment */ |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1306 | /* Test behavior under paging overload */ |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 1307 | |
Harald Welte | e65d40e | 2017-12-13 00:09:06 +0100 | [diff] [blame] | 1308 | /* Verify PCH load */ |
| 1309 | testcase TC_paging_imsi_load() runs on test_CT { |
| 1310 | var BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1311 | timer T := 4.0; |
Harald Welte | 2caa106 | 2018-03-17 18:19:05 +0100 | [diff] [blame] | 1312 | timer T_retrans := 1.0; |
Harald Welte | e65d40e | 2017-12-13 00:09:06 +0100 | [diff] [blame] | 1313 | cid_list := valueof(ts_BSSMAP_CIL_noCell); |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1314 | f_pageing_helper('001010123456789'H, cid_list, c_BtsId_all); |
Harald Welte | e65d40e | 2017-12-13 00:09:06 +0100 | [diff] [blame] | 1315 | |
| 1316 | /* tell BSC there is no paging space anymore */ |
| 1317 | f_ipa_tx(0, ts_RSL_PAGING_LOAD_IND(0)); |
Harald Welte | 3b57ab5 | 2018-03-17 18:01:10 +0100 | [diff] [blame] | 1318 | f_sleep(0.2); |
| 1319 | IPA_RSL[0].clear; |
Harald Welte | e65d40e | 2017-12-13 00:09:06 +0100 | [diff] [blame] | 1320 | |
| 1321 | /* Wait for 4 seconds if any more PAGING CMD are received on RSL. Normally, |
| 1322 | * there would be 8 retransmissions during 4 seconds */ |
| 1323 | T.start; |
Harald Welte | 2caa106 | 2018-03-17 18:19:05 +0100 | [diff] [blame] | 1324 | T_retrans.start; |
Harald Welte | e65d40e | 2017-12-13 00:09:06 +0100 | [diff] [blame] | 1325 | alt { |
| 1326 | [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_PAGING_CMD(?))) { |
| 1327 | setverdict(fail, "Received PAGING after LOAD_IND(0)"); |
| 1328 | self.stop; |
| 1329 | } |
Harald Welte | 2caa106 | 2018-03-17 18:19:05 +0100 | [diff] [blame] | 1330 | [] T_retrans.timeout { |
| 1331 | /* re-trnsmit the zero-space LOAD IND to avoid BSC 'auto credit' */ |
| 1332 | f_ipa_tx(0, ts_RSL_PAGING_LOAD_IND(0)); |
| 1333 | T_retrans.start; |
| 1334 | repeat; |
| 1335 | } |
Harald Welte | e65d40e | 2017-12-13 00:09:06 +0100 | [diff] [blame] | 1336 | [] T.timeout { |
| 1337 | setverdict(pass); |
| 1338 | } |
| 1339 | } |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame] | 1340 | |
| 1341 | f_shutdown_helper(); |
Harald Welte | e65d40e | 2017-12-13 00:09:06 +0100 | [diff] [blame] | 1342 | } |
| 1343 | |
Harald Welte | 235ebf1 | 2017-12-15 14:18:16 +0100 | [diff] [blame] | 1344 | /* Verify Paging Counter */ |
Harald Welte | 1ff6999 | 2017-12-14 12:31:17 +0100 | [diff] [blame] | 1345 | testcase TC_paging_counter() runs on test_CT { |
| 1346 | var BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1347 | timer T := 4.0; |
| 1348 | var integer i; |
| 1349 | var integer paging_attempted_bsc; |
| 1350 | var integer paging_attempted_bts[NUM_BTS]; |
| 1351 | var integer paging_expired_bts[NUM_BTS]; |
| 1352 | cid_list := valueof(ts_BSSMAP_CIL_noCell); |
| 1353 | |
| 1354 | f_init(); |
| 1355 | |
| 1356 | /* read counters before paging */ |
| 1357 | paging_attempted_bsc := f_ctrl_get_ratectr_abs(IPA_CTRL, "bsc", 0, "paging:attempted"); |
| 1358 | for (i := 0; i < NUM_BTS; i := i+1) { |
| 1359 | paging_attempted_bts[i] := f_ctrl_get_ratectr_abs(IPA_CTRL, "bts", i, "paging:attempted"); |
| 1360 | paging_expired_bts[i] := f_ctrl_get_ratectr_abs(IPA_CTRL, "bts", i, "paging:expired"); |
| 1361 | } |
| 1362 | |
| 1363 | f_pageing_helper('001230000000001'H, cid_list, c_BtsId_all); |
| 1364 | |
| 1365 | /* expect the attempted pages on BSC and each BTSs to have incremented by one */ |
| 1366 | f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bsc", 0, "paging:attempted", paging_attempted_bsc+1); |
| 1367 | for (i := 0; i < NUM_BTS; i := i+1) { |
| 1368 | f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", i, "paging:attempted", |
| 1369 | paging_attempted_bts[i]+1); |
| 1370 | } |
| 1371 | |
| 1372 | /* assume that 12s later the paging on all BTSs have expired and hence incremented by 1 */ |
| 1373 | f_sleep(12.0); |
| 1374 | for (i := 0; i < NUM_BTS; i := i+1) { |
| 1375 | f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", i, "paging:expired", |
| 1376 | paging_expired_bts[i]+1); |
| 1377 | } |
Harald Welte | 1ff6999 | 2017-12-14 12:31:17 +0100 | [diff] [blame] | 1378 | |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame] | 1379 | f_shutdown_helper(); |
Harald Welte | 1ff6999 | 2017-12-14 12:31:17 +0100 | [diff] [blame] | 1380 | } |
| 1381 | |
| 1382 | |
Harald Welte | 1098500 | 2017-12-12 09:29:15 +0100 | [diff] [blame] | 1383 | /* Verify paging stops after A-RESET */ |
| 1384 | testcase TC_paging_imsi_a_reset() runs on test_CT { |
| 1385 | var BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1386 | timer T := 3.0; |
| 1387 | cid_list := valueof(ts_BSSMAP_CIL_noCell); |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1388 | f_pageing_helper('001010123456789'H, cid_list, c_BtsId_all); |
Harald Welte | 1098500 | 2017-12-12 09:29:15 +0100 | [diff] [blame] | 1389 | |
| 1390 | /* Perform a BSSMAP Reset and wait for ACK */ |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 1391 | BSSAP.send(ts_BSSAP_UNITDATA_req(g_bssap.sccp_addr_peer, g_bssap.sccp_addr_own, ts_BSSMAP_Reset(0))); |
Harald Welte | 1098500 | 2017-12-12 09:29:15 +0100 | [diff] [blame] | 1392 | alt { |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 1393 | [] BSSAP.receive(tr_BSSAP_UNITDATA_ind(g_bssap.sccp_addr_own, g_bssap.sccp_addr_peer, tr_BSSMAP_ResetAck)) { } |
Harald Welte | 1098500 | 2017-12-12 09:29:15 +0100 | [diff] [blame] | 1394 | [] BSSAP.receive { repeat; } |
| 1395 | } |
| 1396 | |
| 1397 | /* Clear the queue, it might still contain stuff like BCCH FILLING */ |
Philipp Maier | 1e6b442 | 2018-02-23 14:02:13 +0100 | [diff] [blame] | 1398 | for (var integer i := 0; i < sizeof(IPA_RSL); i := i+1) { |
| 1399 | IPA_RSL[i].clear; |
| 1400 | } |
Harald Welte | 1098500 | 2017-12-12 09:29:15 +0100 | [diff] [blame] | 1401 | |
| 1402 | /* Wait for 3 seconds if any more PAGING CMD are received on RSL */ |
| 1403 | T.start; |
| 1404 | alt { |
| 1405 | [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_PAGING_CMD(?))) { |
| 1406 | setverdict(fail, "Received PAGING after A-RESET"); |
| 1407 | self.stop; |
| 1408 | } |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1409 | [] IPA_RSL[1].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_PAGING_CMD(?))) { |
| 1410 | setverdict(fail, "Received PAGING after A-RESET"); |
| 1411 | self.stop; |
| 1412 | } |
| 1413 | [] IPA_RSL[2].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_PAGING_CMD(?))) { |
| 1414 | setverdict(fail, "Received PAGING after A-RESET"); |
| 1415 | self.stop; |
| 1416 | } |
Harald Welte | 1098500 | 2017-12-12 09:29:15 +0100 | [diff] [blame] | 1417 | [] T.timeout { |
| 1418 | setverdict(pass); |
| 1419 | } |
| 1420 | } |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame] | 1421 | |
| 1422 | f_shutdown_helper(); |
Harald Welte | 1098500 | 2017-12-12 09:29:15 +0100 | [diff] [blame] | 1423 | } |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 1424 | |
Harald Welte | 4e9b9cc | 2017-12-14 18:31:02 +0100 | [diff] [blame] | 1425 | /* Test RSL link drop causes counter increment */ |
| 1426 | testcase TC_rsl_drop_counter() runs on test_CT { |
| 1427 | var integer rsl_fail; |
| 1428 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 1429 | f_init(1); |
Harald Welte | 4e9b9cc | 2017-12-14 18:31:02 +0100 | [diff] [blame] | 1430 | |
| 1431 | rsl_fail := f_ctrl_get_ratectr_abs(IPA_CTRL, "bts", 0, "rsl_fail"); |
| 1432 | |
| 1433 | bts[0].rsl.vc_IPA.stop; |
| 1434 | |
| 1435 | f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "rsl_fail", rsl_fail+1); |
| 1436 | |
| 1437 | setverdict(pass); |
| 1438 | } |
| 1439 | |
| 1440 | /* TODO: Test OML link drop causes counter increment */ |
| 1441 | |
Stefan Sperling | 830dc9d | 2018-02-12 21:08:28 +0100 | [diff] [blame] | 1442 | /* The body of TC_rsl_unknown_unit_id() and TC_oml_unknown_unit_id() tests. */ |
| 1443 | function f_ipa_unknown_unit_id(integer mp_bsc_ipa_port) runs on test_CT return boolean { |
| 1444 | timer T := 10.0; |
| 1445 | |
| 1446 | bts[0].rsl.id := "IPA-0-RSL"; |
| 1447 | bts[0].rsl.vc_IPA := IPA_Emulation_CT.create(bts[0].rsl.id & "-IPA"); |
| 1448 | bts[0].rsl.ccm_pars := c_IPA_default_ccm_pars; |
| 1449 | bts[0].rsl.ccm_pars.name := "Osmocom TTCN-3 BTS Simulator"; |
| 1450 | bts[0].rsl.ccm_pars.unit_id := "0/0/0"; /* value which is unknown at BTS */ |
| 1451 | |
Stefan Sperling | 830dc9d | 2018-02-12 21:08:28 +0100 | [diff] [blame] | 1452 | f_ipa_ctrl_start(mp_bsc_ip, mp_bsc_ctrl_port); |
| 1453 | |
| 1454 | f_init_mgcp("VirtMSC"); |
| 1455 | |
| 1456 | /* start RSL/OML connection (XXX re-uses RSL port/protocol definitions for OML) */ |
| 1457 | map(bts[0].rsl.vc_IPA:IPA_PORT, system:IPA); |
| 1458 | connect(bts[0].rsl.vc_IPA:IPA_RSL_PORT, self:IPA_RSL[0]); |
| 1459 | bts[0].rsl.vc_IPA.start(IPA_Emulation.main_client(mp_bsc_ip, mp_bsc_ipa_port, "", 10000, bts[0].rsl.ccm_pars)); |
| 1460 | |
| 1461 | /* wait for IPA OML link to connect and then disconnect */ |
| 1462 | T.start; |
| 1463 | alt { |
| 1464 | [] IPA_RSL[0].receive(ASP_IPA_Event:{up_down := ASP_IPA_EVENT_DOWN}) { |
| 1465 | T.stop; |
| 1466 | return true; |
| 1467 | } |
| 1468 | [] IPA_RSL[0].receive { repeat } |
| 1469 | [] T.timeout { |
| 1470 | self.stop; |
Stefan Sperling | 830dc9d | 2018-02-12 21:08:28 +0100 | [diff] [blame] | 1471 | } |
| 1472 | } |
| 1473 | |
| 1474 | return false; |
| 1475 | } |
| 1476 | |
| 1477 | /* BSC should close an RSL connection from a BTS with unknown unit ID (OS#2714). */ |
| 1478 | testcase TC_rsl_unknown_unit_id() runs on test_CT { |
| 1479 | if (f_ipa_unknown_unit_id(mp_bsc_rsl_port)) { |
| 1480 | setverdict(pass); |
| 1481 | } else { |
| 1482 | setverdict(fail, "Timeout RSL waiting for connection to close"); |
| 1483 | } |
| 1484 | } |
| 1485 | |
| 1486 | |
| 1487 | /* BSC should close an RSL connection from a BTS with unknown unit ID (OS#2714). */ |
| 1488 | testcase TC_oml_unknown_unit_id() runs on test_CT { |
| 1489 | if (f_ipa_unknown_unit_id(mp_bsc_oml_port)) { |
| 1490 | setverdict(pass); |
| 1491 | } else { |
| 1492 | setverdict(fail, "Timeout OML waiting for connection to close"); |
| 1493 | } |
| 1494 | } |
| 1495 | |
| 1496 | |
Harald Welte | c1a2fff | 2017-12-17 11:06:19 +0100 | [diff] [blame] | 1497 | /*********************************************************************** |
| 1498 | * "New world" test cases using RSL_Emulation + BSSMAP_Emulation |
| 1499 | ***********************************************************************/ |
| 1500 | |
| 1501 | import from BSSMAP_Emulation all; |
| 1502 | import from RSL_Emulation all; |
| 1503 | import from MSC_ConnectionHandler all; |
| 1504 | |
| 1505 | type function void_fn(charstring id) runs on MSC_ConnHdlr; |
| 1506 | |
Harald Welte | 336820c | 2018-05-31 20:34:52 +0200 | [diff] [blame] | 1507 | /* helper function to create and connect a MSC_ConnHdlr component */ |
Harald Welte | ff579f9 | 2018-05-31 22:19:39 +0200 | [diff] [blame] | 1508 | private function f_connect_handler(inout MSC_ConnHdlr vc_conn) runs on test_CT { |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 1509 | connect(vc_conn:BSSMAPEM, g_bssap.vc_BSSMAP:PROC); |
Daniel Willmann | 191e0d9 | 2018-01-17 12:44:35 +0100 | [diff] [blame] | 1510 | connect(vc_conn:MGCP_PROC, vc_MGCP:MGCP_PROC); |
Harald Welte | c1a2fff | 2017-12-17 11:06:19 +0100 | [diff] [blame] | 1511 | connect(vc_conn:RSL, bts[0].rsl.vc_RSL:CLIENT_PT); |
Harald Welte | f70df65 | 2018-01-29 22:00:23 +0100 | [diff] [blame] | 1512 | connect(vc_conn:RSL_PROC, bts[0].rsl.vc_RSL:RSL_PROC); |
Philipp Maier | 88f4ae8 | 2018-03-01 14:00:58 +0100 | [diff] [blame] | 1513 | if (isvalue(bts[1])) { |
Philipp Maier | 956a92f | 2018-02-16 10:58:07 +0100 | [diff] [blame] | 1514 | connect(vc_conn:RSL1, bts[1].rsl.vc_RSL:CLIENT_PT); |
| 1515 | connect(vc_conn:RSL1_PROC, bts[1].rsl.vc_RSL:RSL_PROC); |
| 1516 | } |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 1517 | connect(vc_conn:BSSAP, g_bssap.vc_BSSMAP:CLIENT); |
Daniel Willmann | 191e0d9 | 2018-01-17 12:44:35 +0100 | [diff] [blame] | 1518 | connect(vc_conn:MGCP, vc_MGCP:MGCP_CLIENT); |
Harald Welte | 336820c | 2018-05-31 20:34:52 +0200 | [diff] [blame] | 1519 | } |
| 1520 | |
| 1521 | function f_start_handler(void_fn fn, template (omit) TestHdlrParams pars := omit) |
| 1522 | runs on test_CT return MSC_ConnHdlr { |
| 1523 | var charstring id := testcasename(); |
| 1524 | var MSC_ConnHdlr vc_conn; |
| 1525 | vc_conn := MSC_ConnHdlr.create(id); |
| 1526 | f_connect_handler(vc_conn); |
Harald Welte | a063003 | 2018-03-20 21:09:55 +0100 | [diff] [blame] | 1527 | vc_conn.start(f_handler_init(fn, id, pars)); |
Harald Welte | c1a2fff | 2017-12-17 11:06:19 +0100 | [diff] [blame] | 1528 | return vc_conn; |
| 1529 | } |
| 1530 | |
Harald Welte | a063003 | 2018-03-20 21:09:55 +0100 | [diff] [blame] | 1531 | /* first function inside ConnHdlr component; sets g_pars + starts function */ |
| 1532 | private function f_handler_init(void_fn fn, charstring id, template (omit) TestHdlrParams pars := omit) |
| 1533 | runs on MSC_ConnHdlr { |
| 1534 | if (isvalue(pars)) { |
| 1535 | g_pars := valueof(pars); |
| 1536 | } |
| 1537 | fn.apply(id); |
| 1538 | } |
| 1539 | |
Harald Welte | 3c86ea0 | 2018-05-10 22:28:05 +0200 | [diff] [blame] | 1540 | /* Establish signalling channel (non-assignment case) followed by cipher mode */ |
| 1541 | private function f_tc_ciph_mode_a5(charstring id) runs on MSC_ConnHdlr { |
Harald Welte | ed84851 | 2018-05-24 22:27:58 +0200 | [diff] [blame] | 1542 | var template PDU_BSSAP exp_compl := f_gen_exp_compl(); |
| 1543 | var PDU_BSSAP ass_cmd := f_gen_ass_req(); |
Harald Welte | 3c86ea0 | 2018-05-10 22:28:05 +0200 | [diff] [blame] | 1544 | ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelTypeSIGNAL); |
Philipp Maier | 2300073 | 2018-05-18 11:25:37 +0200 | [diff] [blame] | 1545 | ass_cmd.pdu.bssmap.assignmentRequest.circuitIdentityCode := omit; |
| 1546 | ass_cmd.pdu.bssmap.assignmentRequest.aoIPTransportLayer := omit; |
| 1547 | exp_compl.pdu.bssmap.assignmentComplete.circuitIdentityCode := omit; |
| 1548 | exp_compl.pdu.bssmap.assignmentComplete.aoIPTransportLayer := omit; |
Harald Welte | 3c86ea0 | 2018-05-10 22:28:05 +0200 | [diff] [blame] | 1549 | |
Philipp Maier | 2300073 | 2018-05-18 11:25:37 +0200 | [diff] [blame] | 1550 | f_establish_fully(ass_cmd, exp_compl); |
Harald Welte | 3c86ea0 | 2018-05-10 22:28:05 +0200 | [diff] [blame] | 1551 | } |
| 1552 | testcase TC_ciph_mode_a5_0() runs on test_CT { |
| 1553 | var MSC_ConnHdlr vc_conn; |
| 1554 | var TestHdlrParams pars := valueof(t_def_TestHdlrPars); |
| 1555 | pars.encr := valueof(t_EncrParams('01'O, f_rnd_octstring(8))); |
| 1556 | |
| 1557 | f_init(1, true); |
| 1558 | f_sleep(1.0); |
| 1559 | vc_conn := f_start_handler(refers(f_tc_ciph_mode_a5), pars); |
| 1560 | vc_conn.done; |
| 1561 | } |
| 1562 | testcase TC_ciph_mode_a5_1() runs on test_CT { |
| 1563 | var MSC_ConnHdlr vc_conn; |
| 1564 | var TestHdlrParams pars := valueof(t_def_TestHdlrPars); |
| 1565 | pars.encr := valueof(t_EncrParams('02'O, f_rnd_octstring(8))); |
| 1566 | |
| 1567 | f_init(1, true); |
| 1568 | f_sleep(1.0); |
| 1569 | vc_conn := f_start_handler(refers(f_tc_ciph_mode_a5), pars); |
| 1570 | vc_conn.done; |
| 1571 | } |
| 1572 | testcase TC_ciph_mode_a5_3() runs on test_CT { |
| 1573 | var MSC_ConnHdlr vc_conn; |
| 1574 | var TestHdlrParams pars := valueof(t_def_TestHdlrPars); |
| 1575 | pars.encr := valueof(t_EncrParams('08'O, f_rnd_octstring(8))); |
| 1576 | |
| 1577 | f_init(1, true); |
| 1578 | f_sleep(1.0); |
| 1579 | vc_conn := f_start_handler(refers(f_tc_ciph_mode_a5), pars); |
| 1580 | vc_conn.done; |
| 1581 | } |
| 1582 | |
| 1583 | |
| 1584 | /* establish initial channel, enable ciphering followed by assignment to ciphered channel */ |
Harald Welte | 651fcdc | 2018-05-10 20:23:16 +0200 | [diff] [blame] | 1585 | private function f_tc_assignment_fr_a5(charstring id) runs on MSC_ConnHdlr { |
Harald Welte | ed84851 | 2018-05-24 22:27:58 +0200 | [diff] [blame] | 1586 | var template PDU_BSSAP exp_compl := f_gen_exp_compl(); |
| 1587 | var PDU_BSSAP ass_cmd := f_gen_ass_req(); |
Harald Welte | c1a2fff | 2017-12-17 11:06:19 +0100 | [diff] [blame] | 1588 | |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1589 | ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType); |
| 1590 | ass_cmd.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR})); |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 1591 | |
Harald Welte | a063003 | 2018-03-20 21:09:55 +0100 | [diff] [blame] | 1592 | f_establish_fully(ass_cmd, exp_compl); |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1593 | } |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1594 | testcase TC_assignment_fr_a5_0() runs on test_CT { |
| 1595 | var MSC_ConnHdlr vc_conn; |
Harald Welte | 651fcdc | 2018-05-10 20:23:16 +0200 | [diff] [blame] | 1596 | var TestHdlrParams pars := valueof(t_def_TestHdlrPars); |
| 1597 | pars.encr := valueof(t_EncrParams('01'O, f_rnd_octstring(8))); |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1598 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 1599 | f_init(1, true); |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1600 | f_sleep(1.0); |
Harald Welte | 651fcdc | 2018-05-10 20:23:16 +0200 | [diff] [blame] | 1601 | vc_conn := f_start_handler(refers(f_tc_assignment_fr_a5), pars); |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1602 | vc_conn.done; |
| 1603 | } |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1604 | testcase TC_assignment_fr_a5_1() runs on test_CT { |
Harald Welte | c1a2fff | 2017-12-17 11:06:19 +0100 | [diff] [blame] | 1605 | var MSC_ConnHdlr vc_conn; |
Harald Welte | 651fcdc | 2018-05-10 20:23:16 +0200 | [diff] [blame] | 1606 | var TestHdlrParams pars := valueof(t_def_TestHdlrPars); |
| 1607 | pars.encr := valueof(t_EncrParams('02'O, f_rnd_octstring(8))); |
Harald Welte | c1a2fff | 2017-12-17 11:06:19 +0100 | [diff] [blame] | 1608 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 1609 | f_init(1, true); |
Harald Welte | c1a2fff | 2017-12-17 11:06:19 +0100 | [diff] [blame] | 1610 | f_sleep(1.0); |
Harald Welte | 651fcdc | 2018-05-10 20:23:16 +0200 | [diff] [blame] | 1611 | vc_conn := f_start_handler(refers(f_tc_assignment_fr_a5), pars); |
| 1612 | vc_conn.done; |
| 1613 | } |
| 1614 | testcase TC_assignment_fr_a5_3() runs on test_CT { |
| 1615 | var MSC_ConnHdlr vc_conn; |
| 1616 | var TestHdlrParams pars := valueof(t_def_TestHdlrPars); |
| 1617 | pars.encr := valueof(t_EncrParams('08'O, f_rnd_octstring(8))); |
Harald Welte | c1a2fff | 2017-12-17 11:06:19 +0100 | [diff] [blame] | 1618 | |
Harald Welte | 651fcdc | 2018-05-10 20:23:16 +0200 | [diff] [blame] | 1619 | f_init(1, true); |
| 1620 | f_sleep(1.0); |
| 1621 | vc_conn := f_start_handler(refers(f_tc_assignment_fr_a5), pars); |
Harald Welte | c1a2fff | 2017-12-17 11:06:19 +0100 | [diff] [blame] | 1622 | vc_conn.done; |
| 1623 | } |
| 1624 | |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1625 | /* Expect ASSIGNMENT FAIL if mandatory IE is missing */ |
| 1626 | private function f_tc_assignment_fr_a5_1_codec_missing(charstring id) runs on MSC_ConnHdlr { |
Harald Welte | a063003 | 2018-03-20 21:09:55 +0100 | [diff] [blame] | 1627 | g_pars := valueof(t_def_TestHdlrPars); |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1628 | var template PDU_BSSAP exp_fail := tr_BSSMAP_AssignmentFail; |
Harald Welte | ed84851 | 2018-05-24 22:27:58 +0200 | [diff] [blame] | 1629 | var PDU_BSSAP ass_cmd := f_gen_ass_req(); |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1630 | const OCT8 kc := '0001020304050607'O; |
| 1631 | |
| 1632 | ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType); |
Harald Welte | a063003 | 2018-03-20 21:09:55 +0100 | [diff] [blame] | 1633 | f_establish_fully(ass_cmd, exp_fail); |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1634 | } |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1635 | testcase TC_assignment_fr_a5_1_codec_missing() runs on test_CT { |
| 1636 | var MSC_ConnHdlr vc_conn; |
| 1637 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 1638 | f_init(1, true); |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1639 | f_sleep(1.0); |
| 1640 | |
Harald Welte | 8863fa1 | 2018-05-10 20:15:27 +0200 | [diff] [blame] | 1641 | vc_conn := f_start_handler(refers(f_tc_assignment_fr_a5_1_codec_missing)); |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1642 | vc_conn.done; |
| 1643 | } |
| 1644 | |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1645 | private function f_tc_assignment_fr_a5_4(charstring id) runs on MSC_ConnHdlr { |
Harald Welte | a063003 | 2018-03-20 21:09:55 +0100 | [diff] [blame] | 1646 | g_pars := valueof(t_def_TestHdlrPars); |
Harald Welte | ed84851 | 2018-05-24 22:27:58 +0200 | [diff] [blame] | 1647 | var template PDU_BSSAP exp_compl := f_gen_exp_compl(); |
| 1648 | var PDU_BSSAP ass_cmd := f_gen_ass_req(); |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1649 | const OCT8 kc := '0001020304050607'O; |
| 1650 | const OCT16 kc128 := kc & kc; |
| 1651 | |
| 1652 | ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType); |
| 1653 | ass_cmd.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR})); |
Harald Welte | a063003 | 2018-03-20 21:09:55 +0100 | [diff] [blame] | 1654 | f_establish_fully(ass_cmd, exp_compl); |
Harald Welte | 38b2a10 | 2017-12-23 02:42:58 +0100 | [diff] [blame] | 1655 | f_cipher_mode('10'O, kc, kc128, true); |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1656 | /* TODO: expect GSM0808_CAUSE_CIPHERING_ALGORITHM_NOT_SUPPORTED cause value */ |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1657 | } |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1658 | testcase TC_assignment_fr_a5_4() runs on test_CT { |
| 1659 | var MSC_ConnHdlr vc_conn; |
| 1660 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 1661 | f_init(1, true); |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1662 | f_sleep(1.0); |
| 1663 | |
Harald Welte | 8863fa1 | 2018-05-10 20:15:27 +0200 | [diff] [blame] | 1664 | vc_conn := f_start_handler(refers(f_tc_assignment_fr_a5_4)); |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1665 | vc_conn.done; |
| 1666 | } |
| 1667 | |
| 1668 | |
Harald Welte | 4532e0a | 2017-12-23 02:05:44 +0100 | [diff] [blame] | 1669 | private function f_tc_assignment_sign(charstring id) runs on MSC_ConnHdlr { |
Philipp Maier | 6a50c7c | 2018-04-16 16:15:59 +0200 | [diff] [blame] | 1670 | g_pars := valueof(t_def_TestHdlrPars); |
Harald Welte | 4532e0a | 2017-12-23 02:05:44 +0100 | [diff] [blame] | 1671 | var template PDU_BSSAP exp_compl := tr_BSSMAP_AssignmentComplete(omit, omit); |
| 1672 | var PDU_BSSAP ass_cmd := valueof(ts_BSSMAP_AssignmentReq(omit, omit)); |
| 1673 | |
| 1674 | ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelTypeSIGNAL); |
Harald Welte | a063003 | 2018-03-20 21:09:55 +0100 | [diff] [blame] | 1675 | f_establish_fully(ass_cmd, exp_compl); |
Harald Welte | 4532e0a | 2017-12-23 02:05:44 +0100 | [diff] [blame] | 1676 | } |
| 1677 | |
| 1678 | testcase TC_assignment_sign() runs on test_CT { |
| 1679 | var MSC_ConnHdlr vc_conn; |
| 1680 | |
| 1681 | f_init(1, true); |
| 1682 | f_sleep(1.0); |
| 1683 | |
Harald Welte | 8863fa1 | 2018-05-10 20:15:27 +0200 | [diff] [blame] | 1684 | vc_conn := f_start_handler(refers(f_tc_assignment_sign)); |
Harald Welte | 4532e0a | 2017-12-23 02:05:44 +0100 | [diff] [blame] | 1685 | vc_conn.done; |
| 1686 | } |
| 1687 | |
Harald Welte | 60aa576 | 2018-03-21 19:33:13 +0100 | [diff] [blame] | 1688 | /*********************************************************************** |
| 1689 | * Codec (list) testing |
| 1690 | ***********************************************************************/ |
| 1691 | |
| 1692 | /* check if the given rsl_mode is compatible with the a_elem */ |
| 1693 | private function f_match_codec(BSSMAP_FIELD_CodecElement a_elem, RSL_IE_ChannelMode rsl_mode) |
| 1694 | return boolean { |
| 1695 | select (a_elem.codecType) { |
| 1696 | case (GSM_FR) { |
| 1697 | if (match(rsl_mode, tr_RSL_ChanMode(RSL_CHRT_TCH_F, RSL_CMOD_SP_GSM1))) { |
| 1698 | return true; |
| 1699 | } |
| 1700 | } |
| 1701 | case (GSM_HR) { |
| 1702 | if (match(rsl_mode, tr_RSL_ChanMode(RSL_CHRT_TCH_H, RSL_CMOD_SP_GSM1))) { |
| 1703 | return true; |
| 1704 | } |
| 1705 | } |
| 1706 | case (GSM_EFR) { |
| 1707 | if (match(rsl_mode, tr_RSL_ChanMode(RSL_CHRT_TCH_F, RSL_CMOD_SP_GSM2))) { |
| 1708 | return true; |
| 1709 | } |
| 1710 | } |
| 1711 | case (FR_AMR) { |
| 1712 | if (match(rsl_mode, tr_RSL_ChanMode(RSL_CHRT_TCH_F, RSL_CMOD_SP_GSM3))) { |
| 1713 | return true; |
| 1714 | } |
| 1715 | } |
| 1716 | case (HR_AMR) { |
| 1717 | if (match(rsl_mode, tr_RSL_ChanMode(RSL_CHRT_TCH_H, RSL_CMOD_SP_GSM3))) { |
| 1718 | return true; |
| 1719 | } |
| 1720 | } |
| 1721 | case else { } |
| 1722 | } |
| 1723 | return false; |
| 1724 | } |
| 1725 | |
| 1726 | /* check if the given rsl_mode is compatible with the a_list */ |
| 1727 | private function f_match_codecs(BSSMAP_IE_SpeechCodecList a_list, RSL_IE_ChannelMode rsl_mode) |
| 1728 | return boolean { |
| 1729 | for (var integer i := 0; i < sizeof(a_list); i := i+1) { |
| 1730 | if (f_match_codec(a_list.codecElements[i], rsl_mode)) { |
| 1731 | return true; |
| 1732 | } |
| 1733 | } |
| 1734 | return false; |
| 1735 | } |
| 1736 | |
| 1737 | /* determine BSSMAP_IE_ChannelType from *first* element of BSSMAP_FIELD_CodecElement */ |
Philipp Maier | 61f6b57 | 2018-07-06 14:03:38 +0200 | [diff] [blame] | 1738 | function f_BSSMAP_chtype_from_codec(BSSMAP_FIELD_CodecElement a_elem) |
Harald Welte | 60aa576 | 2018-03-21 19:33:13 +0100 | [diff] [blame] | 1739 | return BSSMAP_IE_ChannelType { |
| 1740 | /* FIXME: actually look at all elements of BSSMAP_IE_SpeechCodecList */ |
| 1741 | var BSSMAP_IE_ChannelType ret := valueof(ts_BSSMAP_IE_ChannelType); |
| 1742 | select (a_elem.codecType) { |
| 1743 | case (GSM_FR) { |
| 1744 | ret.channelRateAndType := ChRate_TCHF; |
| 1745 | ret.speechId_DataIndicator := Spdi_TCHF_FR; |
| 1746 | } |
| 1747 | case (GSM_HR) { |
| 1748 | ret.channelRateAndType := ChRate_TCHH; |
| 1749 | ret.speechId_DataIndicator := Spdi_TCHH_HR; |
| 1750 | } |
| 1751 | case (GSM_EFR) { |
| 1752 | ret.channelRateAndType := ChRate_TCHF; |
| 1753 | ret.speechId_DataIndicator := Spdi_TCHF_EFR; |
| 1754 | } |
| 1755 | case (FR_AMR) { |
| 1756 | ret.channelRateAndType := ChRate_TCHF; |
| 1757 | ret.speechId_DataIndicator := Spdi_TCHF_AMR; |
| 1758 | } |
| 1759 | case (HR_AMR) { |
| 1760 | ret.channelRateAndType := ChRate_TCHH; |
| 1761 | ret.speechId_DataIndicator := Spdi_TCHH_AMR; |
| 1762 | } |
| 1763 | case else { |
| 1764 | setverdict(fail, "Unsupported codec ", a_elem); |
| 1765 | self.stop; |
| 1766 | } |
| 1767 | } |
| 1768 | return ret; |
| 1769 | } |
| 1770 | |
Harald Welte | a63b910 | 2018-03-22 20:36:16 +0100 | [diff] [blame] | 1771 | private function f_rsl_chmod_tmpl_from_codec(BSSMAP_FIELD_CodecElement a_elem) |
| 1772 | return template RSL_IE_Body { |
| 1773 | var template RSL_IE_Body mode_ie := { |
| 1774 | chan_mode := { |
| 1775 | len := ?, |
| 1776 | reserved := ?, |
| 1777 | dtx_d := ?, |
| 1778 | dtx_u := ?, |
| 1779 | spd_ind := RSL_SPDI_SPEECH, |
| 1780 | ch_rate_type := -, |
| 1781 | coding_alg_rate := - |
| 1782 | } |
| 1783 | } |
| 1784 | |
| 1785 | select (a_elem.codecType) { |
| 1786 | case (GSM_FR) { |
| 1787 | mode_ie.chan_mode.ch_rate_type := RSL_CHRT_TCH_F; |
| 1788 | mode_ie.chan_mode.coding_alg_rate := RSL_CMOD_SP_GSM1; |
| 1789 | } |
| 1790 | case (GSM_HR) { |
| 1791 | mode_ie.chan_mode.ch_rate_type := RSL_CHRT_TCH_H; |
| 1792 | mode_ie.chan_mode.coding_alg_rate := RSL_CMOD_SP_GSM1; |
| 1793 | } |
| 1794 | case (GSM_EFR) { |
| 1795 | mode_ie.chan_mode.ch_rate_type := RSL_CHRT_TCH_F; |
| 1796 | mode_ie.chan_mode.coding_alg_rate := RSL_CMOD_SP_GSM2; |
| 1797 | } |
| 1798 | case (FR_AMR) { |
| 1799 | mode_ie.chan_mode.ch_rate_type := RSL_CHRT_TCH_F; |
| 1800 | mode_ie.chan_mode.coding_alg_rate := RSL_CMOD_SP_GSM3; |
| 1801 | } |
| 1802 | case (HR_AMR) { |
| 1803 | mode_ie.chan_mode.ch_rate_type := RSL_CHRT_TCH_H; |
| 1804 | mode_ie.chan_mode.coding_alg_rate := RSL_CMOD_SP_GSM3; |
| 1805 | } |
| 1806 | } |
| 1807 | return mode_ie; |
| 1808 | } |
| 1809 | |
Harald Welte | 60aa576 | 2018-03-21 19:33:13 +0100 | [diff] [blame] | 1810 | type record CodecListTest { |
| 1811 | BSSMAP_IE_SpeechCodecList codec_list, |
| 1812 | charstring id |
| 1813 | } |
| 1814 | type record of CodecListTest CodecListTests |
| 1815 | |
| 1816 | private function f_TC_assignment_codec(charstring id) runs on MSC_ConnHdlr { |
Harald Welte | ed84851 | 2018-05-24 22:27:58 +0200 | [diff] [blame] | 1817 | var PDU_BSSAP ass_cmd := f_gen_ass_req(); |
| 1818 | var template PDU_BSSAP exp_compl := f_gen_exp_compl(); |
Harald Welte | 60aa576 | 2018-03-21 19:33:13 +0100 | [diff] [blame] | 1819 | |
| 1820 | /* puzzle together the ASSIGNMENT REQ for given codec[s] */ |
Harald Welte | 79f3f54 | 2018-05-25 20:02:37 +0200 | [diff] [blame] | 1821 | if (mp_bssap_cfg.transport == BSSAP_TRANSPORT_AoIP) { |
| 1822 | ass_cmd.pdu.bssmap.assignmentRequest.codecList := g_pars.ass_codec_list; |
| 1823 | exp_compl.pdu.bssmap.assignmentComplete.speechCodec.codecElements[0] := |
| 1824 | g_pars.ass_codec_list.codecElements[0]; |
| 1825 | } |
Harald Welte | 60aa576 | 2018-03-21 19:33:13 +0100 | [diff] [blame] | 1826 | ass_cmd.pdu.bssmap.assignmentRequest.channelType := |
| 1827 | f_BSSMAP_chtype_from_codec(g_pars.ass_codec_list.codecElements[0]); |
Harald Welte | 60aa576 | 2018-03-21 19:33:13 +0100 | [diff] [blame] | 1828 | log("expecting ASS COMPL like this: ", exp_compl); |
| 1829 | |
| 1830 | f_establish_fully(ass_cmd, exp_compl); |
Harald Welte | a63b910 | 2018-03-22 20:36:16 +0100 | [diff] [blame] | 1831 | |
| 1832 | /* Verify that the RSL-side activation actually matches our expectations */ |
| 1833 | var RSL_Message rsl := f_rslem_get_last_act(RSL_PROC, 0, g_chan_nr); |
| 1834 | |
| 1835 | var RSL_IE_Body mode_ie; |
| 1836 | if (f_rsl_find_ie(rsl, RSL_IE_CHAN_MODE, mode_ie) == false) { |
| 1837 | setverdict(fail, "Couldn't find CHAN_MODE IE"); |
| 1838 | self.stop; |
| 1839 | } |
| 1840 | var template RSL_IE_Body t_mode_ie := f_rsl_chmod_tmpl_from_codec(g_pars.ass_codec_list.codecElements[0]); |
| 1841 | if (not match(mode_ie, t_mode_ie)) { |
| 1842 | setverdict(fail, "RSL Channel Mode IE doesn't match expectation"); |
| 1843 | } |
Neels Hofmeyr | bcf62bc | 2018-07-04 00:24:33 +0200 | [diff] [blame] | 1844 | |
| 1845 | var RSL_IE_Body mr_conf; |
| 1846 | if (g_pars.expect_mr_conf_ie != omit) { |
| 1847 | if (f_rsl_find_ie(rsl, RSL_IE_MR_CONFIG, mr_conf) == false) { |
| 1848 | setverdict(fail, "Missing MR CONFIG IE in RSL Chan Activ"); |
| 1849 | self.stop; |
| 1850 | } |
| 1851 | log("found RSL MR CONFIG IE: ", mr_conf); |
| 1852 | |
| 1853 | if (not match(mr_conf, g_pars.expect_mr_conf_ie)) { |
| 1854 | setverdict(fail, "RSL MR CONFIG IE does not match expectation. Expected: ", |
| 1855 | g_pars.expect_mr_conf_ie); |
| 1856 | } |
| 1857 | } else { |
| 1858 | if (f_rsl_find_ie(rsl, RSL_IE_MR_CONFIG, mr_conf) == true) { |
| 1859 | log("found RSL MR CONFIG IE: ", mr_conf); |
| 1860 | setverdict(fail, "Found MR CONFIG IE in RSL Chan Activ, expecting omit"); |
| 1861 | self.stop; |
| 1862 | } |
| 1863 | } |
Harald Welte | 60aa576 | 2018-03-21 19:33:13 +0100 | [diff] [blame] | 1864 | } |
| 1865 | |
| 1866 | testcase TC_assignment_codec_fr() runs on test_CT { |
| 1867 | var TestHdlrParams pars := valueof(t_def_TestHdlrPars); |
| 1868 | var MSC_ConnHdlr vc_conn; |
| 1869 | |
| 1870 | f_init(1, true); |
| 1871 | f_sleep(1.0); |
| 1872 | |
| 1873 | pars.ass_codec_list := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR})); |
Harald Welte | 8863fa1 | 2018-05-10 20:15:27 +0200 | [diff] [blame] | 1874 | vc_conn := f_start_handler(refers(f_TC_assignment_codec), pars); |
Harald Welte | 60aa576 | 2018-03-21 19:33:13 +0100 | [diff] [blame] | 1875 | vc_conn.done; |
| 1876 | } |
| 1877 | |
| 1878 | testcase TC_assignment_codec_hr() runs on test_CT { |
| 1879 | var TestHdlrParams pars := valueof(t_def_TestHdlrPars); |
| 1880 | var MSC_ConnHdlr vc_conn; |
| 1881 | |
| 1882 | f_init(1, true); |
| 1883 | f_sleep(1.0); |
| 1884 | |
| 1885 | pars.ass_codec_list := valueof(ts_BSSMAP_IE_CodecList({ts_CodecHR})); |
Harald Welte | 8863fa1 | 2018-05-10 20:15:27 +0200 | [diff] [blame] | 1886 | vc_conn := f_start_handler(refers(f_TC_assignment_codec), pars); |
Harald Welte | 60aa576 | 2018-03-21 19:33:13 +0100 | [diff] [blame] | 1887 | vc_conn.done; |
| 1888 | } |
| 1889 | |
| 1890 | testcase TC_assignment_codec_efr() runs on test_CT { |
| 1891 | var TestHdlrParams pars := valueof(t_def_TestHdlrPars); |
| 1892 | var MSC_ConnHdlr vc_conn; |
| 1893 | |
| 1894 | f_init(1, true); |
| 1895 | f_sleep(1.0); |
| 1896 | |
| 1897 | pars.ass_codec_list := valueof(ts_BSSMAP_IE_CodecList({ts_CodecEFR})); |
Harald Welte | 8863fa1 | 2018-05-10 20:15:27 +0200 | [diff] [blame] | 1898 | vc_conn := f_start_handler(refers(f_TC_assignment_codec), pars); |
Harald Welte | 60aa576 | 2018-03-21 19:33:13 +0100 | [diff] [blame] | 1899 | vc_conn.done; |
| 1900 | } |
| 1901 | |
| 1902 | testcase TC_assignment_codec_amr_f() runs on test_CT { |
| 1903 | var TestHdlrParams pars := valueof(t_def_TestHdlrPars); |
| 1904 | var MSC_ConnHdlr vc_conn; |
Neels Hofmeyr | bcf62bc | 2018-07-04 00:24:33 +0200 | [diff] [blame] | 1905 | var RSL_IE_Body mr_conf := { |
| 1906 | other := { |
| 1907 | len := 2, |
| 1908 | payload := '2804'O |
| 1909 | } |
| 1910 | }; |
Harald Welte | 60aa576 | 2018-03-21 19:33:13 +0100 | [diff] [blame] | 1911 | |
| 1912 | f_init(1, true); |
| 1913 | f_sleep(1.0); |
| 1914 | |
| 1915 | pars.ass_codec_list := valueof(ts_BSSMAP_IE_CodecList({ts_CodecAMR_F})); |
Neels Hofmeyr | bcf62bc | 2018-07-04 00:24:33 +0200 | [diff] [blame] | 1916 | pars.expect_mr_conf_ie := mr_conf; |
Harald Welte | 8863fa1 | 2018-05-10 20:15:27 +0200 | [diff] [blame] | 1917 | vc_conn := f_start_handler(refers(f_TC_assignment_codec), pars); |
Harald Welte | 60aa576 | 2018-03-21 19:33:13 +0100 | [diff] [blame] | 1918 | vc_conn.done; |
| 1919 | } |
| 1920 | |
| 1921 | testcase TC_assignment_codec_amr_h() runs on test_CT { |
| 1922 | var TestHdlrParams pars := valueof(t_def_TestHdlrPars); |
| 1923 | var MSC_ConnHdlr vc_conn; |
Neels Hofmeyr | bcf62bc | 2018-07-04 00:24:33 +0200 | [diff] [blame] | 1924 | var RSL_IE_Body mr_conf := { |
| 1925 | other := { |
| 1926 | len := 2, |
| 1927 | payload := '2804'O |
| 1928 | } |
| 1929 | }; |
Harald Welte | 60aa576 | 2018-03-21 19:33:13 +0100 | [diff] [blame] | 1930 | |
| 1931 | f_init(1, true); |
| 1932 | f_sleep(1.0); |
| 1933 | |
| 1934 | pars.ass_codec_list := valueof(ts_BSSMAP_IE_CodecList({ts_CodecAMR_H})); |
Neels Hofmeyr | bcf62bc | 2018-07-04 00:24:33 +0200 | [diff] [blame] | 1935 | pars.expect_mr_conf_ie := mr_conf; |
Harald Welte | 8863fa1 | 2018-05-10 20:15:27 +0200 | [diff] [blame] | 1936 | vc_conn := f_start_handler(refers(f_TC_assignment_codec), pars); |
Harald Welte | 60aa576 | 2018-03-21 19:33:13 +0100 | [diff] [blame] | 1937 | vc_conn.done; |
| 1938 | } |
| 1939 | |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1940 | /* test if L3 RR CLASSMARK CHANGE is translated to BSSMAP CLASSMARK UPDATE */ |
| 1941 | private function f_tc_classmark(charstring id) runs on MSC_ConnHdlr { |
Harald Welte | a063003 | 2018-03-20 21:09:55 +0100 | [diff] [blame] | 1942 | g_pars := valueof(t_def_TestHdlrPars); |
| 1943 | f_create_chan_and_exp(); |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1944 | /* we should now have a COMPL_L3 at the MSC */ |
| 1945 | BSSAP.receive(tr_BSSMAP_ComplL3); |
| 1946 | |
| 1947 | f_rsl_send_l3(ts_RRM_CM_CHG(valueof(ts_CM2))); |
| 1948 | BSSAP.receive(tr_BSSMAP_ClassmarkUpd(?, omit)); |
| 1949 | setverdict(pass); |
| 1950 | } |
| 1951 | testcase TC_classmark() runs on test_CT { |
| 1952 | var MSC_ConnHdlr vc_conn; |
| 1953 | f_init(1, true); |
| 1954 | f_sleep(1.0); |
Harald Welte | 8863fa1 | 2018-05-10 20:15:27 +0200 | [diff] [blame] | 1955 | vc_conn := f_start_handler(refers(f_tc_classmark)); |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1956 | vc_conn.done; |
| 1957 | } |
| 1958 | |
Harald Welte | e3bd658 | 2018-01-31 22:51:25 +0100 | [diff] [blame] | 1959 | private function f_est_single_l3(template PDU_ML3_MS_NW l3) runs on MSC_ConnHdlr { |
Harald Welte | a063003 | 2018-03-20 21:09:55 +0100 | [diff] [blame] | 1960 | g_pars := valueof(t_def_TestHdlrPars); |
| 1961 | f_create_chan_and_exp(); |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1962 | /* we should now have a COMPL_L3 at the MSC */ |
| 1963 | BSSAP.receive(tr_BSSMAP_ComplL3); |
| 1964 | |
Harald Welte | e3bd658 | 2018-01-31 22:51:25 +0100 | [diff] [blame] | 1965 | /* send the single message we want to send */ |
| 1966 | f_rsl_send_l3(l3); |
| 1967 | } |
| 1968 | |
| 1969 | private function f_bssap_expect_nothing(float sec := 5.00) runs on MSC_ConnHdlr { |
| 1970 | timer T := sec; |
| 1971 | var PDU_BSSAP bssap; |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1972 | T.start; |
| 1973 | alt { |
Harald Welte | e3bd658 | 2018-01-31 22:51:25 +0100 | [diff] [blame] | 1974 | [] BSSAP.receive(PDU_BSSAP:?) -> value bssap { |
| 1975 | setverdict(fail, "Unexpected BSSMAP ", bssap); |
| 1976 | self.stop; |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1977 | } |
| 1978 | [] T.timeout { |
| 1979 | setverdict(pass); |
| 1980 | } |
| 1981 | } |
| 1982 | } |
| 1983 | |
Harald Welte | e3bd658 | 2018-01-31 22:51:25 +0100 | [diff] [blame] | 1984 | /* unsolicited ASSIGNMENT FAIL (without ASSIGN) from MS shouldn't bring BSC down */ |
| 1985 | private function f_tc_unsol_ass_fail(charstring id) runs on MSC_ConnHdlr { |
| 1986 | f_est_single_l3(ts_RRM_AssignmentFailure('00'O)); |
| 1987 | f_bssap_expect_nothing(); |
| 1988 | } |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1989 | testcase TC_unsol_ass_fail() runs on test_CT { |
| 1990 | var MSC_ConnHdlr vc_conn; |
| 1991 | f_init(1, true); |
| 1992 | f_sleep(1.0); |
Harald Welte | 8863fa1 | 2018-05-10 20:15:27 +0200 | [diff] [blame] | 1993 | vc_conn := f_start_handler(refers(f_tc_unsol_ass_fail)); |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1994 | vc_conn.done; |
| 1995 | } |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1996 | |
Harald Welte | ea99a00 | 2018-01-31 20:46:43 +0100 | [diff] [blame] | 1997 | |
| 1998 | /* unsolicited ASSIGNMENT COMPLETE (without ASSIGN) from MS shouldn't bring BSC down */ |
| 1999 | private function f_tc_unsol_ass_compl(charstring id) runs on MSC_ConnHdlr { |
Harald Welte | e3bd658 | 2018-01-31 22:51:25 +0100 | [diff] [blame] | 2000 | f_est_single_l3(ts_RRM_AssignmentComplete('00'O)); |
| 2001 | f_bssap_expect_nothing(); |
Harald Welte | ea99a00 | 2018-01-31 20:46:43 +0100 | [diff] [blame] | 2002 | } |
| 2003 | testcase TC_unsol_ass_compl() runs on test_CT { |
| 2004 | var MSC_ConnHdlr vc_conn; |
| 2005 | f_init(1, true); |
| 2006 | f_sleep(1.0); |
Harald Welte | 8863fa1 | 2018-05-10 20:15:27 +0200 | [diff] [blame] | 2007 | vc_conn := f_start_handler(refers(f_tc_unsol_ass_compl)); |
Harald Welte | ea99a00 | 2018-01-31 20:46:43 +0100 | [diff] [blame] | 2008 | vc_conn.done; |
| 2009 | } |
| 2010 | |
| 2011 | |
Harald Welte | fbf9b5e | 2018-01-31 20:41:23 +0100 | [diff] [blame] | 2012 | /* unsolicited HANDOVER FAIL (without ASSIGN) from MS shouldn't bring BSC down */ |
| 2013 | private function f_tc_unsol_ho_fail(charstring id) runs on MSC_ConnHdlr { |
Harald Welte | e3bd658 | 2018-01-31 22:51:25 +0100 | [diff] [blame] | 2014 | f_est_single_l3(ts_RRM_HandoverFailure('00'O)); |
| 2015 | f_bssap_expect_nothing(); |
Harald Welte | fbf9b5e | 2018-01-31 20:41:23 +0100 | [diff] [blame] | 2016 | } |
Harald Welte | fbf9b5e | 2018-01-31 20:41:23 +0100 | [diff] [blame] | 2017 | testcase TC_unsol_ho_fail() runs on test_CT { |
| 2018 | var MSC_ConnHdlr vc_conn; |
| 2019 | f_init(1, true); |
| 2020 | f_sleep(1.0); |
Harald Welte | 8863fa1 | 2018-05-10 20:15:27 +0200 | [diff] [blame] | 2021 | vc_conn := f_start_handler(refers(f_tc_unsol_ho_fail)); |
Harald Welte | fbf9b5e | 2018-01-31 20:41:23 +0100 | [diff] [blame] | 2022 | vc_conn.done; |
| 2023 | } |
| 2024 | |
| 2025 | |
Harald Welte | e3bd658 | 2018-01-31 22:51:25 +0100 | [diff] [blame] | 2026 | /* short message from MS should be ignored */ |
| 2027 | private function f_tc_err_82_short_msg(charstring id) runs on MSC_ConnHdlr { |
Harald Welte | a063003 | 2018-03-20 21:09:55 +0100 | [diff] [blame] | 2028 | g_pars := valueof(t_def_TestHdlrPars); |
| 2029 | f_create_chan_and_exp(); |
Harald Welte | e3bd658 | 2018-01-31 22:51:25 +0100 | [diff] [blame] | 2030 | /* we should now have a COMPL_L3 at the MSC */ |
| 2031 | BSSAP.receive(tr_BSSMAP_ComplL3); |
| 2032 | |
| 2033 | /* send short message */ |
| 2034 | RSL.send(ts_RSL_DATA_IND(g_chan_nr, valueof(ts_RslLinkID_DCCH(0)), ''O)); |
| 2035 | f_bssap_expect_nothing(); |
| 2036 | } |
| 2037 | testcase TC_err_82_short_msg() runs on test_CT { |
| 2038 | var MSC_ConnHdlr vc_conn; |
| 2039 | f_init(1, true); |
| 2040 | f_sleep(1.0); |
Harald Welte | 8863fa1 | 2018-05-10 20:15:27 +0200 | [diff] [blame] | 2041 | vc_conn := f_start_handler(refers(f_tc_err_82_short_msg)); |
Harald Welte | e3bd658 | 2018-01-31 22:51:25 +0100 | [diff] [blame] | 2042 | vc_conn.done; |
| 2043 | } |
| 2044 | |
| 2045 | |
Harald Welte | e9e02e4 | 2018-01-31 23:36:25 +0100 | [diff] [blame] | 2046 | /* 24.008 8.4 Unknown message must trigger RR STATUS */ |
| 2047 | private function f_tc_err_84_unknown_msg(charstring id) runs on MSC_ConnHdlr { |
| 2048 | f_est_single_l3(ts_RRM_UL_REL('00'O)); |
| 2049 | timer T := 3.0 |
| 2050 | alt { |
| 2051 | [] RSL.receive(tr_RSL_DATA_REQ(g_chan_nr, ?, decmatch tr_RRM_RR_STATUS)) { |
| 2052 | setverdict(pass); |
| 2053 | } |
| 2054 | [] BSSAP.receive { setverdict(fail, "unexpected BSSAP"); } |
Harald Welte | 458fd37 | 2018-03-21 11:26:23 +0100 | [diff] [blame] | 2055 | [] T.timeout { setverdict(fail, "Timeout waiting for RR STATUS"); } |
Harald Welte | e9e02e4 | 2018-01-31 23:36:25 +0100 | [diff] [blame] | 2056 | } |
| 2057 | } |
| 2058 | testcase TC_err_84_unknown_msg() runs on test_CT { |
| 2059 | var MSC_ConnHdlr vc_conn; |
| 2060 | f_init(1, true); |
| 2061 | f_sleep(1.0); |
Harald Welte | 8863fa1 | 2018-05-10 20:15:27 +0200 | [diff] [blame] | 2062 | vc_conn := f_start_handler(refers(f_tc_err_84_unknown_msg)); |
Harald Welte | e9e02e4 | 2018-01-31 23:36:25 +0100 | [diff] [blame] | 2063 | vc_conn.done; |
| 2064 | } |
| 2065 | |
Harald Welte | 94e0c34 | 2018-04-07 11:33:23 +0200 | [diff] [blame] | 2066 | /* execute a "bts <0-255> trx <0-255> timeslot <0-7> " command on given Dchan */ |
| 2067 | private function f_vty_ts_action(charstring suffix, integer bts_nr, integer trx_nr, integer ts_nr) |
| 2068 | runs on test_CT { |
| 2069 | var charstring cmd := "bts "&int2str(bts_nr)&" trx "&int2str(trx_nr)& |
| 2070 | " timeslot "&int2str(ts_nr)&" "; |
| 2071 | f_vty_transceive(BSCVTY, cmd & suffix); |
| 2072 | } |
| 2073 | |
Harald Welte | 261af4b | 2018-02-12 21:20:39 +0100 | [diff] [blame] | 2074 | /* execute a "bts <0-255> trx <0-255> timeslot <0-7> sub-slot <0-7>" command on given Dchan */ |
| 2075 | private function f_vty_ss_action(charstring suffix, integer bts_nr, integer trx_nr, RslChannelNr chan_nr) |
| 2076 | runs on MSC_ConnHdlr { |
| 2077 | /* FIXME: resolve those from component-global state */ |
| 2078 | var integer ts_nr := chan_nr.tn; |
| 2079 | var integer ss_nr; |
| 2080 | if (ischosen(chan_nr.u.ch0)) { |
| 2081 | ss_nr := 0; |
| 2082 | } else if (ischosen(chan_nr.u.lm)) { |
| 2083 | ss_nr := chan_nr.u.lm.sub_chan; |
| 2084 | } else if (ischosen(chan_nr.u.sdcch4)) { |
| 2085 | ss_nr := chan_nr.u.sdcch4.sub_chan; |
| 2086 | } else if (ischosen(chan_nr.u.sdcch8)) { |
| 2087 | ss_nr := chan_nr.u.sdcch8.sub_chan; |
| 2088 | } else { |
| 2089 | setverdict(fail, "Invalid ChanNr ", chan_nr); |
| 2090 | self.stop; |
| 2091 | } |
| 2092 | |
| 2093 | var charstring cmd := "bts "&int2str(bts_nr)&" trx "&int2str(trx_nr)& |
| 2094 | " timeslot "&int2str(ts_nr)&" sub-slot "&int2str(ss_nr)&" "; |
| 2095 | f_vty_transceive(BSCVTY, cmd & suffix); |
| 2096 | } |
| 2097 | |
| 2098 | private function f_vty_handover(integer bts_nr, integer trx_nr, RslChannelNr chan_nr, |
| 2099 | integer new_bts_nr) |
| 2100 | runs on MSC_ConnHdlr { |
| 2101 | f_vty_ss_action("handover " & int2str(new_bts_nr), bts_nr, trx_nr, chan_nr); |
| 2102 | } |
| 2103 | |
| 2104 | /* intra-BSC hand-over between BTS0 and BTS1 */ |
| 2105 | private function f_tc_ho_int(charstring id) runs on MSC_ConnHdlr { |
Harald Welte | a063003 | 2018-03-20 21:09:55 +0100 | [diff] [blame] | 2106 | g_pars := valueof(t_def_TestHdlrPars); |
Harald Welte | ed84851 | 2018-05-24 22:27:58 +0200 | [diff] [blame] | 2107 | var template PDU_BSSAP exp_compl := f_gen_exp_compl(); |
| 2108 | var PDU_BSSAP ass_cmd := f_gen_ass_req(); |
Harald Welte | 261af4b | 2018-02-12 21:20:39 +0100 | [diff] [blame] | 2109 | const OCT8 kc := '0001020304050607'O; |
| 2110 | |
| 2111 | ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType); |
| 2112 | ass_cmd.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR})); |
| 2113 | |
Harald Welte | a063003 | 2018-03-20 21:09:55 +0100 | [diff] [blame] | 2114 | f_establish_fully(ass_cmd, exp_compl); |
Harald Welte | 261af4b | 2018-02-12 21:20:39 +0100 | [diff] [blame] | 2115 | |
| 2116 | var HandoverState hs := { |
| 2117 | rr_ho_cmpl_seen := false, |
| 2118 | handover_done := false, |
| 2119 | old_chan_nr := - |
| 2120 | }; |
| 2121 | /* issue hand-over command on VTY */ |
| 2122 | f_vty_handover(0, 0, g_chan_nr, 1); |
| 2123 | /* temporarily suspend DChan processing on BTS1 to avoid race with RSLEM_register */ |
| 2124 | f_rslem_suspend(RSL1_PROC); |
Philipp Maier | 3e2af5d | 2018-07-11 17:01:05 +0200 | [diff] [blame] | 2125 | |
| 2126 | /* From the MGW perspective, a handover is is characterized by |
| 2127 | * performing one MDCX operation with the MGW. So we expect to see |
| 2128 | * one more MDCX during handover. */ |
| 2129 | g_media.mgcp_conn[0].mdcx_seen_exp := g_media.mgcp_conn[0].crcx_seen_exp + 1; |
| 2130 | |
Harald Welte | 261af4b | 2018-02-12 21:20:39 +0100 | [diff] [blame] | 2131 | alt { |
| 2132 | [] as_handover(hs); |
Harald Welte | 261af4b | 2018-02-12 21:20:39 +0100 | [diff] [blame] | 2133 | } |
Philipp Maier | 3e2af5d | 2018-07-11 17:01:05 +0200 | [diff] [blame] | 2134 | |
| 2135 | /* Check the amount of MGCP transactions is still consistant with the |
| 2136 | * test expectation */ |
| 2137 | f_check_mgcp_expectations() |
Harald Welte | 261af4b | 2018-02-12 21:20:39 +0100 | [diff] [blame] | 2138 | } |
| 2139 | |
| 2140 | testcase TC_ho_int() runs on test_CT { |
| 2141 | var MSC_ConnHdlr vc_conn; |
| 2142 | f_init(2, true); |
| 2143 | f_sleep(1.0); |
Harald Welte | 8863fa1 | 2018-05-10 20:15:27 +0200 | [diff] [blame] | 2144 | vc_conn := f_start_handler(refers(f_tc_ho_int)); |
Harald Welte | 261af4b | 2018-02-12 21:20:39 +0100 | [diff] [blame] | 2145 | vc_conn.done; |
| 2146 | } |
Harald Welte | e9e02e4 | 2018-01-31 23:36:25 +0100 | [diff] [blame] | 2147 | |
Neels Hofmeyr | cdc2d76 | 2018-03-12 01:48:11 +0100 | [diff] [blame] | 2148 | /* OS#3041: Open and close N connections in a normal fashion, and expect no |
| 2149 | * BSSMAP Reset just because of that. */ |
| 2150 | testcase TC_bssap_rlsd_does_not_cause_bssmap_reset() runs on test_CT { |
| 2151 | var default d; |
| 2152 | var integer i; |
| 2153 | var DchanTuple dt; |
| 2154 | |
| 2155 | f_init(); |
| 2156 | |
| 2157 | /* Wait for initial BSSMAP Reset to pass */ |
| 2158 | f_sleep(4.0); |
| 2159 | |
| 2160 | d := activate(no_bssmap_reset()); |
| 2161 | |
| 2162 | /* Setup up a number of connections and RLSD them again from the MSC |
| 2163 | * side. In the buggy behavior, the fourth one triggers BSSMAP Reset. |
| 2164 | * Let's do it some more times for good measure. */ |
Harald Welte | c3260d9 | 2018-06-11 17:48:16 +0200 | [diff] [blame] | 2165 | for (i := 0; i < 4; i := i+1) { |
Neels Hofmeyr | cdc2d76 | 2018-03-12 01:48:11 +0100 | [diff] [blame] | 2166 | /* Since we're doing a lot of runs, give each one a fresh |
| 2167 | * T_guard from the top. */ |
| 2168 | T_guard.start; |
| 2169 | |
| 2170 | /* Setup a BSSAP connection and clear it right away. This is |
| 2171 | * the MSC telling the BSC about a planned release, it's not an |
| 2172 | * erratic loss of a connection. */ |
Harald Welte | a189718 | 2018-06-11 13:53:09 +0200 | [diff] [blame] | 2173 | dt := f_est_dchan(int2oct(i,1), 23+i, '00010203040506'O); |
Neels Hofmeyr | cdc2d76 | 2018-03-12 01:48:11 +0100 | [diff] [blame] | 2174 | |
| 2175 | /* MSC disconnects (RLSD). */ |
| 2176 | BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0)); |
| 2177 | } |
| 2178 | |
| 2179 | /* In the buggy behavior, a timeout of 2 seconds happens between above |
| 2180 | * trigger (logs "SIGTRAN connection down, reconnecting...") and the |
| 2181 | * actual BSSMAP Reset. Wait a bit longer just to make sure. */ |
| 2182 | f_sleep(4.0); |
| 2183 | |
| 2184 | deactivate(d); |
| 2185 | f_shutdown_helper(); |
| 2186 | } |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 2187 | |
Neels Hofmeyr | 4ff9328 | 2018-03-12 04:25:35 +0100 | [diff] [blame] | 2188 | /* OS#3041: Open and close N connections in a normal fashion, and expect no |
| 2189 | * BSSMAP Reset just because of that. Invoke the release by a BSSMAP Clear from |
| 2190 | * the MSC. */ |
| 2191 | testcase TC_bssmap_clear_does_not_cause_bssmap_reset() runs on test_CT { |
| 2192 | var default d; |
| 2193 | var integer i; |
| 2194 | var DchanTuple dt; |
| 2195 | var BSSAP_N_DATA_ind rx_di; |
Neels Hofmeyr | 4ff9328 | 2018-03-12 04:25:35 +0100 | [diff] [blame] | 2196 | var myBSSMAP_Cause cause_val := GSM0808_CAUSE_CALL_CONTROL; |
| 2197 | var BssmapCause cause := enum2int(cause_val); |
| 2198 | |
| 2199 | f_init(); |
| 2200 | |
| 2201 | /* Wait for initial BSSMAP Reset to pass */ |
| 2202 | f_sleep(4.0); |
| 2203 | |
| 2204 | d := activate(no_bssmap_reset()); |
| 2205 | |
| 2206 | /* Setup up a number of connections and RLSD them again from the MSC |
| 2207 | * side. In the buggy behavior, the fourth one triggers BSSMAP Reset. |
| 2208 | * Let's do it some more times for good measure. */ |
| 2209 | for (i := 0; i < 8; i := i+1) { |
| 2210 | /* Since we're doing a lot of runs, give each one a fresh |
| 2211 | * T_guard from the top. */ |
| 2212 | T_guard.start; |
| 2213 | |
| 2214 | /* Setup a BSSAP connection and clear it right away. This is |
| 2215 | * the MSC telling the BSC about a planned release, it's not an |
| 2216 | * erratic loss of a connection. */ |
Harald Welte | a189718 | 2018-06-11 13:53:09 +0200 | [diff] [blame] | 2217 | dt := f_est_dchan(int2oct(i,1), 23+i, '00010203040506'O); |
Neels Hofmeyr | 4ff9328 | 2018-03-12 04:25:35 +0100 | [diff] [blame] | 2218 | |
| 2219 | /* Instruct BSC to clear channel */ |
| 2220 | BSSAP.send(ts_BSSAP_DATA_req(dt.sccp_conn_id, ts_BSSMAP_ClearCommand(cause))); |
| 2221 | |
| 2222 | /* expect BSC to disable the channel */ |
Harald Welte | 641fcbe | 2018-06-14 10:58:35 +0200 | [diff] [blame] | 2223 | f_exp_chan_rel_and_clear(dt, 0); |
Neels Hofmeyr | 4ff9328 | 2018-03-12 04:25:35 +0100 | [diff] [blame] | 2224 | } |
| 2225 | |
| 2226 | /* In the buggy behavior, a timeout of 2 seconds happens between above |
| 2227 | * trigger (logs "SIGTRAN connection down, reconnecting...") and the |
| 2228 | * actual BSSMAP Reset. Wait a bit longer just to make sure. */ |
| 2229 | f_sleep(4.0); |
| 2230 | |
| 2231 | deactivate(d); |
| 2232 | f_shutdown_helper(); |
| 2233 | } |
| 2234 | |
Neels Hofmeyr | fd445c3 | 2018-03-09 15:39:31 +0100 | [diff] [blame] | 2235 | /* OS#3041: Open and close N connections in a normal fashion, and expect no |
| 2236 | * BSSMAP Reset just because of that. Close connections from the MS side with a |
| 2237 | * Release Ind on RSL. */ |
| 2238 | testcase TC_ms_rel_ind_does_not_cause_bssmap_reset() runs on test_CT { |
| 2239 | var default d; |
| 2240 | var integer i; |
| 2241 | var DchanTuple dt; |
| 2242 | var BSSAP_N_DATA_ind rx_di; |
Neels Hofmeyr | fd445c3 | 2018-03-09 15:39:31 +0100 | [diff] [blame] | 2243 | var integer j; |
| 2244 | |
| 2245 | f_init(); |
| 2246 | |
| 2247 | /* Wait for initial BSSMAP Reset to pass */ |
| 2248 | f_sleep(4.0); |
| 2249 | |
| 2250 | d := activate(no_bssmap_reset()); |
| 2251 | |
| 2252 | /* Setup up a number of connections and RLSD them again from the MSC |
| 2253 | * side. In the buggy behavior, the fourth one triggers BSSMAP Reset. |
| 2254 | * Let's do it some more times for good measure. */ |
| 2255 | for (i := 0; i < 8; i := i+1) { |
| 2256 | /* Since we're doing a lot of runs, give each one a fresh |
| 2257 | * T_guard from the top. */ |
| 2258 | T_guard.start; |
| 2259 | |
| 2260 | /* Setup a BSSAP connection and clear it right away. This is |
| 2261 | * the MSC telling the BSC about a planned release, it's not an |
| 2262 | * erratic loss of a connection. */ |
| 2263 | dt := f_est_dchan('23'O, 23, '00010203040506'O); |
| 2264 | |
| 2265 | /* simulate RLL REL IND */ |
| 2266 | f_ipa_tx(0, ts_RSL_REL_IND(dt.rsl_chan_nr, valueof(ts_RslLinkID_DCCH(0)))); |
| 2267 | |
| 2268 | /* expect Clear Request on MSC side */ |
| 2269 | BSSAP.receive(tr_BSSAP_DATA_ind(dt.sccp_conn_id, tr_BSSMAP_ClearRequest)) -> value rx_di; |
| 2270 | |
| 2271 | /* Instruct BSC to clear channel */ |
| 2272 | var BssmapCause cause := bit2int(rx_di.userData.pdu.bssmap.clearRequest.cause.causeValue); |
| 2273 | BSSAP.send(ts_BSSAP_DATA_req(dt.sccp_conn_id, ts_BSSMAP_ClearCommand(cause))); |
| 2274 | |
| 2275 | /* expect BSC to disable the channel */ |
Harald Welte | 641fcbe | 2018-06-14 10:58:35 +0200 | [diff] [blame] | 2276 | f_exp_chan_rel_and_clear(dt, 0); |
Neels Hofmeyr | fd445c3 | 2018-03-09 15:39:31 +0100 | [diff] [blame] | 2277 | } |
| 2278 | |
| 2279 | /* In the buggy behavior, a timeout of 2 seconds happens between above |
| 2280 | * trigger (logs "SIGTRAN connection down, reconnecting...") and the |
| 2281 | * actual BSSMAP Reset. Wait a bit longer just to make sure. */ |
| 2282 | f_sleep(4.0); |
| 2283 | |
| 2284 | deactivate(d); |
| 2285 | f_shutdown_helper(); |
| 2286 | } |
| 2287 | |
Harald Welte | 94e0c34 | 2018-04-07 11:33:23 +0200 | [diff] [blame] | 2288 | /*********************************************************************** |
| 2289 | * IPA style dynamic PDCH |
| 2290 | ***********************************************************************/ |
| 2291 | |
| 2292 | private function f_dyn_ipa_pdch_act(integer bts_nr, integer trx_nr, integer ts_nr, |
| 2293 | template (omit) RSL_Cause nack := omit) |
| 2294 | runs on test_CT { |
| 2295 | var RslChannelNr chan_nr := valueof(t_RslChanNr_Bm(ts_nr)); |
| 2296 | var RSL_Message rsl_unused; |
| 2297 | /* ask BSC via VTY to activate a given IPA style chan as PDCH */ |
| 2298 | f_vty_ts_action("pdch activate", bts_nr, trx_nr, ts_nr); |
| 2299 | /* expect the BSC to issue the related RSL command */ |
| 2300 | rsl_unused := f_exp_ipa_rx(0, tr_RSL_IPA_PDCH_ACT(chan_nr)); |
| 2301 | if (istemplatekind(nack, "omit")) { |
| 2302 | /* respond with a related acknowledgement */ |
| 2303 | f_ipa_tx(0, ts_RSL_IPA_PDCH_ACT_ACK(chan_nr, ts_RSL_IE_FrameNumber(2342))); |
| 2304 | } else { |
| 2305 | f_ipa_tx(0, ts_RSL_IPA_PDCH_ACT_NACK(chan_nr, valueof(nack))); |
| 2306 | } |
| 2307 | } |
| 2308 | |
| 2309 | private function f_dyn_ipa_pdch_deact(integer bts_nr, integer trx_nr, integer ts_nr, |
| 2310 | template (omit) RSL_Cause nack := omit) |
| 2311 | runs on test_CT { |
| 2312 | var RslChannelNr chan_nr := valueof(t_RslChanNr_Bm(ts_nr)); |
| 2313 | var RSL_Message rsl_unused; |
| 2314 | /* ask BSC via VTY to activate a given IPA style chan as PDCH */ |
| 2315 | f_vty_ts_action("pdch deactivate", bts_nr, trx_nr, ts_nr); |
| 2316 | /* expect the BSC to issue the related RSL command */ |
| 2317 | rsl_unused := f_exp_ipa_rx(0, tr_RSL_IPA_PDCH_DEACT(chan_nr)); |
| 2318 | if (istemplatekind(nack, "omit")) { |
| 2319 | /* respond with a related acknowledgement */ |
| 2320 | f_ipa_tx(0, ts_RSL_IPA_PDCH_DEACT_ACK(chan_nr)); |
| 2321 | } else { |
| 2322 | f_ipa_tx(0, ts_RSL_IPA_PDCH_DEACT_NACK(chan_nr, valueof(nack))); |
| 2323 | } |
| 2324 | } |
| 2325 | |
| 2326 | private function f_ts_dyn_mode_get(integer bts_nr, integer trx_nr, integer ts_nr) |
| 2327 | runs on test_CT return charstring { |
| 2328 | var charstring cmd, resp; |
| 2329 | cmd := "show timeslot "&int2str(bts_nr)&" "&int2str(trx_nr)&" "&int2str(ts_nr); |
| 2330 | resp := f_vty_transceive_ret(BSCVTY, cmd); |
| 2331 | return regexp(resp, "*\((*)\)*", 0); |
| 2332 | } |
| 2333 | |
| 2334 | private function f_ts_dyn_mode_assert(integer bts_nr, integer trx_nr, integer ts_nr, |
| 2335 | template charstring exp) |
| 2336 | runs on test_CT { |
| 2337 | var charstring mode := f_ts_dyn_mode_get(bts_nr, trx_nr, ts_nr); |
| 2338 | if (not match(mode, exp)) { |
| 2339 | setverdict(fail, "Unexpected TS Mode: ", mode); |
| 2340 | self.stop; |
| 2341 | } |
| 2342 | } |
| 2343 | |
| 2344 | private function f_ts_set_chcomb(integer bts_nr, integer trx_nr, integer ts_nr, charstring chcomb) |
| 2345 | runs on test_CT { |
| 2346 | f_vty_enter_cfg_ts(BSCVTY, bts_nr, trx_nr, ts_nr); |
| 2347 | f_vty_transceive(BSCVTY, "phys_chan_config " & chcomb); |
| 2348 | f_vty_transceive(BSCVTY, "end"); |
| 2349 | } |
| 2350 | |
| 2351 | private const charstring TCHF_MODE := "TCH/F mode"; |
| 2352 | private const charstring TCHH_MODE := "TCH/H mode"; |
| 2353 | private const charstring PDCH_MODE := "PDCH mode"; |
| 2354 | private const charstring NONE_MODE := "NONE mode"; |
| 2355 | |
| 2356 | /* Test IPA PDCH activation / deactivation triggered by VTY */ |
| 2357 | testcase TC_dyn_pdch_ipa_act_deact() runs on test_CT { |
| 2358 | var RSL_Message rsl_unused; |
| 2359 | |
| 2360 | /* change Timeslot 6 before f_init() starts RSL */ |
| 2361 | f_init_vty(); |
| 2362 | f_ts_set_chcomb(0, 0, 6, "TCH/F_PDCH"); |
| 2363 | f_vty_transceive(BSCVTY, "drop bts connection 0 oml"); |
| 2364 | |
| 2365 | f_init(1, false); |
| 2366 | f_sleep(1.0); |
| 2367 | |
| 2368 | var RslChannelNr chan_nr := valueof(t_RslChanNr_Bm(6)); |
| 2369 | |
| 2370 | f_ts_dyn_mode_assert(0, 0, chan_nr.tn, TCHF_MODE); |
| 2371 | /* The BSC will activate the dynamic PDCH by default, so confirm that */ |
| 2372 | rsl_unused := f_exp_ipa_rx(0, tr_RSL_IPA_PDCH_ACT(chan_nr)); |
| 2373 | f_ipa_tx(0, ts_RSL_IPA_PDCH_ACT_ACK(chan_nr, ts_RSL_IE_FrameNumber(2342))); |
| 2374 | f_sleep(1.0); |
| 2375 | f_ts_dyn_mode_assert(0, 0, chan_nr.tn, PDCH_MODE); |
| 2376 | |
| 2377 | /* De-activate it via VTY */ |
| 2378 | f_dyn_ipa_pdch_deact(0, 0, chan_nr.tn); |
| 2379 | f_sleep(1.0); |
| 2380 | f_ts_dyn_mode_assert(0, 0, chan_nr.tn, TCHF_MODE); |
| 2381 | |
| 2382 | /* re-activate it via VTY */ |
| 2383 | f_dyn_ipa_pdch_act(0, 0, chan_nr.tn); |
| 2384 | f_sleep(1.0); |
| 2385 | f_ts_dyn_mode_assert(0, 0, chan_nr.tn, PDCH_MODE); |
| 2386 | |
| 2387 | /* and finally de-activate it again */ |
| 2388 | f_dyn_ipa_pdch_deact(0, 0, chan_nr.tn); |
| 2389 | f_sleep(1.0); |
| 2390 | f_ts_dyn_mode_assert(0, 0, chan_nr.tn, TCHF_MODE); |
| 2391 | |
Neels Hofmeyr | 887e8f1 | 2018-06-27 01:01:55 +0200 | [diff] [blame] | 2392 | /* clean up config */ |
| 2393 | f_ts_set_chcomb(0, 0, 6, "PDCH"); |
| 2394 | |
Harald Welte | 94e0c34 | 2018-04-07 11:33:23 +0200 | [diff] [blame] | 2395 | setverdict(pass); |
| 2396 | } |
| 2397 | |
| 2398 | /* Test IPA PDCH activation NACK */ |
| 2399 | testcase TC_dyn_pdch_ipa_act_nack() runs on test_CT { |
| 2400 | var RSL_Message rsl_unused; |
| 2401 | |
| 2402 | /* change Timeslot 6 before f_init() starts RSL */ |
| 2403 | f_init_vty(); |
| 2404 | f_ts_set_chcomb(0, 0, 6, "TCH/F_PDCH"); |
| 2405 | f_vty_transceive(BSCVTY, "drop bts connection 0 oml"); |
| 2406 | |
| 2407 | f_init(1, false); |
| 2408 | f_sleep(1.0); |
| 2409 | |
| 2410 | var RslChannelNr chan_nr := valueof(t_RslChanNr_Bm(6)); |
| 2411 | |
| 2412 | f_ts_dyn_mode_assert(0, 0, chan_nr.tn, TCHF_MODE); |
| 2413 | /* The BSC will activate the dynamic PDCH by default, so confirm that */ |
| 2414 | rsl_unused := f_exp_ipa_rx(0, tr_RSL_IPA_PDCH_ACT(chan_nr)); |
| 2415 | f_ipa_tx(0, ts_RSL_IPA_PDCH_ACT_ACK(chan_nr, ts_RSL_IE_FrameNumber(2342))); |
| 2416 | f_sleep(1.0); |
| 2417 | f_ts_dyn_mode_assert(0, 0, chan_nr.tn, PDCH_MODE); |
| 2418 | |
| 2419 | /* De-activate it via VTY */ |
| 2420 | f_dyn_ipa_pdch_deact(0, 0, chan_nr.tn); |
| 2421 | f_sleep(1.0); |
| 2422 | f_ts_dyn_mode_assert(0, 0, chan_nr.tn, TCHF_MODE); |
| 2423 | |
| 2424 | /* re-activate it via VTY, but fail that; check BSC still assumes TCH/F mode */ |
| 2425 | f_dyn_ipa_pdch_act(0, 0, chan_nr.tn, RSL_ERR_EQUIPMENT_FAIL); |
| 2426 | f_sleep(1.0); |
| 2427 | f_ts_dyn_mode_assert(0, 0, chan_nr.tn, TCHF_MODE); |
| 2428 | |
Neels Hofmeyr | 887e8f1 | 2018-06-27 01:01:55 +0200 | [diff] [blame] | 2429 | /* clean up config */ |
| 2430 | f_ts_set_chcomb(0, 0, 6, "PDCH"); |
| 2431 | |
Harald Welte | 94e0c34 | 2018-04-07 11:33:23 +0200 | [diff] [blame] | 2432 | setverdict(pass); |
| 2433 | } |
| 2434 | |
| 2435 | |
| 2436 | /*********************************************************************** |
| 2437 | * Osmocom style dynamic PDCH |
| 2438 | ***********************************************************************/ |
| 2439 | |
| 2440 | private function f_dyn_osmo_pdch_act(integer bts_nr, integer trx_nr, integer ts_nr, |
| 2441 | template (omit) RSL_Cause nack := omit) |
| 2442 | runs on test_CT { |
| 2443 | var RslChannelNr chan_nr := valueof(t_RslChanNr_PDCH(ts_nr)); |
| 2444 | var RSL_Message rsl_unused; |
| 2445 | /* ask BSC via VTY to activate a given IPA style chan as PDCH */ |
| 2446 | /* FIXME: no VTY command to activate Osmocom PDCH !! */ |
| 2447 | /* expect the BSC to issue the related RSL command */ |
| 2448 | rsl_unused := f_exp_ipa_rx(0, tr_RSL_CHAN_ACT(chan_nr, ?)); |
| 2449 | if (istemplatekind(nack, "omit")) { |
| 2450 | /* respond with a related acknowledgement */ |
| 2451 | f_ipa_tx(0, ts_RSL_CHAN_ACT_ACK(chan_nr, 2342)); |
| 2452 | } else { |
| 2453 | f_ipa_tx(0, ts_RSL_CHAN_ACT_NACK(chan_nr, valueof(nack))); |
| 2454 | } |
| 2455 | } |
| 2456 | |
| 2457 | private function f_dyn_osmo_pdch_deact(integer bts_nr, integer trx_nr, integer ts_nr, |
| 2458 | template (omit) RSL_Cause nack := omit) |
| 2459 | runs on test_CT { |
| 2460 | var RslChannelNr chan_nr := valueof(t_RslChanNr_PDCH(ts_nr)); |
| 2461 | var RSL_Message rsl_unused; |
| 2462 | /* ask BSC via VTY to activate a given IPA style chan as PDCH */ |
| 2463 | /* FIXME: no VTY command to activate Osmocom PDCH !! */ |
| 2464 | /* expect the BSC to issue the related RSL command */ |
| 2465 | rsl_unused := f_exp_ipa_rx(0, tr_RSL_RF_CHAN_REL(chan_nr)); |
| 2466 | if (istemplatekind(nack, "omit")) { |
| 2467 | /* respond with a related acknowledgement */ |
| 2468 | f_ipa_tx(0, ts_RSL_RF_CHAN_REL_ACK(chan_nr)); |
| 2469 | } else { |
| 2470 | //f_ipa_tx(0, ts_RSL_RF_CHAN_REL_NACK(chan_nr, valueof(nack))); |
| 2471 | } |
| 2472 | } |
| 2473 | |
| 2474 | /* Test Osmocom dyn PDCH activation / deactivation triggered by VTY */ |
| 2475 | testcase TC_dyn_pdch_osmo_act_deact() runs on test_CT { |
| 2476 | var RSL_Message rsl_unused; |
| 2477 | |
| 2478 | /* change Timeslot 6 before f_init() starts RSL */ |
| 2479 | f_init_vty(); |
| 2480 | f_ts_set_chcomb(0, 0, 6, "TCH/F_TCH/H_PDCH"); |
| 2481 | f_vty_transceive(BSCVTY, "drop bts connection 0 oml"); |
| 2482 | |
| 2483 | f_init(1, false); |
| 2484 | f_sleep(1.0); |
| 2485 | |
| 2486 | var RslChannelNr chan_nr := valueof(t_RslChanNr_PDCH(6)); |
| 2487 | |
| 2488 | f_ts_dyn_mode_assert(0, 0, chan_nr.tn, NONE_MODE); |
| 2489 | /* The BSC will activate the dynamic PDCH by default, so confirm that */ |
| 2490 | rsl_unused := f_exp_ipa_rx(0, tr_RSL_CHAN_ACT_PDCH(chan_nr, ?)); |
| 2491 | |
| 2492 | f_ipa_tx(0, ts_RSL_CHAN_ACT_ACK(chan_nr, 2342)); |
| 2493 | f_sleep(1.0); |
| 2494 | f_ts_dyn_mode_assert(0, 0, chan_nr.tn, PDCH_MODE); |
| 2495 | |
Neels Hofmeyr | 887e8f1 | 2018-06-27 01:01:55 +0200 | [diff] [blame] | 2496 | /* clean up config */ |
| 2497 | f_ts_set_chcomb(0, 0, 6, "PDCH"); |
| 2498 | |
Harald Welte | 94e0c34 | 2018-04-07 11:33:23 +0200 | [diff] [blame] | 2499 | setverdict(pass); |
| 2500 | } |
| 2501 | |
| 2502 | /* Test Osmocom dyn PDCH activation NACK behavior */ |
| 2503 | testcase TC_dyn_pdch_osmo_act_nack() runs on test_CT { |
| 2504 | var RSL_Message rsl_unused; |
| 2505 | |
| 2506 | /* change Timeslot 6 before f_init() starts RSL */ |
| 2507 | f_init_vty(); |
| 2508 | f_ts_set_chcomb(0, 0, 6, "TCH/F_TCH/H_PDCH"); |
| 2509 | f_vty_transceive(BSCVTY, "drop bts connection 0 oml"); |
| 2510 | |
| 2511 | f_init(1, false); |
| 2512 | f_sleep(1.0); |
| 2513 | |
| 2514 | var RslChannelNr chan_nr := valueof(t_RslChanNr_PDCH(6)); |
| 2515 | |
| 2516 | f_ts_dyn_mode_assert(0, 0, chan_nr.tn, NONE_MODE); |
| 2517 | /* The BSC will activate the dynamic PDCH by default, so confirm that */ |
| 2518 | rsl_unused := f_exp_ipa_rx(0, tr_RSL_CHAN_ACT_PDCH(chan_nr, ?)); |
| 2519 | |
| 2520 | /* NACK this activation and expect the "show timeslot" mode still to be NONE */ |
| 2521 | f_ipa_tx(0, ts_RSL_CHAN_ACT_NACK(chan_nr, RSL_ERR_EQUIPMENT_FAIL)); |
| 2522 | f_sleep(1.0); |
| 2523 | f_ts_dyn_mode_assert(0, 0, chan_nr.tn, NONE_MODE); |
| 2524 | |
Neels Hofmeyr | 887e8f1 | 2018-06-27 01:01:55 +0200 | [diff] [blame] | 2525 | /* clean up config */ |
| 2526 | f_ts_set_chcomb(0, 0, 6, "PDCH"); |
| 2527 | |
Harald Welte | 94e0c34 | 2018-04-07 11:33:23 +0200 | [diff] [blame] | 2528 | setverdict(pass); |
| 2529 | } |
| 2530 | |
Harald Welte | 0ea2d5e | 2018-04-07 21:40:29 +0200 | [diff] [blame] | 2531 | /* Dyn PDCH todo: |
| 2532 | * activate OSMO as TCH/F |
| 2533 | * activate OSMO as TCH/H |
| 2534 | * does the BSC-located PCU socket get the updated INFO? |
| 2535 | * what if no PCU is connected at the time? |
| 2536 | * is the info correct on delayed PCU (re)connect? |
| 2537 | */ |
Harald Welte | 94e0c34 | 2018-04-07 11:33:23 +0200 | [diff] [blame] | 2538 | |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 2539 | control { |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 2540 | /* CTRL interface testing */ |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 2541 | execute( TC_ctrl_msc_connection_status() ); |
Stefan Sperling | b041b3d | 2018-01-03 17:14:55 +0100 | [diff] [blame] | 2542 | execute( TC_ctrl_msc0_connection_status() ); |
Harald Welte | 96c9441 | 2017-12-09 03:12:45 +0100 | [diff] [blame] | 2543 | execute( TC_ctrl() ); |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 2544 | |
| 2545 | /* RSL DCHAN Channel ACtivation / Deactivation */ |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 2546 | execute( TC_chan_act_noreply() ); |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 2547 | execute( TC_chan_act_counter() ); |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 2548 | execute( TC_chan_act_ack_noest() ); |
| 2549 | execute( TC_chan_act_ack_est_ind_noreply() ); |
| 2550 | execute( TC_chan_act_ack_est_ind_refused() ); |
Harald Welte | 618ef64 | 2017-12-14 14:58:20 +0100 | [diff] [blame] | 2551 | execute( TC_chan_act_nack() ); |
Harald Welte | 799c97b | 2017-12-14 17:50:30 +0100 | [diff] [blame] | 2552 | execute( TC_chan_exhaustion() ); |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 2553 | execute( TC_chan_rel_rll_rel_ind() ); |
| 2554 | execute( TC_chan_rel_conn_fail() ); |
| 2555 | execute( TC_chan_rel_hard_clear() ); |
Harald Welte | d8c36cd | 2017-12-09 23:05:31 +0100 | [diff] [blame] | 2556 | execute( TC_chan_rel_hard_rlsd() ); |
Harald Welte | 550daf9 | 2018-06-11 19:22:13 +0200 | [diff] [blame] | 2557 | execute( TC_chan_rel_hard_rlsd_ms_dead() ); |
Harald Welte | 85804d4 | 2017-12-10 14:11:58 +0100 | [diff] [blame] | 2558 | execute( TC_chan_rel_a_reset() ); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 2559 | |
Harald Welte | cfe2c96 | 2017-12-15 12:09:32 +0100 | [diff] [blame] | 2560 | execute( TC_outbound_connect() ); |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 2561 | |
| 2562 | /* Assignment related */ |
Harald Welte | 16a4adf | 2017-12-14 18:54:01 +0100 | [diff] [blame] | 2563 | execute( TC_assignment_cic_only() ); |
Harald Welte | 235ebf1 | 2017-12-15 14:18:16 +0100 | [diff] [blame] | 2564 | execute( TC_assignment_csd() ); |
| 2565 | execute( TC_assignment_ctm() ); |
| 2566 | execute( TC_assignment_sign() ); |
| 2567 | execute( TC_assignment_fr_a5_0() ); |
| 2568 | execute( TC_assignment_fr_a5_1() ); |
Harald Welte | 8f67d1d | 2018-05-25 20:38:42 +0200 | [diff] [blame] | 2569 | if (mp_bssap_cfg.transport == BSSAP_TRANSPORT_AoIP) { |
| 2570 | execute( TC_assignment_fr_a5_1_codec_missing() ); |
| 2571 | } |
Harald Welte | 235ebf1 | 2017-12-15 14:18:16 +0100 | [diff] [blame] | 2572 | execute( TC_assignment_fr_a5_3() ); |
| 2573 | execute( TC_assignment_fr_a5_4() ); |
Harald Welte | 3c86ea0 | 2018-05-10 22:28:05 +0200 | [diff] [blame] | 2574 | execute( TC_ciph_mode_a5_0() ); |
| 2575 | execute( TC_ciph_mode_a5_1() ); |
| 2576 | execute( TC_ciph_mode_a5_3() ); |
Harald Welte | 16a4adf | 2017-12-14 18:54:01 +0100 | [diff] [blame] | 2577 | |
Harald Welte | 60aa576 | 2018-03-21 19:33:13 +0100 | [diff] [blame] | 2578 | execute( TC_assignment_codec_fr() ); |
| 2579 | execute( TC_assignment_codec_hr() ); |
| 2580 | execute( TC_assignment_codec_efr() ); |
| 2581 | execute( TC_assignment_codec_amr_f() ); |
| 2582 | execute( TC_assignment_codec_amr_h() ); |
| 2583 | |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 2584 | /* RLL Establish Indication on inactive DCHAN / SAPI */ |
Harald Welte | 5cd20ed | 2017-12-13 21:03:20 +0100 | [diff] [blame] | 2585 | execute( TC_rll_est_ind_inact_lchan() ); |
| 2586 | execute( TC_rll_est_ind_inval_sapi1() ); |
| 2587 | execute( TC_rll_est_ind_inval_sapi3() ); |
| 2588 | execute( TC_rll_est_ind_inval_sacch() ); |
| 2589 | |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 2590 | /* Paging related tests */ |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 2591 | execute( TC_paging_imsi_nochan() ); |
| 2592 | execute( TC_paging_tmsi_nochan() ); |
| 2593 | execute( TC_paging_tmsi_any() ); |
| 2594 | execute( TC_paging_tmsi_sdcch() ); |
| 2595 | execute( TC_paging_tmsi_tch_f() ); |
| 2596 | execute( TC_paging_tmsi_tch_hf() ); |
| 2597 | execute( TC_paging_imsi_nochan_cgi() ); |
| 2598 | execute( TC_paging_imsi_nochan_lac_ci() ); |
| 2599 | execute( TC_paging_imsi_nochan_ci() ); |
| 2600 | execute( TC_paging_imsi_nochan_lai() ); |
| 2601 | execute( TC_paging_imsi_nochan_lac() ); |
| 2602 | execute( TC_paging_imsi_nochan_all() ); |
Harald Welte | 751d3eb | 2018-01-31 15:51:06 +0100 | [diff] [blame] | 2603 | execute( TC_paging_imsi_nochan_plmn_lac_rnc() ); |
| 2604 | execute( TC_paging_imsi_nochan_rnc() ); |
| 2605 | execute( TC_paging_imsi_nochan_lac_rnc() ); |
| 2606 | execute( TC_paging_imsi_nochan_lacs() ); |
| 2607 | execute( TC_paging_imsi_nochan_lacs_empty() ); |
Stefan Sperling | 049a86e | 2018-03-20 15:51:00 +0100 | [diff] [blame] | 2608 | execute( TC_paging_imsi_nochan_cgi_unknown_cid() ); |
Harald Welte | 1098500 | 2017-12-12 09:29:15 +0100 | [diff] [blame] | 2609 | execute( TC_paging_imsi_a_reset() ); |
Harald Welte | e65d40e | 2017-12-13 00:09:06 +0100 | [diff] [blame] | 2610 | execute( TC_paging_imsi_load() ); |
Philipp Maier | 779a792 | 2018-02-16 11:00:37 +0100 | [diff] [blame] | 2611 | execute( TC_paging_counter() ); |
Harald Welte | 4e9b9cc | 2017-12-14 18:31:02 +0100 | [diff] [blame] | 2612 | |
| 2613 | execute( TC_rsl_drop_counter() ); |
Stefan Sperling | 830dc9d | 2018-02-12 21:08:28 +0100 | [diff] [blame] | 2614 | execute( TC_rsl_unknown_unit_id() ); |
| 2615 | |
| 2616 | execute( TC_oml_unknown_unit_id() ); |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 2617 | |
| 2618 | execute( TC_classmark() ); |
| 2619 | execute( TC_unsol_ass_fail() ); |
Harald Welte | ea99a00 | 2018-01-31 20:46:43 +0100 | [diff] [blame] | 2620 | execute( TC_unsol_ass_compl() ); |
Harald Welte | fbf9b5e | 2018-01-31 20:41:23 +0100 | [diff] [blame] | 2621 | execute( TC_unsol_ho_fail() ); |
Harald Welte | e3bd658 | 2018-01-31 22:51:25 +0100 | [diff] [blame] | 2622 | execute( TC_err_82_short_msg() ); |
Harald Welte | e9e02e4 | 2018-01-31 23:36:25 +0100 | [diff] [blame] | 2623 | execute( TC_err_84_unknown_msg() ); |
Harald Welte | 261af4b | 2018-02-12 21:20:39 +0100 | [diff] [blame] | 2624 | execute( TC_ho_int() ); |
Neels Hofmeyr | cdc2d76 | 2018-03-12 01:48:11 +0100 | [diff] [blame] | 2625 | |
| 2626 | execute( TC_bssap_rlsd_does_not_cause_bssmap_reset() ); |
Neels Hofmeyr | 4ff9328 | 2018-03-12 04:25:35 +0100 | [diff] [blame] | 2627 | execute( TC_bssmap_clear_does_not_cause_bssmap_reset() ); |
Neels Hofmeyr | fd445c3 | 2018-03-09 15:39:31 +0100 | [diff] [blame] | 2628 | execute( TC_ms_rel_ind_does_not_cause_bssmap_reset() ); |
Harald Welte | 94e0c34 | 2018-04-07 11:33:23 +0200 | [diff] [blame] | 2629 | |
| 2630 | execute( TC_dyn_pdch_ipa_act_deact() ); |
| 2631 | execute( TC_dyn_pdch_ipa_act_nack() ); |
| 2632 | execute( TC_dyn_pdch_osmo_act_deact() ); |
| 2633 | execute( TC_dyn_pdch_osmo_act_nack() ); |
Harald Welte | 99f3ca0 | 2018-06-14 13:40:29 +0200 | [diff] [blame] | 2634 | |
| 2635 | /* at bottom as they might crash OsmoBSC before OS#3182 is fixed */ |
| 2636 | execute( TC_early_conn_fail() ); |
| 2637 | execute( TC_late_conn_fail() ); |
| 2638 | |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 2639 | } |
| 2640 | |
| 2641 | } |