blob: 36db22502ac7b531359629a6eba8a875dc36e8a9 [file] [log] [blame]
Harald Welte9fbcf4b2018-12-07 07:56:52 +01001module PCU_Tests_RAW {
2
3/* "RAW" PCU tests: Talk directly to the PCU socket of OsmoPCU on the one hand side (emulating
4 the BTS/BSC side PCU socket server) and the Gb interface on the other hand side. No NS/BSSGP
5 Emulation is used; rather, we simply use the NS_CodecPort to implement both standard and non-
6 standard procedures on the NS and BSSGP level. The goal of these tests is to test exactly
7 those NS and BSSGP implementations on the BSS (PCU) side. */
8
Harald Welte34b5a952019-05-27 11:54:11 +02009/* (C) 2018-2019 Harald Welte <laforge@gnumonks.org>
10 * All rights reserved.
11 *
12 * Released under the terms of GNU General Public License, Version 2 or
13 * (at your option) any later version.
14 *
15 * SPDX-License-Identifier: GPL-2.0-or-later
16 */
17
Harald Welte9fbcf4b2018-12-07 07:56:52 +010018import from General_Types all;
19import from Osmocom_Types all;
Harald Welte7fd25cf2019-03-21 22:14:02 +010020import from GSM_Types all;
21import from GSM_RR_Types all;
22
Harald Welte9fbcf4b2018-12-07 07:56:52 +010023import from NS_Types all;
24import from BSSGP_Types all;
25import from Osmocom_Gb_Types all;
26
27import from BSSGP_Emulation all; /* BssgpConfig */
28import from NS_Emulation all; /* NSConfiguration */
29
30import from UD_Types all;
31import from PCUIF_Types all;
32import from PCUIF_CodecPort all;
33import from IPL4asp_Types all;
34import from NS_CodecPort all;
35import from NS_CodecPort_CtrlFunct all;
36import from Native_Functions all;
37import from PCU_Tests all;
38
39modulepar {
40 charstring mp_pcu_sock_path := PCU_SOCK_DEFAULT;
41}
42
43type component RAW_NS_CT {
44 /* UDP port towards the bottom (IUT) */
Harald Weltebf768242019-02-21 22:19:21 +010045 port NS_CODEC_PT NSCP[4];
46 var ConnectionId g_ns_conn_id[4] := {-1, -1, -1, -1};
47 var NSConfiguration g_nsconfig[4];
Harald Welte9fbcf4b2018-12-07 07:56:52 +010048 timer g_T_guard;
Harald Welteea3c7e92019-03-01 19:34:55 +010049}
Harald Welte9fbcf4b2018-12-07 07:56:52 +010050
Harald Welteea3c7e92019-03-01 19:34:55 +010051type component RAW_PCU_CT {
Harald Welte9fbcf4b2018-12-07 07:56:52 +010052 /* PCUIF (we emulate the BTS part) */
53 port PCUIF_CODEC_PT PCU;
54 var ConnectionId g_pcu_conn_id := -1;
55}
56
Harald Welteea3c7e92019-03-01 19:34:55 +010057type component RAW_Test_CT extends RAW_NS_CT, RAW_PCU_CT {
58}
59
Harald Welte9fbcf4b2018-12-07 07:56:52 +010060private altstep as_Tguard() runs on RAW_NS_CT {
61 [] g_T_guard.timeout {
62 setverdict(fail, "Timeout of T_guard");
63 mtc.stop;
64 }
65}
66
Harald Welteea3c7e92019-03-01 19:34:55 +010067function f_init_pcuif() runs on RAW_PCU_CT {
Harald Welte9fbcf4b2018-12-07 07:56:52 +010068 map(self:PCU, system:PCU);
69
70 /* Connect the Unix Domain Socket */
71 g_pcu_conn_id := f_pcuif_listen(PCU, mp_pcu_sock_path);
72 PCU.receive(UD_connected:?);
73
74 /* Wait for PCU_VERSION and return INFO_IND */
75 PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_TXT_IND(0, PCU_VERSION, ?)));
76 /* FIXME: make sure to use parameters from mp_gb_cfg.cell_id in the PCU INFO IND */
77 var template PCUIF_Message info_ind := ts_PCUIF_INFO_IND(bts_nr := 0,
78 nsei := mp_nsconfig.nsei,
79 nsvci := mp_nsconfig.nsvci,
80 bvci := mp_gb_cfg.bvci,
81 local_port := mp_nsconfig.remote_udp_port,
82 remote_port := mp_nsconfig.local_udp_port,
83 remote_ip := f_inet_haddr(mp_nsconfig.local_ip)
84 );
85 PCU.send(t_SD_PCUIF(g_pcu_conn_id, info_ind));
86}
87
Harald Welte0466d162019-03-21 21:30:21 +010088function f_pcuif_tx(template (value) PCUIF_Message msg) runs on RAW_PCU_CT {
89 PCU.send(t_SD_PCUIF(g_pcu_conn_id, msg));
90}
91
Harald Weltebf768242019-02-21 22:19:21 +010092function f_init_ns_codec(integer idx := 0, float guard_secs := 60.0) runs on RAW_NS_CT {
Harald Welte9fbcf4b2018-12-07 07:56:52 +010093 var Result res;
Harald Weltebf768242019-02-21 22:19:21 +010094
95 if (not g_T_guard.running) {
96 g_T_guard.start(guard_secs);
97 activate(as_Tguard());
98 }
99
100 if (not isbound(g_nsconfig) or not isbound(g_nsconfig[idx])) {
101 /* copy most parts from mp_nsconfig */
102 g_nsconfig[idx] := mp_nsconfig;
103 /* adjust those parts different for each NS-VC */
104 g_nsconfig[idx].nsvci := mp_nsconfig.nsvci + idx;
105 g_nsconfig[idx].local_udp_port := mp_nsconfig.local_udp_port + idx;
106 }
107
108 map(self:NSCP[idx], system:NSCP);
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100109 /* Connect the UDP socket */
Harald Weltebf768242019-02-21 22:19:21 +0100110 log("connecting NSCP[", idx, "] to ", g_nsconfig[idx]);
111 res := f_IPL4_connect(NSCP[idx], g_nsconfig[idx].remote_ip, g_nsconfig[idx].remote_udp_port,
112 g_nsconfig[idx].local_ip, g_nsconfig[idx].local_udp_port, 0, { udp := {}});
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100113 if (not ispresent(res.connId)) {
Harald Weltebf768242019-02-21 22:19:21 +0100114 setverdict(fail, "Could not connect NS UDP socket, check your configuration ", g_nsconfig[idx]);
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100115 mtc.stop;
116 }
Harald Weltebf768242019-02-21 22:19:21 +0100117 g_ns_conn_id[idx] := res.connId;
118
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100119}
120
Harald Weltebf768242019-02-21 22:19:21 +0100121function f_ns_exp(template PDU_NS exp_rx, integer idx := 0) runs on RAW_NS_CT return PDU_NS {
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100122 var NS_RecvFrom nrf;
123 log("f_ns_exp() expecting ", exp_rx);
124 alt {
Harald Weltebf768242019-02-21 22:19:21 +0100125 [] NSCP[idx].receive(t_NS_RecvFrom(exp_rx)) -> value nrf { }
126 [] NSCP[idx].receive {
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100127 setverdict(fail, "Received unexpected NS: ", nrf);
128 mtc.stop;
129 }
130 }
131 return nrf.msg;
132}
133
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100134/* perform outbound NS-ALIVE procedure */
Harald Weltebf768242019-02-21 22:19:21 +0100135function f_outgoing_ns_alive(integer idx := 0) runs on RAW_NS_CT {
136 NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], t_NS_ALIVE));
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100137 alt {
Harald Weltebf768242019-02-21 22:19:21 +0100138 [] NSCP[idx].receive(t_NS_RecvFrom(t_NS_ALIVE_ACK));
139 [] NSCP[idx].receive { repeat; }
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100140 }
141}
142
Harald Welteecd159e2019-03-16 13:36:07 +0100143/* perform outbound NS-ALIVE procedure */
144function f_outgoing_ns_alive_no_ack(integer idx := 0, float tout := 10.0) runs on RAW_NS_CT {
145 timer T := tout;
146 NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], t_NS_ALIVE));
147 T.start;
148 alt {
149 [] NSCP[idx].receive(t_NS_RecvFrom(t_NS_ALIVE_ACK)) {
150 setverdict(fail, "Received unexpected NS-ALIVE ACK");
151 }
152 [] NSCP[idx].receive { repeat; }
153 [] T.timeout {
154 setverdict(pass);
155 }
156 }
157}
158
159/* ensure no matching message is received within 'tout' */
160function f_ensure_no_ns(template PDU_NS ns := ?, integer idx := 0, float tout := 3.0)
161runs on RAW_Test_CT {
162 timer T := tout;
163 T.start;
164 alt {
165 [] NSCP[idx].receive(t_NS_RecvFrom(ns)) {
166 setverdict(fail, "NS-ALIVE from unconfigured (possibly initial) endpoint");
167 }
168 [] T.timeout {
169 setverdict(pass);
170 }
171 }
172}
173
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100174/* perform outbound NS-BLOCK procedure */
Harald Weltebf768242019-02-21 22:19:21 +0100175function f_outgoing_ns_block(NsCause cause, integer idx := 0) runs on RAW_NS_CT {
176 NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_NS_BLOCK(cause, g_nsconfig[idx].nsvci)));
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100177 alt {
Harald Weltebf768242019-02-21 22:19:21 +0100178 [] NSCP[idx].receive(t_NS_RecvFrom(tr_NS_BLOCK_ACK(g_nsconfig[idx].nsvci)));
179 [] NSCP[idx].receive { repeat; }
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100180 }
181}
182
183/* receive NS-ALIVE and ACK it */
Harald Weltebf768242019-02-21 22:19:21 +0100184altstep as_rx_alive_tx_ack(boolean oneshot := false, integer idx := 0) runs on RAW_NS_CT {
185 [] NSCP[idx].receive(t_NS_RecvFrom(t_NS_ALIVE)) {
186 NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], t_NS_ALIVE_ACK));
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100187 if (not oneshot) { repeat; }
188 }
189}
190
Harald Welte64d07312019-03-20 09:48:39 +0100191/* Transmit BSSGP RESET for given BVCI and expect ACK */
192function f_tx_bvc_reset_rx_ack(BssgpBvci bvci, integer idx := 0, boolean exp_ack := true)
193runs on RAW_NS_CT {
194 var PDU_BSSGP bssgp_tx := valueof(ts_BVC_RESET(BSSGP_CAUSE_NET_SV_CAP_MOD_GT_ZERO_KBPS, bvci,
195 mp_gb_cfg.cell_id));
196 timer T := 5.0;
197 NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_NS_UNITDATA(t_SduCtrlB, 0, enc_PDU_BSSGP(bssgp_tx))));
198 T.start;
199 alt {
200 [exp_ack] NSCP[idx].receive(t_NS_RecvFrom(tr_NS_UNITDATA(t_SduCtrlB, 0,
201 decmatch tr_BVC_RESET_ACK(bvci, ?)))) {
202 setverdict(pass);
203 }
204 [exp_ack] T.timeout {
205 setverdict(fail, "No response to BVC-RESET");
206 }
207 [not exp_ack] T.timeout {
208 setverdict(pass);
209 }
210 [] NSCP[idx].receive { repeat; }
211 }
212}
213
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100214/* Receive a BSSGP RESET for given BVCI and ACK it */
Harald Weltebf768242019-02-21 22:19:21 +0100215altstep as_rx_bvc_reset_tx_ack(BssgpBvci bvci, boolean oneshot := false, integer idx := 0) runs on RAW_NS_CT {
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100216 var NS_RecvFrom ns_rf;
217 /* FIXME: nail down received cell_id in match */
Harald Weltebf768242019-02-21 22:19:21 +0100218 [] NSCP[idx].receive(t_NS_RecvFrom(tr_NS_UNITDATA(t_SduCtrlB, 0,
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100219 decmatch tr_BVC_RESET(?, bvci, ?))))
220 -> value ns_rf {
221 var PDU_BSSGP bssgp_rx := dec_PDU_BSSGP(ns_rf.msg.pDU_NS_Unitdata.nS_SDU);
222 var PDU_BSSGP bssgp_tx := valueof(ts_BVC_RESET_ACK(bvci, mp_gb_cfg.cell_id));
Harald Weltebf768242019-02-21 22:19:21 +0100223 NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_NS_UNITDATA(t_SduCtrlB, 0, enc_PDU_BSSGP(bssgp_tx))));
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100224 if (not oneshot) { repeat; }
225 }
226}
227
228
229/* Receive a BSSGP UNBLOCK for given BVCI and ACK it */
Harald Weltebf768242019-02-21 22:19:21 +0100230altstep as_rx_bvc_unblock_tx_ack(BssgpBvci bvci, boolean oneshot := false, integer idx := 0) runs on RAW_NS_CT {
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100231 var NS_RecvFrom ns_rf;
Harald Weltebf768242019-02-21 22:19:21 +0100232 [] NSCP[idx].receive(t_NS_RecvFrom(tr_NS_UNITDATA(t_SduCtrlB, 0,
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100233 decmatch t_BVC_UNBLOCK(bvci))))
234 -> value ns_rf {
235 var PDU_BSSGP bssgp_rx := dec_PDU_BSSGP(ns_rf.msg.pDU_NS_Unitdata.nS_SDU);
236 var PDU_BSSGP bssgp_tx := valueof(t_BVC_UNBLOCK_ACK(bvci));
Harald Weltebf768242019-02-21 22:19:21 +0100237 NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_NS_UNITDATA(t_SduCtrlB, 0, enc_PDU_BSSGP(bssgp_tx))));
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100238 if (not oneshot) { repeat; }
239 }
240}
241
242/* Receive a BSSGP FLOW-CONTROL-BVC and ACK it */
Harald Weltebf768242019-02-21 22:19:21 +0100243altstep as_rx_bvc_fc_tx_ack(BssgpBvci bvci, boolean oneshot := false, integer idx := 0) runs on RAW_NS_CT {
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100244 var NS_RecvFrom ns_rf;
Harald Weltebf768242019-02-21 22:19:21 +0100245 [] NSCP[idx].receive(t_NS_RecvFrom(tr_NS_UNITDATA(t_SduCtrlB, bvci,
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100246 decmatch tr_BVC_FC_BVC)))
247 -> value ns_rf {
248 var PDU_BSSGP bssgp_rx := dec_PDU_BSSGP(ns_rf.msg.pDU_NS_Unitdata.nS_SDU);
249 var OCT1 tag := bssgp_rx.pDU_BSSGP_FLOW_CONTROL_BVC.tag.unstructured_Value;
250 var PDU_BSSGP bssgp_tx := valueof(t_BVC_FC_BVC_ACK(tag));
Harald Weltebf768242019-02-21 22:19:21 +0100251 NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_NS_UNITDATA(t_SduCtrlB, bvci, enc_PDU_BSSGP(bssgp_tx))));
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100252 if (not oneshot) { repeat; }
253 }
254}
255
256/**********************************************************************************
257 * Classic Gb/IP bring-up test cases using NS-{RESET,BLOCK,UNBLOCK} and no IP-SNS *
258 **********************************************************************************/
259
260/* Receive a NS-RESET and ACK it */
Harald Weltebf768242019-02-21 22:19:21 +0100261private altstep as_rx_ns_reset_ack(boolean oneshot := false, integer idx := 0) runs on RAW_NS_CT {
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100262 var NS_RecvFrom ns_rf;
Harald Weltebf768242019-02-21 22:19:21 +0100263 [] NSCP[idx].receive(t_NS_RecvFrom(tr_NS_RESET(NS_CAUSE_OM_INTERVENTION, g_nsconfig[idx].nsvci,
264 g_nsconfig[idx].nsei))) -> value ns_rf {
265 NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_NS_RESET_ACK(g_nsconfig[idx].nsvci,
266 g_nsconfig[idx].nsei)));
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100267 if (not oneshot) { repeat; }
268 }
269}
270/* Receive a NS-UNBLOCK and ACK it */
Harald Weltebf768242019-02-21 22:19:21 +0100271private altstep as_rx_ns_unblock_ack(boolean oneshot := false, integer idx := 0) runs on RAW_NS_CT {
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100272 var NS_RecvFrom ns_rf;
Harald Weltebf768242019-02-21 22:19:21 +0100273 [] NSCP[idx].receive(t_NS_RecvFrom(t_NS_UNBLOCK)) -> value ns_rf {
274 NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], t_NS_UNBLOCK_ACK));
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100275 if (not oneshot) { repeat; }
276 }
277}
278
279/* test the NS-RESET procedure */
Harald Welteea3c7e92019-03-01 19:34:55 +0100280testcase TC_ns_reset() runs on RAW_Test_CT {
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100281 f_init_ns_codec();
282 f_init_pcuif();
283
284
285 /* Expect inbound NS-RESET procedure */
286 as_rx_ns_reset_ack(oneshot := true);
287 setverdict(pass);
288}
289
290/* ensure NS-RESET are re-transmitted */
Harald Welteea3c7e92019-03-01 19:34:55 +0100291testcase TC_ns_reset_retrans() runs on RAW_Test_CT {
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100292 f_init_ns_codec();
293 f_init_pcuif();
294
295 var integer i;
296 for (i := 0; i < 3; i := i+1) {
Harald Weltebf768242019-02-21 22:19:21 +0100297 NSCP[0].receive(t_NS_RecvFrom(tr_NS_RESET(NS_CAUSE_OM_INTERVENTION,
298 g_nsconfig[0].nsvci, g_nsconfig[0].nsei)));
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100299 }
300
301 /* Expect inbound NS-RESET procedure */
302 as_rx_ns_reset_ack(oneshot := true);
303 setverdict(pass);
304}
305
306/* test the inbound NS-ALIVE procedure after NS-RESET */
Harald Welteea3c7e92019-03-01 19:34:55 +0100307testcase TC_ns_alive() runs on RAW_Test_CT {
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100308 f_init_ns_codec();
309 f_init_pcuif();
310
311 /* Expect inbound NS-RESET procedure */
312 as_rx_ns_reset_ack(oneshot := true);
313
314 /* wait for one ALIVE cycle, then ACK any further ALIVE in the background */
315 as_rx_alive_tx_ack(oneshot := true);
316 setverdict(pass);
317}
318
319/* Test for NS-RESET after NS-ALIVE timeout */
Harald Welteea3c7e92019-03-01 19:34:55 +0100320testcase TC_ns_alive_timeout_reset() runs on RAW_Test_CT {
Harald Weltebf768242019-02-21 22:19:21 +0100321 f_init_ns_codec(guard_secs := 100.0);
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100322 f_init_pcuif();
323
324 /* Expect inbound NS-RESET procedure */
325 as_rx_ns_reset_ack(oneshot := true);
326
327 /* wait for at least one NS-ALIVE */
Harald Weltebf768242019-02-21 22:19:21 +0100328 NSCP[0].receive(t_NS_RecvFrom(t_NS_ALIVE));
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100329
330 /* wait for NS-RESET to re-appear, ignoring any NS-ALIVE until then */
331 alt {
332 [] as_rx_ns_reset_ack(oneshot := true) { setverdict(pass); }
Harald Weltebf768242019-02-21 22:19:21 +0100333 [] NSCP[0].receive(t_NS_RecvFrom(t_NS_ALIVE)) { repeat; }
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100334 }
335}
336
337/* test for NS-RESET/NS-ALIVE/NS-UNBLOCK */
Harald Welteea3c7e92019-03-01 19:34:55 +0100338testcase TC_ns_unblock() runs on RAW_Test_CT {
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100339 f_init_ns_codec();
340 f_init_pcuif();
341
342 /* Expect inbound NS-RESET procedure */
343 as_rx_ns_reset_ack(oneshot := true);
344
345 /* wait for one ALIVE cycle, then ACK any further ALIVE in the background */
346 as_rx_alive_tx_ack(oneshot := true);
347 activate(as_rx_alive_tx_ack());
348
349 as_rx_ns_unblock_ack(oneshot := true);
350 setverdict(pass);
351}
352
353/* test for NS-UNBLOCK re-transmissions */
Harald Welteea3c7e92019-03-01 19:34:55 +0100354testcase TC_ns_unblock_retrans() runs on RAW_Test_CT {
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100355 f_init_ns_codec();
356 f_init_pcuif();
357
358 /* Expect inbound NS-RESET procedure */
359 as_rx_ns_reset_ack(oneshot := true);
360
361 /* wait for one ALIVE cycle, then ACK any further ALIVE in the background */
362 as_rx_alive_tx_ack(oneshot := true);
363 activate(as_rx_alive_tx_ack());
364
365 /* wait for first NS-UNBLOCK, don't respond */
Harald Weltebf768242019-02-21 22:19:21 +0100366 NSCP[0].receive(t_NS_RecvFrom(t_NS_UNBLOCK));
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100367
368 /* wait for re-transmission of NS-UNBLOCK */
369 as_rx_ns_unblock_ack(oneshot := true);
370 setverdict(pass);
371}
372
373/* full bring-up of the Gb link for NS and BSSGP layer up to BVC-FC */
Harald Welteea3c7e92019-03-01 19:34:55 +0100374testcase TC_ns_full_bringup() runs on RAW_Test_CT {
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100375 f_init_ns_codec();
376 f_init_pcuif();
377
378 /* Expect inbound NS-RESET procedure */
379 as_rx_ns_reset_ack(oneshot := true);
380
381 /* wait for one ALIVE cycle, then ACK any further ALIVE in the background */
382 as_rx_alive_tx_ack(oneshot := true);
383 activate(as_rx_alive_tx_ack());
384
385 as_rx_ns_unblock_ack(oneshot := true);
386
387 f_outgoing_ns_alive();
388
389 /* Expect BVC-RESET for signaling (0) and ptp BVCI */
390 as_rx_bvc_reset_tx_ack(0, oneshot := true);
391 as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvci, oneshot := true);
392 as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvci, oneshot := true);
393
394 /* wait for one FLOW-CONTROL BVC and then ACK any further in the future */
395 as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvci, oneshot := true);
396 activate(as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvci));
397 setverdict(pass);
398}
399
400/* test outbound (SGSN-originated) NS-BLOCK procedure */
Harald Welteea3c7e92019-03-01 19:34:55 +0100401testcase TC_ns_so_block() runs on RAW_Test_CT {
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100402 f_init_ns_codec();
403 f_init_pcuif();
404
405 /* Expect inbound NS-RESET procedure */
406 as_rx_ns_reset_ack(oneshot := true);
407
408 /* wait for one ALIVE cycle, then ACK any further ALIVE in the background */
409 as_rx_alive_tx_ack(oneshot := true);
410 activate(as_rx_alive_tx_ack());
411
412 as_rx_ns_unblock_ack(oneshot := true);
413
414 f_outgoing_ns_alive();
415
416 f_outgoing_ns_block(NS_CAUSE_EQUIPMENT_FAILURE);
417 setverdict(pass);
418}
419
Harald Welte7fd25cf2019-03-21 22:14:02 +0100420/* Test component with PCUIF + BSSGP/NS Emulation (no L1CTL) */
421type component bssgp_pcuif_CT extends bssgp_CT, RAW_PCU_CT {
422}
423
424testcase TC_pcuif_suspend() runs on bssgp_pcuif_CT {
425 var OCT6 ra_id := enc_RoutingAreaIdentification(mp_gb_cfg.cell_id.ra_id);
426 var GprsTlli tlli := 'FFFFFFFF'O;
427
428 /* Initialize PCU interface side */
429 f_init_pcuif();
430
431 /* Initialize NS/BSSGP side */
432 f_init_bssgp();
433
434 f_sleep(1.0);
435 f_pcuif_tx(ts_PCUIF_SUSP_REQ(0, tlli, ra_id, 0));
436 BSSGP_SIG[0].receive(tr_BD_BSSGP(tr_BSSGP_SUSPEND(tlli, mp_gb_cfg.cell_id.ra_id)));
437
438 setverdict(pass);
439}
440
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100441
442control {
443 execute( TC_ns_reset() );
444 execute( TC_ns_reset_retrans() );
445 execute( TC_ns_alive() );
446 execute( TC_ns_alive_timeout_reset() );
447 execute( TC_ns_unblock() );
448 execute( TC_ns_unblock_retrans() );
449 execute( TC_ns_full_bringup() );
450 execute( TC_ns_so_block() );
Harald Welte7fd25cf2019-03-21 22:14:02 +0100451
452 execute( TC_pcuif_suspend() );
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100453}
454
455
456
457
458
459
460}