blob: 8d789bd177d44b009cf5c6873d1bfe885257900c [file] [log] [blame]
Harald Welte70767382018-02-21 12:16:40 +01001module BTS_Tests {
2
3import from General_Types all;
4import from GSM_Types all;
5import from GSM_RR_Types all;
6import from Osmocom_Types all;
7import from GSM_Types all;
8import from GSM_RR_Types all;
Harald Welte82ccef72018-02-25 16:17:33 +01009import from GSM_SystemInformation all;
Harald Welte70767382018-02-21 12:16:40 +010010import from L1CTL_PortType all;
11import from L1CTL_Types all;
12import from LAPDm_Types all;
13import from Osmocom_CTRL_Adapter all;
14
15import from RSL_Types all;
Harald Welte7484fc42018-02-24 14:09:45 +010016import from IPA_Types all;
Harald Welte70767382018-02-21 12:16:40 +010017import from IPA_Emulation all;
18import from RSL_Emulation all;
19
20import from IPL4asp_Types all;
21import from TRXC_Types all;
22import from TRXC_CodecPort all;
23import from TRXC_CodecPort_CtrlFunct all;
24
Harald Welte883340c2018-02-28 18:59:29 +010025import from PCUIF_Types all;
26import from PCUIF_CodecPort all;
27
Harald Welte7484fc42018-02-24 14:09:45 +010028import from MobileL3_CommonIE_Types all;
Harald Welte68e495b2018-02-25 00:05:57 +010029import from MobileL3_RRM_Types all;
30import from MobileL3_Types all;
31import from L3_Templates all;
Harald Welte7484fc42018-02-24 14:09:45 +010032
Harald Welte8da48242018-02-27 20:41:32 +010033import from Osmocom_VTY_Functions all;
34import from TELNETasp_PortType all;
35
Harald Welte70767382018-02-21 12:16:40 +010036/* The tests assume a BTS with the following timeslot configuration:
37 * TS0 : Combined CCCH + SDCCH/4
38 * TS1 .. TS 4: TCH/F
39 * TS5 : TCH/H
40 * TS6 : SDCCH/8
41 * TS7 : PDCH
42 */
43
44modulepar {
45 charstring mp_rsl_ip := "127.0.0.2";
46 integer mp_rsl_port := 3003;
47 integer mp_trx0_arfcn := 871;
Harald Weltea4d8f352018-03-01 15:47:20 +010048 charstring mp_bb_trxc_ip := "127.0.0.1";
Harald Welteef3e1c92018-02-28 23:40:14 +010049 integer mp_bb_trxc_port := 6701;
Harald Welte883340c2018-02-28 18:59:29 +010050 charstring mp_pcu_socket := PCU_SOCK_DEFAULT;
Harald Welted5684392018-03-10 18:22:04 +010051 integer mp_tolerance_rxqual := 1;
52 integer mp_tolerance_rxlev := 3;
Harald Welte70767382018-02-21 12:16:40 +010053}
54
55type component test_CT extends CTRL_Adapter_CT {
Harald Welte68e495b2018-02-25 00:05:57 +010056 /* IPA Emulation component underneath RSL */
Harald Welte70767382018-02-21 12:16:40 +010057 var IPA_Emulation_CT vc_IPA;
Harald Welte68e495b2018-02-25 00:05:57 +010058 /* RSL Emulation component (for ConnHdlr tests) */
Harald Welte70767382018-02-21 12:16:40 +010059 var RSL_Emulation_CT vc_RSL;
Harald Welte68e495b2018-02-25 00:05:57 +010060 /* Direct RSL_CCHAN_PT */
Harald Welte70767382018-02-21 12:16:40 +010061 port RSL_CCHAN_PT RSL_CCHAN;
Harald Welte68e495b2018-02-25 00:05:57 +010062
63 /* L1CTL port (for classic tests) */
64 port L1CTL_PT L1CTL;
Harald Welte48494ca2018-02-25 16:59:50 +010065
Harald Welte54a2a2d2018-02-26 09:14:05 +010066 /* TRXC port (for classic tests) */
67 port TRXC_CODEC_PT BB_TRXC;
68 var integer g_bb_trxc_conn_id;
69
Harald Welte8da48242018-02-27 20:41:32 +010070 port TELNETasp_PT BTSVTY;
71
Harald Welte883340c2018-02-28 18:59:29 +010072 /* PCU Interface of BTS */
73 port PCUIF_CODEC_PT PCU;
74 var integer g_pcu_conn_id;
75 /* Last PCU INFO IND we received */
76 var PCUIF_Message g_pcu_last_info;
77
Harald Welte48494ca2018-02-25 16:59:50 +010078 /* SI configuration */
79 var SystemInformationConfig si_cfg := {
80 bcch_extended := false,
81 si1_present := false,
82 si2bis_present := false,
83 si2ter_present := false,
84 si2quater_present := false,
85 si7_present := false,
86 si8_present := false,
87 si9_present := false,
88 si13_present := false,
89 si13alt_present := false,
90 si15_present := false,
91 si16_present := false,
92 si17_present := false,
93 si2n_present := false,
94 si21_present := false,
95 si22_present := false
96 };
Harald Welte70767382018-02-21 12:16:40 +010097}
98
99/* an individual call / channel */
100type component ConnHdlr extends RSL_DchanHdlr {
101 port L1CTL_PT L1CTL;
102
103 port TRXC_CODEC_PT BB_TRXC;
104 var integer g_bb_trxc_conn_id;
105
106 timer g_Tguard;
107 timer g_Tmeas_exp := 2.0; /* >= 103 SACCH multiframe ~ 500ms */
108
109 var ConnHdlrPars g_pars;
110 var uint8_t g_next_meas_res_nr := 0;
Harald Weltefa45e9e2018-03-10 18:59:03 +0100111 var boolean g_first_meas_res := true;
Harald Welte70767382018-02-21 12:16:40 +0100112}
113
114function f_init_rsl(charstring id) runs on test_CT {
115 vc_IPA := IPA_Emulation_CT.create(id & "-RSL-IPA");
116 vc_RSL := RSL_Emulation_CT.create(id & "-RSL");
117
118 map(vc_IPA:IPA_PORT, system:IPA_CODEC_PT);
119 connect(vc_IPA:IPA_RSL_PORT, vc_RSL:IPA_PT);
120 connect(self:RSL_CCHAN, vc_RSL:CCHAN_PT);
121
122 vc_IPA.start(IPA_Emulation.main_server(mp_rsl_ip, mp_rsl_port));
123 vc_RSL.start(RSL_Emulation.main(false));
124}
125
126type record ConnHdlrPars {
127 RslChannelNr chan_nr,
128 RSL_IE_ChannelMode chan_mode,
129 float t_guard,
130 ConnL1Pars l1_pars
131}
132
Harald Welte82ccef72018-02-25 16:17:33 +0100133template (value) RachControlParameters ts_RachCtrl_default := {
Harald Welte0fd1fb02018-03-10 17:19:50 +0100134 max_retrans := RACH_MAX_RETRANS_7,
135 tx_integer := '1001'B, /* 12 slots */
Harald Welte82ccef72018-02-25 16:17:33 +0100136 cell_barr_access := false,
137 re_not_allowed := true,
Harald Welteb9585f82018-03-10 17:18:47 +0100138 acc := '0000010000000000'B
Harald Welte82ccef72018-02-25 16:17:33 +0100139};
140
Harald Weltef10153f2018-02-25 16:34:05 +0100141template (value) CellSelectionParameters ts_CellSelPar_default := {
Harald Welte0fd1fb02018-03-10 17:19:50 +0100142 cell_resel_hyst_2dB := 2,
143 ms_txpwr_max_cch := 7,
Harald Weltef10153f2018-02-25 16:34:05 +0100144 acs := '0'B,
145 neci := true,
146 rxlev_access_min := 0
147}
148
149template (value) LocationAreaIdentification ts_LAI_default := {
150 mcc_mnc := '262F42'H,
151 lac := 42
152}
153
Harald Welte7484fc42018-02-24 14:09:45 +0100154/* Default SYSTEM INFORMATION 3 */
Harald Weltef8df4cb2018-03-10 15:15:08 +0100155template (value) SystemInformation ts_SI3_default := {
156 header := ts_RrHeader(SYSTEM_INFORMATION_TYPE_3, 18),
Harald Welte7484fc42018-02-24 14:09:45 +0100157 payload := {
158 si3 := {
159 cell_id := 23,
Harald Weltef10153f2018-02-25 16:34:05 +0100160 lai := ts_LAI_default,
Harald Welte7484fc42018-02-24 14:09:45 +0100161 ctrl_chan_desc := {
162 msc_r99 := true,
163 att := true,
164 bs_ag_blks_res := 1,
165 ccch_conf := CCHAN_DESC_1CCCH_COMBINED,
Harald Welte82ccef72018-02-25 16:17:33 +0100166 si22ind := false,
Harald Welte7484fc42018-02-24 14:09:45 +0100167 cbq3 := CBQ3_IU_MODE_NOT_SUPPORTED,
168 spare := '00'B,
169 bs_pa_mfrms := 0, /* 2 multiframes */
170 t3212 := 1 /* 6 minutes */
171 },
Harald Welte82ccef72018-02-25 16:17:33 +0100172 cell_options := {
Harald Welte7484fc42018-02-24 14:09:45 +0100173 dn_ind := false,
174 pwrc := false,
175 dtx := MS_MAY_USE_UL_DTX,
Harald Welte0fd1fb02018-03-10 17:19:50 +0100176 radio_link_tout_div4 := (32/4)-1
Harald Welte7484fc42018-02-24 14:09:45 +0100177 },
Harald Weltef10153f2018-02-25 16:34:05 +0100178 cell_sel_par := ts_CellSelPar_default,
Harald Welte82ccef72018-02-25 16:17:33 +0100179 rach_control := ts_RachCtrl_default,
Harald Welte3778acc2018-03-09 19:32:31 +0100180 rest_octets := '2B2B2B2B'O
Harald Welte7484fc42018-02-24 14:09:45 +0100181 }
182 }
183}
Harald Welte70767382018-02-21 12:16:40 +0100184
Harald Weltef8df4cb2018-03-10 15:15:08 +0100185template (value) SystemInformation ts_SI2_default := {
186 header := ts_RrHeader(SYSTEM_INFORMATION_TYPE_2, 22),
Harald Weltef10153f2018-02-25 16:34:05 +0100187 payload := {
188 si2 := {
189 bcch_freq_list := '00000000000000000000000000000000'O,
190 ncc_permitted := '11111111'B,
191 rach_control := ts_RachCtrl_default
192 }
193 }
194}
195
Harald Weltef8df4cb2018-03-10 15:15:08 +0100196template (value) SystemInformation ts_SI4_default := {
197 header := ts_RrHeader(SYSTEM_INFORMATION_TYPE_4, 12), /* no CBCH / restoct */
Harald Weltef10153f2018-02-25 16:34:05 +0100198 payload := {
199 si4 := {
200 lai := ts_LAI_default,
201 cell_sel_par := ts_CellSelPar_default,
202 rach_control := ts_RachCtrl_default,
203 cbch_chan_desc := omit,
204 cbch_mobile_alloc := omit,
205 rest_octets := ''O
206 }
207 }
208}
209
210function f_rsl_bcch_fill_raw(RSL_IE_SysinfoType rsl_si_type, octetstring si_enc)
211runs on test_CT {
212 log("Setting ", rsl_si_type, ": ", si_enc);
213 RSL_CCHAN.send(ts_RSL_UD(ts_RSL_BCCH_INFO(rsl_si_type, si_enc)));
214}
215
216function f_rsl_bcch_fill(RSL_IE_SysinfoType rsl_si_type, template (value) SystemInformation si_dec)
217runs on test_CT {
218 var octetstring si_enc := enc_SystemInformation(valueof(si_dec));
219 log("Setting ", rsl_si_type, ": ", si_dec);
220 f_rsl_bcch_fill_raw(rsl_si_type, si_enc);
221}
222
Harald Welte8da48242018-02-27 20:41:32 +0100223private function f_init_vty(charstring id) runs on test_CT {
224 map(self:BTSVTY, system:BTSVTY);
225 f_vty_set_prompts(BTSVTY);
226 f_vty_transceive(BTSVTY, "enable");
227}
228
Harald Welte883340c2018-02-28 18:59:29 +0100229/* PCU socket may at any time receive a new INFO.ind */
230private altstep as_pcu_info_ind() runs on test_CT {
231 var PCUIF_send_data sd;
232 [] PCU.receive(t_SD_PCUIF_MSGT(g_pcu_conn_id, PCU_IF_MSG_INFO_IND)) -> value sd {
233 g_pcu_last_info := sd.data;
234 repeat;
235 }
236}
237
238private function f_init_pcu(charstring id) runs on test_CT {
239 timer T := 2.0;
240 var PCUIF_send_data sd;
241 map(self:PCU, system:PCU);
Harald Welte84271622018-03-10 17:21:03 +0100242 if (mp_pcu_socket == "") {
243 g_pcu_conn_id := -1;
244 return;
245 }
Harald Welte883340c2018-02-28 18:59:29 +0100246 g_pcu_conn_id := f_pcuif_connect(PCU, mp_pcu_socket);
247
248 T.start;
249 alt {
250 [] PCU.receive(t_SD_PCUIF_MSGT(g_pcu_conn_id, PCU_IF_MSG_INFO_IND)) -> value sd {
251 g_pcu_last_info := sd.data;
252 }
253 [] T.timeout {
254 setverdict(fail, "Timeout waiting for PCU INFO_IND");
255 self.stop;
256 }
257 }
258}
259
Harald Welte70767382018-02-21 12:16:40 +0100260/* global init function */
Harald Welte68e495b2018-02-25 00:05:57 +0100261function f_init(charstring id := "BTS-Test") runs on test_CT {
Harald Welte70767382018-02-21 12:16:40 +0100262 f_init_rsl(id);
263 RSL_CCHAN.receive(ASP_IPA_Event:{up_down := ASP_IPA_EVENT_UP});
Harald Welte2d142592018-02-25 13:19:44 +0100264 f_sleep(0.5); /* workaround for OS#3000 */
Harald Welte8da48242018-02-27 20:41:32 +0100265 f_init_vty(id);
Harald Welte7484fc42018-02-24 14:09:45 +0100266
267 /* Send SI3 to the BTS, it is needed for various computations */
Harald Weltef10153f2018-02-25 16:34:05 +0100268 f_rsl_bcch_fill(RSL_SYSTEM_INFO_3, ts_SI3_default);
269 /* SI2 + SI4 are required for SI testing as they are mandatory defaults */
270 f_rsl_bcch_fill(RSL_SYSTEM_INFO_2, ts_SI2_default);
271 f_rsl_bcch_fill(RSL_SYSTEM_INFO_4, ts_SI4_default);
Harald Welte57fe8232018-02-26 17:52:50 +0100272
Harald Welte883340c2018-02-28 18:59:29 +0100273 f_init_pcu(id);
274
Harald Welte84271622018-03-10 17:21:03 +0100275 if (mp_bb_trxc_port != -1) {
276 var TrxcMessage ret;
277 /* start with a default moderate timing offset equalling TA=2 */
278 f_main_trxc_connect();
279 ret := f_TRXC_transceive(BB_TRXC, g_bb_trxc_conn_id, valueof(ts_TRXC_FAKE_TIMING(2*256)));
280 }
Harald Welte70767382018-02-21 12:16:40 +0100281}
282
Harald Welte68e495b2018-02-25 00:05:57 +0100283/* Attach L1CTL to master test_CT (classic tests, non-handler mode) */
284function f_init_l1ctl() runs on test_CT {
285 map(self:L1CTL, system:L1CTL);
286 f_connect_reset(L1CTL);
287}
288
Harald Welte70767382018-02-21 12:16:40 +0100289type function void_fn(charstring id) runs on ConnHdlr;
290
291/* create a new test component */
292function f_start_handler(void_fn fn, ConnHdlrPars pars)
293runs on test_CT return ConnHdlr {
294 var charstring id := testcasename();
295 var ConnHdlr vc_conn;
296
297 vc_conn := ConnHdlr.create(id);
298 /* connect to RSL Emulation main component */
299 connect(vc_conn:RSL, vc_RSL:CLIENT_PT);
300 connect(vc_conn:RSL_PROC, vc_RSL:RSL_PROC);
301
302 vc_conn.start(f_handler_init(fn, id, pars));
303 return vc_conn;
304}
305
Harald Welte7484fc42018-02-24 14:09:45 +0100306template ASP_RSL_Unitdata ts_RSL_UD(template RSL_Message rsl, IpaStreamId sid := IPAC_PROTO_RSL_TRX0) := {
307 streamId := sid,
308 rsl := rsl
309}
310
311template ASP_RSL_Unitdata tr_RSL_UD(template RSL_Message rsl,
312 template IpaStreamId sid := IPAC_PROTO_RSL_TRX0) := {
313 streamId := sid,
314 rsl := rsl
315}
316
Harald Welte70767382018-02-21 12:16:40 +0100317private altstep as_Tguard() runs on ConnHdlr {
318 [] g_Tguard.timeout {
319 setverdict(fail, "Tguard timeout");
320 self.stop;
321 }
322}
323
Harald Welte68e495b2018-02-25 00:05:57 +0100324private function f_l1_tune(L1CTL_PT L1CTL) {
Harald Welte70767382018-02-21 12:16:40 +0100325 f_L1CTL_FBSB(L1CTL, { false, mp_trx0_arfcn }, CCCH_MODE_COMBINED);
326}
327
328private function f_trxc_connect() runs on ConnHdlr {
329 map(self:BB_TRXC, system:BB_TRXC);
330 var Result res;
Harald Weltea4d8f352018-03-01 15:47:20 +0100331 res := TRXC_CodecPort_CtrlFunct.f_IPL4_connect(BB_TRXC, mp_bb_trxc_ip, mp_bb_trxc_port,
332 "", -1, -1, {udp:={}}, {});
Harald Welte70767382018-02-21 12:16:40 +0100333 g_bb_trxc_conn_id := res.connId;
334}
335
336private function f_trxc_fake_rssi(uint8_t rssi) runs on ConnHdlr {
Harald Weltef8df4cb2018-03-10 15:15:08 +0100337 var TrxcMessage ret;
338 ret := f_TRXC_transceive(BB_TRXC, g_bb_trxc_conn_id, valueof(ts_TRXC_FAKE_RSSI(rssi)));
Harald Welte70767382018-02-21 12:16:40 +0100339}
340
341private function f_trx_fake_toffs256(int16_t toffs256) runs on ConnHdlr {
Harald Weltef8df4cb2018-03-10 15:15:08 +0100342 var TrxcMessage ret;
343 ret := f_TRXC_transceive(BB_TRXC, g_bb_trxc_conn_id, valueof(ts_TRXC_FAKE_TIMING(toffs256)));
Harald Welte70767382018-02-21 12:16:40 +0100344}
345
346/* first function started in ConnHdlr component */
347private function f_handler_init(void_fn fn, charstring id, ConnHdlrPars pars)
348runs on ConnHdlr {
349 g_pars := pars;
350 g_chan_nr := pars.chan_nr;
351
352 map(self:L1CTL, system:L1CTL);
353 f_connect_reset(L1CTL);
354
Harald Welte84271622018-03-10 17:21:03 +0100355 if (mp_bb_trxc_port != -1) {
356 f_trxc_connect();
357 }
Harald Welte70767382018-02-21 12:16:40 +0100358
359 g_Tguard.start(pars.t_guard);
360 activate(as_Tguard());
361
362 f_rslem_register(0, pars.chan_nr);
363
364 /* call the user-supplied test case function */
365 fn.apply(id);
366}
367
Harald Welte1eba3742018-02-25 12:48:14 +0100368function f_rsl_transceive(template RSL_Message tx, template RSL_Message exp_rx, charstring id)
369runs on ConnHdlr {
370 timer T := 3.0;
371 RSL.send(tx);
372 T.start;
Harald Welte70767382018-02-21 12:16:40 +0100373 alt {
Harald Welte1eba3742018-02-25 12:48:14 +0100374 [] RSL.receive(exp_rx) {
375 T.stop;
376 setverdict(pass);
Harald Welte70767382018-02-21 12:16:40 +0100377 }
Harald Welte1eba3742018-02-25 12:48:14 +0100378 [] T.timeout {
379 setverdict(fail, "Timeout expecting " & id);
380 self.stop;
381 }
Harald Welte3c0a0f82018-03-10 23:01:33 +0100382 [] as_l1_sacch();
383 [] as_meas_res();
384 [] as_l1_dcch();
Harald Welte1eba3742018-02-25 12:48:14 +0100385 [] RSL.receive {
386 setverdict(fail, "Unexpected RSL message received");
Harald Welte70767382018-02-21 12:16:40 +0100387 }
388 }
389}
390
Harald Welte1eba3742018-02-25 12:48:14 +0100391function f_rsl_chan_act(RSL_IE_ChannelMode mode) runs on ConnHdlr {
392 f_rsl_transceive(ts_RSL_CHAN_ACT(g_chan_nr, mode), tr_RSL_CHAN_ACT_ACK(g_chan_nr),
393 "RSL CHAN ACT");
394}
395
Harald Welte70767382018-02-21 12:16:40 +0100396function f_rsl_chan_deact() runs on ConnHdlr {
Harald Welte1eba3742018-02-25 12:48:14 +0100397 f_rsl_transceive(ts_RSL_RF_CHAN_REL(g_chan_nr), tr_RSL_RF_CHAN_REL_ACK(g_chan_nr),
398 "RF CHAN REL");
Harald Welte70767382018-02-21 12:16:40 +0100399}
400
Harald Welte70767382018-02-21 12:16:40 +0100401private template ConnHdlrPars t_Pars(template RslChannelNr chan_nr,
402 template RSL_IE_ChannelMode chan_mode,
403 float t_guard := 20.0) := {
404 chan_nr := valueof(chan_nr),
405 chan_mode := valueof(chan_mode),
406 t_guard := t_guard,
407 l1_pars := {
408 dtx_enabled := false,
Harald Welte685d5982018-02-27 20:42:05 +0100409 toa256_enabled := false,
Harald Welte70767382018-02-21 12:16:40 +0100410 meas_ul := {
411 full := {
412 rxlev := dbm2rxlev(-53),
413 rxqual := 0
414 },
415 sub := {
416 rxlev := dbm2rxlev(-53),
417 rxqual := 0
418 }
419 },
420 timing_offset_256syms := 0,
421 bs_power_level := 0,
422 ms_power_level := 0,
423 ms_actual_ta := 0
424 }
425}
426
Harald Welte93640c62018-02-25 16:59:33 +0100427/***********************************************************************
428 * Channel Activation / Deactivation
429 ***********************************************************************/
430
Harald Welte70767382018-02-21 12:16:40 +0100431/* Stress test: Do 500 channel activations/deactivations in rapid succession */
432function f_TC_chan_act_stress(charstring id) runs on ConnHdlr {
433 for (var integer i := 0; i < 500; i := i+1) {
434 f_rsl_chan_act(g_pars.chan_mode);
435 f_rsl_chan_deact();
436 }
437 setverdict(pass);
438}
439testcase TC_chan_act_stress() runs on test_CT {
440 var ConnHdlr vc_conn;
441 var ConnHdlrPars pars := valueof(t_Pars(t_RslChanNr_Bm(1), ts_RSL_ChanMode_SIGN));
442 f_init(testcasename());
443 vc_conn := f_start_handler(refers(f_TC_chan_act_stress), pars);
444 vc_conn.done;
445}
446
447/* Test if re-activation of an already active channel fails as expected */
448function f_TC_chan_act_react(charstring id) runs on ConnHdlr {
449 f_rsl_chan_act(g_pars.chan_mode);
450 /* attempt to activate the same lchan again -> expect reject */
451 RSL.send(ts_RSL_CHAN_ACT(g_chan_nr, g_pars.chan_mode));
452 alt {
453 [] RSL.receive(tr_RSL_CHAN_ACT_ACK(g_chan_nr)) {
454 setverdict(fail, "Unexpected CHAN ACT ACK on double activation");
455 }
456 [] RSL.receive(tr_RSL_CHAN_ACT_NACK(g_chan_nr)) {
457 setverdict(pass);
458 }
459 }
460 f_rsl_chan_deact();
461}
462testcase TC_chan_act_react() runs on test_CT {
463 var ConnHdlr vc_conn;
464 var ConnHdlrPars pars := valueof(t_Pars(t_RslChanNr_Bm(1), ts_RSL_ChanMode_SIGN));
465 f_init(testcasename());
466 vc_conn := f_start_handler(refers(f_TC_chan_act_react), pars);
467 vc_conn.done;
468}
469
470/* Attempt to de-activate a channel that's not active */
471function f_TC_chan_deact_not_active(charstring id) runs on ConnHdlr {
472 timer T := 3.0;
473 RSL.send(ts_RSL_RF_CHAN_REL(g_chan_nr));
474 T.start;
475 alt {
476 [] RSL.receive(tr_RSL_RF_CHAN_REL_ACK(g_chan_nr)) {
477 setverdict(pass);
478 }
479 [] T.timeout {
480 setverdict(fail, "Timeout expecting RF_CHAN_REL_ACK");
481 }
482 }
483}
484testcase TC_chan_deact_not_active() runs on test_CT {
485 var ConnHdlrPars pars := valueof(t_Pars(t_RslChanNr_Bm(1), ts_RSL_ChanMode_SIGN));
486 f_init(testcasename());
487 var ConnHdlr vc_conn := f_start_handler(refers(f_TC_chan_deact_not_active), pars);
488 vc_conn.done;
489}
490
491/* attempt to activate channel with wrong RSL Channel Nr IE; expect NACK */
492function f_TC_chan_act_wrong_nr(charstring id) runs on ConnHdlr {
493 RSL.send(ts_RSL_CHAN_ACT(g_chan_nr, g_pars.chan_mode));
494 alt {
495 [] RSL.receive(tr_RSL_CHAN_ACT_ACK(g_chan_nr)) {
496 setverdict(fail, "Unexpected CHAN ACT ACK");
497 }
498 [] RSL.receive(tr_RSL_CHAN_ACT_NACK(g_chan_nr)) {
499 setverdict(pass);
500 }
501 }
502}
503private type record WrongChanNrCase {
504 RslChannelNr chan_nr,
505 charstring description
506}
507private type record of WrongChanNrCase WrongChanNrCases;
508private template WrongChanNrCase t_WCN(template RslChannelNr chan_nr, charstring desc) := {
509 chan_nr := chan_nr,
510 description := desc
511}
512
513testcase TC_chan_act_wrong_nr() runs on test_CT {
514 var ConnHdlr vc_conn;
515 var ConnHdlrPars pars;
516
517 f_init(testcasename());
518
519 var WrongChanNrCases wrong := {
520 valueof(t_WCN(t_RslChanNr_RACH(0), "RACH is not a dedicated channel")),
521 valueof(t_WCN(t_RslChanNr_RACH(1), "RACH doesn't exist on timeslot")),
522 valueof(t_WCN(t_RslChanNr_BCCH(0), "BCCH is not a dedicated channel")),
523 valueof(t_WCN(t_RslChanNr_PCH_AGCH(0), "PCH/AGCH is not a dedicated channel")),
524 valueof(t_WCN(t_RslChanNr_Bm(0), "TS0 cannot be TCH/F")),
525 valueof(t_WCN(t_RslChanNr_Lm(0, 0), "TS0 cannot be TCH/H")),
526 valueof(t_WCN(t_RslChanNr_Lm(0, 1), "TS0 cannot be TCH/H")),
527 valueof(t_WCN(t_RslChanNr_PDCH(0), "TS0 cannot be PDCH")),
528 valueof(t_WCN(t_RslChanNr_SDCCH8(0, 0), "TS0 cannot be SDCCH/8")),
529 valueof(t_WCN(t_RslChanNr_SDCCH8(0, 7), "TS0 cannot be SDCCH/8")),
530 valueof(t_WCN(t_RslChanNr_SDCCH4(7, 0), "TS7 cannot be SDCCH/4")),
531 valueof(t_WCN(t_RslChanNr_SDCCH4(7, 3), "TS7 cannot be SDCCH/4")),
532 valueof(t_WCN(t_RslChanNr_Lm(1, 0), "TS1 cannot be TCH/H"))
533 };
534
535 for (var integer i := 0; i < sizeof(wrong); i := i+1) {
536 pars := valueof(t_Pars(wrong[i].chan_nr, ts_RSL_ChanMode_SIGN));
537 vc_conn := f_start_handler(refers(f_TC_chan_act_wrong_nr), pars);
538 vc_conn.done;
539 }
540}
541
Harald Welte93640c62018-02-25 16:59:33 +0100542/***********************************************************************
543 * RACH Handling
544 ***********************************************************************/
545
Harald Welte8c24c2b2018-02-26 08:31:31 +0100546/* like L1SAP_IS_PACKET_RACH */
547private function ra_is_ps(OCT1 ra) return boolean {
Harald Welte56c05802018-02-28 21:39:35 +0100548 if ((ra and4b 'F0'O == '70'O) and (ra and4b '0F'O != '0F'O)) {
Harald Welte8c24c2b2018-02-26 08:31:31 +0100549 return true;
550 }
551 return false;
552}
553
554/* generate a random RACH for circuit-switched */
555private function f_rnd_ra_cs() return OCT1 {
556 var OCT1 ra;
557 do {
558 ra := f_rnd_octstring(1);
559 } while (ra_is_ps(ra));
560 return ra;
561}
562
Harald Welte883340c2018-02-28 18:59:29 +0100563/* generate a random RACH for packet-switched */
564private function f_rnd_ra_ps() return OCT1 {
565 var OCT1 ra;
566 do {
567 ra := f_rnd_octstring(1);
568 } while (not ra_is_ps(ra));
569 return ra;
570}
571
Harald Welte8c24c2b2018-02-26 08:31:31 +0100572/* Send 1000 RACH requests and check their RA+FN on the RSL side */
573testcase TC_rach_content() runs on test_CT {
574 f_init(testcasename());
575 f_init_l1ctl();
Harald Welte68e495b2018-02-25 00:05:57 +0100576 f_l1_tune(L1CTL);
Harald Welte70767382018-02-21 12:16:40 +0100577
Harald Welte8c24c2b2018-02-26 08:31:31 +0100578 var GsmFrameNumber fn_last := 0;
579 for (var integer i := 0; i < 1000; i := i+1) {
580 var OCT1 ra := f_rnd_ra_cs();
581 var GsmFrameNumber fn := f_L1CTL_RACH(L1CTL, oct2int(ra));
582 if (fn == fn_last) {
583 setverdict(fail, "Two RACH in same FN?!?");
584 self.stop;
585 }
586 fn_last := fn;
587
588 timer T := 5.0;
Harald Welte56c05802018-02-28 21:39:35 +0100589 T.start;
Harald Welte8c24c2b2018-02-26 08:31:31 +0100590 alt {
591 [] RSL_CCHAN.receive(tr_RSL_UD(tr_RSL_CHAN_RQD(ra, fn, ?))) {
592 T.stop;
593 }
594 [] RSL_CCHAN.receive(tr_RSL_UD(tr_RSL_CHAN_RQD(?, ?, ?))) {
595 setverdict(fail, "Unexpected CHAN RQD");
596 self.stop;
597 }
598 [] RSL_CCHAN.receive { repeat; }
599 [] T.timeout {
600 setverdict(fail, "Timeout waiting for CHAN RQD");
601 self.stop;
602 }
603 }
604 }
605 setverdict(pass);
Harald Welte70767382018-02-21 12:16:40 +0100606}
Harald Welte8c24c2b2018-02-26 08:31:31 +0100607
608/* Send 1000 RACH Requests (flood ~ 89/s) and count if count(Abis) == count(Um) */
609testcase TC_rach_count() runs on test_CT {
Harald Welte70767382018-02-21 12:16:40 +0100610 f_init(testcasename());
Harald Welte8c24c2b2018-02-26 08:31:31 +0100611 f_init_l1ctl();
612 f_l1_tune(L1CTL);
613
614 var GsmFrameNumber fn_last := 0;
615 for (var integer i := 0; i < 1000; i := i+1) {
616 var OCT1 ra := f_rnd_ra_cs();
617 var GsmFrameNumber fn := f_L1CTL_RACH(L1CTL, oct2int(ra));
618 if (fn == fn_last) {
619 setverdict(fail, "Two RACH in same FN?!?");
620 self.stop;
621 }
622 fn_last := fn;
623 }
624 var integer rsl_chrqd := 0;
625 timer T := 3.0;
Harald Welte56c05802018-02-28 21:39:35 +0100626 T.start;
Harald Welte8c24c2b2018-02-26 08:31:31 +0100627 alt {
628 [] RSL_CCHAN.receive(tr_RSL_UD(tr_RSL_CHAN_RQD(?,?))) {
629 rsl_chrqd := rsl_chrqd + 1;
Harald Weltec3a3f452018-02-26 17:37:47 +0100630 f_timer_safe_restart(T);
Harald Welte8c24c2b2018-02-26 08:31:31 +0100631 repeat;
632 }
633 [] RSL_CCHAN.receive { repeat; }
634 [] T.timeout { }
635 }
636 if (rsl_chrqd == 1000) {
637 setverdict(pass);
638 } else {
639 setverdict(fail, "Received only ", rsl_chrqd, " out of 1000 RACH");
640 }
Harald Welte70767382018-02-21 12:16:40 +0100641}
642
Harald Welte54a2a2d2018-02-26 09:14:05 +0100643private function f_main_trxc_connect() runs on test_CT {
644 map(self:BB_TRXC, system:BB_TRXC);
645 var Result res;
Harald Welted3a88a62018-03-01 16:04:52 +0100646 res := TRXC_CodecPort_CtrlFunct.f_IPL4_connect(BB_TRXC, mp_bb_trxc_ip, mp_bb_trxc_port,
647 "", -1, -1, {udp:={}}, {});
Harald Welte54a2a2d2018-02-26 09:14:05 +0100648 g_bb_trxc_conn_id := res.connId;
649}
650
651private function f_rach_toffs(int16_t toffs256, boolean expect_pass) runs on test_CT {
Harald Weltef8df4cb2018-03-10 15:15:08 +0100652 var TrxcMessage ret;
Harald Welte54a2a2d2018-02-26 09:14:05 +0100653 /* tell fake_trx to use a given timing offset for all bursts */
Harald Weltef8df4cb2018-03-10 15:15:08 +0100654 ret := f_TRXC_transceive(BB_TRXC, g_bb_trxc_conn_id, valueof(ts_TRXC_FAKE_TIMING(toffs256)));
Harald Welte54a2a2d2018-02-26 09:14:05 +0100655 f_sleep(0.5);
656
657 /* Transmit RACH request + wait for confirmation */
658 var OCT1 ra := f_rnd_ra_cs();
659 var GsmFrameNumber fn := f_L1CTL_RACH(L1CTL, oct2int(ra));
660
661 /* Check for expected result */
662 timer T := 1.5;
663 T.start;
664 alt {
665 [expect_pass] RSL_CCHAN.receive(tr_RSL_UD(tr_RSL_CHAN_RQD(ra, fn))) {
666 setverdict(pass);
667 }
668 [not expect_pass] RSL_CCHAN.receive(tr_RSL_UD(tr_RSL_CHAN_RQD(ra, fn))) {
Harald Welteb3e30942018-03-02 10:33:42 +0100669 setverdict(fail, "RACH passed but was expected to be dropped: ", toffs256);
Harald Welte54a2a2d2018-02-26 09:14:05 +0100670 }
671 [] RSL_CCHAN.receive { repeat; }
672 [not expect_pass] T.timeout {
673 setverdict(pass);
674 }
675 [expect_pass] T.timeout {
676 setverdict(fail, "Timeout waiting for CHAN RQD");
677 }
678 }
679}
680
681/* Test if dropping of RACH Based on NM_ATT_MAX_TA works */
682testcase TC_rach_max_ta() runs on test_CT {
683 f_init(testcasename());
684 f_init_l1ctl();
685 f_l1_tune(L1CTL);
Harald Welte54a2a2d2018-02-26 09:14:05 +0100686 f_sleep(1.0);
687
688 /* default max-ta is 63 (full range of GSM timing advance */
689
Vadim Yanitskiyc81d6e42018-03-05 22:39:01 +0700690 /* We allow early arrival up to 2 symbols */
691 f_rach_toffs(-1*256, true);
692 f_rach_toffs(-2*256, true);
Harald Welte54a2a2d2018-02-26 09:14:05 +0100693 f_rach_toffs(-10*256, false);
694
695 /* 0 / 32 / 63 bits is legal / permitted */
696 f_rach_toffs(0, true);
697 f_rach_toffs(32*256, true);
698 f_rach_toffs(63*256, true);
699
700 /* more than 63 bits is not legal / permitted */
701 f_rach_toffs(64*256, false);
702 f_rach_toffs(127*256, false);
703}
Harald Welte8c24c2b2018-02-26 08:31:31 +0100704
Harald Welte93640c62018-02-25 16:59:33 +0100705/***********************************************************************
706 * Measurement Processing / Reporting
707 ***********************************************************************/
708
Harald Welte70767382018-02-21 12:16:40 +0100709template LapdmAddressField ts_LapdmAddr(LapdmSapi sapi, boolean c_r) := {
710 spare := '0'B,
711 lpd := 0,
712 sapi := sapi,
713 c_r := c_r,
714 ea := true
715}
716
717template LapdmFrameB ts_LAPDm_B(LapdmSapi sapi, boolean c_r, boolean p, octetstring pl) := {
718 addr := ts_LapdmAddr(sapi, c_r),
719 ctrl := t_LapdmCtrlUI(p),
720 len := 0, /* overwritten */
721 m := false,
722 el := 1,
723 payload := pl
724}
725
726/* handle incoming downlink SACCH and respond with uplink SACCH (meas res) */
727altstep as_l1_sacch() runs on ConnHdlr {
728 var L1ctlDlMessage l1_dl;
Harald Weltef8df4cb2018-03-10 15:15:08 +0100729 [] L1CTL.receive(tr_L1CTL_DATA_IND(g_chan_nr, tr_RslLinkID_SACCH(?))) -> value l1_dl {
Harald Welte70767382018-02-21 12:16:40 +0100730 log("SACCH received: ", l1_dl.payload.data_ind.payload);
731 var GsmRrL3Message meas_rep := valueof(ts_MEAS_REP(true, 23, 23, 0, 0, omit));
732 var LapdmFrameB lb := valueof(ts_LAPDm_B(0, false, false, enc_GsmRrL3Message(meas_rep)));
733 log("LAPDm: ", lb);
734 var octetstring pl := '0000'O & enc_LapdmFrameB(lb);
Harald Weltef8df4cb2018-03-10 15:15:08 +0100735 L1CTL.send(ts_L1CTL_DATA_REQ(g_chan_nr, ts_RslLinkID_SACCH(0), pl));
Harald Welte70767382018-02-21 12:16:40 +0100736 repeat;
737 }
738}
739
740altstep as_l1_dcch() runs on ConnHdlr {
741 var L1ctlDlMessage l1_dl;
Harald Weltef8df4cb2018-03-10 15:15:08 +0100742 [] L1CTL.receive(tr_L1CTL_DATA_IND(g_chan_nr, tr_RslLinkID_DCCH(?))) -> value l1_dl {
Harald Welte70767382018-02-21 12:16:40 +0100743 log("DCCH received: ", l1_dl.payload.data_ind.payload);
744 var octetstring pl := '010301'O;
Harald Weltef8df4cb2018-03-10 15:15:08 +0100745 L1CTL.send(ts_L1CTL_DATA_REQ(g_chan_nr, ts_RslLinkID_DCCH(0), pl));
Harald Welte70767382018-02-21 12:16:40 +0100746 repeat;
747 }
748}
749
750type record MeasElem {
751 uint6_t rxlev,
752 uint3_t rxqual
753}
754
755type record MeasElemFS {
756 MeasElem full,
757 MeasElem sub
758}
759
760type record ConnL1Pars {
761 boolean dtx_enabled,
Harald Welte685d5982018-02-27 20:42:05 +0100762 boolean toa256_enabled,
Harald Welte70767382018-02-21 12:16:40 +0100763 MeasElemFS meas_ul,
764 int16_t timing_offset_256syms,
765 uint5_t bs_power_level,
766 uint5_t ms_power_level,
767 uint8_t ms_actual_ta
768}
769
770/* Convert tiing offset from 1/256th symbol to RSL Timing Offset */
771private function toffs256s_to_rsl(int16_t toffs256s) return uint8_t {
772 return 63 + (toffs256s/256);
773}
774
Harald Welted5684392018-03-10 18:22:04 +0100775private function f_max(integer a, integer b) return integer {
776 if (a > b) {
777 return a;
778 } else {
779 return b;
780 }
781}
782
783private function f_min(integer a, integer b) return integer {
784 if (a < b) {
785 return a;
786 } else {
787 return b;
788 }
789}
790
791/* compute negative tolerance val-tolerance, ensure >= min */
792private function f_tolerance_neg(integer val, integer min, integer tolerance) return integer {
793 val := val - tolerance;
794 return f_max(val, min);
795}
796
797/* compute positive tolerance val+tolerance, ensure <= max */
798private function f_tolerance_pos(integer val, integer max, integer tolerance) return integer {
799 val := val + tolerance;
800 return f_min(val, max);
801}
802
803/* return a template of (val-tolerance .. val+tolerance) ensuring it is within (min .. max) */
804private function f_tolerance(integer val, integer min, integer max, integer tolerance)
805return template integer {
806 var template integer ret;
807 ret := (f_tolerance_neg(val, min, tolerance) .. f_tolerance_pos(val, max, tolerance));
808 return ret;
809}
810
811
Harald Welte70767382018-02-21 12:16:40 +0100812/* build a template for matching measurement results against */
813private function f_build_meas_res_tmpl() runs on ConnHdlr return template RSL_Message {
814 var ConnL1Pars l1p := g_pars.l1_pars;
815 var template RSL_IE_UplinkMeas ul_meas := {
816 len := 3,
817 rfu := '0'B,
818 dtx_d := l1p.dtx_enabled,
Harald Welted5684392018-03-10 18:22:04 +0100819 rxlev_f_u := f_tolerance(l1p.meas_ul.full.rxlev, 0, 63, mp_tolerance_rxlev),
Harald Welte70767382018-02-21 12:16:40 +0100820 reserved1 := '00'B,
Harald Welted5684392018-03-10 18:22:04 +0100821 rxlev_s_u := f_tolerance(l1p.meas_ul.sub.rxlev, 0, 63, mp_tolerance_rxlev),
Harald Welte70767382018-02-21 12:16:40 +0100822 reserved2 := '00'B,
Harald Welted5684392018-03-10 18:22:04 +0100823 rxq_f_u := f_tolerance(l1p.meas_ul.full.rxqual, 0, 7, mp_tolerance_rxqual),
824 rxq_s_u := f_tolerance(l1p.meas_ul.sub.rxqual, 0, 7, mp_tolerance_rxqual),
Harald Welte70767382018-02-21 12:16:40 +0100825 supp_meas_info := omit
826 };
Harald Welte685d5982018-02-27 20:42:05 +0100827 if (l1p.toa256_enabled) {
828 ul_meas.len := 5;
829 ul_meas.supp_meas_info := int2oct(l1p.timing_offset_256syms, 2);
830 }
Harald Welte70767382018-02-21 12:16:40 +0100831 /* HACK HACK HACK FIXME HACK HACK HACK see https://osmocom.org/issues/2988 */
832 ul_meas.rxlev_f_u := ?;
833 ul_meas.rxlev_s_u := ?;
834 ul_meas.rxq_f_u := ?;
835 ul_meas.rxq_s_u := ?;
836 var template RSL_IE_BS_Power bs_power := {
837 reserved := 0,
838 epc := false,
839 fpc := false,
840 power_level := l1p.bs_power_level
841 };
842 var template RSL_IE_L1Info l1_info := {
843 ms_power_lvl := l1p.ms_power_level,
844 fpc := false,
845 reserved := 0,
846 actual_ta := l1p.ms_actual_ta
847 };
848 var uint8_t offs := toffs256s_to_rsl(l1p.timing_offset_256syms);
849 var template uint8_t t_toffs := (offs-1 .. offs+1); /* some tolerance */
850 return tr_RSL_MEAS_RES_OSMO(g_chan_nr, g_next_meas_res_nr, ul_meas, bs_power, l1_info,
851 ?, t_toffs);
852}
853
854/* verify we regularly receive measurement reports with incrementing numbers */
855altstep as_meas_res() runs on ConnHdlr {
856 var RSL_Message rsl;
857 [] RSL.receive(f_build_meas_res_tmpl()) -> value rsl {
858 /* increment counter of next to-be-expected meas rep */
859 g_next_meas_res_nr := (g_next_meas_res_nr + 1) mod 256;
860 /* Re-start the timer expecting the next MEAS RES */
Harald Weltec3a3f452018-02-26 17:37:47 +0100861 f_timer_safe_restart(g_Tmeas_exp);
Harald Welte70767382018-02-21 12:16:40 +0100862 repeat;
863 }
864 [] RSL.receive(tr_RSL_MEAS_RES(g_chan_nr, g_next_meas_res_nr)) -> value rsl {
Harald Weltefa45e9e2018-03-10 18:59:03 +0100865 /* increment counter of next to-be-expected meas rep */
866 g_next_meas_res_nr := (g_next_meas_res_nr + 1) mod 256;
867 if (g_first_meas_res) {
868 g_first_meas_res := false;
869 repeat;
870 } else {
871 setverdict(fail, "Received unspecific MEAS RES ", rsl);
872 self.stop;
873 }
Harald Welte70767382018-02-21 12:16:40 +0100874 }
875 [] RSL.receive(tr_RSL_MEAS_RES(?)) -> value rsl {
876 setverdict(fail, "Received unexpected MEAS RES ", rsl);
877 self.stop;
878 }
879 [] g_Tmeas_exp.timeout {
880 setverdict(fail, "Didn't receive expected measurement result")
881 self.stop;
882 }
883}
884
885/* Establish dedicated channel: L1CTL + RSL side */
886private function f_est_dchan() runs on ConnHdlr {
887 var GsmFrameNumber fn;
888 var ImmediateAssignment imm_ass;
889 var integer ra := 23;
890
891 fn := f_L1CTL_RACH(L1CTL, ra);
892 /* This arrives on CCHAN, so we cannot test for receiving CHAN RQDhere */
893 //RSL.receive(tr_RSL_CHAN_RQD(int2oct(23,1)));
894
895 /* Activate channel on BTS side */
896 f_rsl_chan_act(g_pars.chan_mode);
897
898 /* Send IMM.ASS via CCHAN */
899 var ChannelDescription ch_desc := {
900 chan_nr := g_pars.chan_nr,
901 tsc := 7,
902 h := false,
903 arfcn := mp_trx0_arfcn,
904 maio_hsn := omit
905 };
906 var MobileAllocation ma := {
907 len := 0,
908 ma := ''B
909 };
910 var GsmRrMessage rr_msg := valueof(ts_IMM_ASS(ra, fn, 0, ch_desc, ma));
911 RSL.send(ts_RSL_IMM_ASSIGN(enc_GsmRrMessage(rr_msg)));
912
913 /* receive IMM.ASS on MS side */
914 var ImmediateAssignment ia_um;
915 ia_um := f_L1CTL_WAIT_IMM_ASS(L1CTL, ra, fn);
916 /* enable dedicated mode */
917 f_L1CTL_DM_EST_REQ_IA(L1CTL, ia_um);
Harald Weltefa45e9e2018-03-10 18:59:03 +0100918
919 g_first_meas_res := true;
Harald Welte70767382018-02-21 12:16:40 +0100920}
921
922/* establish DChan, verify existance + contents of measurement reports */
923function f_TC_meas_res_periodic(charstring id) runs on ConnHdlr {
Harald Welte68e495b2018-02-25 00:05:57 +0100924 f_l1_tune(L1CTL);
Harald Welte70767382018-02-21 12:16:40 +0100925 RSL.clear;
926
Harald Welte5398d5e2018-03-10 19:00:24 +0100927 if (mp_bb_trxc_port != -1) {
928 g_pars.l1_pars.meas_ul.full.rxlev := dbm2rxlev(-100);
929 f_trxc_fake_rssi(100);
Harald Welte70767382018-02-21 12:16:40 +0100930
Harald Welte5398d5e2018-03-10 19:00:24 +0100931 g_pars.l1_pars.timing_offset_256syms := 512; /* 2 symbols */
932 f_trx_fake_toffs256(g_pars.l1_pars.timing_offset_256syms);
933 } else {
934 g_pars.l1_pars.timing_offset_256syms := 0; /* FIXME */
935 g_pars.l1_pars.meas_ul.full.rxlev := dbm2rxlev(-55); /* FIXME */
936 }
937 g_pars.l1_pars.meas_ul.sub.rxlev := g_pars.l1_pars.meas_ul.full.rxlev;
Harald Welte70767382018-02-21 12:16:40 +0100938
939 f_est_dchan();
940
941 /* run for a number of seconds, send SACCH + FACCH from MS side and verify
942 * RSL measurement reports on Abis side */
943 timer T := 8.0;
944 T.start;
945 alt {
946 [] as_l1_sacch();
947 [] as_meas_res();
948 [] as_l1_dcch();
949 [] L1CTL.receive { repeat; }
950 [g_Tmeas_exp.running] T.timeout {
951 /* as_meas_res() would have done setverdict(fail) / self.stop in case
952 * of any earlier errors, so if we reach this timeout, we're good */
953 setverdict(pass);
954 }
955 [] T.timeout {
956 setverdict(fail, "No MEAS RES received at all");
957 }
958 }
959 f_rsl_chan_deact();
Harald Welte3dc20462018-03-10 23:03:38 +0100960 f_L1CTL_DM_REL_REQ(L1CTL, g_chan_nr);
Harald Welte70767382018-02-21 12:16:40 +0100961}
962testcase TC_meas_res_sign_tchf() runs on test_CT {
963 var ConnHdlr vc_conn;
964 var ConnHdlrPars pars;
965 f_init(testcasename());
966 for (var integer tn := 1; tn <= 4; tn := tn+1) {
967 pars := valueof(t_Pars(t_RslChanNr_Bm(tn), ts_RSL_ChanMode_SIGN));
968 vc_conn := f_start_handler(refers(f_TC_meas_res_periodic), pars);
969 vc_conn.done;
970 }
971}
972testcase TC_meas_res_sign_tchh() runs on test_CT {
973 var ConnHdlr vc_conn;
974 var ConnHdlrPars pars;
975 f_init(testcasename());
976 for (var integer ss := 0; ss <= 1; ss := ss+1) {
977 pars := valueof(t_Pars(t_RslChanNr_Lm(5, ss), ts_RSL_ChanMode_SIGN));
978 vc_conn := f_start_handler(refers(f_TC_meas_res_periodic), pars);
979 vc_conn.done;
980 }
981}
982testcase TC_meas_res_sign_sdcch4() runs on test_CT {
983 var ConnHdlr vc_conn;
984 var ConnHdlrPars pars;
985 f_init(testcasename());
986 for (var integer ss := 0; ss <= 3; ss := ss+1) {
987 pars := valueof(t_Pars(t_RslChanNr_SDCCH4(0, ss), ts_RSL_ChanMode_SIGN));
988 vc_conn := f_start_handler(refers(f_TC_meas_res_periodic), pars);
989 vc_conn.done;
990 }
991}
992testcase TC_meas_res_sign_sdcch8() runs on test_CT {
993 var ConnHdlr vc_conn;
994 var ConnHdlrPars pars;
995 f_init(testcasename());
996 for (var integer ss := 0; ss <= 7; ss := ss+1) {
997 pars := valueof(t_Pars(t_RslChanNr_SDCCH8(6, ss), ts_RSL_ChanMode_SIGN));
998 vc_conn := f_start_handler(refers(f_TC_meas_res_periodic), pars);
999 vc_conn.done;
1000 }
1001}
Harald Welte685d5982018-02-27 20:42:05 +01001002testcase TC_meas_res_sign_tchh_toa256() runs on test_CT {
1003 var ConnHdlr vc_conn;
1004 var ConnHdlrPars pars;
1005 f_init(testcasename());
1006 f_vty_config(BTSVTY, "bts 0", "supp-meas-info toa256");
1007 for (var integer ss := 0; ss <= 1; ss := ss+1) {
1008 pars := valueof(t_Pars(t_RslChanNr_Lm(5, ss), ts_RSL_ChanMode_SIGN));
1009 pars.l1_pars.toa256_enabled := true;
1010 vc_conn := f_start_handler(refers(f_TC_meas_res_periodic), pars);
1011 vc_conn.done;
1012 }
1013}
1014
Harald Welte70767382018-02-21 12:16:40 +01001015
1016/* Test if a channel without valid uplink bursts generates RSL CONN FAIL IND */
1017private function f_TC_conn_fail_crit(charstring id) runs on ConnHdlr {
Harald Welte68e495b2018-02-25 00:05:57 +01001018 f_l1_tune(L1CTL);
Harald Welte70767382018-02-21 12:16:40 +01001019 RSL.clear;
1020
1021 f_est_dchan();
1022 f_sleep(2.0);
Harald Weltef8df4cb2018-03-10 15:15:08 +01001023 L1CTL.send(ts_L1CTL_DM_REL_REQ(g_chan_nr));
Harald Welte70767382018-02-21 12:16:40 +01001024
1025 timer T := 40.0;
1026 T.start;
1027 alt {
1028 [] RSL.receive(tr_RSL_CONN_FAIL_IND(g_chan_nr, ?)) {
1029 setverdict(pass)
1030 }
1031 [] RSL.receive { repeat };
1032 [] T.timeout {
1033 setverdict(fail, "No CONN FAIL IND received");
1034 }
1035 }
1036 f_rsl_chan_deact();
1037}
1038testcase TC_conn_fail_crit() runs on test_CT {
1039 var ConnHdlr vc_conn;
1040 var ConnHdlrPars pars;
1041 f_init(testcasename());
1042 pars := valueof(t_Pars(t_RslChanNr_SDCCH8(6, 3), ts_RSL_ChanMode_SIGN));
1043 pars.t_guard := 60.0;
1044 vc_conn := f_start_handler(refers(f_TC_conn_fail_crit), pars);
1045 vc_conn.done;
1046}
1047
Harald Welte93640c62018-02-25 16:59:33 +01001048/***********************************************************************
1049 * Paging
1050 ***********************************************************************/
1051
Harald Welte68e495b2018-02-25 00:05:57 +01001052function tmsi_is_dummy(TMSIP_TMSI_V tmsi) return boolean {
1053 if (tmsi == 'FFFFFFFF'O) {
1054 return true;
1055 } else {
1056 return false;
1057 }
1058}
Harald Welte70767382018-02-21 12:16:40 +01001059
Harald Welte68e495b2018-02-25 00:05:57 +01001060altstep as_l1_count_paging(inout integer num_paging_rcv_msgs, inout integer num_paging_rcv_ids)
1061runs on test_CT {
1062 var L1ctlDlMessage dl;
Harald Weltef8df4cb2018-03-10 15:15:08 +01001063 [] L1CTL.receive(tr_L1CTL_DATA_IND(t_RslChanNr_PCH_AGCH(0), ?, c_DummyUI)) {
Harald Welte68e495b2018-02-25 00:05:57 +01001064 repeat;
1065 }
Harald Weltef8df4cb2018-03-10 15:15:08 +01001066 [] L1CTL.receive(tr_L1CTL_DATA_IND(t_RslChanNr_PCH_AGCH(0))) -> value dl {
Harald Welte68e495b2018-02-25 00:05:57 +01001067 var octetstring without_plen :=
1068 substr(dl.payload.data_ind.payload, 1, lengthof(dl.payload.data_ind.payload)-1);
1069 var PDU_ML3_NW_MS rr := dec_PDU_ML3_NW_MS(without_plen);
1070 if (match(rr, tr_PAGING_REQ1)) {
1071 num_paging_rcv_msgs := num_paging_rcv_msgs + 1;
1072 num_paging_rcv_ids := num_paging_rcv_ids + 1;
1073 if (isvalue(rr.msgs.rrm.pagingReq_Type1.mobileIdentity2)) {
1074 num_paging_rcv_ids := num_paging_rcv_ids + 1;
1075 }
1076 } else if (match(rr, tr_PAGING_REQ2)) {
1077 num_paging_rcv_msgs := num_paging_rcv_msgs + 1;
1078 if (not tmsi_is_dummy(rr.msgs.rrm.pagingReq_Type2.mobileIdentity1)) {
1079 num_paging_rcv_ids := num_paging_rcv_ids + 1;
1080 }
1081 if (not tmsi_is_dummy(rr.msgs.rrm.pagingReq_Type2.mobileIdentity2)) {
1082 num_paging_rcv_ids := num_paging_rcv_ids + 1;
1083 }
1084 if (isvalue(rr.msgs.rrm.pagingReq_Type2.mobileIdentity3)) {
1085 num_paging_rcv_ids := num_paging_rcv_ids + 1;
1086 }
1087 } else if (match(rr, tr_PAGING_REQ3)) {
1088 num_paging_rcv_msgs := num_paging_rcv_msgs + 1;
1089 if (not tmsi_is_dummy(rr.msgs.rrm.pagingReq_Type3.mobileIdentity1)) {
1090 num_paging_rcv_ids := num_paging_rcv_ids + 1;
1091 }
1092 if (not tmsi_is_dummy(rr.msgs.rrm.pagingReq_Type3.mobileIdentity2)) {
1093 num_paging_rcv_ids := num_paging_rcv_ids + 1;
1094 }
1095 if (not tmsi_is_dummy(rr.msgs.rrm.pagingReq_Type3.mobileIdentity3)) {
1096 num_paging_rcv_ids := num_paging_rcv_ids + 1;
1097 }
1098 if (not tmsi_is_dummy(rr.msgs.rrm.pagingReq_Type3.mobileIdentity4)) {
1099 num_paging_rcv_ids := num_paging_rcv_ids + 1;
1100 }
1101 }
1102 repeat;
1103 }
1104}
1105
1106type record PagingTestCfg {
1107 boolean combined_ccch,
1108 integer bs_ag_blks_res,
1109 float load_factor,
1110 boolean exp_load_ind,
1111 boolean exp_overload,
1112 boolean use_tmsi
1113}
1114
1115type record PagingTestState {
1116 integer num_paging_sent,
1117 integer num_paging_rcv_msgs,
1118 integer num_paging_rcv_ids,
1119 integer num_overload
1120}
1121
1122/* receive + ignore RSL RF RES IND */
1123altstep as_rsl_res_ind() runs on test_CT {
1124 [] RSL_CCHAN.receive(tr_RSL_UD(tr_RSL_RF_RES_IND)) {
1125 repeat;
1126 }
1127}
1128
1129/* Helper function for paging related testing */
1130private function f_TC_paging(PagingTestCfg cfg) runs on test_CT return PagingTestState {
1131 f_init(testcasename());
1132 f_init_l1ctl();
1133 f_l1_tune(L1CTL);
1134
1135 var PagingTestState st := {
1136 num_paging_sent := 0,
1137 num_paging_rcv_msgs := 0,
1138 num_paging_rcv_ids := 0,
1139 num_overload := 0
1140 };
1141
1142 var float max_pch_blocks_per_sec := f_pch_block_rate_est(cfg.combined_ccch, cfg.bs_ag_blks_res);
1143 var float max_pch_imsi_per_sec;
1144 if (cfg.use_tmsi) {
1145 max_pch_imsi_per_sec := max_pch_blocks_per_sec * 4.0; /* Type 3 */
1146 } else {
1147 max_pch_imsi_per_sec := max_pch_blocks_per_sec * 2.0; /* Type 1 */
1148 }
1149 var float pch_blocks_per_sec := max_pch_imsi_per_sec * cfg.load_factor;
1150 var float interval := 1.0 / pch_blocks_per_sec;
1151 log("pch_blocks_per_sec=", pch_blocks_per_sec, " interval=", interval);
1152
1153 for (var integer i := 0; i < float2int(20.0/interval); i := i+1) {
1154 /* build mobile Identity */
1155 var MobileL3_CommonIE_Types.MobileIdentityLV mi;
1156 if (cfg.use_tmsi) {
1157 mi := valueof(ts_MI_TMSI_LV(f_rnd_octstring(4)));
1158 } else {
1159 mi := valueof(ts_MI_IMSI_LV(f_gen_imsi(i)));
1160 }
1161 var octetstring mi_enc_lv := enc_MobileIdentityLV(mi);
1162 var octetstring mi_enc := substr(mi_enc_lv, 1, lengthof(mi_enc_lv)-1);
1163
1164 /* Send RSL PAGING COMMAND */
1165 RSL_CCHAN.send(ts_RSL_UD(ts_RSL_PAGING_CMD(mi_enc, i mod 4)));
1166 st.num_paging_sent := st.num_paging_sent + 1;
1167
1168 /* Wait for interval to next PAGING COMMAND */
1169 timer T_itv := interval;
1170 T_itv.start;
1171 alt {
1172 /* check for presence of CCCH LOAD IND (paging load) */
1173 [cfg.exp_overload] RSL_CCHAN.receive(tr_RSL_UD(tr_RSL_PAGING_LOAD_IND(0))) {
1174 st.num_overload := st.num_overload + 1;
1175 repeat;
1176 }
1177 [not cfg.exp_overload] RSL_CCHAN.receive(tr_RSL_UD(tr_RSL_PAGING_LOAD_IND(0))) {
1178 setverdict(fail, "Unexpected PCH Overload");
1179 }
1180 [cfg.exp_load_ind] RSL_CCHAN.receive(tr_RSL_UD(tr_RSL_PAGING_LOAD_IND)) {
1181 log("Rx LOAD_IND");
1182 /* FIXME: analyze/verify interval + contents */
1183 repeat;
1184 }
1185 /* check if paging requests arrive on Um side */
1186 [] as_l1_count_paging(st.num_paging_rcv_msgs, st.num_paging_rcv_ids);
1187 [] L1CTL.receive { repeat; }
1188 [] T_itv.timeout { }
1189 [] as_rsl_res_ind();
1190 }
1191 }
1192
1193 /* wait for max 18s for paging queue to drain (size: 200, ~ 13 per s -> 15s) */
1194 timer T_wait := 18.0;
1195 T_wait.start;
1196 alt {
1197 [] as_l1_count_paging(st.num_paging_rcv_msgs, st.num_paging_rcv_ids);
1198 [] L1CTL.receive { repeat; }
1199 /* 65535 == empty paging queue, we can terminate*/
1200 [] RSL_CCHAN.receive(tr_RSL_UD(tr_RSL_PAGING_LOAD_IND(65535))) { }
1201 [] RSL_CCHAN.receive(tr_RSL_UD(tr_RSL_PAGING_LOAD_IND)) { repeat; }
1202 [] T_wait.timeout {
1203 setverdict(fail, "Waiting for empty paging queue");
1204 }
1205 [] as_rsl_res_ind();
1206 }
1207
1208 log("num_paging_sent=", st.num_paging_sent, " rcvd_msgs=", st.num_paging_rcv_msgs,
1209 " rcvd_ids=", st.num_paging_rcv_ids);
1210 return st;
1211}
1212
1213/* Create ~ 80% paging load (IMSI only) sustained for about 20s, verifying that
1214 * - the number of Mobile Identities on Um PCH match the number of pages on RSL
1215 * - that CCCH LOAD IND (PCH) are being generated
1216 * - that CCCH LOAD IND (PCH) [no load] is received after paging flood is over */
1217testcase TC_paging_imsi_80percent() runs on test_CT {
1218 var PagingTestCfg cfg := {
1219 combined_ccch := true,
1220 bs_ag_blks_res := 1,
1221 load_factor := 0.8,
1222 exp_load_ind := true,
1223 exp_overload := false,
1224 use_tmsi := false
1225 };
1226 var PagingTestState st := f_TC_paging(cfg);
1227 if (st.num_paging_sent != st.num_paging_rcv_ids) {
1228 setverdict(fail, "Expected ", st.num_paging_sent, " pagings but have ",
1229 st.num_paging_rcv_ids);
1230 } else {
1231 setverdict(pass);
1232 }
1233}
1234
1235/* Create ~ 80% paging load (TMSI only) sustained for about 20s, verifying that
1236 * - the number of Mobile Identities on Um PCH match the number of pages on RSL
1237 * - that CCCH LOAD IND (PCH) are being generated
1238 * - that CCCH LOAD IND (PCH) [no load] is received after paging flood is over */
1239testcase TC_paging_tmsi_80percent() runs on test_CT {
1240 var PagingTestCfg cfg := {
1241 combined_ccch := true,
1242 bs_ag_blks_res := 1,
1243 load_factor := 0.8,
1244 exp_load_ind := true,
1245 exp_overload := false,
1246 use_tmsi := true
1247 };
1248 var PagingTestState st := f_TC_paging(cfg);
1249 if (st.num_paging_sent != st.num_paging_rcv_ids) {
1250 setverdict(fail, "Expected ", st.num_paging_sent, " pagings but have ",
1251 st.num_paging_rcv_ids);
1252 } else {
1253 setverdict(pass);
1254 }
1255}
1256
1257/* Create ~ 200% paging load (IMSI only) sustained for about 20s, verifying that
1258 * - the number of Mobile Identities on Um PCH are ~ 82% of the number of pages on RSL
1259 * - that CCCH LOAD IND (PCH) are being generated and reach 0 at some point
1260 * - that CCCH LOAD IND (PCH) [no load] is received after paging flood is over */
1261testcase TC_paging_imsi_200percent() runs on test_CT {
1262 var PagingTestCfg cfg := {
1263 combined_ccch := true,
1264 bs_ag_blks_res := 1,
1265 load_factor := 2.0,
1266 exp_load_ind := true,
1267 exp_overload := true,
1268 use_tmsi := false
1269 };
1270 var PagingTestState st := f_TC_paging(cfg);
1271 /* We expect about 80-85% to pass, given that we can fill the paging buffer of 200
1272 * slots and will fully drain that buffer before returning */
1273 var template integer tpl := (st.num_paging_sent*80/100 .. st.num_paging_sent *85/100);
1274 if (not match(st.num_paging_rcv_ids, tpl)) {
1275 setverdict(fail, "Expected ", tpl, " pagings but have ", st.num_paging_rcv_ids);
1276 } else {
1277 setverdict(pass);
1278 }
1279}
1280
1281/* Create ~ 200% paging load (TMSI only) sustained for about 20s, verifying that
1282 * - the number of Mobile Identities on Um PCH are ~ 82% of the number of pages on RSL
1283 * - that CCCH LOAD IND (PCH) are being generated and reach 0 at some point
1284 * - that CCCH LOAD IND (PCH) [no load] is received after paging flood is over */
1285testcase TC_paging_tmsi_200percent() runs on test_CT {
1286 var PagingTestCfg cfg := {
1287 combined_ccch := true,
1288 bs_ag_blks_res := 1,
1289 load_factor := 2.0,
1290 exp_load_ind := true,
1291 exp_overload := true,
1292 use_tmsi := true
1293 };
1294 var PagingTestState st := f_TC_paging(cfg);
1295 /* We expect about 70% to pass, given that we can fill the paging buffer of 200
1296 * slots and will fully drain that buffer before returning */
1297 var template integer tpl := (st.num_paging_sent*68/100 .. st.num_paging_sent *72/100);
1298 if (not match(st.num_paging_rcv_ids, tpl)) {
1299 setverdict(fail, "Expected ", tpl, " pagings but have ", st.num_paging_rcv_ids);
1300 } else {
1301 setverdict(pass);
1302 }
1303}
1304
1305
Harald Welte93640c62018-02-25 16:59:33 +01001306/***********************************************************************
1307 * Immediate Assignment / AGCH
1308 ***********************************************************************/
1309
Harald Welte68e495b2018-02-25 00:05:57 +01001310testcase TC_imm_ass() runs on test_CT {
1311 f_init(testcasename());
1312 for (var integer i := 0; i < 1000; i := i+1) {
1313 var octetstring ia_enc := f_rnd_octstring(8);
1314 RSL_CCHAN.send(ts_RSL_UD(ts_RSL_IMM_ASSIGN(ia_enc, 0)));
1315 f_sleep(0.02);
1316 }
1317 /* FIXME: check if imm.ass arrive on Um side */
1318 /* FIXME: check for DELETE INDICATION */
1319 f_sleep(100.0);
1320}
1321
Harald Welte48494ca2018-02-25 16:59:50 +01001322/***********************************************************************
1323 * BCCH
1324 ***********************************************************************/
1325
1326/* tuple of Frame Number + decoded SI */
1327type record SystemInformationFn {
1328 GsmFrameNumber frame_number,
1329 SystemInformation si
1330}
1331
1332/* an arbitrary-length vector of decoded SI + gsmtap header */
1333type record of SystemInformationFn SystemInformationVector;
1334
1335/* an array of SI-vectors indexed by TC value */
1336type SystemInformationVector SystemInformationVectorPerTc[8];
1337
1338/* determine if a given SI vector contains given SI type at least once */
1339function f_si_vecslot_contains(SystemInformationVector arr, RrMessageType key, boolean bcch_ext := false) return boolean {
1340 for (var integer i:= 0; i< sizeof(arr); i := i + 1) {
1341 var integer fn_mod51 := arr[i].frame_number mod 51;
1342 if (not bcch_ext and fn_mod51 == 2 or
1343 bcch_ext and fn_mod51 == 6) {
1344 if (arr[i].si.header.message_type == key) {
1345 return true;
1346 }
1347 }
1348 }
1349 return false;
1350}
1351
1352/* ensure a given TC slot of the SI vector contains given SI type at least once at TC */
1353function f_ensure_si_vec_contains(SystemInformationVectorPerTc arr, integer tc, RrMessageType key, boolean ext_bcch := false) {
1354 if (not f_si_vecslot_contains(arr[tc], key, ext_bcch)) {
1355 setverdict(fail, "No ", key, " in TC=", tc, "!");
1356 }
1357}
1358
1359/* check if a given SI vector contains given SI type at least once on any TC */
1360function f_si_vec_contains(SystemInformationVectorPerTc arr, RrMessageType key) return boolean {
1361 for (var integer tc:= 0; tc < sizeof(arr); tc := tc + 1) {
1362 if (f_si_vecslot_contains(arr[tc], key) or
1363 f_si_vecslot_contains(arr[tc], key, true)) {
1364 return true;
1365 }
1366 }
1367 return false;
1368}
1369
1370/* determine if a given SI vector contains given SI type at least N of M times */
1371function f_si_vecslot_contains_n_of_m(SystemInformationVector arr, RrMessageType key, boolean bcch_ext := false, integer n := 1, integer m := 4) return boolean {
1372 var integer count := 0;
1373 if (sizeof(arr) < m) {
1374 setverdict(fail, "Error: Insufficient SI in array");
1375 self.stop;
1376 }
1377 for (var integer i:= 0; i < m; i := i + 1) {
1378 var integer fn_mod51 := arr[i].frame_number mod 51;
1379 if (not bcch_ext and fn_mod51 == 2 or
1380 bcch_ext and fn_mod51 == 6) {
1381 if (arr[i].si.header.message_type == key) {
1382 count := count + 1;
1383 }
1384 }
1385 }
1386 if (count >= n) {
1387 return true;
1388 } else {
1389 return false;
1390 }
1391}
1392
1393/* ensure a given TC slot of the SI vector contains given SI type at least N out of M times at TC */
1394function f_ensure_si_vec_contains_n_of_m(SystemInformationVectorPerTc arr, integer tc, RrMessageType key, boolean ext_bcch := false, integer n, integer m) {
1395 if (not f_si_vecslot_contains_n_of_m(arr[tc], key, ext_bcch, n, m)) {
1396 setverdict(fail, "Not ", n, "/", m, " of ", key, " in TC=", tc, "!");
1397 }
1398}
1399
1400/* determine if a given SI vector contains given SI type at least once */
1401function f_si_vecslot_contains_only(SystemInformationVector arr, RrMessageType key, boolean bcch_ext := false) return boolean {
1402 for (var integer i:= 0; i< sizeof(arr); i := i + 1) {
1403 var integer fn_mod51 := arr[i].frame_number mod 51;
1404 if (not bcch_ext and fn_mod51 == 2 or
1405 bcch_ext and fn_mod51 == 6) {
1406 if (arr[i].si.header.message_type != key) {
1407 return false;
1408 }
1409 }
1410 }
1411 return true;
1412}
1413
1414/* ensure a given TC slot of the SI vector contains only given SI type */
1415function f_ensure_si_vec_contains_only(SystemInformationVectorPerTc arr, integer tc, RrMessageType key, boolean ext_bcch := false) {
1416 if (not f_si_vecslot_contains_only(arr[tc], key, ext_bcch)) {
1417 setverdict(fail, "Not all ", key, " in TC=", tc, "!");
1418 }
1419}
1420
1421/* SI configuration of cell, against which we validate actual SI messages */
1422type set SystemInformationConfig {
1423 boolean bcch_extended,
1424 boolean si1_present,
1425 boolean si2bis_present,
1426 boolean si2ter_present,
1427 boolean si2quater_present,
1428 boolean si7_present,
1429 boolean si8_present,
1430 boolean si9_present,
1431 boolean si13_present,
1432 boolean si13alt_present,
1433 boolean si15_present,
1434 boolean si16_present,
1435 boolean si17_present,
1436 boolean si2n_present,
1437 boolean si21_present,
1438 boolean si22_present
1439}
1440
1441/* validate the SI scheduling according to TS 45.002 version 14.1.0 Release 14, Section 6.3.1.3 */
1442function f_validate_si_scheduling(SystemInformationConfig cfg, SystemInformationVectorPerTc si_per_tc) {
1443 var integer i;
1444 for (i := 0; i < sizeof(si_per_tc); i := i + 1) {
1445 if (sizeof(si_per_tc[i]) == 0) {
Harald Welte544565a2018-03-02 10:34:08 +01001446 setverdict(fail, "No SI messages for TC=", i);
Harald Welte48494ca2018-02-25 16:59:50 +01001447 }
1448 }
1449 if (cfg.si1_present) {
1450 /* ii) System Information Type 1 needs to be sent if frequency hopping is in use or
1451 * when the NCH is present in a cell. If the MS finds another message on BCCH Norm
1452 * when TC = 0, it can assume that System Information Type 1 is not in use. */
1453 f_ensure_si_vec_contains(si_per_tc, 0, SYSTEM_INFORMATION_TYPE_1);
1454 /* make sure *ALL* contain SI1 */
1455 f_ensure_si_vec_contains_only(si_per_tc, 0, SYSTEM_INFORMATION_TYPE_1);
1456 }
1457 f_ensure_si_vec_contains(si_per_tc, 1, SYSTEM_INFORMATION_TYPE_2);
1458 /* iii) A SI 2 message will be sent at least every time TC = 1 */
1459 f_ensure_si_vec_contains(si_per_tc, 2, SYSTEM_INFORMATION_TYPE_3);
1460 f_ensure_si_vec_contains(si_per_tc, 6, SYSTEM_INFORMATION_TYPE_3);
1461 f_ensure_si_vec_contains(si_per_tc, 3, SYSTEM_INFORMATION_TYPE_4);
1462 f_ensure_si_vec_contains(si_per_tc, 7, SYSTEM_INFORMATION_TYPE_4);
1463
1464 /* iii) System information type 2 bis or 2 ter messages are sent if needed, as determined by the
1465 * system operator. If only one of them is needed, it is sent when TC = 5. If both are
1466 * needed, 2bis is sent when TC = 5 and 2ter is sent at least once within any of 4
1467 * consecutive occurrences of TC = 4. */
1468 if (cfg.si2bis_present and not cfg.si2ter_present) {
1469 f_ensure_si_vec_contains(si_per_tc, 5, SYSTEM_INFORMATION_TYPE_2bis);
1470 } else if (cfg.si2ter_present and not cfg.si2bis_present) {
1471 f_ensure_si_vec_contains(si_per_tc, 5, SYSTEM_INFORMATION_TYPE_2ter);
1472 } else if (cfg.si2ter_present and cfg.si2bis_present) {
1473 f_ensure_si_vec_contains(si_per_tc, 5, SYSTEM_INFORMATION_TYPE_2bis);
1474 f_ensure_si_vec_contains_n_of_m(si_per_tc, 4, SYSTEM_INFORMATION_TYPE_2ter, false, 1, 4);
1475 }
1476
1477 if (cfg.si7_present or cfg.si8_present) {
1478 /* vi) Use of System Information type 7 and 8 is not always necessary. It is necessary
1479 * if System Information type 4 does not contain all information needed for cell
1480 * selection and reselection. */
1481 if (not cfg.bcch_extended) {
1482 testcase.stop("Error: SI7/SI8 require BCCH Extd.");
1483 }
1484 if (cfg.si7_present) {
1485 f_ensure_si_vec_contains(si_per_tc, 7, SYSTEM_INFORMATION_TYPE_7, true);
1486 }
1487 if (cfg.si8_present) {
1488 f_ensure_si_vec_contains(si_per_tc, 3, SYSTEM_INFORMATION_TYPE_8, true);
1489 }
1490 }
1491
1492 if (cfg.si2quater_present) {
1493 /* iii) System information type 2 quater is sent if needed, as determined by the system
1494 * operator. If sent on BCCH Norm, it shall be sent when TC = 5 if neither of 2bis
1495 * and 2ter are used, otherwise it shall be sent at least once within any of 4
1496 * consecutive occurrences of TC = 4. If sent on BCCH Ext, it is sent at least once
1497 * within any of 4 consecutive occurrences of TC = 5. */
1498 if (not (cfg.bcch_extended)) {
1499 if (not (cfg.si2bis_present or cfg.si2ter_present)) {
1500 f_ensure_si_vec_contains(si_per_tc, 5, SYSTEM_INFORMATION_TYPE_2quater);
1501 } else {
1502 f_ensure_si_vec_contains_n_of_m(si_per_tc, 4, SYSTEM_INFORMATION_TYPE_2quater, false, 1, 4);
1503 }
1504 } else {
1505 f_ensure_si_vec_contains_n_of_m(si_per_tc, 5, SYSTEM_INFORMATION_TYPE_2quater, true, 1, 4);
1506 }
1507 }
1508 if (cfg.si9_present) {
1509 /* vi) System Information type 9 is sent in those blocks with TC = 4 which are specified
1510 * in system information type 3 as defined in 3GPP TS 44.018. */
1511 f_ensure_si_vec_contains(si_per_tc, 4, SYSTEM_INFORMATION_TYPE_9); // FIXME SI3
1512 }
1513 if (cfg.si13_present) {
1514 /* vii) System Information type 13 is only related to the GPRS service. System Information
1515 * Type 13 need only be sent if GPRS support is indicated in one or more of System
1516 * Information Type 3 or 4 or 7 or 8 messages. These messages also indicate if the
1517 * message is sent on the BCCH Norm or if the message is transmitted on the BCCH Ext.
1518 * In the case that the message is sent on the BCCH Norm, it is sent at least once
1519 * within any of 4 consecutive occurrences of TC=4. */
1520 if (not cfg.bcch_extended) {
1521 log("not-bccch-extended");
1522 f_ensure_si_vec_contains_n_of_m(si_per_tc, 4, SYSTEM_INFORMATION_TYPE_13, false, 1, 4);
1523 } else {
1524 log("bccch-extended");
1525 f_ensure_si_vec_contains(si_per_tc, 0, SYSTEM_INFORMATION_TYPE_13, true);
1526 }
1527 if (f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_13alt)) {
1528 setverdict(fail, "Cannot have SI13alt and SI13");
1529 }
1530 }
1531 if (cfg.si16_present or cfg.si17_present) {
1532 /* viii) System Information type 16 and 17 are only related to the SoLSA service. They
1533 * should not be sent in a cell where network sharing is used (see rule xv). */
1534 if (cfg.si22_present) {
1535 testcase.stop("Error: Cannot have SI16/SI17 and SI22!");
1536 }
1537 if (f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_22)) {
1538 setverdict(fail, "Cannot have SI16/SI17 and SI22!");
1539 }
1540 if (not cfg.bcch_extended) {
1541 testcase.stop("Error: SI16/SI17 requires BCCH Extd!");
1542 }
1543 if (cfg.si16_present) {
1544 f_ensure_si_vec_contains(si_per_tc, 6, SYSTEM_INFORMATION_TYPE_16, true);
1545 }
1546 if (cfg.si17_present) {
1547 f_ensure_si_vec_contains(si_per_tc, 2, SYSTEM_INFORMATION_TYPE_17, true);
1548 }
1549 }
1550
1551 /* ix) System Information type 18 and 20 are sent in order to transmit non-GSM
1552 * broadcast information. The frequency with which they are sent is determined by the
1553 * system operator. System Information type 9 identifies the scheduling of System
1554 * Information type 18 and 20 messages. */
1555
1556 /* x) System Information Type 19 is sent if COMPACT neighbours exist. If System
1557 * Information Type 19 is present, then its scheduling shall be indicated in System
1558 * Information Type 9. */
1559
1560 if (cfg.si15_present) {
1561 /* xi) System Information Type 15 is broadcast if dynamic ARFCN mapping is used in the
1562 * PLMN. If sent on BCCH Norm, it is sent at least once within any of 4 consecutive
1563 * occurrences of TC = 4. If sent on BCCH Ext, it is sent at least once within any of
1564 * 4 consecutive occurrences of TC = 1. */
1565 if (not cfg.bcch_extended) {
1566 f_ensure_si_vec_contains_n_of_m(si_per_tc, 4, SYSTEM_INFORMATION_TYPE_15, false, 1, 4);
1567 } else {
1568 f_ensure_si_vec_contains_n_of_m(si_per_tc, 1, SYSTEM_INFORMATION_TYPE_15, true, 1, 4);
1569 }
1570 }
1571 if (cfg.si13alt_present) {
1572 /* xii) System Information type 13 alt is only related to the GERAN Iu mode. System
1573 * Information Type 13 alt need only be sent if GERAN Iu mode support is indicated in
1574 * one or more of System Information Type 3 or 4 or 7 or 8 messages and SI 13 is not
1575 * broadcast. These messages also indicate if the message is sent on the BCCH Norm or
1576 * if the message is transmitted on the BCCH Ext. In the case that the message is sent
1577 * on the BCCH Norm, it is sent at least once within any of 4 consecutive occurrences
1578 * of TC = 4. */
1579 if (cfg.si13_present) {
1580 testcase.stop("Error: Cannot have SI13alt and SI13");
1581 }
1582 if (f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_13)) {
1583 setverdict(fail, "Cannot have SI13alt and SI13");
1584 }
1585 if (not cfg.bcch_extended) {
1586 f_ensure_si_vec_contains_n_of_m(si_per_tc, 4, SYSTEM_INFORMATION_TYPE_13alt, false, 1, 4);
1587 } else {
1588 f_ensure_si_vec_contains(si_per_tc, 0, SYSTEM_INFORMATION_TYPE_13alt, true);
1589 }
1590 }
1591 if (cfg.si2n_present) {
1592 /* xiii) System Information Type 2n is optionally sent on BCCH Norm or BCCH Ext if needed,
1593 * as determined by the system operator. In the case that the message is sent on the
1594 * BCCH Norm, it is sent at least once within any of 4 consecutive occurrences of TC =
1595 * 4. If the message is sent on BCCH Ext, it is sent at least once within any of 2
1596 * consecutive occurrences of TC = 4. */
1597 if (not cfg.bcch_extended) {
1598 f_ensure_si_vec_contains_n_of_m(si_per_tc, 4, SYSTEM_INFORMATION_TYPE_2n, false, 1, 4);
1599 } else {
1600 f_ensure_si_vec_contains_n_of_m(si_per_tc, 4, SYSTEM_INFORMATION_TYPE_2n, true, 2, 4);
1601 }
1602 }
1603 if (cfg.si21_present) {
1604 /* xiv) System Information Type 21 is optionally sent on BCCH Norm or BCCH Ext, as
1605 * determined by the system operator. If Extended Access Barring is in use in the cell
1606 * then this message is sent at least once within any of 4 consecutive occurrences of
1607 * TC = 4 regardless if it is sent on BCCH Norm or BCCH Ext. If BCCH Ext is used in a
1608 * cell then this message shall only be sent on BCCH Ext. */
1609 if (not cfg.bcch_extended) {
1610 f_ensure_si_vec_contains_n_of_m(si_per_tc, 4, SYSTEM_INFORMATION_TYPE_21, false, 1, 4);
1611 } else {
1612 f_ensure_si_vec_contains_n_of_m(si_per_tc, 4, SYSTEM_INFORMATION_TYPE_21, true, 1, 4);
1613 if (f_si_vecslot_contains(si_per_tc[4], SYSTEM_INFORMATION_TYPE_21)) {
1614 setverdict(fail, "Cannot have SI21 on BCCH Norm if BCCH Extd enabled!");
1615 }
1616 }
1617 }
1618 if (cfg.si22_present) {
1619 /* xv) System Information Type 22 is sent if network sharing is in use in the cell. It
1620 * should not be sent in a cell where SoLSA is used (see rule viii). System
1621 * Information Type 22 instances shall be sent on BCCH Ext within any occurrence of TC
1622 * =2 and TC=6. */
1623 if (cfg.si16_present or cfg.si17_present) {
1624 testcase.stop("Error: Cannot have SI16/SI17 and SI22!");
1625 }
1626 if (f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_16) or
1627 f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_17)) {
1628 setverdict(fail, "Cannot have SI16/SI17 and SI22!");
1629 }
1630 if (not cfg.bcch_extended) {
1631 testcase.stop("Error: SI22 requires BCCH Extd!");
1632 } else {
1633 f_ensure_si_vec_contains_only(si_per_tc, 2, SYSTEM_INFORMATION_TYPE_22, true);
1634 f_ensure_si_vec_contains_only(si_per_tc, 6, SYSTEM_INFORMATION_TYPE_22, true);
1635 }
1636 }
1637}
1638
1639/* sample Systme Information for specified duration via L1CTL */
1640function f_l1_sample_si(L1CTL_PT pt, float duration := 8.0) return SystemInformationVectorPerTc {
1641 timer T := duration;
1642 var SystemInformationVectorPerTc si_per_tc;
1643 var L1ctlDlMessage l1_dl;
1644
1645 /* initialize all per-TC vectors empty */
1646 for (var integer i:= 0; i < sizeof(si_per_tc); i := i+1) {
1647 si_per_tc[i] := {};
1648 }
1649
1650 /* flush all previous L1 queued msgs */
1651 pt.clear;
1652
1653 T.start;
1654 alt {
Harald Weltef8df4cb2018-03-10 15:15:08 +01001655 [] pt.receive(tr_L1CTL_DATA_IND(t_RslChanNr_BCCH(0), ?)) -> value l1_dl {
Harald Welte48494ca2018-02-25 16:59:50 +01001656 /* somehow dec_SystemInformation will try to decode even non-RR as SI */
1657 if (not (l1_dl.payload.data_ind.payload[1] == '06'O)) {
1658 log("Ignoring non-RR SI ", l1_dl);
1659 repeat;
1660 }
1661 var SystemInformationFn sig := {
1662 frame_number := l1_dl.dl_info.frame_nr,
1663 si := dec_SystemInformation(l1_dl.payload.data_ind.payload)
1664 }
1665 var integer tc := f_gsm_compute_tc(sig.frame_number);
1666 log("SI received at TC=", tc, ": ", sig.si);
1667 /* append to the per-TC bucket */
1668 si_per_tc[tc] := si_per_tc[tc] & { sig };
1669 repeat;
1670 }
1671 [] pt.receive { repeat; }
1672 [] T.timeout { }
1673 }
1674
1675 for (var integer i:= 0; i < sizeof(si_per_tc); i := i+1) {
1676 log(testcasename(), ": TC=", i, " has #of SI=", sizeof(si_per_tc[i]));
1677 }
1678 log("si_per_tc=", si_per_tc);
1679 return si_per_tc;
1680}
1681
1682/* helper function: Set given SI via RSL + validate scheduling.
1683 * CALLER MUST MAKE SURE TO CHANGE GLOBAL si_cfg! */
1684function f_TC_si_sched() runs on test_CT {
1685 var SystemInformationVectorPerTc si_per_tc;
1686 f_init_l1ctl();
1687 f_l1_tune(L1CTL);
1688
1689 /* Sample + Validate Scheduling */
1690 si_per_tc := f_l1_sample_si(L1CTL);
1691 f_validate_si_scheduling(si_cfg, si_per_tc);
1692
1693 setverdict(pass);
1694}
1695
1696testcase TC_si_sched_default() runs on test_CT {
1697 f_init();
Harald Welte0cae4552018-03-09 22:20:26 +01001698 /* 2+3+4 are mandatory and set in f_init() */
1699 f_TC_si_sched();
1700}
1701
1702testcase TC_si_sched_1() runs on test_CT {
1703 f_init();
1704 si_cfg.si1_present := true;
1705 f_rsl_bcch_fill_raw(RSL_SYSTEM_INFO_1, '5506198fb38000000000000000000000000000e504002b'O);
Harald Welte48494ca2018-02-25 16:59:50 +01001706 f_TC_si_sched();
1707}
1708
1709testcase TC_si_sched_2bis() runs on test_CT {
1710 f_init();
1711 si_cfg.si2bis_present := true;
1712 f_rsl_bcch_fill_raw(RSL_SYSTEM_INFO_2bis, '550602bfe809b3ff00000000000000000000007900002b'O);
1713 f_TC_si_sched();
1714}
1715
1716testcase TC_si_sched_2ter() runs on test_CT {
1717 f_init();
1718 si_cfg.si2ter_present := true;
1719 f_rsl_bcch_fill_raw(RSL_SYSTEM_INFO_2ter, '010603bf66b0aa0a00000002000000000000002b2b2b2b'O);
1720 f_TC_si_sched();
1721}
1722
1723testcase TC_si_sched_2ter_2bis() runs on test_CT {
1724 f_init();
1725 si_cfg.si2bis_present := true;
1726 f_rsl_bcch_fill_raw(RSL_SYSTEM_INFO_2bis, '550602bfe809b3ff00000000000000000000007900002b'O);
1727 si_cfg.si2ter_present := true;
1728 f_rsl_bcch_fill_raw(RSL_SYSTEM_INFO_2ter, '010603bf66b0aa0a00000002000000000000002b2b2b2b'O);
1729 f_TC_si_sched();
1730}
1731
1732testcase TC_si_sched_2quater() runs on test_CT {
1733 f_init();
1734 si_cfg.si2quater_present := true;
1735 f_rsl_bcch_fill_raw(RSL_SYSTEM_INFO_2quater, '050607a8a0364aa698d72ff424feee0506d5e7fff02043'O);
1736 f_TC_si_sched();
1737}
1738
1739testcase TC_si_sched_13() runs on test_CT {
1740 f_init();
1741 si_cfg.si13_present := true;
1742 //f_rsl_bcch_fill_raw(RSL_SYSTEM_INFO_13, fixme);
1743 f_TC_si_sched();
1744}
1745
1746testcase TC_si_sched_13_2bis_2ter_2quater() runs on test_CT {
1747 f_init();
1748 si_cfg.si2bis_present := true;
1749 f_rsl_bcch_fill_raw(RSL_SYSTEM_INFO_2bis, '550602bfe809b3ff00000000000000000000007900002b'O);
1750 si_cfg.si2ter_present := true;
1751 f_rsl_bcch_fill_raw(RSL_SYSTEM_INFO_2ter, '010603bf66b0aa0a00000002000000000000002b2b2b2b'O);
1752 si_cfg.si2quater_present := true;
1753 f_rsl_bcch_fill_raw(RSL_SYSTEM_INFO_2quater, '050607a8a0364aa698d72ff424feee0506d5e7fff02043'O);
1754 si_cfg.si13_present := true;
1755 //f_rsl_bcch_fill_raw(RSL_SYSTEM_INFO_13, fixme);
1756 f_TC_si_sched();
1757}
1758
1759
Harald Welte68e495b2018-02-25 00:05:57 +01001760testcase TC_bcch_info() runs on test_CT {
1761 f_init(testcasename());
1762 /* FIXME: enable / disable individual BCCH info */
1763 //ts_RSL_BCCH_INFO(si_type, info);
1764 /* expect no ERROR REPORT after either of them *
1765 /* negative test: ensure ERROR REPORT on unsupported types */
1766}
1767
Harald Welte93640c62018-02-25 16:59:33 +01001768/***********************************************************************
1769 * Low-Level Protocol Errors / ERROR REPORT
1770 ***********************************************************************/
1771
Harald Welte01d982c2018-02-25 01:31:40 +01001772private function f_exp_err_rep(template RSL_Cause cause) runs on test_CT {
1773 timer T := 5.0;
1774 T.start;
1775 alt {
1776 [] RSL_CCHAN.receive(tr_RSL_UD(tr_RSL_ERROR_REPORT(cause))) {
1777 setverdict(pass);
1778 }
1779 [] RSL_CCHAN.receive(tr_RSL_UD(tr_RSL_ERROR_REPORT(?))) {
1780 setverdict(fail, "Wrong cause in RSL ERR REP");
1781 }
1782 [] RSL_CCHAN.receive {
1783 repeat;
1784 }
1785 [] T.timeout {
1786 setverdict(fail, "Timeout waiting for RSL ERR REP");
1787 }
1788 }
1789}
1790
1791/* Provoke a protocol error (message too short) and match on ERROR REPORT */
1792testcase TC_rsl_protocol_error() runs on test_CT {
1793 f_init(testcasename());
1794 var RSL_Message rsl := valueof(ts_RSL_BCCH_INFO(RSL_SYSTEM_INFO_1, ''O));
1795 rsl.ies := omit;
1796 RSL_CCHAN.send(ts_RSL_UD(rsl));
1797
1798 f_exp_err_rep(RSL_ERR_PROTO);
1799}
1800
1801/* Provoke a mandatory IE error and match on ERROR REPORT */
1802testcase TC_rsl_mand_ie_error() runs on test_CT {
1803 f_init(testcasename());
1804
1805 var RSL_Message rsl := valueof(ts_RSL_BCCH_INFO(RSL_SYSTEM_INFO_1, ''O));
1806 rsl.ies := { rsl.ies[0] };
1807 RSL_CCHAN.send(ts_RSL_UD(rsl));
1808
1809 f_exp_err_rep(RSL_ERR_MAND_IE_ERROR);
1810}
1811
1812/* Provoke an IE content error and match on ERROR REPORT */
1813testcase TC_rsl_ie_content_error() runs on test_CT {
1814 f_init(testcasename());
1815 var RSL_Message rsl := valueof(ts_RSL_BCCH_INFO(RSL_SYSTEM_INFO_1, ''O));
1816 rsl.ies[1].body.sysinfo_type := RSL_SYSTEM_INFO_5;
1817 RSL_CCHAN.send(ts_RSL_UD(rsl));
1818
1819 f_exp_err_rep(RSL_ERR_IE_CONTENT);
1820}
1821
Harald Welte93640c62018-02-25 16:59:33 +01001822/***********************************************************************
1823 * IPA CRCX/MDCX/DLCS media stream handling
1824 ***********************************************************************/
1825
Harald Weltea871a382018-02-25 02:03:14 +01001826/* Send IPA DLCX to inactive lchan */
1827function f_TC_ipa_dlcx_not_active(charstring id) runs on ConnHdlr {
Harald Welte1eba3742018-02-25 12:48:14 +01001828 f_rsl_transceive(ts_RSL_IPA_DLCX(g_chan_nr, 0), tr_RSL_IPA_DLCX_ACK(g_chan_nr, ?, ?),
1829 "IPA DLCX ACK");
Harald Weltea871a382018-02-25 02:03:14 +01001830}
1831testcase TC_ipa_dlcx_not_active() runs on test_CT {
1832 var ConnHdlrPars pars := valueof(t_Pars(t_RslChanNr_Bm(1), ts_RSL_ChanMode_SIGN));
1833 f_init(testcasename());
1834 var ConnHdlr vc_conn := f_start_handler(refers(f_TC_ipa_dlcx_not_active), pars);
1835 vc_conn.done;
1836}
Harald Welte68e495b2018-02-25 00:05:57 +01001837
Harald Weltea3f1df92018-02-25 12:49:55 +01001838/* Send IPA CRCX twice to inactive lchan */
1839function f_TC_ipa_crcx_twice_not_active(charstring id) runs on ConnHdlr {
1840 f_rsl_transceive(ts_RSL_IPA_CRCX(g_chan_nr), tr_RSL_IPA_CRCX_ACK(g_chan_nr, ?, ?, ?),
1841 "IPA CRCX ACK");
1842 f_rsl_transceive(ts_RSL_IPA_CRCX(g_chan_nr), tr_RSL_IPA_CRCX_NACK(g_chan_nr, RSL_ERR_RES_UNAVAIL),
1843 "IPA CRCX NACK");
1844}
1845testcase TC_ipa_crcx_twice_not_active() runs on test_CT {
1846 var ConnHdlrPars pars := valueof(t_Pars(t_RslChanNr_Bm(1), ts_RSL_ChanMode_SIGN));
1847 f_init(testcasename());
1848 var ConnHdlr vc_conn := f_start_handler(refers(f_TC_ipa_crcx_twice_not_active), pars);
1849 vc_conn.done;
1850}
1851
1852/* Regular sequence of CRCX/MDCX/DLCX */
1853function f_TC_ipa_crcx_mdcx_dlcx_not_active(charstring id) runs on ConnHdlr {
1854 f_rsl_transceive(ts_RSL_IPA_CRCX(g_chan_nr), tr_RSL_IPA_CRCX_ACK(g_chan_nr, ?, ?, ?),
1855 "IPA CRCX ACK");
1856 var uint32_t remote_ip := f_rnd_int(c_UINT32_MAX);
1857 var uint16_t remote_port := f_rnd_int(c_UINT16_MAX);
1858 var uint7_t rtp_pt2 := f_rnd_int(127);
1859 var uint16_t fake_conn_id := 23; /* we're too lazy to read it out from the CRCX ACK above */
1860 f_rsl_transceive(ts_RSL_IPA_MDCX(g_chan_nr, fake_conn_id, remote_ip, remote_port, rtp_pt2),
1861 tr_RSL_IPA_MDCX_ACK(g_chan_nr, ?, ?, ?, rtp_pt2),
1862 "IPA MDCX ACK");
1863 f_rsl_transceive(ts_RSL_IPA_DLCX(g_chan_nr, fake_conn_id), tr_RSL_IPA_DLCX_ACK(g_chan_nr, ?, ?),
1864 "IPA DLCX ACK");
1865}
1866testcase TC_ipa_crcx_mdcx_dlcx_not_active() runs on test_CT {
1867 var ConnHdlrPars pars := valueof(t_Pars(t_RslChanNr_Bm(1), ts_RSL_ChanMode_SIGN));
1868 f_init(testcasename());
1869 var ConnHdlr vc_conn := f_start_handler(refers(f_TC_ipa_crcx_mdcx_dlcx_not_active), pars);
1870 vc_conn.done;
1871}
1872
Harald Welte3ae11da2018-02-25 13:36:06 +01001873/* Sequence of CRCX, 2x MDCX, DLCX */
1874function f_TC_ipa_crcx_mdcx_mdcx_dlcx_not_active(charstring id) runs on ConnHdlr {
1875 f_rsl_transceive(ts_RSL_IPA_CRCX(g_chan_nr), tr_RSL_IPA_CRCX_ACK(g_chan_nr, ?, ?, ?),
1876 "IPA CRCX ACK");
1877 var uint32_t remote_ip := f_rnd_int(c_UINT32_MAX);
1878 var uint16_t remote_port := f_rnd_int(c_UINT16_MAX);
1879 var uint7_t rtp_pt2 := f_rnd_int(127);
1880 var uint16_t fake_conn_id := 23; /* we're too lazy to read it out from the CRCX ACK above */
1881 f_rsl_transceive(ts_RSL_IPA_MDCX(g_chan_nr, fake_conn_id, remote_ip, remote_port, rtp_pt2),
1882 tr_RSL_IPA_MDCX_ACK(g_chan_nr, ?, ?, ?, rtp_pt2),
1883 "IPA MDCX ACK");
1884 /* Second MDCX */
1885 remote_ip := f_rnd_int(c_UINT32_MAX);
1886 remote_port := f_rnd_int(c_UINT16_MAX);
1887 f_rsl_transceive(ts_RSL_IPA_MDCX(g_chan_nr, fake_conn_id, remote_ip, remote_port, rtp_pt2),
1888 tr_RSL_IPA_MDCX_ACK(g_chan_nr, ?, ?, ?, rtp_pt2),
1889 "IPA MDCX ACK");
1890 f_rsl_transceive(ts_RSL_IPA_DLCX(g_chan_nr, fake_conn_id), tr_RSL_IPA_DLCX_ACK(g_chan_nr, ?, ?),
1891 "IPA DLCX ACK");
1892}
1893testcase TC_ipa_crcx_mdcx_mdcx_dlcx_not_active() runs on test_CT {
1894 var ConnHdlrPars pars := valueof(t_Pars(t_RslChanNr_Bm(1), ts_RSL_ChanMode_SIGN));
1895 f_init(testcasename());
1896 var ConnHdlr vc_conn := f_start_handler(refers(f_TC_ipa_crcx_mdcx_mdcx_dlcx_not_active), pars);
1897 vc_conn.done;
1898}
1899
Harald Welte9912eb52018-02-25 13:30:15 +01001900/* IPA CRCX on SDCCH/4 and SDCCH/8 (doesn't make sense) */
1901function f_TC_ipa_crcx_sdcch_not_active(charstring id) runs on ConnHdlr {
1902 f_rsl_transceive(ts_RSL_IPA_CRCX(g_chan_nr), tr_RSL_IPA_CRCX_NACK(g_chan_nr, ?),
1903 "IPA CRCX NACK");
1904}
1905testcase TC_ipa_crcx_sdcch_not_active() runs on test_CT {
1906 var ConnHdlrPars pars;
1907 var ConnHdlr vc_conn;
1908 f_init(testcasename());
1909
1910 pars := valueof(t_Pars(t_RslChanNr_SDCCH4(0,1), ts_RSL_ChanMode_SIGN));
1911 vc_conn := f_start_handler(refers(f_TC_ipa_crcx_sdcch_not_active), pars);
1912 vc_conn.done;
1913
1914 pars := valueof(t_Pars(t_RslChanNr_SDCCH8(6,5), ts_RSL_ChanMode_SIGN));
1915 vc_conn := f_start_handler(refers(f_TC_ipa_crcx_sdcch_not_active), pars);
1916 vc_conn.done;
1917}
1918
Harald Weltea3f1df92018-02-25 12:49:55 +01001919
Harald Welte883340c2018-02-28 18:59:29 +01001920/***********************************************************************
1921 * PCU Socket related tests
1922 ***********************************************************************/
1923
1924private function f_TC_pcu_act_req(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr, boolean exp_success)
1925runs on test_CT {
1926 timer T := 3.0;
1927
1928 /* we don't expect any RTS.req before PDCH are active */
1929 T.start;
1930 alt {
1931 [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RTS_REQ(bts_nr))) {
1932 setverdict(fail, "PCU RTS.req before PDCH active?");
1933 self.stop;
1934 }
1935 [] PCU.receive { repeat; }
1936 [] T.timeout { }
1937 }
1938
1939 /* Send PDCH activate request for known PDCH timeslot */
1940 PCU.send(t_SD_PCUIF(g_pcu_conn_id, ts_PCUIF_ACT_REQ(bts_nr, trx_nr, ts_nr)));
1941
1942 /* we now expect RTS.req for this timeslot (only) */
1943 T.start;
1944 alt {
1945 [exp_success] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RTS_REQ(bts_nr, trx_nr, ts_nr))) {
1946 setverdict(pass);
1947 }
1948 [not exp_success] PCU.receive(t_SD_PCUIF(g_pcu_conn_id,
1949 tr_PCUIF_RTS_REQ(bts_nr, trx_nr, ts_nr))) {
1950 setverdict(fail, "Unexpected RTS.req for supposedly failing activation");
1951 self.stop;
1952 }
1953 [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RTS_REQ)) {
1954 setverdict(fail, "RTS.req for wrong TRX/TS");
1955 self.stop;
1956 }
1957 [] PCU.receive { repeat; }
1958 [exp_success] T.timeout {
1959 setverdict(fail, "Timeout waiting for PCU RTS.req");
1960 }
1961 [not exp_success] T.timeout {
1962 setverdict(pass);
1963 }
1964 }
1965}
1966
1967private function f_TC_pcu_deact_req(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr)
1968runs on test_CT {
1969 timer T := 3.0;
1970
1971 /* Send PDCH activate request for known PDCH timeslot */
1972 PCU.send(t_SD_PCUIF(g_pcu_conn_id, ts_PCUIF_DEACT_REQ(bts_nr, trx_nr, ts_nr)));
1973
1974 PCU.clear;
1975 /* we now expect no RTS.req for this timeslot */
1976 T.start;
1977 alt {
1978 [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RTS_REQ(bts_nr, trx_nr, ts_nr))) {
1979 setverdict(fail, "Received unexpected PCU RTS.req");
1980 self.stop;
1981 }
1982 [] PCU.receive { repeat; }
1983 [] T.timeout {
1984 setverdict(pass);
1985 }
1986 }
1987}
1988
1989/* PDCH activation via PCU socket; check for presence of RTS.req */
1990testcase TC_pcu_act_req() runs on test_CT {
1991 f_init();
1992 f_TC_pcu_act_req(0, 0, 7, true);
1993}
1994
1995/* PDCH activation via PCU socket on non-PDCU timeslot */
1996testcase TC_pcu_act_req_wrong_ts() runs on test_CT {
1997 f_init();
1998 f_TC_pcu_act_req(0, 0, 1, false);
1999}
2000
2001/* PDCH activation via PCU socket on wrong BTS */
2002testcase TC_pcu_act_req_wrong_bts() runs on test_CT {
2003 f_init();
2004 f_TC_pcu_act_req(23, 0, 7, false);
2005}
2006
2007/* PDCH activation via PCU socket on wrong TRX */
2008testcase TC_pcu_act_req_wrong_trx() runs on test_CT {
2009 f_init();
2010 f_TC_pcu_act_req(0, 23, 7, false);
2011}
2012
2013/* PDCH deactivation via PCU socket; check for absence of RTS.req */
2014testcase TC_pcu_deact_req() runs on test_CT {
2015 f_init();
2016 /* Activate PDCH */
2017 f_TC_pcu_act_req(0, 0, 7, true);
2018 f_sleep(1.0);
2019 /* and De-Activate again */
2020 f_TC_pcu_deact_req(0, 0, 7);
2021}
2022
2023/* Attempt to deactivate a PDCH on a non-PDCH timeslot */
2024testcase TC_pcu_deact_req_wrong_ts() runs on test_CT {
2025 f_init();
2026 f_TC_pcu_deact_req(0, 0, 1);
2027}
2028
2029/* Test the PCU->BTS Version and BTS->PCU SI13 handshake */
2030testcase TC_pcu_ver_si13() runs on test_CT {
2031 const octetstring si13 := '00010203040506070909'O;
2032 var PCUIF_send_data sd;
2033 timer T:= 3.0;
2034 f_init();
2035
2036 /* Set SI13 via RSL */
2037 f_rsl_bcch_fill_raw(RSL_SYSTEM_INFO_13, si13);
2038 PCU.send(t_SD_PCUIF(g_pcu_conn_id, ts_PCUIF_TXT_IND(0, PCU_VERSION, "BTS_Test v23")));
2039 T.start;
2040 alt {
2041 [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_DATA_IND(0, 0, 0, ?, PCU_IF_SAPI_BCCH))) -> value sd {
2042 if (substr(sd.data.u.data_ind.data, 0, lengthof(si13)) == si13) {
2043 setverdict(pass);
2044 } else {
2045 repeat;
2046 }
2047 }
2048 [] PCU.receive { repeat; }
2049 [] T.timeout {
2050 setverdict(fail, "Timeout waiting for SI13");
2051 self.stop;
2052 }
2053 }
2054}
2055
2056private const octetstring c_PCU_DATA := '000102030405060708090a0b0c0d0e0f10111213141516'O;
2057
2058/* helper function to send a PCU DATA.req */
2059private function f_pcu_data_req(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr,
2060 uint8_t block_nr, uint32_t fn, PCUIF_Sapi sapi, octetstring data)
2061runs on test_CT
2062{
2063 PCU.send(t_SD_PCUIF(g_pcu_conn_id,
2064 ts_PCUIF_DATA_REQ(bts_nr, trx_nr, ts_nr, block_nr, fn, sapi, data)));
2065}
2066
2067/* helper function to wait for RTS.ind for given SAPI on given BTS/TRX/TS and then send */
2068private function f_pcu_wait_rts_and_data_req(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr,
2069 PCUIF_Sapi sapi, octetstring data)
2070runs on test_CT
2071{
2072 var PCUIF_send_data sd;
2073
2074 timer T := 3.0;
2075 T.start;
2076 alt {
2077 [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id,
2078 tr_PCUIF_RTS_REQ(bts_nr, trx_nr, ts_nr, sapi))) -> value sd {
2079 f_pcu_data_req(bts_nr, trx_nr, ts_nr, sd.data.u.rts_req.block_nr,
2080 sd.data.u.rts_req.fn, sapi, data);
2081 }
2082 [] PCU.receive { repeat; }
2083 [] T.timeout {
2084 setverdict(fail, "Timeout waiting for RTS.ind");
2085 }
2086 }
2087}
2088
2089/* Send DATA.req on invalid BTS */
2090testcase TC_pcu_data_req_wrong_bts() runs on test_CT {
2091 f_init();
2092 f_TC_pcu_act_req(0, 0, 7, true);
2093 f_pcu_data_req(23, 0, 7, 0, 0, PCU_IF_SAPI_PDTCH, c_PCU_DATA);
2094 /* FIXME: how to check this wasn't actually sent and didn't crash BTS? */
2095 f_sleep(10.0);
2096}
2097
2098/* Send DATA.req on invalid TRX */
2099testcase TC_pcu_data_req_wrong_trx() runs on test_CT {
2100 f_init();
2101 f_TC_pcu_act_req(0, 0, 7, true);
2102 f_pcu_data_req(0, 100, 7, 0, 0, PCU_IF_SAPI_PDTCH, c_PCU_DATA);
2103 /* FIXME: how to check this wasn't actually sent and didn't crash BTS? */
2104 f_sleep(10.0);
2105}
2106
2107/* Send DATA.req on invalid timeslot */
2108testcase TC_pcu_data_req_wrong_ts() runs on test_CT {
2109 f_init();
2110 f_TC_pcu_act_req(0, 0, 7, true);
2111 f_pcu_data_req(0, 0, 70, 0, 0, PCU_IF_SAPI_PDTCH, c_PCU_DATA);
2112 /* FIXME: how to check this wasn't actually sent and didn't crash BTS? */
2113 f_sleep(10.0);
2114}
2115
2116/* Send DATA.req on timeslot that hasn't been activated */
2117testcase TC_pcu_data_req_ts_inactive() runs on test_CT {
2118 f_init();
2119 f_pcu_data_req(0, 0, 7, 0, 0, PCU_IF_SAPI_PDTCH, c_PCU_DATA);
2120 /* FIXME: how to check this wasn't actually sent and didn't crash BTS? */
2121 f_sleep(2.0);
2122}
2123
2124testcase TC_pcu_data_req_pdtch() runs on test_CT {
2125 f_init();
2126 f_TC_pcu_act_req(0, 0, 7, true);
2127 f_pcu_wait_rts_and_data_req(0, 0, 7, PCU_IF_SAPI_PDTCH, c_PCU_DATA);
2128 /* FIXME: how to check this was actually sent */
2129 f_sleep(2.0);
2130}
2131
2132testcase TC_pcu_data_req_ptcch() runs on test_CT {
2133 f_init();
2134 f_TC_pcu_act_req(0, 0, 7, true);
2135 f_pcu_wait_rts_and_data_req(0, 0, 7, PCU_IF_SAPI_PTCCH, c_PCU_DATA);
2136 /* FIXME: how to check this was actually sent */
2137 f_sleep(2.0);
2138}
2139
2140/* Send AGCH from PCU; check it appears on Um side */
2141testcase TC_pcu_data_req_agch() runs on test_CT {
2142 timer T := 3.0;
2143 f_init();
2144 f_init_l1ctl();
2145 f_l1_tune(L1CTL);
2146
2147 f_TC_pcu_act_req(0, 0, 7, true);
2148 f_pcu_data_req(0, 0, 7, 0, 0, PCU_IF_SAPI_AGCH, c_PCU_DATA);
2149
2150 T.start;
2151 alt {
Harald Weltef8df4cb2018-03-10 15:15:08 +01002152 [] L1CTL.receive(tr_L1CTL_DATA_IND(t_RslChanNr_PCH_AGCH(0), ?, c_PCU_DATA)) {
Harald Welte883340c2018-02-28 18:59:29 +01002153 setverdict(pass);
2154 }
2155 [] L1CTL.receive { repeat; }
2156 [] T.timeout {
2157 setverdict(fail, "Timeout waiting for PCU-originated AGCH block on Um");
2158 }
2159 }
2160}
2161
2162/* Send IMM.ASS from PCU for PCH; check it appears on Um side */
2163testcase TC_pcu_data_req_imm_ass_pch() runs on test_CT {
2164 var octetstring imm_ass := f_rnd_octstring(23);
2165 f_init();
2166 f_init_l1ctl();
2167 f_l1_tune(L1CTL);
2168
2169 /* append 3 last imsi digits so BTS can compute pagng group */
2170 var uint32_t fn := f_PCUIF_tx_imm_ass_pch(PCU, g_pcu_conn_id, imm_ass, '123459987'H);
2171
2172 timer T := 0.5;
2173 T.start;
2174 alt {
Harald Weltef8df4cb2018-03-10 15:15:08 +01002175 [] L1CTL.receive(tr_L1CTL_DATA_IND(t_RslChanNr_PCH_AGCH(0), ?, imm_ass)) {
Harald Welte883340c2018-02-28 18:59:29 +01002176 /* TODO: verify paging group */
2177 setverdict(pass);
2178 }
2179 [] L1CTL.receive { repeat; }
2180 [] T.timeout {
2181 setverdict(fail, "Timeout waiting for PCU-originated AGCH block on Um");
2182 }
2183 }
2184}
2185
2186/* Send RACH from Um side, expect it to show up on PCU socket */
2187testcase TC_pcu_rach_content() runs on test_CT {
2188 f_init();
2189 f_init_l1ctl();
2190 f_l1_tune(L1CTL);
2191
2192 var GsmFrameNumber fn_last := 0;
2193 for (var integer i := 0; i < 1000; i := i+1) {
2194 var OCT1 ra := f_rnd_ra_ps();
2195 var GsmFrameNumber fn := f_L1CTL_RACH(L1CTL, oct2int(ra));
2196 if (fn == fn_last) {
2197 setverdict(fail, "Two RACH in same FN?!?");
2198 self.stop;
2199 }
2200 fn_last := fn;
2201
2202 timer T := 2.0;
2203 T.start;
2204 alt {
2205 [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RACH_IND(0, oct2int(ra), 0, ?, fn))) {
2206 T.stop;
2207 }
2208 [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RACH_IND)) {
2209 setverdict(fail, "Unexpected RACH IND");
2210 self.stop;
2211 }
2212 [] PCU.receive { repeat; }
2213 [] T.timeout {
2214 setverdict(fail, "Timeout waiting for RACH IND");
2215 self.stop;
2216 }
2217 }
2218 }
2219 setverdict(pass);
2220}
2221
2222private function f_pad_oct(octetstring str, integer len, OCT1 pad) return octetstring {
2223 var integer strlen := lengthof(str);
2224 for (var integer i := 0; i < len-strlen; i := i+1) {
2225 str := str & pad;
2226 }
2227 return str;
2228}
2229
2230/* Send PAGING via RSL, expect it to shw up on PCU socket */
2231testcase TC_pcu_paging_from_rsl() runs on test_CT {
2232 f_init();
2233
2234 for (var integer i := 0; i < 100; i := i+1) {
2235 var MobileL3_CommonIE_Types.MobileIdentityLV mi;
2236 timer T := 3.0;
2237 if (i < 50) {
2238 mi := valueof(ts_MI_TMSI_LV(f_rnd_octstring(4)));
2239 } else {
2240 mi := valueof(ts_MI_IMSI_LV(f_gen_imsi(i)));
2241 }
2242 var octetstring mi_enc_lv := enc_MobileIdentityLV(mi);
2243 var octetstring mi_enc := substr(mi_enc_lv, 1, lengthof(mi_enc_lv)-1);
2244 var octetstring t_mi_lv := f_pad_oct(mi_enc_lv, 9, '00'O);
2245
2246 /* Send RSL PAGING COMMAND */
2247 RSL_CCHAN.send(ts_RSL_UD(ts_RSL_PAGING_CMD(mi_enc, i mod 4)));
2248 T.start;
2249 alt {
2250 [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_PAG_REQ(0, t_mi_lv))) {
2251 }
2252 [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_PAG_REQ)) {
2253 setverdict(fail, "Unexpected PAGING REQ");
2254 self.stop;
2255 }
2256 [] PCU.receive { repeat; }
2257 [] T.timeout {
2258 setverdict(fail, "Timeout waiting for PAGING REQ");
2259 self.stop;
2260 }
2261 }
2262 }
2263 setverdict(pass);
2264}
2265
2266
Harald Welte68e495b2018-02-25 00:05:57 +01002267/* TODO Areas:
2268
2269* channel activation
2270** with BS_Power / MS_Power, bypassing power control loop
2271** on primary vs. secondary TRX
2272** with encryption from initial activation on
2273** with timing advance from initial activation on
2274* mode modify
2275** encryption
2276** multirate
2277* check DEACTIVATE SACCH
2278* encryption command / intricate logic about tx-only/tx+rx/...
2279** unsupported algorithm
2280* handover detection
2281* MS Power Control
2282* BS Power Control
2283* Physical Context
2284* SACCH info modify
Harald Welte68e495b2018-02-25 00:05:57 +01002285* CCCH Load Indication for PCH and RACH
2286* Delete Indication on AGCH overflow
2287* SMS Broadcast Req / Cmd / CBCH LOad Ind
2288* RF resource ind
Harald Welte68e495b2018-02-25 00:05:57 +01002289* error handling
2290* discriminator error
2291** type error
2292** sequence error
2293** IE duplicated?
Harald Welte883340c2018-02-28 18:59:29 +01002294* PCU interface
2295** TIME_IND from BTS->PCU
2296** DATA_IND from BTS->PCU
2297** verification of PCU-originated DATA_REQ arrival on Um/MS side
Harald Welte68e495b2018-02-25 00:05:57 +01002298
2299*/
Harald Welte70767382018-02-21 12:16:40 +01002300
2301control {
2302 execute( TC_chan_act_stress() );
2303 execute( TC_chan_act_react() );
2304 execute( TC_chan_deact_not_active() );
2305 execute( TC_chan_act_wrong_nr() );
Harald Welte8c24c2b2018-02-26 08:31:31 +01002306 execute( TC_rach_content() );
2307 execute( TC_rach_count() );
Harald Welte54a2a2d2018-02-26 09:14:05 +01002308 execute( TC_rach_max_ta() );
Harald Welte70767382018-02-21 12:16:40 +01002309 execute( TC_meas_res_sign_tchf() );
2310 execute( TC_meas_res_sign_tchh() );
2311 execute( TC_meas_res_sign_sdcch4() );
2312 execute( TC_meas_res_sign_sdcch8() );
Harald Welte685d5982018-02-27 20:42:05 +01002313 execute( TC_meas_res_sign_tchh_toa256() );
Harald Welte70767382018-02-21 12:16:40 +01002314 execute( TC_conn_fail_crit() );
Harald Welte68e495b2018-02-25 00:05:57 +01002315 execute( TC_paging_imsi_80percent() );
2316 execute( TC_paging_tmsi_80percent() );
2317 execute( TC_paging_imsi_200percent() );
2318 execute( TC_paging_tmsi_200percent() );
Harald Welte01d982c2018-02-25 01:31:40 +01002319 execute( TC_rsl_protocol_error() );
2320 execute( TC_rsl_mand_ie_error() );
2321 execute( TC_rsl_ie_content_error() );
Harald Welte48494ca2018-02-25 16:59:50 +01002322 execute( TC_si_sched_default() );
Harald Welte0cae4552018-03-09 22:20:26 +01002323 execute( TC_si_sched_1() );
Harald Welte48494ca2018-02-25 16:59:50 +01002324 execute( TC_si_sched_2bis() );
2325 execute( TC_si_sched_2ter() );
2326 execute( TC_si_sched_2ter_2bis() );
2327 execute( TC_si_sched_2quater() );
2328 execute( TC_si_sched_13() );
2329 execute( TC_si_sched_13_2bis_2ter_2quater() );
Harald Weltea871a382018-02-25 02:03:14 +01002330 execute( TC_ipa_dlcx_not_active() );
Harald Weltea3f1df92018-02-25 12:49:55 +01002331 execute( TC_ipa_crcx_twice_not_active() );
2332 execute( TC_ipa_crcx_mdcx_dlcx_not_active() );
Harald Welte3ae11da2018-02-25 13:36:06 +01002333 execute( TC_ipa_crcx_mdcx_mdcx_dlcx_not_active() );
Harald Welte9912eb52018-02-25 13:30:15 +01002334 execute( TC_ipa_crcx_sdcch_not_active() );
Harald Welte883340c2018-02-28 18:59:29 +01002335
2336 execute( TC_pcu_act_req() );
2337 execute( TC_pcu_act_req_wrong_ts() );
2338 execute( TC_pcu_act_req_wrong_bts() );
2339 execute( TC_pcu_act_req_wrong_trx() );
2340 execute( TC_pcu_deact_req() );
2341 execute( TC_pcu_deact_req_wrong_ts() );
2342 execute( TC_pcu_ver_si13() );
2343 execute( TC_pcu_data_req_wrong_bts() );
2344 execute( TC_pcu_data_req_wrong_trx() );
2345 execute( TC_pcu_data_req_wrong_ts() );
2346 execute( TC_pcu_data_req_ts_inactive() );
2347 execute( TC_pcu_data_req_pdtch() );
2348 execute( TC_pcu_data_req_ptcch() );
2349 execute( TC_pcu_data_req_agch() );
2350 execute( TC_pcu_data_req_imm_ass_pch() );
2351 execute( TC_pcu_rach_content() );
2352 execute( TC_pcu_paging_from_rsl() );
Harald Welte70767382018-02-21 12:16:40 +01002353}
2354
2355
2356}