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 |
| 4 | * (C) 2017 by Harald Welte <laforge@gnumonks.org> |
| 5 | * All rights reserved. |
| 6 | * |
| 7 | * Released under the terms of GNU General Public License, Version 2 or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * 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 | |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 49 | const integer NUM_BTS := 3; |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 50 | const float T3101_MAX := 12.0; |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 51 | |
Harald Welte | 799c97b | 2017-12-14 17:50:30 +0100 | [diff] [blame] | 52 | /* make sure to sync this with the osmo-bts.cfg you're using */ |
| 53 | const integer NUM_TCHF_PER_BTS := 5; |
Harald Welte | dd8cbf3 | 2018-01-28 12:07:52 +0100 | [diff] [blame] | 54 | const integer NUM_SDCCH_PER_BTS := 4; |
Harald Welte | 799c97b | 2017-12-14 17:50:30 +0100 | [diff] [blame] | 55 | |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 56 | |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 57 | /* per-BTS state which we keep */ |
Harald Welte | 96c9441 | 2017-12-09 03:12:45 +0100 | [diff] [blame] | 58 | type record BTS_State { |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 59 | /* component reference to the IPA_Client component used for RSL */ |
Harald Welte | a5d2ab2 | 2017-12-09 14:21:42 +0100 | [diff] [blame] | 60 | IPA_Client rsl |
Harald Welte | 96c9441 | 2017-12-09 03:12:45 +0100 | [diff] [blame] | 61 | } |
| 62 | |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 63 | type component test_CT extends CTRL_Adapter_CT { |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 64 | /* Array of per-BTS state */ |
Harald Welte | 96c9441 | 2017-12-09 03:12:45 +0100 | [diff] [blame] | 65 | var BTS_State bts[NUM_BTS]; |
Harald Welte | 89ab191 | 2018-02-23 18:56:29 +0100 | [diff] [blame] | 66 | /* RSL common Channel Port (for RSL_Emulation) */ |
| 67 | port RSL_CCHAN_PT RSL_CCHAN[NUM_BTS]; |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 68 | /* array of per-BTS RSL test ports */ |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 69 | port IPA_RSL_PT IPA_RSL[NUM_BTS]; |
Stefan Sperling | 830dc9d | 2018-02-12 21:08:28 +0100 | [diff] [blame] | 70 | 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] | 71 | |
Daniel Willmann | 191e0d9 | 2018-01-17 12:44:35 +0100 | [diff] [blame] | 72 | var MGCP_Emulation_CT vc_MGCP; |
Harald Welte | bc03c76 | 2018-02-12 18:09:38 +0100 | [diff] [blame] | 73 | port TELNETasp_PT BSCVTY; |
Daniel Willmann | 191e0d9 | 2018-01-17 12:44:35 +0100 | [diff] [blame] | 74 | |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 75 | var BSSAP_Adapter g_bssap; |
| 76 | /* for old legacy-tests only */ |
| 77 | port BSSAP_CODEC_PT BSSAP; |
| 78 | |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 79 | /* are we initialized yet */ |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 80 | var boolean g_initialized := false; |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 81 | |
| 82 | /* global test case guard timer */ |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 83 | timer T_guard := 30.0; |
| 84 | |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 85 | } |
| 86 | |
| 87 | modulepar { |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 88 | /* IP address at which the BSC can be reached */ |
Harald Welte | 696ddb6 | 2017-12-08 14:01:43 +0100 | [diff] [blame] | 89 | charstring mp_bsc_ip := "127.0.0.1"; |
Stefan Sperling | 830dc9d | 2018-02-12 21:08:28 +0100 | [diff] [blame] | 90 | /* port number to which to establish the IPA OML connections */ |
| 91 | integer mp_bsc_oml_port := 3002; |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 92 | /* port number to which to establish the IPA RSL connections */ |
Harald Welte | 696ddb6 | 2017-12-08 14:01:43 +0100 | [diff] [blame] | 93 | integer mp_bsc_rsl_port := 3003; |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 94 | /* port number to which to establish the IPA CTRL connection */ |
Harald Welte | 96c9441 | 2017-12-09 03:12:45 +0100 | [diff] [blame] | 95 | integer mp_bsc_ctrl_port := 4249; |
Daniel Willmann | 191e0d9 | 2018-01-17 12:44:35 +0100 | [diff] [blame] | 96 | /* IP address at which the test binds */ |
| 97 | charstring mp_test_ip := "127.0.0.1"; |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 98 | |
| 99 | BSSAP_Configuration mp_bssap_cfg := { |
| 100 | sccp_service_type := "mtp3_itu", |
| 101 | sctp_addr := { 23905, "127.0.0.1", 2905, "127.0.0.1" }, |
| 102 | own_pc := 185, |
| 103 | own_ssn := 254, |
| 104 | peer_pc := 187, |
| 105 | peer_ssn := 254, |
| 106 | sio := '83'O |
| 107 | }; |
| 108 | } |
| 109 | |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame^] | 110 | private function f_shutdown_helper() runs on test_CT { |
| 111 | all port.stop; |
| 112 | setverdict(pass); |
| 113 | } |
| 114 | |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 115 | private function f_legacy_bssap_reset() runs on test_CT { |
| 116 | var BSSAP_N_UNITDATA_ind ud_ind; |
| 117 | timer T := 5.0; |
| 118 | BSSAP.send(ts_BSSAP_UNITDATA_req(g_bssap.sccp_addr_peer, g_bssap.sccp_addr_own, ts_BSSMAP_Reset(0))); |
| 119 | T.start; |
| 120 | alt { |
| 121 | [] BSSAP.receive(tr_BSSAP_UNITDATA_ind(g_bssap.sccp_addr_own, g_bssap.sccp_addr_peer, tr_BSSMAP_ResetAck)) { |
| 122 | log("Received RESET-ACK in response to RESET, we're ready to go!"); |
| 123 | } |
| 124 | [] BSSAP.receive(tr_BSSAP_UNITDATA_ind(?, ?, tr_BSSMAP_Reset)) -> value ud_ind { |
| 125 | log("Respoding to inbound RESET with RESET-ACK"); |
| 126 | BSSAP.send(ts_BSSAP_UNITDATA_req(ud_ind.callingAddress, ud_ind.calledAddress, |
| 127 | ts_BSSMAP_ResetAck)); |
| 128 | repeat; |
| 129 | } |
| 130 | [] BSSAP.receive { repeat; } |
| 131 | [] T.timeout { setverdict(fail, "Waiting for RESET-ACK after sending RESET"); } |
| 132 | } |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 133 | } |
| 134 | |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 135 | type record IPA_Client { |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 136 | /* IPA Emulation component reference */ |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 137 | IPA_Emulation_CT vc_IPA, |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 138 | /* Unit-ID and other CCM parameters to use for IPA client emulation */ |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 139 | IPA_CCM_Parameters ccm_pars, |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 140 | /* String identifier for this IPA Client */ |
Harald Welte | 624f963 | 2017-12-16 19:26:04 +0100 | [diff] [blame] | 141 | charstring id, |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 142 | /* Associated RSL Emulation Component (if any). Only used in "Handler mode" */ |
Harald Welte | 624f963 | 2017-12-16 19:26:04 +0100 | [diff] [blame] | 143 | RSL_Emulation_CT vc_RSL optional |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 144 | } |
| 145 | |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 146 | /*! Start the IPA/RSL related bits for one IPA_Client. |
| 147 | * \param clnt IPA_Client for which to establish |
| 148 | * \param bsc_host IP address / hostname of the BSC |
| 149 | * \param bsc_port TCP port number of the BSC |
| 150 | * \param i number identifying this BTS |
| 151 | * \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] | 152 | function f_ipa_rsl_start(inout IPA_Client clnt, charstring bsc_host, PortNumber bsc_port, integer i, |
| 153 | boolean handler_mode := false) |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 154 | runs on test_CT { |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 155 | timer T := 10.0; |
| 156 | |
Harald Welte | 96c9441 | 2017-12-09 03:12:45 +0100 | [diff] [blame] | 157 | clnt.id := "IPA" & int2str(i) & "-RSL"; |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 158 | clnt.vc_IPA := IPA_Emulation_CT.create(clnt.id & "-IPA"); |
| 159 | clnt.ccm_pars := c_IPA_default_ccm_pars; |
| 160 | clnt.ccm_pars.name := "Osmocom TTCN-3 BTS Simulator"; |
| 161 | clnt.ccm_pars.unit_id := int2str(1234+i) & "/0/0"; |
Harald Welte | 624f963 | 2017-12-16 19:26:04 +0100 | [diff] [blame] | 162 | if (handler_mode) { |
| 163 | clnt.vc_RSL := RSL_Emulation_CT.create(clnt.id & "-RSL"); |
Harald Welte | 89ab191 | 2018-02-23 18:56:29 +0100 | [diff] [blame] | 164 | connect(clnt.vc_RSL:CCHAN_PT, self:RSL_CCHAN[i]); |
Harald Welte | 624f963 | 2017-12-16 19:26:04 +0100 | [diff] [blame] | 165 | } |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 166 | |
| 167 | map(clnt.vc_IPA:IPA_PORT, system:IPA_CODEC_PT); |
Harald Welte | 624f963 | 2017-12-16 19:26:04 +0100 | [diff] [blame] | 168 | if (handler_mode) { |
| 169 | connect(clnt.vc_IPA:IPA_RSL_PORT, clnt.vc_RSL:IPA_PT); |
| 170 | } else { |
| 171 | connect(clnt.vc_IPA:IPA_RSL_PORT, self:IPA_RSL[i]); |
| 172 | } |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 173 | |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 174 | 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] | 175 | if (handler_mode) { |
| 176 | clnt.vc_RSL.start(RSL_Emulation.main()); |
| 177 | return; |
| 178 | } |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 179 | |
| 180 | /* wait for IPA RSL link to connect and send ID ACK */ |
| 181 | T.start; |
| 182 | alt { |
| 183 | [] IPA_RSL[i].receive(ASP_IPA_Event:{up_down := ASP_IPA_EVENT_ID_ACK}) { |
| 184 | T.stop; |
| 185 | IPA_RSL[i].send(ts_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,ts_RSL_PAGING_LOAD_IND(23))); |
| 186 | } |
Harald Welte | 60e823a | 2017-12-10 14:10:59 +0100 | [diff] [blame] | 187 | [] IPA_RSL[i].receive(ASP_IPA_Event:?) { repeat } |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 188 | [] IPA_RSL[i].receive { repeat } |
| 189 | [] T.timeout { |
Harald Welte | 96c9441 | 2017-12-09 03:12:45 +0100 | [diff] [blame] | 190 | setverdict(fail, "Timeout RSL waiting for ASP_IPA_EVENT_ID_ACK"); |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 191 | self.stop; |
| 192 | } |
| 193 | } |
| 194 | } |
| 195 | |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 196 | /* 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] | 197 | function f_wait_oml(integer bts_nr, charstring status, float secs_max) runs on test_CT { |
| 198 | timer T := secs_max; |
| 199 | T.start; |
| 200 | while (true) { |
| 201 | if (f_ctrl_get_bts(IPA_CTRL, bts_nr, "oml-connection-state") == status) { |
| 202 | T.stop; |
Harald Welte | bd868bd | 2017-12-10 18:28:40 +0100 | [diff] [blame] | 203 | /* the 'degraded' state exists from OML connection time, and we have to wait |
| 204 | * until all MO's are initialized */ |
| 205 | T.start(1.0); |
| 206 | T.timeout; |
Harald Welte | a5d2ab2 | 2017-12-09 14:21:42 +0100 | [diff] [blame] | 207 | return; |
| 208 | } |
Harald Welte | f0d6ac6 | 2017-12-17 17:02:21 +0100 | [diff] [blame] | 209 | f_sleep(0.1); |
Harald Welte | a5d2ab2 | 2017-12-09 14:21:42 +0100 | [diff] [blame] | 210 | if (not T.running) { |
| 211 | setverdict(fail, "Timeout waiting for oml-connection-state ", status); |
| 212 | self.stop; |
| 213 | } |
| 214 | } |
| 215 | } |
| 216 | |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 217 | /* sleep for given number of (fractional) seconds */ |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 218 | function f_sleep(float seconds) { |
| 219 | timer T := seconds; |
| 220 | T.start; |
| 221 | T.timeout; |
| 222 | } |
| 223 | |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 224 | /* 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] | 225 | altstep as_Tguard() runs on test_CT { |
Harald Welte | 60e823a | 2017-12-10 14:10:59 +0100 | [diff] [blame] | 226 | var BSSAP_N_UNITDATA_ind ud_ind; |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 227 | [] T_guard.timeout { setverdict(fail, "Timeout of T_guard"); } |
Harald Welte | 60e823a | 2017-12-10 14:10:59 +0100 | [diff] [blame] | 228 | /* always respond with RESET ACK to RESET */ |
| 229 | [] BSSAP.receive(tr_BSSAP_UNITDATA_ind(?, ?, tr_BSSMAP_Reset)) -> value ud_ind { |
| 230 | BSSAP.send(ts_BSSAP_UNITDATA_req(ud_ind.callingAddress, ud_ind.calledAddress, |
| 231 | ts_BSSMAP_ResetAck)); |
Harald Welte | 69c1c26 | 2017-12-13 21:02:08 +0100 | [diff] [blame] | 232 | repeat; |
Harald Welte | 60e823a | 2017-12-10 14:10:59 +0100 | [diff] [blame] | 233 | } |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 234 | } |
| 235 | |
Daniel Willmann | 191e0d9 | 2018-01-17 12:44:35 +0100 | [diff] [blame] | 236 | function f_init_mgcp(charstring id) runs on test_CT { |
| 237 | id := id & "-MGCP"; |
| 238 | |
| 239 | var MGCPOps ops := { |
| 240 | create_cb := refers(MGCP_Emulation.ExpectedCreateCallback), |
| 241 | unitdata_cb := refers(MGCP_Emulation.DummyUnitdataCallback) |
| 242 | }; |
| 243 | var MGCP_conn_parameters mgcp_pars := { |
| 244 | callagent_ip := mp_bsc_ip, |
Harald Welte | 9e4273e | 2018-01-29 22:01:22 +0100 | [diff] [blame] | 245 | callagent_udp_port := -1, |
Daniel Willmann | 191e0d9 | 2018-01-17 12:44:35 +0100 | [diff] [blame] | 246 | mgw_ip := mp_test_ip, |
| 247 | mgw_udp_port := 2427 |
| 248 | }; |
| 249 | |
| 250 | vc_MGCP := MGCP_Emulation_CT.create(id); |
| 251 | vc_MGCP.start(MGCP_Emulation.main(ops, mgcp_pars, id)); |
| 252 | } |
| 253 | |
Harald Welte | bc03c76 | 2018-02-12 18:09:38 +0100 | [diff] [blame] | 254 | private function f_init_vty(charstring id) runs on test_CT { |
| 255 | map(self:BSCVTY, system:BSCVTY); |
| 256 | f_vty_set_prompts(BSCVTY); |
| 257 | f_vty_transceive(BSCVTY, "enable"); |
| 258 | } |
| 259 | |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 260 | /* global initialization function |
| 261 | * \param nr_bts Number of BTSs we should start/bring up |
| 262 | * \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] | 263 | 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] | 264 | var integer i; |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 265 | |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 266 | if (g_initialized) { |
| 267 | return; |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 268 | } |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 269 | g_initialized := true; |
| 270 | |
| 271 | /* Call a function of our 'parent component' BSSAP_Adapter_CT to start the |
| 272 | * MSC-side BSSAP emulation */ |
Harald Welte | 67089ee | 2018-01-17 22:19:03 +0100 | [diff] [blame] | 273 | if (handler_mode) { |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 274 | f_bssap_init(g_bssap, mp_bssap_cfg, "VirtMSC", MSC_BssmapOps); |
Harald Welte | 67089ee | 2018-01-17 22:19:03 +0100 | [diff] [blame] | 275 | } else { |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 276 | f_bssap_init(g_bssap, mp_bssap_cfg, "VirtMSC", omit); |
| 277 | connect(self:BSSAP, g_bssap.vc_SCCP:SCCP_SP_PORT); |
| 278 | f_legacy_bssap_reset(); |
Harald Welte | 67089ee | 2018-01-17 22:19:03 +0100 | [diff] [blame] | 279 | } |
Harald Welte | ffe55fc | 2018-01-17 22:39:54 +0100 | [diff] [blame] | 280 | f_ipa_ctrl_start(mp_bsc_ip, mp_bsc_ctrl_port); |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 281 | |
Daniel Willmann | 191e0d9 | 2018-01-17 12:44:35 +0100 | [diff] [blame] | 282 | f_init_mgcp("VirtMSC"); |
Harald Welte | bc03c76 | 2018-02-12 18:09:38 +0100 | [diff] [blame] | 283 | f_init_vty("VirtMSC"); |
Daniel Willmann | 191e0d9 | 2018-01-17 12:44:35 +0100 | [diff] [blame] | 284 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 285 | for (i := 0; i < nr_bts; i := i+1) { |
Harald Welte | a5d2ab2 | 2017-12-09 14:21:42 +0100 | [diff] [blame] | 286 | /* wait until osmo-bts-omldummy has respawned */ |
| 287 | f_wait_oml(i, "degraded", 5.0); |
| 288 | /* start RSL connection */ |
Harald Welte | 624f963 | 2017-12-16 19:26:04 +0100 | [diff] [blame] | 289 | 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] | 290 | /* wait until BSC tells us "connected" */ |
| 291 | f_wait_oml(i, "connected", 5.0); |
Harald Welte | 696ddb6 | 2017-12-08 14:01:43 +0100 | [diff] [blame] | 292 | } |
| 293 | |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 294 | T_guard.start; |
| 295 | activate(as_Tguard()); |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 296 | } |
| 297 | |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 298 | /* 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] | 299 | function f_exp_ipa_rx(integer bts_nr, template RSL_Message t_rx, float t_secs := 2.0, IpaStreamId sid := IPAC_PROTO_RSL_TRX0) |
| 300 | runs on test_CT return RSL_Message { |
| 301 | var ASP_RSL_Unitdata rx_rsl_ud; |
| 302 | timer T := t_secs; |
| 303 | |
| 304 | T.start; |
| 305 | alt { |
| 306 | [] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(sid, t_rx)) -> value rx_rsl_ud { |
| 307 | T.stop; |
| 308 | } |
| 309 | [] IPA_RSL[bts_nr].receive { repeat; } |
Harald Welte | b291770 | 2017-12-10 15:48:52 +0100 | [diff] [blame] | 310 | [] T.timeout { |
| 311 | setverdict(fail, "Timeout expecting ", t_rx); |
| 312 | self.stop; |
| 313 | } |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 314 | } |
| 315 | return rx_rsl_ud.rsl; |
| 316 | } |
| 317 | |
Harald Welte | 21b46bd | 2017-12-17 19:46:32 +0100 | [diff] [blame] | 318 | /* helper function to transmit RSL on a given BTS/stream */ |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 319 | function f_ipa_tx(integer bts_nr, template RSL_Message t_tx, IpaStreamId sid := IPAC_PROTO_RSL_TRX0) |
| 320 | runs on test_CT { |
| 321 | IPA_RSL[bts_nr].send(ts_ASP_RSL_UD(sid, t_tx)); |
| 322 | } |
| 323 | |
| 324 | |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 325 | /* verify we get a CHAN_ACT after CHAN RQD */ |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 326 | testcase TC_chan_act_noreply() runs on test_CT { |
| 327 | var BSSAP_N_UNITDATA_ind ud_ind; |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 328 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 329 | f_init(1); |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 330 | |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 331 | IPA_RSL[0].send(ts_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,ts_RSL_CHAN_RQD('23'O, 23))); |
| 332 | f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV)); |
| 333 | setverdict(pass); |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 334 | } |
| 335 | |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 336 | /* verify if the "chreq:total" counter increments as expected */ |
| 337 | testcase TC_chan_act_counter() runs on test_CT { |
| 338 | var BSSAP_N_UNITDATA_ind ud_ind; |
| 339 | var integer chreq_total; |
| 340 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 341 | f_init(1); |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 342 | |
| 343 | chreq_total := f_ctrl_get_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:total"); |
| 344 | IPA_RSL[0].send(ts_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,ts_RSL_CHAN_RQD('23'O, 23))); |
| 345 | f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV)); |
| 346 | f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:total", chreq_total+1); |
| 347 | |
| 348 | setverdict(pass); |
| 349 | } |
| 350 | |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 351 | /* CHAN RQD -> CHAN ACT -> CHAN ACT ACK -> RF CHAN REL */ |
| 352 | testcase TC_chan_act_ack_noest() runs on test_CT { |
| 353 | var RSL_Message rx_rsl; |
| 354 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 355 | f_init(1); |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 356 | |
| 357 | /* Send CHAN RQD and wait for allocation; acknowledge it */ |
Harald Welte | d693965 | 2017-12-13 21:02:46 +0100 | [diff] [blame] | 358 | var RslChannelNr chan_nr := f_chreq_act_ack(); |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 359 | |
| 360 | /* expect BSC to disable the channel again if there's no RLL EST IND */ |
| 361 | rx_rsl := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL), T3101_MAX); |
| 362 | |
| 363 | setverdict(pass); |
| 364 | } |
| 365 | |
| 366 | /* Test behavior if MSC never answers to CR */ |
| 367 | testcase TC_chan_act_ack_est_ind_noreply() runs on test_CT { |
Harald Welte | f77aef6 | 2018-01-28 15:35:42 +0100 | [diff] [blame] | 368 | var RslLinkId main_dcch := valueof(ts_RslLinkID_DCCH(0)); |
| 369 | var IpaStreamId sid := IPAC_PROTO_RSL_TRX0; |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 370 | var RSL_Message rx_rsl; |
Harald Welte | f77aef6 | 2018-01-28 15:35:42 +0100 | [diff] [blame] | 371 | var ASP_RSL_Unitdata rx_rsl_ud; |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 372 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 373 | f_init(1); |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 374 | |
| 375 | /* Send CHAN RQD and wait for allocation; acknowledge it */ |
Harald Welte | d693965 | 2017-12-13 21:02:46 +0100 | [diff] [blame] | 376 | var RslChannelNr chan_nr := f_chreq_act_ack(); |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 377 | |
| 378 | var octetstring l3 := '00010203040506'O |
| 379 | f_ipa_tx(0, ts_RSL_EST_IND(chan_nr, valueof(ts_RslLinkID_DCCH(0)), l3)); |
| 380 | |
| 381 | BSSAP.receive(tr_BSSAP_CONNECT_ind(?, ?, tr_BSSMAP_ComplL3(l3))); |
| 382 | |
| 383 | /* 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] | 384 | /* MS waits 20s (T3210) at LU; 10s (T3230) at CM SERV REQ and 5s (T3220) AT detach */ |
| 385 | IPA_RSL[0].clear; |
| 386 | alt { |
| 387 | [] IPA_RSL[0].receive(tr_ASP_RSL_UD(sid, tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL))) -> value rx_rsl_ud { } |
| 388 | [] IPA_RSL[0].receive(tr_ASP_RSL_UD(sid, tr_RSL_REL_REQ(chan_nr, ?))) -> value rx_rsl_ud { |
| 389 | f_ipa_tx(0, ts_RSL_REL_CONF(chan_nr, main_dcch)); |
| 390 | repeat; |
| 391 | } |
| 392 | } |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 393 | |
| 394 | setverdict(pass); |
| 395 | } |
| 396 | |
| 397 | /* Test behavior if MSC answers with CREF to CR */ |
| 398 | testcase TC_chan_act_ack_est_ind_refused() runs on test_CT { |
| 399 | var BSSAP_N_CONNECT_ind rx_c_ind; |
| 400 | var RSL_Message rx_rsl; |
| 401 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 402 | f_init(1); |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 403 | |
| 404 | /* Send CHAN RQD and wait for allocation; acknowledge it */ |
Harald Welte | d693965 | 2017-12-13 21:02:46 +0100 | [diff] [blame] | 405 | var RslChannelNr chan_nr := f_chreq_act_ack(); |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 406 | |
| 407 | var octetstring l3 := '00010203040506'O |
| 408 | f_ipa_tx(0, ts_RSL_EST_IND(chan_nr, valueof(ts_RslLinkID_DCCH(0)), l3)); |
| 409 | |
| 410 | BSSAP.receive(tr_BSSAP_CONNECT_ind(?, ?, tr_BSSMAP_ComplL3(l3))) -> value rx_c_ind; |
| 411 | BSSAP.send(ts_BSSAP_DISC_req(rx_c_ind.connectionId, 0)); |
| 412 | |
| 413 | /* expect BSC to disable the channel */ |
Harald Welte | 725844b | 2018-01-28 16:18:32 +0100 | [diff] [blame] | 414 | f_expect_chan_rel(0, chan_nr); |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 415 | setverdict(pass); |
| 416 | } |
| 417 | |
Harald Welte | 618ef64 | 2017-12-14 14:58:20 +0100 | [diff] [blame] | 418 | /* CHAN RQD -> CHAN ACT -> CHAN ACT NACK -> RF CHAN REL */ |
| 419 | testcase TC_chan_act_nack() runs on test_CT { |
| 420 | var RSL_Message rx_rsl; |
| 421 | var integer chact_nack; |
| 422 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 423 | f_init(1); |
Harald Welte | 618ef64 | 2017-12-14 14:58:20 +0100 | [diff] [blame] | 424 | |
| 425 | chact_nack := f_ctrl_get_ratectr_abs(IPA_CTRL, "bts", 0, "chan_act:nack"); |
| 426 | |
| 427 | f_ipa_tx(0, ts_RSL_CHAN_RQD('33'O, 33)); |
| 428 | rx_rsl := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV)); |
| 429 | var RslChannelNr chan_nr := rx_rsl.ies[0].body.chan_nr; |
| 430 | |
| 431 | f_ipa_tx(0, ts_RSL_CHAN_ACT_NACK(chan_nr, RSL_ERR_EQUIPMENT_FAIL)); |
| 432 | |
| 433 | /* wait for some time to hope the NACK arrives before the CTRL GET below */ |
| 434 | f_sleep(0.5); |
| 435 | |
| 436 | f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "chan_act:nack", chact_nack+1); |
| 437 | |
| 438 | setverdict(pass); |
| 439 | } |
| 440 | |
Harald Welte | 799c97b | 2017-12-14 17:50:30 +0100 | [diff] [blame] | 441 | /* Test for channel exhaustion due to RACH overload */ |
| 442 | testcase TC_chan_exhaustion() runs on test_CT { |
| 443 | var ASP_RSL_Unitdata rsl_ud; |
| 444 | var integer i; |
| 445 | var integer chreq_total, chreq_nochan; |
| 446 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 447 | f_init(1); |
Harald Welte | 799c97b | 2017-12-14 17:50:30 +0100 | [diff] [blame] | 448 | |
| 449 | chreq_total := f_ctrl_get_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:total"); |
| 450 | chreq_nochan := f_ctrl_get_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:no_channel"); |
| 451 | |
| 452 | /* expect 5xTCH/F to succeed */ |
Harald Welte | dd8cbf3 | 2018-01-28 12:07:52 +0100 | [diff] [blame] | 453 | for (i := 0; i < NUM_TCHF_PER_BTS + NUM_SDCCH_PER_BTS; i := i+1) { |
Harald Welte | 799c97b | 2017-12-14 17:50:30 +0100 | [diff] [blame] | 454 | f_chreq_act_ack('23'O, i); |
| 455 | } |
| 456 | |
| 457 | IPA_RSL[0].clear; |
| 458 | |
Harald Welte | dd8cbf3 | 2018-01-28 12:07:52 +0100 | [diff] [blame] | 459 | f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:total", |
| 460 | chreq_total+NUM_TCHF_PER_BTS+NUM_SDCCH_PER_BTS); |
Harald Welte | 799c97b | 2017-12-14 17:50:30 +0100 | [diff] [blame] | 461 | |
| 462 | /* now expect additional channel activations to fail */ |
| 463 | f_ipa_tx(0, ts_RSL_CHAN_RQD('42'O, 42)); |
| 464 | |
| 465 | alt { |
| 466 | [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, |
| 467 | tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV))) { |
| 468 | setverdict(fail, "Received CHAN ACT ACK without resources?!?"); |
| 469 | } |
| 470 | [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_IMM_ASSIGN(?))) -> value rsl_ud { |
| 471 | var GsmRrMessage rr; |
| 472 | /* match on IMM ASS REJ */ |
| 473 | rr := dec_GsmRrMessage(rsl_ud.rsl.ies[1].body.full_imm_ass_info.payload); |
| 474 | if (rr.header.message_type == IMMEDIATE_ASSIGNMENT_REJECT) { |
| 475 | f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:total", |
Harald Welte | dd8cbf3 | 2018-01-28 12:07:52 +0100 | [diff] [blame] | 476 | chreq_total+NUM_TCHF_PER_BTS+NUM_SDCCH_PER_BTS+1); |
Harald Welte | 799c97b | 2017-12-14 17:50:30 +0100 | [diff] [blame] | 477 | f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:no_channel", |
| 478 | chreq_nochan+1); |
| 479 | setverdict(pass); |
| 480 | } else { |
| 481 | repeat; |
| 482 | } |
| 483 | } |
| 484 | [] IPA_RSL[0].receive { repeat; } |
| 485 | } |
| 486 | } |
| 487 | |
Harald Welte | cfe2c96 | 2017-12-15 12:09:32 +0100 | [diff] [blame] | 488 | /*********************************************************************** |
| 489 | * Assignment Testing |
| 490 | ***********************************************************************/ |
| 491 | |
| 492 | /* Verify that the BSC refuses any BSSAP connection from the MSC (They are all BSC->MSC direction) */ |
| 493 | testcase TC_outbound_connect() runs on test_CT { |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 494 | f_init(1); |
Harald Welte | cfe2c96 | 2017-12-15 12:09:32 +0100 | [diff] [blame] | 495 | |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 496 | 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] | 497 | BSSAP.receive(tr_BSSAP_DISC_ind(2342, ?, ?)); |
| 498 | setverdict(pass); |
| 499 | } |
| 500 | |
Harald Welte | 16a4adf | 2017-12-14 18:54:01 +0100 | [diff] [blame] | 501 | /* Test behavior if MSC answers with CREF to CR */ |
| 502 | testcase TC_assignment_cic_only() runs on test_CT { |
| 503 | var BSSAP_N_CONNECT_ind rx_c_ind; |
| 504 | var RSL_Message rx_rsl; |
| 505 | var DchanTuple dt; |
| 506 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 507 | f_init(1); |
Harald Welte | 16a4adf | 2017-12-14 18:54:01 +0100 | [diff] [blame] | 508 | |
| 509 | dt := f_est_dchan('23'O, 23, '00000000'O); |
| 510 | /* send assignment without AoIP IEs */ |
Harald Welte | cc7e4dc | 2017-12-14 21:55:10 +0100 | [diff] [blame] | 511 | BSSAP.send(ts_BSSAP_DATA_req(dt.sccp_conn_id, ts_BSSMAP_AssignmentReq(ts_BSSMAP_IE_CIC(0, 1)))); |
Harald Welte | 16a4adf | 2017-12-14 18:54:01 +0100 | [diff] [blame] | 512 | alt { |
| 513 | [] BSSAP.receive(tr_BSSAP_DATA_ind(dt.sccp_conn_id, tr_BSSMAP_AssignmentComplete)) { |
| 514 | setverdict(fail, "AoIP BSC cannot accept ASSIGNMENT without AoIP Transport IE"); |
| 515 | } |
Harald Welte | 235ebf1 | 2017-12-15 14:18:16 +0100 | [diff] [blame] | 516 | /* TODO: Actually expect GSM0808_CAUSE_REQ_A_IF_TYPE_NOT_SUPP */ |
Harald Welte | 16a4adf | 2017-12-14 18:54:01 +0100 | [diff] [blame] | 517 | [] BSSAP.receive(tr_BSSAP_DATA_ind(dt.sccp_conn_id, tr_BSSMAP_AssignmentFail)) { |
| 518 | setverdict(pass); |
| 519 | } |
| 520 | [] BSSAP.receive { repeat; } |
| 521 | } |
| 522 | } |
| 523 | |
Harald Welte | 235ebf1 | 2017-12-15 14:18:16 +0100 | [diff] [blame] | 524 | /* Run everything required up to sending a caller-specified assignment command and expect response */ |
| 525 | function f_assignment_exp(PDU_BSSAP ass_cmd, template PDU_BSSAP exp, charstring fail_text) |
| 526 | runs on test_CT { |
| 527 | var BSSAP_N_CONNECT_ind rx_c_ind; |
| 528 | var RSL_Message rx_rsl; |
| 529 | var DchanTuple dt; |
| 530 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 531 | f_init(1); |
Harald Welte | 235ebf1 | 2017-12-15 14:18:16 +0100 | [diff] [blame] | 532 | |
| 533 | dt := f_est_dchan('23'O, 23, '00000000'O); |
| 534 | /* send assignment without AoIP IEs */ |
| 535 | BSSAP.send(ts_BSSAP_DATA_req(dt.sccp_conn_id, ass_cmd)); |
| 536 | alt { |
| 537 | [] BSSAP.receive(tr_BSSAP_DATA_ind(dt.sccp_conn_id, tr_BSSMAP_AssignmentComplete)) { |
| 538 | if (ischosen(exp.pdu.bssmap.assignmentComplete)) { |
| 539 | setverdict(pass); |
| 540 | } else { |
| 541 | setverdict(fail, fail_text); |
| 542 | } |
| 543 | } |
| 544 | [] BSSAP.receive(tr_BSSAP_DATA_ind(dt.sccp_conn_id, tr_BSSMAP_AssignmentFail)) { |
| 545 | if (ischosen(exp.pdu.bssmap.assignmentFailure)) { |
| 546 | setverdict(pass); |
| 547 | } else { |
| 548 | setverdict(fail, fail_text); |
| 549 | } |
| 550 | } |
| 551 | [] BSSAP.receive { repeat; } |
| 552 | } |
| 553 | } |
| 554 | testcase TC_assignment_csd() runs on test_CT { |
| 555 | var template PDU_BSSAP exp_fail := tr_BSSMAP_AssignmentFail; |
| 556 | var BSSMAP_IE_AoIP_TransportLayerAddress tla := valueof(ts_BSSMAP_IE_AoIP_TLA4('01020304'O, 2342)); |
| 557 | var PDU_BSSAP ass_cmd := valueof(ts_BSSMAP_AssignmentReq(omit, tla)); |
| 558 | ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelTypeCSD); |
| 559 | //exp_fail.pdu.bssmap.assignmentFailure.cause.causeValue := int2bit(enum2int(GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_UNAVAIL), 7); |
| 560 | f_assignment_exp(ass_cmd, exp_fail, "BSC accepted Assignment for CSD"); |
| 561 | } |
| 562 | |
| 563 | testcase TC_assignment_ctm() runs on test_CT { |
| 564 | var template PDU_BSSAP exp_fail := tr_BSSMAP_AssignmentFail; |
| 565 | var BSSMAP_IE_AoIP_TransportLayerAddress tla := valueof(ts_BSSMAP_IE_AoIP_TLA4('01020304'O, 2342)); |
| 566 | var PDU_BSSAP ass_cmd := valueof(ts_BSSMAP_AssignmentReq(omit, tla)); |
| 567 | ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelTypeCTM); |
| 568 | //exp_fail.pdu.bssmap.assignmentFailure.cause.causeValue := int2bit(enum2int(GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_UNAVAIL), 7); |
| 569 | f_assignment_exp(ass_cmd, exp_fail, "BSC accepted Assignment for Speech+CTM"); |
| 570 | } |
| 571 | |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 572 | type record DchanTuple { |
| 573 | integer sccp_conn_id, |
| 574 | RslChannelNr rsl_chan_nr |
Harald Welte | a5d2ab2 | 2017-12-09 14:21:42 +0100 | [diff] [blame] | 575 | } |
| 576 | |
Harald Welte | d693965 | 2017-12-13 21:02:46 +0100 | [diff] [blame] | 577 | /* Send CHAN RQD and wait for allocation; acknowledge it */ |
| 578 | private function f_chreq_act_ack(OCT1 ra := '23'O, GsmFrameNumber fn := 23) |
| 579 | runs on test_CT return RslChannelNr { |
| 580 | var RSL_Message rx_rsl; |
| 581 | f_ipa_tx(0, ts_RSL_CHAN_RQD(ra, fn)); |
| 582 | rx_rsl := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV)); |
| 583 | var RslChannelNr chan_nr := rx_rsl.ies[0].body.chan_nr; |
| 584 | f_ipa_tx(0, ts_RSL_CHAN_ACT_ACK(chan_nr, fn+10)); |
| 585 | return chan_nr; |
| 586 | } |
| 587 | |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 588 | /* helper function to establish a dedicated channel via BTS and MSC */ |
| 589 | function f_est_dchan(OCT1 ra, GsmFrameNumber fn, octetstring l3) |
| 590 | runs on test_CT return DchanTuple { |
| 591 | var BSSAP_N_CONNECT_ind rx_c_ind; |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 592 | var DchanTuple dt; |
Harald Welte | a5d2ab2 | 2017-12-09 14:21:42 +0100 | [diff] [blame] | 593 | |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 594 | /* Send CHAN RQD and wait for allocation; acknowledge it */ |
Harald Welte | d693965 | 2017-12-13 21:02:46 +0100 | [diff] [blame] | 595 | dt.rsl_chan_nr := f_chreq_act_ack(ra, fn); |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 596 | |
| 597 | f_ipa_tx(0, ts_RSL_EST_IND(dt.rsl_chan_nr, valueof(ts_RslLinkID_DCCH(0)), l3)); |
| 598 | |
| 599 | BSSAP.receive(tr_BSSAP_CONNECT_ind(?, ?, tr_BSSMAP_ComplL3(l3))) -> value rx_c_ind; |
| 600 | dt.sccp_conn_id := rx_c_ind.connectionId; |
| 601 | BSSAP.send(ts_BSSAP_CONNECT_res(dt.sccp_conn_id)); |
| 602 | |
| 603 | return dt; |
Harald Welte | a5d2ab2 | 2017-12-09 14:21:42 +0100 | [diff] [blame] | 604 | } |
| 605 | |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 606 | /* Test behavior of channel release after unilateral RLL REL IND (DISC from MS) */ |
| 607 | testcase TC_chan_rel_rll_rel_ind() runs on test_CT { |
| 608 | var RSL_Message rx_rsl; |
| 609 | var DchanTuple dt; |
Harald Welte | 96c9441 | 2017-12-09 03:12:45 +0100 | [diff] [blame] | 610 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 611 | f_init(1); |
Harald Welte | 96c9441 | 2017-12-09 03:12:45 +0100 | [diff] [blame] | 612 | |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 613 | dt := f_est_dchan('23'O, 23, '00010203040506'O); |
| 614 | |
| 615 | /* simulate RLL REL IND */ |
| 616 | f_ipa_tx(0, ts_RSL_REL_IND(dt.rsl_chan_nr, valueof(ts_RslLinkID_DCCH(0)))); |
| 617 | |
| 618 | /* expect BSC to disable the channel */ |
| 619 | rx_rsl := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL), T3101_MAX); |
| 620 | /* respond with CHAN REL ACK */ |
| 621 | f_ipa_tx(0, ts_RSL_RF_CHAN_REL_ACK(dt.rsl_chan_nr)); |
| 622 | |
| 623 | /* expect DISC_IND on MSC side */ |
| 624 | BSSAP.receive(tr_BSSAP_DISC_ind(dt.sccp_conn_id, ?, ?)); |
| 625 | |
| 626 | setverdict(pass); |
| 627 | } |
| 628 | |
| 629 | /* Test behavior of channel release after CONN FAIL IND from BTS */ |
| 630 | testcase TC_chan_rel_conn_fail() runs on test_CT { |
| 631 | var BSSAP_N_DATA_ind rx_di; |
| 632 | var RSL_Message rx_rsl; |
| 633 | var DchanTuple dt; |
| 634 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 635 | f_init(1); |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 636 | |
| 637 | dt := f_est_dchan('23'O, 23, '00010203040506'O); |
| 638 | |
| 639 | /* simulate CONN FAIL IND */ |
Harald Welte | a8ed906 | 2017-12-14 09:46:01 +0100 | [diff] [blame] | 640 | 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] | 641 | /* TODO: different cause values? */ |
| 642 | |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 643 | /* expect Clear Request from BSC */ |
| 644 | BSSAP.receive(tr_BSSAP_DATA_ind(dt.sccp_conn_id, tr_BSSMAP_ClearRequest)) -> value rx_di; |
| 645 | |
| 646 | /* Instruct BSC to clear channel */ |
| 647 | var BssmapCause cause := bit2int(rx_di.userData.pdu.bssmap.clearRequest.cause.causeValue); |
| 648 | BSSAP.send(ts_BSSAP_DATA_req(dt.sccp_conn_id, ts_BSSMAP_ClearCommand(cause))); |
| 649 | |
Harald Welte | 6ff76ea | 2018-01-28 13:08:01 +0100 | [diff] [blame] | 650 | /* expect BSC to disable the channel */ |
| 651 | rx_rsl := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL), T3101_MAX); |
| 652 | /* respond with CHAN REL ACK */ |
| 653 | f_ipa_tx(0, ts_RSL_RF_CHAN_REL_ACK(dt.rsl_chan_nr)); |
| 654 | |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 655 | /* expect Clear Complete from BSC */ |
| 656 | BSSAP.receive(tr_BSSAP_DATA_ind(dt.sccp_conn_id, tr_BSSMAP_ClearComplete)); |
| 657 | |
| 658 | /* release the SCCP connection */ |
| 659 | BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0)); |
| 660 | |
| 661 | /* wait for SCCP emulation to do its job */ |
| 662 | f_sleep(1.0); |
| 663 | |
| 664 | setverdict(pass); |
| 665 | } |
| 666 | |
Harald Welte | 91d54a5 | 2018-01-28 15:35:07 +0100 | [diff] [blame] | 667 | function f_expect_chan_rel(integer bts_nr, RslChannelNr rsl_chan_nr, boolean flush := true, |
| 668 | boolean handle_rll_rel := true) runs on test_CT { |
| 669 | |
| 670 | var RslLinkId main_dcch := valueof(ts_RslLinkID_DCCH(0)); |
| 671 | if (flush) { |
| 672 | /* Clear the queue, it might still contain stuff like IMMEDIATE ASSIGN */ |
| 673 | IPA_RSL[bts_nr].clear; |
| 674 | } |
| 675 | alt { |
| 676 | /* ignore DEACTIVATE SACCH (if any) */ |
| 677 | [] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, |
| 678 | tr_RSL_DEACT_SACCH(rsl_chan_nr))) { |
| 679 | repeat; |
| 680 | } |
| 681 | /* acknowledge RLL release (if any)*/ |
| 682 | [handle_rll_rel] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, |
| 683 | tr_RSL_REL_REQ(rsl_chan_nr, ?))) { |
| 684 | /* FIXME: Why are we getting this for LinkID SACCH? */ |
| 685 | f_ipa_tx(0, ts_RSL_REL_CONF(rsl_chan_nr, main_dcch)); |
| 686 | repeat; |
| 687 | } |
| 688 | /* Expect RF channel release from BSC on Abis */ |
| 689 | [] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, |
| 690 | tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL))) { |
| 691 | /* respond with CHAN REL ACK */ |
| 692 | f_ipa_tx(0, ts_RSL_RF_CHAN_REL_ACK(rsl_chan_nr)); |
| 693 | } |
| 694 | /* ignore any user data */ |
| 695 | [] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_MsgTypeR(?))) { |
| 696 | repeat; |
| 697 | } |
| 698 | } |
| 699 | } |
| 700 | |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 701 | /* Test behavior of channel release after hard Clear Command from MSC */ |
| 702 | testcase TC_chan_rel_hard_clear() runs on test_CT { |
| 703 | var BSSAP_N_DATA_ind rx_di; |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 704 | var DchanTuple dt; |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 705 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 706 | f_init(1); |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 707 | |
| 708 | dt := f_est_dchan('23'O, 23, '00010203040506'O); |
| 709 | |
| 710 | /* Instruct BSC to clear channel */ |
| 711 | var BssmapCause cause := 0; |
| 712 | BSSAP.send(ts_BSSAP_DATA_req(dt.sccp_conn_id, ts_BSSMAP_ClearCommand(cause))); |
| 713 | |
| 714 | /* expect Clear Complete from BSC on A */ |
| 715 | BSSAP.receive(tr_BSSAP_DATA_ind(dt.sccp_conn_id, tr_BSSMAP_ClearComplete)) { |
| 716 | /* release the SCCP connection */ |
| 717 | BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0)); |
| 718 | } |
| 719 | |
Harald Welte | 91d54a5 | 2018-01-28 15:35:07 +0100 | [diff] [blame] | 720 | f_expect_chan_rel(0, dt.rsl_chan_nr); |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 721 | setverdict(pass); |
| 722 | } |
| 723 | |
Harald Welte | d8c36cd | 2017-12-09 23:05:31 +0100 | [diff] [blame] | 724 | /* Test behavior of channel release after hard RLSD from MSC */ |
| 725 | testcase TC_chan_rel_hard_rlsd() runs on test_CT { |
Harald Welte | d8c36cd | 2017-12-09 23:05:31 +0100 | [diff] [blame] | 726 | var DchanTuple dt; |
Harald Welte | d8c36cd | 2017-12-09 23:05:31 +0100 | [diff] [blame] | 727 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 728 | f_init(1); |
Harald Welte | d8c36cd | 2017-12-09 23:05:31 +0100 | [diff] [blame] | 729 | |
| 730 | dt := f_est_dchan('23'O, 23, '00010203040506'O); |
| 731 | |
| 732 | /* release the SCCP connection */ |
| 733 | BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0)); |
| 734 | |
Harald Welte | 91d54a5 | 2018-01-28 15:35:07 +0100 | [diff] [blame] | 735 | f_expect_chan_rel(0, dt.rsl_chan_nr); |
Harald Welte | d8c36cd | 2017-12-09 23:05:31 +0100 | [diff] [blame] | 736 | setverdict(pass); |
| 737 | } |
| 738 | |
Harald Welte | 85804d4 | 2017-12-10 14:11:58 +0100 | [diff] [blame] | 739 | /* Test behavior of channel release after BSSMAP RESET from MSC */ |
| 740 | testcase TC_chan_rel_a_reset() runs on test_CT { |
Harald Welte | 85804d4 | 2017-12-10 14:11:58 +0100 | [diff] [blame] | 741 | var DchanTuple dt; |
Harald Welte | 85804d4 | 2017-12-10 14:11:58 +0100 | [diff] [blame] | 742 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 743 | f_init(1); |
Harald Welte | 85804d4 | 2017-12-10 14:11:58 +0100 | [diff] [blame] | 744 | |
| 745 | dt := f_est_dchan('23'O, 23, '00010203040506'O); |
| 746 | |
| 747 | /* Clear the queue, it might still contain stuff like IMMEDIATE ASSIGN */ |
| 748 | IPA_RSL[0].clear; |
| 749 | |
| 750 | /* perform BSSAP RESET, expect RESET ACK and DISC.ind on connection */ |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 751 | 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] | 752 | interleave { |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 753 | [] 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] | 754 | [] BSSAP.receive(tr_BSSAP_DISC_ind(dt.sccp_conn_id, ?, ?)) { } |
| 755 | } |
| 756 | |
Philipp Maier | e8f38ed | 2018-02-09 10:30:31 +0100 | [diff] [blame] | 757 | f_expect_chan_rel(0, dt.rsl_chan_nr, false); |
Harald Welte | 85804d4 | 2017-12-10 14:11:58 +0100 | [diff] [blame] | 758 | setverdict(pass); |
| 759 | } |
| 760 | |
Harald Welte | 5cd20ed | 2017-12-13 21:03:20 +0100 | [diff] [blame] | 761 | /* Test behavior if RSL EST IND for non-active channel */ |
| 762 | testcase TC_rll_est_ind_inact_lchan() runs on test_CT { |
| 763 | timer T := 2.0; |
| 764 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 765 | f_init(1); |
Harald Welte | 5cd20ed | 2017-12-13 21:03:20 +0100 | [diff] [blame] | 766 | |
| 767 | var octetstring l3 := '00010203040506'O; |
| 768 | var RslChannelNr chan_nr := valueof(t_RslChanNr_Bm(6)); |
| 769 | f_ipa_tx(0, ts_RSL_EST_IND(chan_nr, valueof(ts_RslLinkID_DCCH(0)), l3)); |
| 770 | |
| 771 | T.start; |
| 772 | alt { |
| 773 | [] BSSAP.receive(tr_BSSAP_CONNECT_ind(?, ?, tr_BSSMAP_ComplL3(l3))) { |
| 774 | setverdict(fail, "MSC received COMPL L3 for non-active lchan"); |
| 775 | } |
| 776 | [] BSSAP.receive {} |
| 777 | [] IPA_RSL[0].receive {} |
| 778 | [] T.timeout {} |
| 779 | } |
| 780 | |
| 781 | setverdict(pass); |
| 782 | } |
| 783 | |
| 784 | /* Test behavior if RSL EST IND for invalid SAPI */ |
| 785 | testcase TC_rll_est_ind_inval_sapi1() runs on test_CT { |
| 786 | var RslChannelNr chan_nr; |
| 787 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 788 | f_init(1); |
Harald Welte | 5cd20ed | 2017-12-13 21:03:20 +0100 | [diff] [blame] | 789 | |
| 790 | chan_nr := f_chreq_act_ack() |
| 791 | |
| 792 | var octetstring l3 := '00010203040506'O; |
| 793 | f_ipa_tx(0, ts_RSL_EST_IND(chan_nr, valueof(ts_RslLinkID_DCCH(1)), l3)); |
| 794 | |
| 795 | timer T := 2.0; |
| 796 | T.start; |
| 797 | alt { |
| 798 | [] BSSAP.receive(tr_BSSAP_CONNECT_ind(?, ?, tr_BSSMAP_ComplL3(l3))) { |
| 799 | setverdict(fail, "MSC received COMPL L3 for invalid SAPI 1"); |
| 800 | } |
| 801 | [] BSSAP.receive { repeat; } |
| 802 | [] IPA_RSL[0].receive { repeat; } |
| 803 | [] T.timeout {} |
| 804 | } |
| 805 | |
| 806 | setverdict(pass); |
| 807 | } |
| 808 | |
| 809 | /* Test behavior if RSL EST IND for invalid SAPI */ |
| 810 | testcase TC_rll_est_ind_inval_sapi3() runs on test_CT { |
| 811 | timer T := 2.0; |
| 812 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 813 | f_init(1); |
Harald Welte | 5cd20ed | 2017-12-13 21:03:20 +0100 | [diff] [blame] | 814 | |
| 815 | var RslChannelNr chan_nr := f_chreq_act_ack(); |
| 816 | |
| 817 | var octetstring l3 := '00010203040506'O; |
| 818 | f_ipa_tx(0, ts_RSL_EST_IND(chan_nr, valueof(ts_RslLinkID_DCCH(3)), l3)); |
| 819 | |
| 820 | T.start; |
| 821 | alt { |
| 822 | [] BSSAP.receive(tr_BSSAP_CONNECT_ind(?, ?, tr_BSSMAP_ComplL3(l3))) { |
| 823 | setverdict(fail, "MSC received COMPL L3 for invalid SAPI 3"); |
| 824 | } |
| 825 | [] BSSAP.receive { repeat; } |
| 826 | [] IPA_RSL[0].receive { repeat; } |
| 827 | [] T.timeout {} |
| 828 | } |
| 829 | |
| 830 | setverdict(pass); |
| 831 | } |
| 832 | |
| 833 | /* Test behavior if RSL EST IND for invalid SACCH */ |
| 834 | testcase TC_rll_est_ind_inval_sacch() runs on test_CT { |
| 835 | timer T := 2.0; |
| 836 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 837 | f_init(1); |
Harald Welte | 5cd20ed | 2017-12-13 21:03:20 +0100 | [diff] [blame] | 838 | |
| 839 | var RslChannelNr chan_nr := f_chreq_act_ack(); |
| 840 | |
| 841 | var octetstring l3 := '00010203040506'O; |
| 842 | f_ipa_tx(0, ts_RSL_EST_IND(chan_nr, valueof(ts_RslLinkID_SACCH(0)), l3)); |
| 843 | |
| 844 | T.start; |
| 845 | alt { |
| 846 | [] BSSAP.receive(tr_BSSAP_CONNECT_ind(?, ?, tr_BSSMAP_ComplL3(l3))) { |
| 847 | setverdict(fail, "MSC received COMPL L3 for invalid Link SACCH"); |
| 848 | } |
| 849 | [] BSSAP.receive { repeat; } |
| 850 | [] IPA_RSL[0].receive { repeat; } |
| 851 | [] T.timeout {} |
| 852 | } |
| 853 | |
| 854 | setverdict(pass); |
| 855 | } |
| 856 | |
| 857 | |
| 858 | |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 859 | |
| 860 | testcase TC_ctrl_msc_connection_status() runs on test_CT { |
| 861 | var charstring ctrl_resp; |
| 862 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 863 | f_init(1); |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 864 | |
| 865 | /* See https://osmocom.org/issues/2729 */ |
| 866 | f_ctrl_get_exp(IPA_CTRL, "msc_connection_status", "connected"); |
| 867 | setverdict(pass); |
| 868 | } |
| 869 | |
Stefan Sperling | b041b3d | 2018-01-03 17:14:55 +0100 | [diff] [blame] | 870 | testcase TC_ctrl_msc0_connection_status() runs on test_CT { |
| 871 | var charstring ctrl_resp; |
| 872 | |
| 873 | f_init(1); |
Stefan Sperling | b041b3d | 2018-01-03 17:14:55 +0100 | [diff] [blame] | 874 | |
| 875 | f_ctrl_get_exp(IPA_CTRL, "msc.0.connection_status", "connected"); |
| 876 | setverdict(pass); |
| 877 | } |
| 878 | |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 879 | testcase TC_ctrl() runs on test_CT { |
| 880 | var charstring ctrl_resp; |
| 881 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 882 | f_init(1); |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 883 | |
| 884 | /* all below values must match the osmo-bsc.cfg config file used */ |
| 885 | |
| 886 | f_ctrl_get_exp(IPA_CTRL, "mcc", "1"); |
| 887 | f_ctrl_get_exp(IPA_CTRL, "mnc", "1"); |
Harald Welte | 44bdaa5 | 2017-12-17 17:01:47 +0100 | [diff] [blame] | 888 | f_ctrl_get_exp(IPA_CTRL, "number-of-bts", "3"); |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 889 | |
| 890 | var integer bts_nr := 0; |
| 891 | f_ctrl_get_exp_bts(IPA_CTRL, bts_nr, "location-area-code", "1"); |
| 892 | f_ctrl_get_exp_bts(IPA_CTRL, bts_nr, "cell-identity", "0"); |
| 893 | f_ctrl_get_exp_bts(IPA_CTRL, bts_nr, "oml-connection-state", "connected"); |
| 894 | f_ctrl_get_exp_bts(IPA_CTRL, bts_nr, "gprs-mode", "gprs"); |
| 895 | f_ctrl_get_exp_bts(IPA_CTRL, bts_nr, "rf_state", "operational,unlocked,on"); |
| 896 | f_ctrl_get_exp_trx(IPA_CTRL, bts_nr, 0, "arfcn", "871"); |
| 897 | f_ctrl_get_exp_trx(IPA_CTRL, bts_nr, 0, "max-power-reduction", "20"); |
| 898 | |
| 899 | var integer uptime := str2int(f_ctrl_get_bts(IPA_CTRL, bts_nr, "oml-uptime")); |
| 900 | f_sleep(2.0); |
| 901 | if (str2int(f_ctrl_get_bts(IPA_CTRL, bts_nr, "oml-uptime")) < uptime+1) { |
| 902 | setverdict(fail, "oml-uptime not incrementing as expected"); |
| 903 | } |
| 904 | /* TODO: Disconnect RSL, imply that OML is disconnected and check for uptime zero? */ |
| 905 | |
| 906 | f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bsc", 0, "paging:attempted", 0); |
| 907 | |
| 908 | setverdict(pass); |
Harald Welte | 96c9441 | 2017-12-09 03:12:45 +0100 | [diff] [blame] | 909 | } |
| 910 | |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 911 | 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] | 912 | 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] | 913 | } |
| 914 | |
| 915 | |
| 916 | /*********************************************************************** |
| 917 | * Paging Testing |
| 918 | ***********************************************************************/ |
| 919 | |
| 920 | type record Cell_Identity { |
| 921 | GsmMcc mcc, |
| 922 | GsmMnc mnc, |
| 923 | GsmLac lac, |
| 924 | GsmCellId ci |
| 925 | }; |
| 926 | private const Cell_Identity cid := { '001'H, '001'H, 1, 0 }; |
| 927 | |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 928 | type set of integer BtsIdList; |
| 929 | |
| 930 | private function f_bts_in_list(integer bts_id, BtsIdList bts_ids) return boolean { |
| 931 | for (var integer j := 0; j < sizeof(bts_ids); j := j + 1) { |
| 932 | if (bts_id == bts_ids[j]) { |
| 933 | return true; |
| 934 | } |
| 935 | } |
| 936 | return false; |
| 937 | } |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 938 | |
| 939 | /* core paging test helper function; used by most paging test cases */ |
| 940 | private function f_pageing_helper(hexstring imsi, |
| 941 | template BSSMAP_FIELD_CellIdentificationList cid_list, |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 942 | BtsIdList bts_ids := { 0 }, |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 943 | template RSL_ChanNeeded rsl_chneed := omit, |
| 944 | template OCT4 tmsi := omit) runs on test_CT |
| 945 | { |
| 946 | var template BSSMAP_IE_ChannelNeeded bssmap_chneed; |
| 947 | var MobileIdentity mi; |
| 948 | var template octetstring id_enc; /* FIXME */ |
| 949 | var RSL_Message rx_rsl; |
| 950 | var integer paging_group := hex2int(imsi[lengthof(imsi)-1]); |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 951 | var integer i; |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 952 | |
| 953 | f_init(); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 954 | |
| 955 | /* Clear the queue, it might still contain stuff like BCCH FILLING */ |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 956 | for (i := 0; i < sizeof(bts_ids); i := i + 1) { |
| 957 | IPA_RSL[bts_ids[i]].clear; |
| 958 | } |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 959 | |
| 960 | if (isvalue(rsl_chneed)) { |
| 961 | /* The values of 08.08 3.2.2.36 and 08.58 9.3.40 are luckily identical */ |
| 962 | bssmap_chneed := ts_BSSMAP_IE_ChanNeeded(int2bit(enum2int(valueof(rsl_chneed)),2)); |
| 963 | } else { |
| 964 | bssmap_chneed := omit; |
| 965 | } |
| 966 | |
| 967 | f_bssap_tx_ud(ts_BSSMAP_Paging(imsi, cid_list, tmsi, bssmap_chneed)); |
| 968 | |
| 969 | /* FIXME: Disabled due to bugs in both GSM_RR_Types and MobileL3_CommonIE_Types IMSI encoder |
| 970 | if (isvalue(tmsi)) { |
| 971 | mi := valueof(t_Osmo_MI_TMSI(oct2int(valueof(tmsi)))); |
| 972 | } else { |
| 973 | mi := valueof(ts_Osmo_MI_IMSI(imsi)); |
| 974 | } |
| 975 | id_enc := enc_MobileIdentity(mi); |
| 976 | */ |
| 977 | id_enc := ?; |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 978 | for (i := 0; i < sizeof(bts_ids); i := i + 1) { |
| 979 | rx_rsl := f_exp_ipa_rx(bts_ids[i], tr_RSL_PAGING_CMD(id_enc)); |
| 980 | /* check channel type, paging group */ |
| 981 | if (rx_rsl.ies[1].body.paging_group != paging_group) { |
| 982 | setverdict(fail, "Paging for wrong paging group"); |
| 983 | } |
| 984 | if (ispresent(rsl_chneed) and |
| 985 | rx_rsl.ies[3].body.chan_needed.chan_needed != valueof(rsl_chneed)) { |
| 986 | setverdict(fail, "RSL Channel Needed != BSSMAP Channel Needed"); |
| 987 | } |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 988 | } |
Harald Welte | 2fccd98 | 2018-01-31 15:48:19 +0100 | [diff] [blame] | 989 | f_sleep(2.0); |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 990 | /* do a quick check on all not-included BTSs if they received paging */ |
| 991 | for (i := 0; i < NUM_BTS; i := i + 1) { |
| 992 | timer T := 0.1; |
| 993 | if (f_bts_in_list(i, bts_ids)) { |
| 994 | continue; |
| 995 | } |
| 996 | T.start; |
| 997 | alt { |
| 998 | [] IPA_RSL[i].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_PAGING_CMD(id_enc))) { |
| 999 | setverdict(fail, "Paging on BTS ", i, " which is not part of ", bts_ids); |
| 1000 | } |
| 1001 | [] IPA_RSL[i].receive { repeat; } |
| 1002 | [] T.timeout { } |
| 1003 | } |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1004 | } |
| 1005 | |
| 1006 | setverdict(pass); |
| 1007 | } |
| 1008 | |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1009 | const BtsIdList c_BtsId_all := { 0, 1, 2 }; |
Harald Welte | 751d3eb | 2018-01-31 15:51:06 +0100 | [diff] [blame] | 1010 | const BtsIdList c_BtsId_none := { }; |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1011 | const BtsIdList c_BtsId_LAC1 := { 0, 1 }; |
| 1012 | const BtsIdList c_BtsId_LAC2 := { 2 }; |
| 1013 | |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1014 | /* PAGING by IMSI + TMSI */ |
| 1015 | testcase TC_paging_imsi_nochan() runs on test_CT { |
| 1016 | var BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1017 | cid_list := valueof(ts_BSSMAP_CIL_noCell); |
Philipp Maier | 8c04b0a | 2018-02-23 13:48:48 +0100 | [diff] [blame] | 1018 | f_pageing_helper('001010100000001'H, cid_list, c_BtsId_all, omit, omit); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame^] | 1019 | f_shutdown_helper(); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1020 | } |
| 1021 | |
| 1022 | /* PAGING by IMSI + TMSI */ |
| 1023 | testcase TC_paging_tmsi_nochan() runs on test_CT { |
| 1024 | var BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1025 | cid_list := valueof(ts_BSSMAP_CIL_noCell); |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1026 | 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^] | 1027 | f_shutdown_helper(); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1028 | } |
| 1029 | |
| 1030 | /* Paging with different "channel needed' values */ |
| 1031 | testcase TC_paging_tmsi_any() runs on test_CT { |
| 1032 | var BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1033 | cid_list := valueof(ts_BSSMAP_CIL_noCell); |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1034 | 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^] | 1035 | f_shutdown_helper(); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1036 | } |
| 1037 | testcase TC_paging_tmsi_sdcch() runs on test_CT { |
| 1038 | var BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1039 | cid_list := valueof(ts_BSSMAP_CIL_noCell); |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1040 | 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^] | 1041 | f_shutdown_helper(); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1042 | } |
| 1043 | testcase TC_paging_tmsi_tch_f() runs on test_CT { |
| 1044 | var BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1045 | cid_list := valueof(ts_BSSMAP_CIL_noCell); |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1046 | 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^] | 1047 | f_shutdown_helper(); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1048 | } |
| 1049 | testcase TC_paging_tmsi_tch_hf() runs on test_CT { |
| 1050 | var BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1051 | cid_list := valueof(ts_BSSMAP_CIL_noCell); |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1052 | 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^] | 1053 | f_shutdown_helper(); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1054 | } |
| 1055 | |
| 1056 | /* Paging by CGI */ |
| 1057 | testcase TC_paging_imsi_nochan_cgi() runs on test_CT { |
| 1058 | var template BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1059 | 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] | 1060 | f_pageing_helper('001010000000006'H, cid_list, { 0 }); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame^] | 1061 | f_shutdown_helper(); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1062 | } |
| 1063 | |
| 1064 | /* Paging by LAC+CI */ |
| 1065 | testcase TC_paging_imsi_nochan_lac_ci() runs on test_CT { |
| 1066 | var template BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1067 | 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] | 1068 | f_pageing_helper('001010000000007'H, cid_list, { 0 }); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame^] | 1069 | f_shutdown_helper(); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1070 | } |
| 1071 | |
| 1072 | /* Paging by CI */ |
| 1073 | testcase TC_paging_imsi_nochan_ci() runs on test_CT { |
| 1074 | var template BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1075 | cid_list := { cIl_CI := { ts_BSSMAP_CI_CI(cid.ci) } }; |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1076 | f_pageing_helper('001010000000008'H, cid_list, { 0 }); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame^] | 1077 | f_shutdown_helper(); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1078 | } |
| 1079 | |
| 1080 | /* Paging by LAI */ |
| 1081 | testcase TC_paging_imsi_nochan_lai() runs on test_CT { |
| 1082 | var template BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1083 | 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] | 1084 | f_pageing_helper('001010000000009'H, cid_list, c_BtsId_LAC1); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame^] | 1085 | f_shutdown_helper(); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1086 | } |
| 1087 | |
| 1088 | /* Paging by LAC */ |
| 1089 | testcase TC_paging_imsi_nochan_lac() runs on test_CT { |
| 1090 | var template BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1091 | cid_list := { cIl_LAC := { ts_BSSMAP_CI_LAC(cid.lac) } }; |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1092 | f_pageing_helper('001010000000010'H, cid_list, c_BtsId_LAC1); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame^] | 1093 | f_shutdown_helper(); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1094 | } |
| 1095 | |
| 1096 | /* Paging by "all in BSS" */ |
| 1097 | testcase TC_paging_imsi_nochan_all() runs on test_CT { |
| 1098 | var template BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1099 | cid_list := { cIl_allInBSS := ''O }; |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1100 | f_pageing_helper('001010000000011'H, cid_list, c_BtsId_all); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame^] | 1101 | f_shutdown_helper(); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1102 | } |
| 1103 | |
| 1104 | /* Paging by PLMN+LAC+RNC */ |
Harald Welte | 751d3eb | 2018-01-31 15:51:06 +0100 | [diff] [blame] | 1105 | testcase TC_paging_imsi_nochan_plmn_lac_rnc() runs on test_CT { |
| 1106 | var template BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1107 | cid_list := { cIl_PLMN_LAC_RNC := { ts_BSSMAP_CI_PLMN_LAC_RNC(cid.mcc, cid.mnc, cid.lac, 12) } }; |
Harald Welte | beb9dbc | 2018-01-31 15:56:00 +0100 | [diff] [blame] | 1108 | f_pageing_helper('001010000000012'H, cid_list, c_BtsId_all); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame^] | 1109 | f_shutdown_helper(); |
Harald Welte | 751d3eb | 2018-01-31 15:51:06 +0100 | [diff] [blame] | 1110 | } |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1111 | |
Harald Welte | 751d3eb | 2018-01-31 15:51:06 +0100 | [diff] [blame] | 1112 | /* Paging by RNC */ |
| 1113 | testcase TC_paging_imsi_nochan_rnc() runs on test_CT { |
| 1114 | var template BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1115 | cid_list := { cIl_RNC := { int2oct(13, 2) } }; |
Harald Welte | beb9dbc | 2018-01-31 15:56:00 +0100 | [diff] [blame] | 1116 | f_pageing_helper('001010000000013'H, cid_list, c_BtsId_all); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame^] | 1117 | f_shutdown_helper(); |
Harald Welte | 751d3eb | 2018-01-31 15:51:06 +0100 | [diff] [blame] | 1118 | } |
| 1119 | |
| 1120 | /* Paging by LAC+RNC */ |
| 1121 | testcase TC_paging_imsi_nochan_lac_rnc() runs on test_CT { |
| 1122 | var template BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1123 | cid_list := { cIl_LAC_RNC := { ts_BSSMAP_CI_LAC_RNC(cid.lac, 14) } }; |
Harald Welte | beb9dbc | 2018-01-31 15:56:00 +0100 | [diff] [blame] | 1124 | f_pageing_helper('001010000000014'H, cid_list, c_BtsId_all); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame^] | 1125 | f_shutdown_helper(); |
Harald Welte | 751d3eb | 2018-01-31 15:51:06 +0100 | [diff] [blame] | 1126 | } |
| 1127 | |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1128 | /* 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] | 1129 | testcase TC_paging_imsi_nochan_lacs() runs on test_CT { |
| 1130 | var template BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1131 | cid_list := { cIl_LAC := { ts_BSSMAP_CI_LAC(1), ts_BSSMAP_CI_LAC(2) } }; |
| 1132 | f_pageing_helper('001010000000015'H, cid_list, c_BtsId_all); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame^] | 1133 | f_shutdown_helper(); |
Harald Welte | 751d3eb | 2018-01-31 15:51:06 +0100 | [diff] [blame] | 1134 | } |
| 1135 | |
| 1136 | /* Paging on empty list: Verify none of them page */ |
| 1137 | testcase TC_paging_imsi_nochan_lacs_empty() runs on test_CT { |
| 1138 | var template BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1139 | cid_list := { cIl_LAC := { } }; |
| 1140 | f_pageing_helper('001010000000016'H, cid_list, c_BtsId_none); |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame^] | 1141 | f_shutdown_helper(); |
Harald Welte | 751d3eb | 2018-01-31 15:51:06 +0100 | [diff] [blame] | 1142 | } |
| 1143 | |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1144 | /* Verify paging retransmission interval + count */ |
| 1145 | /* Verify paging stops after channel establishment */ |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1146 | /* Test behavior under paging overload */ |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 1147 | |
Harald Welte | e65d40e | 2017-12-13 00:09:06 +0100 | [diff] [blame] | 1148 | /* Verify PCH load */ |
| 1149 | testcase TC_paging_imsi_load() runs on test_CT { |
| 1150 | var BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1151 | timer T := 4.0; |
| 1152 | cid_list := valueof(ts_BSSMAP_CIL_noCell); |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1153 | f_pageing_helper('001010123456789'H, cid_list, c_BtsId_all); |
Harald Welte | e65d40e | 2017-12-13 00:09:06 +0100 | [diff] [blame] | 1154 | |
| 1155 | /* tell BSC there is no paging space anymore */ |
| 1156 | f_ipa_tx(0, ts_RSL_PAGING_LOAD_IND(0)); |
| 1157 | |
| 1158 | /* Wait for 4 seconds if any more PAGING CMD are received on RSL. Normally, |
| 1159 | * there would be 8 retransmissions during 4 seconds */ |
| 1160 | T.start; |
| 1161 | alt { |
| 1162 | [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_PAGING_CMD(?))) { |
| 1163 | setverdict(fail, "Received PAGING after LOAD_IND(0)"); |
| 1164 | self.stop; |
| 1165 | } |
| 1166 | [] T.timeout { |
| 1167 | setverdict(pass); |
| 1168 | } |
| 1169 | } |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame^] | 1170 | |
| 1171 | f_shutdown_helper(); |
Harald Welte | e65d40e | 2017-12-13 00:09:06 +0100 | [diff] [blame] | 1172 | } |
| 1173 | |
Harald Welte | 235ebf1 | 2017-12-15 14:18:16 +0100 | [diff] [blame] | 1174 | /* Verify Paging Counter */ |
Harald Welte | 1ff6999 | 2017-12-14 12:31:17 +0100 | [diff] [blame] | 1175 | testcase TC_paging_counter() runs on test_CT { |
| 1176 | var BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1177 | timer T := 4.0; |
| 1178 | var integer i; |
| 1179 | var integer paging_attempted_bsc; |
| 1180 | var integer paging_attempted_bts[NUM_BTS]; |
| 1181 | var integer paging_expired_bts[NUM_BTS]; |
| 1182 | cid_list := valueof(ts_BSSMAP_CIL_noCell); |
| 1183 | |
| 1184 | f_init(); |
| 1185 | |
| 1186 | /* read counters before paging */ |
| 1187 | paging_attempted_bsc := f_ctrl_get_ratectr_abs(IPA_CTRL, "bsc", 0, "paging:attempted"); |
| 1188 | for (i := 0; i < NUM_BTS; i := i+1) { |
| 1189 | paging_attempted_bts[i] := f_ctrl_get_ratectr_abs(IPA_CTRL, "bts", i, "paging:attempted"); |
| 1190 | paging_expired_bts[i] := f_ctrl_get_ratectr_abs(IPA_CTRL, "bts", i, "paging:expired"); |
| 1191 | } |
| 1192 | |
| 1193 | f_pageing_helper('001230000000001'H, cid_list, c_BtsId_all); |
| 1194 | |
| 1195 | /* expect the attempted pages on BSC and each BTSs to have incremented by one */ |
| 1196 | f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bsc", 0, "paging:attempted", paging_attempted_bsc+1); |
| 1197 | for (i := 0; i < NUM_BTS; i := i+1) { |
| 1198 | f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", i, "paging:attempted", |
| 1199 | paging_attempted_bts[i]+1); |
| 1200 | } |
| 1201 | |
| 1202 | /* assume that 12s later the paging on all BTSs have expired and hence incremented by 1 */ |
| 1203 | f_sleep(12.0); |
| 1204 | for (i := 0; i < NUM_BTS; i := i+1) { |
| 1205 | f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", i, "paging:expired", |
| 1206 | paging_expired_bts[i]+1); |
| 1207 | } |
Harald Welte | 1ff6999 | 2017-12-14 12:31:17 +0100 | [diff] [blame] | 1208 | |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame^] | 1209 | f_shutdown_helper(); |
Harald Welte | 1ff6999 | 2017-12-14 12:31:17 +0100 | [diff] [blame] | 1210 | } |
| 1211 | |
| 1212 | |
Harald Welte | 1098500 | 2017-12-12 09:29:15 +0100 | [diff] [blame] | 1213 | /* Verify paging stops after A-RESET */ |
| 1214 | testcase TC_paging_imsi_a_reset() runs on test_CT { |
| 1215 | var BSSMAP_FIELD_CellIdentificationList cid_list; |
| 1216 | timer T := 3.0; |
| 1217 | cid_list := valueof(ts_BSSMAP_CIL_noCell); |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1218 | f_pageing_helper('001010123456789'H, cid_list, c_BtsId_all); |
Harald Welte | 1098500 | 2017-12-12 09:29:15 +0100 | [diff] [blame] | 1219 | |
| 1220 | /* Perform a BSSMAP Reset and wait for ACK */ |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 1221 | 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] | 1222 | alt { |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 1223 | [] 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] | 1224 | [] BSSAP.receive { repeat; } |
| 1225 | } |
| 1226 | |
| 1227 | /* Clear the queue, it might still contain stuff like BCCH FILLING */ |
Philipp Maier | 1e6b442 | 2018-02-23 14:02:13 +0100 | [diff] [blame] | 1228 | for (var integer i := 0; i < sizeof(IPA_RSL); i := i+1) { |
| 1229 | IPA_RSL[i].clear; |
| 1230 | } |
Harald Welte | 1098500 | 2017-12-12 09:29:15 +0100 | [diff] [blame] | 1231 | |
| 1232 | /* Wait for 3 seconds if any more PAGING CMD are received on RSL */ |
| 1233 | T.start; |
| 1234 | alt { |
| 1235 | [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_PAGING_CMD(?))) { |
| 1236 | setverdict(fail, "Received PAGING after A-RESET"); |
| 1237 | self.stop; |
| 1238 | } |
Harald Welte | 5d1a220 | 2017-12-13 19:51:29 +0100 | [diff] [blame] | 1239 | [] IPA_RSL[1].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_PAGING_CMD(?))) { |
| 1240 | setverdict(fail, "Received PAGING after A-RESET"); |
| 1241 | self.stop; |
| 1242 | } |
| 1243 | [] IPA_RSL[2].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_PAGING_CMD(?))) { |
| 1244 | setverdict(fail, "Received PAGING after A-RESET"); |
| 1245 | self.stop; |
| 1246 | } |
Harald Welte | 1098500 | 2017-12-12 09:29:15 +0100 | [diff] [blame] | 1247 | [] T.timeout { |
| 1248 | setverdict(pass); |
| 1249 | } |
| 1250 | } |
Philipp Maier | 282ca4b | 2018-02-27 17:17:00 +0100 | [diff] [blame^] | 1251 | |
| 1252 | f_shutdown_helper(); |
Harald Welte | 1098500 | 2017-12-12 09:29:15 +0100 | [diff] [blame] | 1253 | } |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 1254 | |
Harald Welte | 4e9b9cc | 2017-12-14 18:31:02 +0100 | [diff] [blame] | 1255 | /* Test RSL link drop causes counter increment */ |
| 1256 | testcase TC_rsl_drop_counter() runs on test_CT { |
| 1257 | var integer rsl_fail; |
| 1258 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 1259 | f_init(1); |
Harald Welte | 4e9b9cc | 2017-12-14 18:31:02 +0100 | [diff] [blame] | 1260 | |
| 1261 | rsl_fail := f_ctrl_get_ratectr_abs(IPA_CTRL, "bts", 0, "rsl_fail"); |
| 1262 | |
| 1263 | bts[0].rsl.vc_IPA.stop; |
| 1264 | |
| 1265 | f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "rsl_fail", rsl_fail+1); |
| 1266 | |
| 1267 | setverdict(pass); |
| 1268 | } |
| 1269 | |
| 1270 | /* TODO: Test OML link drop causes counter increment */ |
| 1271 | |
Stefan Sperling | 830dc9d | 2018-02-12 21:08:28 +0100 | [diff] [blame] | 1272 | /* The body of TC_rsl_unknown_unit_id() and TC_oml_unknown_unit_id() tests. */ |
| 1273 | function f_ipa_unknown_unit_id(integer mp_bsc_ipa_port) runs on test_CT return boolean { |
| 1274 | timer T := 10.0; |
| 1275 | |
| 1276 | bts[0].rsl.id := "IPA-0-RSL"; |
| 1277 | bts[0].rsl.vc_IPA := IPA_Emulation_CT.create(bts[0].rsl.id & "-IPA"); |
| 1278 | bts[0].rsl.ccm_pars := c_IPA_default_ccm_pars; |
| 1279 | bts[0].rsl.ccm_pars.name := "Osmocom TTCN-3 BTS Simulator"; |
| 1280 | bts[0].rsl.ccm_pars.unit_id := "0/0/0"; /* value which is unknown at BTS */ |
| 1281 | |
| 1282 | /* Call a function of our 'parent component' BSSAP_Adapter_CT to start the |
| 1283 | * MSC-side BSSAP emulation */ |
| 1284 | f_bssap_init(g_bssap, mp_bssap_cfg, "VirtMSC", omit); |
| 1285 | |
| 1286 | f_ipa_ctrl_start(mp_bsc_ip, mp_bsc_ctrl_port); |
| 1287 | |
| 1288 | f_init_mgcp("VirtMSC"); |
| 1289 | |
| 1290 | /* start RSL/OML connection (XXX re-uses RSL port/protocol definitions for OML) */ |
| 1291 | map(bts[0].rsl.vc_IPA:IPA_PORT, system:IPA); |
| 1292 | connect(bts[0].rsl.vc_IPA:IPA_RSL_PORT, self:IPA_RSL[0]); |
| 1293 | bts[0].rsl.vc_IPA.start(IPA_Emulation.main_client(mp_bsc_ip, mp_bsc_ipa_port, "", 10000, bts[0].rsl.ccm_pars)); |
| 1294 | |
| 1295 | /* wait for IPA OML link to connect and then disconnect */ |
| 1296 | T.start; |
| 1297 | alt { |
| 1298 | [] IPA_RSL[0].receive(ASP_IPA_Event:{up_down := ASP_IPA_EVENT_DOWN}) { |
| 1299 | T.stop; |
| 1300 | return true; |
| 1301 | } |
| 1302 | [] IPA_RSL[0].receive { repeat } |
| 1303 | [] T.timeout { |
| 1304 | self.stop; |
| 1305 | return false; |
| 1306 | } |
| 1307 | } |
| 1308 | |
| 1309 | return false; |
| 1310 | } |
| 1311 | |
| 1312 | /* BSC should close an RSL connection from a BTS with unknown unit ID (OS#2714). */ |
| 1313 | testcase TC_rsl_unknown_unit_id() runs on test_CT { |
| 1314 | if (f_ipa_unknown_unit_id(mp_bsc_rsl_port)) { |
| 1315 | setverdict(pass); |
| 1316 | } else { |
| 1317 | setverdict(fail, "Timeout RSL waiting for connection to close"); |
| 1318 | } |
| 1319 | } |
| 1320 | |
| 1321 | |
| 1322 | /* BSC should close an RSL connection from a BTS with unknown unit ID (OS#2714). */ |
| 1323 | testcase TC_oml_unknown_unit_id() runs on test_CT { |
| 1324 | if (f_ipa_unknown_unit_id(mp_bsc_oml_port)) { |
| 1325 | setverdict(pass); |
| 1326 | } else { |
| 1327 | setverdict(fail, "Timeout OML waiting for connection to close"); |
| 1328 | } |
| 1329 | } |
| 1330 | |
| 1331 | |
Harald Welte | c1a2fff | 2017-12-17 11:06:19 +0100 | [diff] [blame] | 1332 | /*********************************************************************** |
| 1333 | * "New world" test cases using RSL_Emulation + BSSMAP_Emulation |
| 1334 | ***********************************************************************/ |
| 1335 | |
| 1336 | import from BSSMAP_Emulation all; |
| 1337 | import from RSL_Emulation all; |
| 1338 | import from MSC_ConnectionHandler all; |
| 1339 | |
| 1340 | type function void_fn(charstring id) runs on MSC_ConnHdlr; |
| 1341 | |
| 1342 | /* helper function to create, connect and start a MSC_ConnHdlr component */ |
| 1343 | function f_start_handler(void_fn fn, charstring id) runs on test_CT return MSC_ConnHdlr { |
| 1344 | var MSC_ConnHdlr vc_conn; |
| 1345 | |
| 1346 | vc_conn := MSC_ConnHdlr.create(id); |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 1347 | connect(vc_conn:BSSMAPEM, g_bssap.vc_BSSMAP:PROC); |
Daniel Willmann | 191e0d9 | 2018-01-17 12:44:35 +0100 | [diff] [blame] | 1348 | connect(vc_conn:MGCP_PROC, vc_MGCP:MGCP_PROC); |
Harald Welte | c1a2fff | 2017-12-17 11:06:19 +0100 | [diff] [blame] | 1349 | connect(vc_conn:RSL, bts[0].rsl.vc_RSL:CLIENT_PT); |
Harald Welte | f70df65 | 2018-01-29 22:00:23 +0100 | [diff] [blame] | 1350 | connect(vc_conn:RSL_PROC, bts[0].rsl.vc_RSL:RSL_PROC); |
Philipp Maier | 956a92f | 2018-02-16 10:58:07 +0100 | [diff] [blame] | 1351 | if (isbound(bts[1])) { |
| 1352 | connect(vc_conn:RSL1, bts[1].rsl.vc_RSL:CLIENT_PT); |
| 1353 | connect(vc_conn:RSL1_PROC, bts[1].rsl.vc_RSL:RSL_PROC); |
| 1354 | } |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 1355 | connect(vc_conn:BSSAP, g_bssap.vc_BSSMAP:CLIENT); |
Daniel Willmann | 191e0d9 | 2018-01-17 12:44:35 +0100 | [diff] [blame] | 1356 | connect(vc_conn:MGCP, vc_MGCP:MGCP_CLIENT); |
Harald Welte | c1a2fff | 2017-12-17 11:06:19 +0100 | [diff] [blame] | 1357 | vc_conn.start(derefers(fn)(id)); |
| 1358 | return vc_conn; |
| 1359 | } |
| 1360 | |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1361 | private function f_tc_assignment_fr_a5_0(charstring id) runs on MSC_ConnHdlr { |
| 1362 | var TestHdlrParams pars := valueof(t_def_TestHdlrPars); |
| 1363 | var template PDU_BSSAP exp_compl := tr_BSSMAP_AssignmentComplete(omit, ?); |
| 1364 | var BSSMAP_IE_AoIP_TransportLayerAddress tla := valueof(ts_BSSMAP_IE_AoIP_TLA4('01020304'O, 2342)); |
| 1365 | var PDU_BSSAP ass_cmd := valueof(ts_BSSMAP_AssignmentReq(omit, tla)); |
| 1366 | const OCT8 kc := '0001020304050607'O; |
Harald Welte | c1a2fff | 2017-12-17 11:06:19 +0100 | [diff] [blame] | 1367 | |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1368 | ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType); |
| 1369 | 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] | 1370 | |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1371 | f_establish_fully(pars, ass_cmd, exp_compl); |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 1372 | f_cipher_mode('01'O, kc); |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1373 | } |
| 1374 | |
| 1375 | testcase TC_assignment_fr_a5_0() runs on test_CT { |
| 1376 | var MSC_ConnHdlr vc_conn; |
| 1377 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 1378 | f_init(1, true); |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1379 | f_sleep(1.0); |
| 1380 | |
| 1381 | vc_conn := f_start_handler(refers(f_tc_assignment_fr_a5_0), testcasename()); |
| 1382 | vc_conn.done; |
| 1383 | } |
| 1384 | |
| 1385 | |
| 1386 | |
| 1387 | private function f_tc_assignment_fr_a5_1(charstring id) runs on MSC_ConnHdlr { |
Harald Welte | c1a2fff | 2017-12-17 11:06:19 +0100 | [diff] [blame] | 1388 | var TestHdlrParams pars := valueof(t_def_TestHdlrPars); |
| 1389 | |
| 1390 | var template PDU_BSSAP exp_compl := tr_BSSMAP_AssignmentComplete(omit, ?); |
| 1391 | var BSSMAP_IE_AoIP_TransportLayerAddress tla := valueof(ts_BSSMAP_IE_AoIP_TLA4('01020304'O, 2342)); |
| 1392 | var PDU_BSSAP ass_cmd := valueof(ts_BSSMAP_AssignmentReq(omit, tla)); |
| 1393 | const OCT8 kc := '0001020304050607'O; |
| 1394 | |
| 1395 | ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType); |
| 1396 | ass_cmd.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR})); |
Harald Welte | c1a2fff | 2017-12-17 11:06:19 +0100 | [diff] [blame] | 1397 | |
| 1398 | f_establish_fully(pars, ass_cmd, exp_compl); |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 1399 | f_cipher_mode('02'O, kc); |
Harald Welte | c1a2fff | 2017-12-17 11:06:19 +0100 | [diff] [blame] | 1400 | } |
| 1401 | |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1402 | testcase TC_assignment_fr_a5_1() runs on test_CT { |
Harald Welte | c1a2fff | 2017-12-17 11:06:19 +0100 | [diff] [blame] | 1403 | var MSC_ConnHdlr vc_conn; |
| 1404 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 1405 | f_init(1, true); |
Harald Welte | c1a2fff | 2017-12-17 11:06:19 +0100 | [diff] [blame] | 1406 | f_sleep(1.0); |
| 1407 | |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1408 | vc_conn := f_start_handler(refers(f_tc_assignment_fr_a5_1), testcasename()); |
Harald Welte | c1a2fff | 2017-12-17 11:06:19 +0100 | [diff] [blame] | 1409 | vc_conn.done; |
| 1410 | } |
| 1411 | |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1412 | /* Expect ASSIGNMENT FAIL if mandatory IE is missing */ |
| 1413 | private function f_tc_assignment_fr_a5_1_codec_missing(charstring id) runs on MSC_ConnHdlr { |
| 1414 | var TestHdlrParams pars := valueof(t_def_TestHdlrPars); |
| 1415 | var template PDU_BSSAP exp_fail := tr_BSSMAP_AssignmentFail; |
| 1416 | var BSSMAP_IE_AoIP_TransportLayerAddress tla := valueof(ts_BSSMAP_IE_AoIP_TLA4('01020304'O, 2342)); |
| 1417 | var PDU_BSSAP ass_cmd := valueof(ts_BSSMAP_AssignmentReq(omit, tla)); |
| 1418 | const OCT8 kc := '0001020304050607'O; |
| 1419 | |
| 1420 | ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType); |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1421 | f_establish_fully(pars, ass_cmd, exp_fail); |
| 1422 | } |
| 1423 | |
| 1424 | testcase TC_assignment_fr_a5_1_codec_missing() runs on test_CT { |
| 1425 | var MSC_ConnHdlr vc_conn; |
| 1426 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 1427 | f_init(1, true); |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1428 | f_sleep(1.0); |
| 1429 | |
| 1430 | vc_conn := f_start_handler(refers(f_tc_assignment_fr_a5_1_codec_missing), testcasename()); |
| 1431 | vc_conn.done; |
| 1432 | } |
| 1433 | |
| 1434 | |
| 1435 | private function f_tc_assignment_fr_a5_3(charstring id ) runs on MSC_ConnHdlr { |
| 1436 | var TestHdlrParams pars := valueof(t_def_TestHdlrPars); |
| 1437 | var template PDU_BSSAP exp_compl := tr_BSSMAP_AssignmentComplete(omit, ?); |
| 1438 | var BSSMAP_IE_AoIP_TransportLayerAddress tla := valueof(ts_BSSMAP_IE_AoIP_TLA4('01020304'O, 2342)); |
| 1439 | var PDU_BSSAP ass_cmd := valueof(ts_BSSMAP_AssignmentReq(omit, tla)); |
| 1440 | const OCT8 kc := '0001020304050607'O; |
| 1441 | |
| 1442 | ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType); |
| 1443 | 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] | 1444 | |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1445 | f_establish_fully(pars, ass_cmd, exp_compl); |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 1446 | f_cipher_mode('08'O, kc); |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1447 | } |
| 1448 | |
| 1449 | testcase TC_assignment_fr_a5_3() runs on test_CT { |
| 1450 | var MSC_ConnHdlr vc_conn; |
| 1451 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 1452 | f_init(1, true); |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1453 | f_sleep(1.0); |
| 1454 | |
| 1455 | vc_conn := f_start_handler(refers(f_tc_assignment_fr_a5_3), testcasename()); |
| 1456 | vc_conn.done; |
| 1457 | } |
| 1458 | |
| 1459 | |
| 1460 | private function f_tc_assignment_fr_a5_4(charstring id) runs on MSC_ConnHdlr { |
| 1461 | var TestHdlrParams pars := valueof(t_def_TestHdlrPars); |
Harald Welte | 38b2a10 | 2017-12-23 02:42:58 +0100 | [diff] [blame] | 1462 | var template PDU_BSSAP exp_compl := tr_BSSMAP_AssignmentComplete(omit, ?); |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1463 | var BSSMAP_IE_AoIP_TransportLayerAddress tla := valueof(ts_BSSMAP_IE_AoIP_TLA4('01020304'O, 2342)); |
| 1464 | var PDU_BSSAP ass_cmd := valueof(ts_BSSMAP_AssignmentReq(omit, tla)); |
| 1465 | const OCT8 kc := '0001020304050607'O; |
| 1466 | const OCT16 kc128 := kc & kc; |
| 1467 | |
| 1468 | ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType); |
| 1469 | ass_cmd.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR})); |
Harald Welte | 38b2a10 | 2017-12-23 02:42:58 +0100 | [diff] [blame] | 1470 | f_establish_fully(pars, ass_cmd, exp_compl); |
| 1471 | f_cipher_mode('10'O, kc, kc128, true); |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1472 | /* TODO: expect GSM0808_CAUSE_CIPHERING_ALGORITHM_NOT_SUPPORTED cause value */ |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1473 | } |
| 1474 | |
| 1475 | testcase TC_assignment_fr_a5_4() runs on test_CT { |
| 1476 | var MSC_ConnHdlr vc_conn; |
| 1477 | |
Harald Welte | 89d42e8 | 2017-12-17 16:42:41 +0100 | [diff] [blame] | 1478 | f_init(1, true); |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1479 | f_sleep(1.0); |
| 1480 | |
| 1481 | vc_conn := f_start_handler(refers(f_tc_assignment_fr_a5_4), testcasename()); |
| 1482 | vc_conn.done; |
| 1483 | } |
| 1484 | |
| 1485 | |
Harald Welte | 4532e0a | 2017-12-23 02:05:44 +0100 | [diff] [blame] | 1486 | private function f_tc_assignment_sign(charstring id) runs on MSC_ConnHdlr { |
| 1487 | var TestHdlrParams pars := valueof(t_def_TestHdlrPars); |
| 1488 | var template PDU_BSSAP exp_compl := tr_BSSMAP_AssignmentComplete(omit, omit); |
| 1489 | var PDU_BSSAP ass_cmd := valueof(ts_BSSMAP_AssignmentReq(omit, omit)); |
| 1490 | |
| 1491 | ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelTypeSIGNAL); |
| 1492 | f_establish_fully(pars, ass_cmd, exp_compl); |
| 1493 | } |
| 1494 | |
| 1495 | testcase TC_assignment_sign() runs on test_CT { |
| 1496 | var MSC_ConnHdlr vc_conn; |
| 1497 | |
| 1498 | f_init(1, true); |
| 1499 | f_sleep(1.0); |
| 1500 | |
| 1501 | vc_conn := f_start_handler(refers(f_tc_assignment_sign), testcasename()); |
| 1502 | vc_conn.done; |
| 1503 | } |
| 1504 | |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1505 | /* test if L3 RR CLASSMARK CHANGE is translated to BSSMAP CLASSMARK UPDATE */ |
| 1506 | private function f_tc_classmark(charstring id) runs on MSC_ConnHdlr { |
| 1507 | var TestHdlrParams pars := valueof(t_def_TestHdlrPars); |
| 1508 | f_create_chan_and_exp(pars); |
| 1509 | /* we should now have a COMPL_L3 at the MSC */ |
| 1510 | BSSAP.receive(tr_BSSMAP_ComplL3); |
| 1511 | |
| 1512 | f_rsl_send_l3(ts_RRM_CM_CHG(valueof(ts_CM2))); |
| 1513 | BSSAP.receive(tr_BSSMAP_ClassmarkUpd(?, omit)); |
| 1514 | setverdict(pass); |
| 1515 | } |
| 1516 | testcase TC_classmark() runs on test_CT { |
| 1517 | var MSC_ConnHdlr vc_conn; |
| 1518 | f_init(1, true); |
| 1519 | f_sleep(1.0); |
| 1520 | vc_conn := f_start_handler(refers(f_tc_classmark), testcasename()); |
| 1521 | vc_conn.done; |
| 1522 | } |
| 1523 | |
Harald Welte | e3bd658 | 2018-01-31 22:51:25 +0100 | [diff] [blame] | 1524 | private function f_est_single_l3(template PDU_ML3_MS_NW l3) runs on MSC_ConnHdlr { |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1525 | var TestHdlrParams pars := valueof(t_def_TestHdlrPars); |
| 1526 | f_create_chan_and_exp(pars); |
| 1527 | /* we should now have a COMPL_L3 at the MSC */ |
| 1528 | BSSAP.receive(tr_BSSMAP_ComplL3); |
| 1529 | |
Harald Welte | e3bd658 | 2018-01-31 22:51:25 +0100 | [diff] [blame] | 1530 | /* send the single message we want to send */ |
| 1531 | f_rsl_send_l3(l3); |
| 1532 | } |
| 1533 | |
| 1534 | private function f_bssap_expect_nothing(float sec := 5.00) runs on MSC_ConnHdlr { |
| 1535 | timer T := sec; |
| 1536 | var PDU_BSSAP bssap; |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1537 | T.start; |
| 1538 | alt { |
Harald Welte | e3bd658 | 2018-01-31 22:51:25 +0100 | [diff] [blame] | 1539 | [] BSSAP.receive(PDU_BSSAP:?) -> value bssap { |
| 1540 | setverdict(fail, "Unexpected BSSMAP ", bssap); |
| 1541 | self.stop; |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1542 | } |
| 1543 | [] T.timeout { |
| 1544 | setverdict(pass); |
| 1545 | } |
| 1546 | } |
| 1547 | } |
| 1548 | |
Harald Welte | e3bd658 | 2018-01-31 22:51:25 +0100 | [diff] [blame] | 1549 | /* unsolicited ASSIGNMENT FAIL (without ASSIGN) from MS shouldn't bring BSC down */ |
| 1550 | private function f_tc_unsol_ass_fail(charstring id) runs on MSC_ConnHdlr { |
| 1551 | f_est_single_l3(ts_RRM_AssignmentFailure('00'O)); |
| 1552 | f_bssap_expect_nothing(); |
| 1553 | } |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1554 | testcase TC_unsol_ass_fail() runs on test_CT { |
| 1555 | var MSC_ConnHdlr vc_conn; |
| 1556 | f_init(1, true); |
| 1557 | f_sleep(1.0); |
| 1558 | vc_conn := f_start_handler(refers(f_tc_unsol_ass_fail), testcasename()); |
| 1559 | vc_conn.done; |
| 1560 | } |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1561 | |
Harald Welte | ea99a00 | 2018-01-31 20:46:43 +0100 | [diff] [blame] | 1562 | |
| 1563 | /* unsolicited ASSIGNMENT COMPLETE (without ASSIGN) from MS shouldn't bring BSC down */ |
| 1564 | 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] | 1565 | f_est_single_l3(ts_RRM_AssignmentComplete('00'O)); |
| 1566 | f_bssap_expect_nothing(); |
Harald Welte | ea99a00 | 2018-01-31 20:46:43 +0100 | [diff] [blame] | 1567 | } |
| 1568 | testcase TC_unsol_ass_compl() runs on test_CT { |
| 1569 | var MSC_ConnHdlr vc_conn; |
| 1570 | f_init(1, true); |
| 1571 | f_sleep(1.0); |
| 1572 | vc_conn := f_start_handler(refers(f_tc_unsol_ass_compl), testcasename()); |
| 1573 | vc_conn.done; |
| 1574 | } |
| 1575 | |
| 1576 | |
Harald Welte | fbf9b5e | 2018-01-31 20:41:23 +0100 | [diff] [blame] | 1577 | /* unsolicited HANDOVER FAIL (without ASSIGN) from MS shouldn't bring BSC down */ |
| 1578 | 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] | 1579 | f_est_single_l3(ts_RRM_HandoverFailure('00'O)); |
| 1580 | f_bssap_expect_nothing(); |
Harald Welte | fbf9b5e | 2018-01-31 20:41:23 +0100 | [diff] [blame] | 1581 | } |
Harald Welte | fbf9b5e | 2018-01-31 20:41:23 +0100 | [diff] [blame] | 1582 | testcase TC_unsol_ho_fail() runs on test_CT { |
| 1583 | var MSC_ConnHdlr vc_conn; |
| 1584 | f_init(1, true); |
| 1585 | f_sleep(1.0); |
| 1586 | vc_conn := f_start_handler(refers(f_tc_unsol_ho_fail), testcasename()); |
| 1587 | vc_conn.done; |
| 1588 | } |
| 1589 | |
| 1590 | |
Harald Welte | e3bd658 | 2018-01-31 22:51:25 +0100 | [diff] [blame] | 1591 | /* short message from MS should be ignored */ |
| 1592 | private function f_tc_err_82_short_msg(charstring id) runs on MSC_ConnHdlr { |
| 1593 | var TestHdlrParams pars := valueof(t_def_TestHdlrPars); |
| 1594 | f_create_chan_and_exp(pars); |
| 1595 | /* we should now have a COMPL_L3 at the MSC */ |
| 1596 | BSSAP.receive(tr_BSSMAP_ComplL3); |
| 1597 | |
| 1598 | /* send short message */ |
| 1599 | RSL.send(ts_RSL_DATA_IND(g_chan_nr, valueof(ts_RslLinkID_DCCH(0)), ''O)); |
| 1600 | f_bssap_expect_nothing(); |
| 1601 | } |
| 1602 | testcase TC_err_82_short_msg() runs on test_CT { |
| 1603 | var MSC_ConnHdlr vc_conn; |
| 1604 | f_init(1, true); |
| 1605 | f_sleep(1.0); |
| 1606 | vc_conn := f_start_handler(refers(f_tc_err_82_short_msg), testcasename()); |
| 1607 | vc_conn.done; |
| 1608 | } |
| 1609 | |
| 1610 | |
Harald Welte | e9e02e4 | 2018-01-31 23:36:25 +0100 | [diff] [blame] | 1611 | /* 24.008 8.4 Unknown message must trigger RR STATUS */ |
| 1612 | private function f_tc_err_84_unknown_msg(charstring id) runs on MSC_ConnHdlr { |
| 1613 | f_est_single_l3(ts_RRM_UL_REL('00'O)); |
| 1614 | timer T := 3.0 |
| 1615 | alt { |
| 1616 | [] RSL.receive(tr_RSL_DATA_REQ(g_chan_nr, ?, decmatch tr_RRM_RR_STATUS)) { |
| 1617 | setverdict(pass); |
| 1618 | } |
| 1619 | [] BSSAP.receive { setverdict(fail, "unexpected BSSAP"); } |
| 1620 | [] T.timeout { setverdict(inconc); } |
| 1621 | } |
| 1622 | } |
| 1623 | testcase TC_err_84_unknown_msg() runs on test_CT { |
| 1624 | var MSC_ConnHdlr vc_conn; |
| 1625 | f_init(1, true); |
| 1626 | f_sleep(1.0); |
| 1627 | vc_conn := f_start_handler(refers(f_tc_err_84_unknown_msg), testcasename()); |
| 1628 | vc_conn.done; |
| 1629 | } |
| 1630 | |
Harald Welte | 261af4b | 2018-02-12 21:20:39 +0100 | [diff] [blame] | 1631 | /* execute a "bts <0-255> trx <0-255> timeslot <0-7> sub-slot <0-7>" command on given Dchan */ |
| 1632 | private function f_vty_ss_action(charstring suffix, integer bts_nr, integer trx_nr, RslChannelNr chan_nr) |
| 1633 | runs on MSC_ConnHdlr { |
| 1634 | /* FIXME: resolve those from component-global state */ |
| 1635 | var integer ts_nr := chan_nr.tn; |
| 1636 | var integer ss_nr; |
| 1637 | if (ischosen(chan_nr.u.ch0)) { |
| 1638 | ss_nr := 0; |
| 1639 | } else if (ischosen(chan_nr.u.lm)) { |
| 1640 | ss_nr := chan_nr.u.lm.sub_chan; |
| 1641 | } else if (ischosen(chan_nr.u.sdcch4)) { |
| 1642 | ss_nr := chan_nr.u.sdcch4.sub_chan; |
| 1643 | } else if (ischosen(chan_nr.u.sdcch8)) { |
| 1644 | ss_nr := chan_nr.u.sdcch8.sub_chan; |
| 1645 | } else { |
| 1646 | setverdict(fail, "Invalid ChanNr ", chan_nr); |
| 1647 | self.stop; |
| 1648 | } |
| 1649 | |
| 1650 | var charstring cmd := "bts "&int2str(bts_nr)&" trx "&int2str(trx_nr)& |
| 1651 | " timeslot "&int2str(ts_nr)&" sub-slot "&int2str(ss_nr)&" "; |
| 1652 | f_vty_transceive(BSCVTY, cmd & suffix); |
| 1653 | } |
| 1654 | |
| 1655 | private function f_vty_handover(integer bts_nr, integer trx_nr, RslChannelNr chan_nr, |
| 1656 | integer new_bts_nr) |
| 1657 | runs on MSC_ConnHdlr { |
| 1658 | f_vty_ss_action("handover " & int2str(new_bts_nr), bts_nr, trx_nr, chan_nr); |
| 1659 | } |
| 1660 | |
| 1661 | /* intra-BSC hand-over between BTS0 and BTS1 */ |
| 1662 | private function f_tc_ho_int(charstring id) runs on MSC_ConnHdlr { |
| 1663 | var TestHdlrParams pars := valueof(t_def_TestHdlrPars); |
| 1664 | var template PDU_BSSAP exp_compl := tr_BSSMAP_AssignmentComplete(omit, ?); |
| 1665 | var BSSMAP_IE_AoIP_TransportLayerAddress tla := valueof(ts_BSSMAP_IE_AoIP_TLA4('01020304'O, 2342)); |
| 1666 | var PDU_BSSAP ass_cmd := valueof(ts_BSSMAP_AssignmentReq(omit, tla)); |
| 1667 | const OCT8 kc := '0001020304050607'O; |
| 1668 | |
| 1669 | ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType); |
| 1670 | ass_cmd.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR})); |
| 1671 | |
| 1672 | f_establish_fully(pars, ass_cmd, exp_compl); |
| 1673 | |
| 1674 | var HandoverState hs := { |
| 1675 | rr_ho_cmpl_seen := false, |
| 1676 | handover_done := false, |
| 1677 | old_chan_nr := - |
| 1678 | }; |
| 1679 | /* issue hand-over command on VTY */ |
| 1680 | f_vty_handover(0, 0, g_chan_nr, 1); |
| 1681 | /* temporarily suspend DChan processing on BTS1 to avoid race with RSLEM_register */ |
| 1682 | f_rslem_suspend(RSL1_PROC); |
| 1683 | alt { |
| 1684 | [] as_handover(hs); |
| 1685 | /* FIXME: somehow determine that the hand-over has completed, by MGCP MDCX? */ |
| 1686 | } |
| 1687 | } |
| 1688 | |
| 1689 | testcase TC_ho_int() runs on test_CT { |
| 1690 | var MSC_ConnHdlr vc_conn; |
| 1691 | f_init(2, true); |
| 1692 | f_sleep(1.0); |
| 1693 | vc_conn := f_start_handler(refers(f_tc_ho_int), testcasename()); |
| 1694 | vc_conn.done; |
| 1695 | } |
Harald Welte | e9e02e4 | 2018-01-31 23:36:25 +0100 | [diff] [blame] | 1696 | |
Harald Welte | 552620d | 2017-12-16 23:21:36 +0100 | [diff] [blame] | 1697 | |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 1698 | control { |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1699 | /* CTRL interface testing */ |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 1700 | execute( TC_ctrl_msc_connection_status() ); |
Stefan Sperling | b041b3d | 2018-01-03 17:14:55 +0100 | [diff] [blame] | 1701 | execute( TC_ctrl_msc0_connection_status() ); |
Harald Welte | 96c9441 | 2017-12-09 03:12:45 +0100 | [diff] [blame] | 1702 | execute( TC_ctrl() ); |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1703 | |
| 1704 | /* RSL DCHAN Channel ACtivation / Deactivation */ |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 1705 | execute( TC_chan_act_noreply() ); |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 1706 | execute( TC_chan_act_counter() ); |
Harald Welte | ae02669 | 2017-12-09 01:03:01 +0100 | [diff] [blame] | 1707 | execute( TC_chan_act_ack_noest() ); |
| 1708 | execute( TC_chan_act_ack_est_ind_noreply() ); |
| 1709 | execute( TC_chan_act_ack_est_ind_refused() ); |
Harald Welte | 618ef64 | 2017-12-14 14:58:20 +0100 | [diff] [blame] | 1710 | execute( TC_chan_act_nack() ); |
Harald Welte | 799c97b | 2017-12-14 17:50:30 +0100 | [diff] [blame] | 1711 | execute( TC_chan_exhaustion() ); |
Harald Welte | 4003d11 | 2017-12-09 22:35:39 +0100 | [diff] [blame] | 1712 | execute( TC_chan_rel_rll_rel_ind() ); |
| 1713 | execute( TC_chan_rel_conn_fail() ); |
| 1714 | execute( TC_chan_rel_hard_clear() ); |
Harald Welte | d8c36cd | 2017-12-09 23:05:31 +0100 | [diff] [blame] | 1715 | execute( TC_chan_rel_hard_rlsd() ); |
Harald Welte | 85804d4 | 2017-12-10 14:11:58 +0100 | [diff] [blame] | 1716 | execute( TC_chan_rel_a_reset() ); |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1717 | |
Harald Welte | cfe2c96 | 2017-12-15 12:09:32 +0100 | [diff] [blame] | 1718 | execute( TC_outbound_connect() ); |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1719 | |
| 1720 | /* Assignment related */ |
Harald Welte | 16a4adf | 2017-12-14 18:54:01 +0100 | [diff] [blame] | 1721 | execute( TC_assignment_cic_only() ); |
Harald Welte | 235ebf1 | 2017-12-15 14:18:16 +0100 | [diff] [blame] | 1722 | execute( TC_assignment_csd() ); |
| 1723 | execute( TC_assignment_ctm() ); |
| 1724 | execute( TC_assignment_sign() ); |
| 1725 | execute( TC_assignment_fr_a5_0() ); |
| 1726 | execute( TC_assignment_fr_a5_1() ); |
Harald Welte | f1b64e2 | 2017-12-15 14:55:14 +0100 | [diff] [blame] | 1727 | execute( TC_assignment_fr_a5_1_codec_missing() ); |
Harald Welte | 235ebf1 | 2017-12-15 14:18:16 +0100 | [diff] [blame] | 1728 | execute( TC_assignment_fr_a5_3() ); |
| 1729 | execute( TC_assignment_fr_a5_4() ); |
Harald Welte | 16a4adf | 2017-12-14 18:54:01 +0100 | [diff] [blame] | 1730 | |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1731 | /* RLL Establish Indication on inactive DCHAN / SAPI */ |
Harald Welte | 5cd20ed | 2017-12-13 21:03:20 +0100 | [diff] [blame] | 1732 | execute( TC_rll_est_ind_inact_lchan() ); |
| 1733 | execute( TC_rll_est_ind_inval_sapi1() ); |
| 1734 | execute( TC_rll_est_ind_inval_sapi3() ); |
| 1735 | execute( TC_rll_est_ind_inval_sacch() ); |
| 1736 | |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1737 | /* Paging related tests */ |
Harald Welte | 6f521d8 | 2017-12-11 19:52:02 +0100 | [diff] [blame] | 1738 | execute( TC_paging_imsi_nochan() ); |
| 1739 | execute( TC_paging_tmsi_nochan() ); |
| 1740 | execute( TC_paging_tmsi_any() ); |
| 1741 | execute( TC_paging_tmsi_sdcch() ); |
| 1742 | execute( TC_paging_tmsi_tch_f() ); |
| 1743 | execute( TC_paging_tmsi_tch_hf() ); |
| 1744 | execute( TC_paging_imsi_nochan_cgi() ); |
| 1745 | execute( TC_paging_imsi_nochan_lac_ci() ); |
| 1746 | execute( TC_paging_imsi_nochan_ci() ); |
| 1747 | execute( TC_paging_imsi_nochan_lai() ); |
| 1748 | execute( TC_paging_imsi_nochan_lac() ); |
| 1749 | execute( TC_paging_imsi_nochan_all() ); |
Harald Welte | 751d3eb | 2018-01-31 15:51:06 +0100 | [diff] [blame] | 1750 | execute( TC_paging_imsi_nochan_plmn_lac_rnc() ); |
| 1751 | execute( TC_paging_imsi_nochan_rnc() ); |
| 1752 | execute( TC_paging_imsi_nochan_lac_rnc() ); |
| 1753 | execute( TC_paging_imsi_nochan_lacs() ); |
| 1754 | execute( TC_paging_imsi_nochan_lacs_empty() ); |
Harald Welte | 1098500 | 2017-12-12 09:29:15 +0100 | [diff] [blame] | 1755 | execute( TC_paging_imsi_a_reset() ); |
Harald Welte | e65d40e | 2017-12-13 00:09:06 +0100 | [diff] [blame] | 1756 | execute( TC_paging_imsi_load() ); |
Philipp Maier | 779a792 | 2018-02-16 11:00:37 +0100 | [diff] [blame] | 1757 | execute( TC_paging_counter() ); |
Harald Welte | 4e9b9cc | 2017-12-14 18:31:02 +0100 | [diff] [blame] | 1758 | |
| 1759 | execute( TC_rsl_drop_counter() ); |
Stefan Sperling | 830dc9d | 2018-02-12 21:08:28 +0100 | [diff] [blame] | 1760 | execute( TC_rsl_unknown_unit_id() ); |
| 1761 | |
| 1762 | execute( TC_oml_unknown_unit_id() ); |
Harald Welte | 898113b | 2018-01-31 18:32:21 +0100 | [diff] [blame] | 1763 | |
| 1764 | execute( TC_classmark() ); |
| 1765 | execute( TC_unsol_ass_fail() ); |
Harald Welte | ea99a00 | 2018-01-31 20:46:43 +0100 | [diff] [blame] | 1766 | execute( TC_unsol_ass_compl() ); |
Harald Welte | fbf9b5e | 2018-01-31 20:41:23 +0100 | [diff] [blame] | 1767 | execute( TC_unsol_ho_fail() ); |
Harald Welte | e3bd658 | 2018-01-31 22:51:25 +0100 | [diff] [blame] | 1768 | execute( TC_err_82_short_msg() ); |
Harald Welte | e9e02e4 | 2018-01-31 23:36:25 +0100 | [diff] [blame] | 1769 | execute( TC_err_84_unknown_msg() ); |
Harald Welte | 261af4b | 2018-02-12 21:20:39 +0100 | [diff] [blame] | 1770 | execute( TC_ho_int() ); |
Harald Welte | 28d943e | 2017-11-25 15:00:50 +0100 | [diff] [blame] | 1771 | } |
| 1772 | |
| 1773 | } |