blob: 96a3f862101c4d630ef99a0e5bc73eb5a1b2fa12 [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
9import from General_Types all;
10import from Osmocom_Types all;
Harald Welte7fd25cf2019-03-21 22:14:02 +010011import from GSM_Types all;
12import from GSM_RR_Types all;
13
Harald Welte9fbcf4b2018-12-07 07:56:52 +010014import from NS_Types all;
15import from BSSGP_Types all;
16import from Osmocom_Gb_Types all;
17
18import from BSSGP_Emulation all; /* BssgpConfig */
19import from NS_Emulation all; /* NSConfiguration */
20
21import from UD_Types all;
22import from PCUIF_Types all;
23import from PCUIF_CodecPort all;
24import from IPL4asp_Types all;
25import from NS_CodecPort all;
26import from NS_CodecPort_CtrlFunct all;
27import from Native_Functions all;
28import from PCU_Tests all;
29
30modulepar {
31 charstring mp_pcu_sock_path := PCU_SOCK_DEFAULT;
32}
33
34type component RAW_NS_CT {
35 /* UDP port towards the bottom (IUT) */
Harald Weltebf768242019-02-21 22:19:21 +010036 port NS_CODEC_PT NSCP[4];
37 var ConnectionId g_ns_conn_id[4] := {-1, -1, -1, -1};
38 var NSConfiguration g_nsconfig[4];
Harald Welte9fbcf4b2018-12-07 07:56:52 +010039 timer g_T_guard;
Harald Welteea3c7e92019-03-01 19:34:55 +010040}
Harald Welte9fbcf4b2018-12-07 07:56:52 +010041
Harald Welteea3c7e92019-03-01 19:34:55 +010042type component RAW_PCU_CT {
Harald Welte9fbcf4b2018-12-07 07:56:52 +010043 /* PCUIF (we emulate the BTS part) */
44 port PCUIF_CODEC_PT PCU;
45 var ConnectionId g_pcu_conn_id := -1;
46}
47
Harald Welteea3c7e92019-03-01 19:34:55 +010048type component RAW_Test_CT extends RAW_NS_CT, RAW_PCU_CT {
49}
50
Harald Welte9fbcf4b2018-12-07 07:56:52 +010051private altstep as_Tguard() runs on RAW_NS_CT {
52 [] g_T_guard.timeout {
53 setverdict(fail, "Timeout of T_guard");
54 mtc.stop;
55 }
56}
57
Harald Welteea3c7e92019-03-01 19:34:55 +010058function f_init_pcuif() runs on RAW_PCU_CT {
Harald Welte9fbcf4b2018-12-07 07:56:52 +010059 map(self:PCU, system:PCU);
60
61 /* Connect the Unix Domain Socket */
62 g_pcu_conn_id := f_pcuif_listen(PCU, mp_pcu_sock_path);
63 PCU.receive(UD_connected:?);
64
65 /* Wait for PCU_VERSION and return INFO_IND */
66 PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_TXT_IND(0, PCU_VERSION, ?)));
67 /* FIXME: make sure to use parameters from mp_gb_cfg.cell_id in the PCU INFO IND */
68 var template PCUIF_Message info_ind := ts_PCUIF_INFO_IND(bts_nr := 0,
69 nsei := mp_nsconfig.nsei,
70 nsvci := mp_nsconfig.nsvci,
71 bvci := mp_gb_cfg.bvci,
72 local_port := mp_nsconfig.remote_udp_port,
73 remote_port := mp_nsconfig.local_udp_port,
74 remote_ip := f_inet_haddr(mp_nsconfig.local_ip)
75 );
76 PCU.send(t_SD_PCUIF(g_pcu_conn_id, info_ind));
77}
78
Harald Welte0466d162019-03-21 21:30:21 +010079function f_pcuif_tx(template (value) PCUIF_Message msg) runs on RAW_PCU_CT {
80 PCU.send(t_SD_PCUIF(g_pcu_conn_id, msg));
81}
82
Harald Weltebf768242019-02-21 22:19:21 +010083function f_init_ns_codec(integer idx := 0, float guard_secs := 60.0) runs on RAW_NS_CT {
Harald Welte9fbcf4b2018-12-07 07:56:52 +010084 var Result res;
Harald Weltebf768242019-02-21 22:19:21 +010085
86 if (not g_T_guard.running) {
87 g_T_guard.start(guard_secs);
88 activate(as_Tguard());
89 }
90
91 if (not isbound(g_nsconfig) or not isbound(g_nsconfig[idx])) {
92 /* copy most parts from mp_nsconfig */
93 g_nsconfig[idx] := mp_nsconfig;
94 /* adjust those parts different for each NS-VC */
95 g_nsconfig[idx].nsvci := mp_nsconfig.nsvci + idx;
96 g_nsconfig[idx].local_udp_port := mp_nsconfig.local_udp_port + idx;
97 }
98
99 map(self:NSCP[idx], system:NSCP);
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100100 /* Connect the UDP socket */
Harald Weltebf768242019-02-21 22:19:21 +0100101 log("connecting NSCP[", idx, "] to ", g_nsconfig[idx]);
102 res := f_IPL4_connect(NSCP[idx], g_nsconfig[idx].remote_ip, g_nsconfig[idx].remote_udp_port,
103 g_nsconfig[idx].local_ip, g_nsconfig[idx].local_udp_port, 0, { udp := {}});
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100104 if (not ispresent(res.connId)) {
Harald Weltebf768242019-02-21 22:19:21 +0100105 setverdict(fail, "Could not connect NS UDP socket, check your configuration ", g_nsconfig[idx]);
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100106 mtc.stop;
107 }
Harald Weltebf768242019-02-21 22:19:21 +0100108 g_ns_conn_id[idx] := res.connId;
109
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100110}
111
Harald Weltebf768242019-02-21 22:19:21 +0100112function 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 +0100113 var NS_RecvFrom nrf;
114 log("f_ns_exp() expecting ", exp_rx);
115 alt {
Harald Weltebf768242019-02-21 22:19:21 +0100116 [] NSCP[idx].receive(t_NS_RecvFrom(exp_rx)) -> value nrf { }
117 [] NSCP[idx].receive {
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100118 setverdict(fail, "Received unexpected NS: ", nrf);
119 mtc.stop;
120 }
121 }
122 return nrf.msg;
123}
124
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100125/* perform outbound NS-ALIVE procedure */
Harald Weltebf768242019-02-21 22:19:21 +0100126function f_outgoing_ns_alive(integer idx := 0) runs on RAW_NS_CT {
127 NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], t_NS_ALIVE));
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100128 alt {
Harald Weltebf768242019-02-21 22:19:21 +0100129 [] NSCP[idx].receive(t_NS_RecvFrom(t_NS_ALIVE_ACK));
130 [] NSCP[idx].receive { repeat; }
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100131 }
132}
133
Harald Welteecd159e2019-03-16 13:36:07 +0100134/* perform outbound NS-ALIVE procedure */
135function f_outgoing_ns_alive_no_ack(integer idx := 0, float tout := 10.0) runs on RAW_NS_CT {
136 timer T := tout;
137 NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], t_NS_ALIVE));
138 T.start;
139 alt {
140 [] NSCP[idx].receive(t_NS_RecvFrom(t_NS_ALIVE_ACK)) {
141 setverdict(fail, "Received unexpected NS-ALIVE ACK");
142 }
143 [] NSCP[idx].receive { repeat; }
144 [] T.timeout {
145 setverdict(pass);
146 }
147 }
148}
149
150/* ensure no matching message is received within 'tout' */
151function f_ensure_no_ns(template PDU_NS ns := ?, integer idx := 0, float tout := 3.0)
152runs on RAW_Test_CT {
153 timer T := tout;
154 T.start;
155 alt {
156 [] NSCP[idx].receive(t_NS_RecvFrom(ns)) {
157 setverdict(fail, "NS-ALIVE from unconfigured (possibly initial) endpoint");
158 }
159 [] T.timeout {
160 setverdict(pass);
161 }
162 }
163}
164
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100165/* perform outbound NS-BLOCK procedure */
Harald Weltebf768242019-02-21 22:19:21 +0100166function f_outgoing_ns_block(NsCause cause, integer idx := 0) runs on RAW_NS_CT {
167 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 +0100168 alt {
Harald Weltebf768242019-02-21 22:19:21 +0100169 [] NSCP[idx].receive(t_NS_RecvFrom(tr_NS_BLOCK_ACK(g_nsconfig[idx].nsvci)));
170 [] NSCP[idx].receive { repeat; }
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100171 }
172}
173
174/* receive NS-ALIVE and ACK it */
Harald Weltebf768242019-02-21 22:19:21 +0100175altstep as_rx_alive_tx_ack(boolean oneshot := false, integer idx := 0) runs on RAW_NS_CT {
176 [] NSCP[idx].receive(t_NS_RecvFrom(t_NS_ALIVE)) {
177 NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], t_NS_ALIVE_ACK));
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100178 if (not oneshot) { repeat; }
179 }
180}
181
Harald Welte64d07312019-03-20 09:48:39 +0100182/* Transmit BSSGP RESET for given BVCI and expect ACK */
183function f_tx_bvc_reset_rx_ack(BssgpBvci bvci, integer idx := 0, boolean exp_ack := true)
184runs on RAW_NS_CT {
185 var PDU_BSSGP bssgp_tx := valueof(ts_BVC_RESET(BSSGP_CAUSE_NET_SV_CAP_MOD_GT_ZERO_KBPS, bvci,
186 mp_gb_cfg.cell_id));
187 timer T := 5.0;
188 NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_NS_UNITDATA(t_SduCtrlB, 0, enc_PDU_BSSGP(bssgp_tx))));
189 T.start;
190 alt {
191 [exp_ack] NSCP[idx].receive(t_NS_RecvFrom(tr_NS_UNITDATA(t_SduCtrlB, 0,
192 decmatch tr_BVC_RESET_ACK(bvci, ?)))) {
193 setverdict(pass);
194 }
195 [exp_ack] T.timeout {
196 setverdict(fail, "No response to BVC-RESET");
197 }
198 [not exp_ack] T.timeout {
199 setverdict(pass);
200 }
201 [] NSCP[idx].receive { repeat; }
202 }
203}
204
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100205/* Receive a BSSGP RESET for given BVCI and ACK it */
Harald Weltebf768242019-02-21 22:19:21 +0100206altstep 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 +0100207 var NS_RecvFrom ns_rf;
208 /* FIXME: nail down received cell_id in match */
Harald Weltebf768242019-02-21 22:19:21 +0100209 [] NSCP[idx].receive(t_NS_RecvFrom(tr_NS_UNITDATA(t_SduCtrlB, 0,
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100210 decmatch tr_BVC_RESET(?, bvci, ?))))
211 -> value ns_rf {
212 var PDU_BSSGP bssgp_rx := dec_PDU_BSSGP(ns_rf.msg.pDU_NS_Unitdata.nS_SDU);
213 var PDU_BSSGP bssgp_tx := valueof(ts_BVC_RESET_ACK(bvci, mp_gb_cfg.cell_id));
Harald Weltebf768242019-02-21 22:19:21 +0100214 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 +0100215 if (not oneshot) { repeat; }
216 }
217}
218
219
220/* Receive a BSSGP UNBLOCK for given BVCI and ACK it */
Harald Weltebf768242019-02-21 22:19:21 +0100221altstep 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 +0100222 var NS_RecvFrom ns_rf;
Harald Weltebf768242019-02-21 22:19:21 +0100223 [] NSCP[idx].receive(t_NS_RecvFrom(tr_NS_UNITDATA(t_SduCtrlB, 0,
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100224 decmatch t_BVC_UNBLOCK(bvci))))
225 -> value ns_rf {
226 var PDU_BSSGP bssgp_rx := dec_PDU_BSSGP(ns_rf.msg.pDU_NS_Unitdata.nS_SDU);
227 var PDU_BSSGP bssgp_tx := valueof(t_BVC_UNBLOCK_ACK(bvci));
Harald Weltebf768242019-02-21 22:19:21 +0100228 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 +0100229 if (not oneshot) { repeat; }
230 }
231}
232
233/* Receive a BSSGP FLOW-CONTROL-BVC and ACK it */
Harald Weltebf768242019-02-21 22:19:21 +0100234altstep 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 +0100235 var NS_RecvFrom ns_rf;
Harald Weltebf768242019-02-21 22:19:21 +0100236 [] NSCP[idx].receive(t_NS_RecvFrom(tr_NS_UNITDATA(t_SduCtrlB, bvci,
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100237 decmatch tr_BVC_FC_BVC)))
238 -> value ns_rf {
239 var PDU_BSSGP bssgp_rx := dec_PDU_BSSGP(ns_rf.msg.pDU_NS_Unitdata.nS_SDU);
240 var OCT1 tag := bssgp_rx.pDU_BSSGP_FLOW_CONTROL_BVC.tag.unstructured_Value;
241 var PDU_BSSGP bssgp_tx := valueof(t_BVC_FC_BVC_ACK(tag));
Harald Weltebf768242019-02-21 22:19:21 +0100242 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 +0100243 if (not oneshot) { repeat; }
244 }
245}
246
247/**********************************************************************************
248 * Classic Gb/IP bring-up test cases using NS-{RESET,BLOCK,UNBLOCK} and no IP-SNS *
249 **********************************************************************************/
250
251/* Receive a NS-RESET and ACK it */
Harald Weltebf768242019-02-21 22:19:21 +0100252private altstep as_rx_ns_reset_ack(boolean oneshot := false, integer idx := 0) runs on RAW_NS_CT {
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100253 var NS_RecvFrom ns_rf;
Harald Weltebf768242019-02-21 22:19:21 +0100254 [] NSCP[idx].receive(t_NS_RecvFrom(tr_NS_RESET(NS_CAUSE_OM_INTERVENTION, g_nsconfig[idx].nsvci,
255 g_nsconfig[idx].nsei))) -> value ns_rf {
256 NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_NS_RESET_ACK(g_nsconfig[idx].nsvci,
257 g_nsconfig[idx].nsei)));
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100258 if (not oneshot) { repeat; }
259 }
260}
261/* Receive a NS-UNBLOCK and ACK it */
Harald Weltebf768242019-02-21 22:19:21 +0100262private altstep as_rx_ns_unblock_ack(boolean oneshot := false, integer idx := 0) runs on RAW_NS_CT {
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100263 var NS_RecvFrom ns_rf;
Harald Weltebf768242019-02-21 22:19:21 +0100264 [] NSCP[idx].receive(t_NS_RecvFrom(t_NS_UNBLOCK)) -> value ns_rf {
265 NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], t_NS_UNBLOCK_ACK));
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100266 if (not oneshot) { repeat; }
267 }
268}
269
270/* test the NS-RESET procedure */
Harald Welteea3c7e92019-03-01 19:34:55 +0100271testcase TC_ns_reset() runs on RAW_Test_CT {
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100272 f_init_ns_codec();
273 f_init_pcuif();
274
275
276 /* Expect inbound NS-RESET procedure */
277 as_rx_ns_reset_ack(oneshot := true);
278 setverdict(pass);
279}
280
281/* ensure NS-RESET are re-transmitted */
Harald Welteea3c7e92019-03-01 19:34:55 +0100282testcase TC_ns_reset_retrans() runs on RAW_Test_CT {
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100283 f_init_ns_codec();
284 f_init_pcuif();
285
286 var integer i;
287 for (i := 0; i < 3; i := i+1) {
Harald Weltebf768242019-02-21 22:19:21 +0100288 NSCP[0].receive(t_NS_RecvFrom(tr_NS_RESET(NS_CAUSE_OM_INTERVENTION,
289 g_nsconfig[0].nsvci, g_nsconfig[0].nsei)));
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100290 }
291
292 /* Expect inbound NS-RESET procedure */
293 as_rx_ns_reset_ack(oneshot := true);
294 setverdict(pass);
295}
296
297/* test the inbound NS-ALIVE procedure after NS-RESET */
Harald Welteea3c7e92019-03-01 19:34:55 +0100298testcase TC_ns_alive() runs on RAW_Test_CT {
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100299 f_init_ns_codec();
300 f_init_pcuif();
301
302 /* Expect inbound NS-RESET procedure */
303 as_rx_ns_reset_ack(oneshot := true);
304
305 /* wait for one ALIVE cycle, then ACK any further ALIVE in the background */
306 as_rx_alive_tx_ack(oneshot := true);
307 setverdict(pass);
308}
309
310/* Test for NS-RESET after NS-ALIVE timeout */
Harald Welteea3c7e92019-03-01 19:34:55 +0100311testcase TC_ns_alive_timeout_reset() runs on RAW_Test_CT {
Harald Weltebf768242019-02-21 22:19:21 +0100312 f_init_ns_codec(guard_secs := 100.0);
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100313 f_init_pcuif();
314
315 /* Expect inbound NS-RESET procedure */
316 as_rx_ns_reset_ack(oneshot := true);
317
318 /* wait for at least one NS-ALIVE */
Harald Weltebf768242019-02-21 22:19:21 +0100319 NSCP[0].receive(t_NS_RecvFrom(t_NS_ALIVE));
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100320
321 /* wait for NS-RESET to re-appear, ignoring any NS-ALIVE until then */
322 alt {
323 [] as_rx_ns_reset_ack(oneshot := true) { setverdict(pass); }
Harald Weltebf768242019-02-21 22:19:21 +0100324 [] NSCP[0].receive(t_NS_RecvFrom(t_NS_ALIVE)) { repeat; }
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100325 }
326}
327
328/* test for NS-RESET/NS-ALIVE/NS-UNBLOCK */
Harald Welteea3c7e92019-03-01 19:34:55 +0100329testcase TC_ns_unblock() runs on RAW_Test_CT {
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100330 f_init_ns_codec();
331 f_init_pcuif();
332
333 /* Expect inbound NS-RESET procedure */
334 as_rx_ns_reset_ack(oneshot := true);
335
336 /* wait for one ALIVE cycle, then ACK any further ALIVE in the background */
337 as_rx_alive_tx_ack(oneshot := true);
338 activate(as_rx_alive_tx_ack());
339
340 as_rx_ns_unblock_ack(oneshot := true);
341 setverdict(pass);
342}
343
344/* test for NS-UNBLOCK re-transmissions */
Harald Welteea3c7e92019-03-01 19:34:55 +0100345testcase TC_ns_unblock_retrans() runs on RAW_Test_CT {
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100346 f_init_ns_codec();
347 f_init_pcuif();
348
349 /* Expect inbound NS-RESET procedure */
350 as_rx_ns_reset_ack(oneshot := true);
351
352 /* wait for one ALIVE cycle, then ACK any further ALIVE in the background */
353 as_rx_alive_tx_ack(oneshot := true);
354 activate(as_rx_alive_tx_ack());
355
356 /* wait for first NS-UNBLOCK, don't respond */
Harald Weltebf768242019-02-21 22:19:21 +0100357 NSCP[0].receive(t_NS_RecvFrom(t_NS_UNBLOCK));
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100358
359 /* wait for re-transmission of NS-UNBLOCK */
360 as_rx_ns_unblock_ack(oneshot := true);
361 setverdict(pass);
362}
363
364/* full bring-up of the Gb link for NS and BSSGP layer up to BVC-FC */
Harald Welteea3c7e92019-03-01 19:34:55 +0100365testcase TC_ns_full_bringup() runs on RAW_Test_CT {
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100366 f_init_ns_codec();
367 f_init_pcuif();
368
369 /* Expect inbound NS-RESET procedure */
370 as_rx_ns_reset_ack(oneshot := true);
371
372 /* wait for one ALIVE cycle, then ACK any further ALIVE in the background */
373 as_rx_alive_tx_ack(oneshot := true);
374 activate(as_rx_alive_tx_ack());
375
376 as_rx_ns_unblock_ack(oneshot := true);
377
378 f_outgoing_ns_alive();
379
380 /* Expect BVC-RESET for signaling (0) and ptp BVCI */
381 as_rx_bvc_reset_tx_ack(0, oneshot := true);
382 as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvci, oneshot := true);
383 as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvci, oneshot := true);
384
385 /* wait for one FLOW-CONTROL BVC and then ACK any further in the future */
386 as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvci, oneshot := true);
387 activate(as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvci));
388 setverdict(pass);
389}
390
391/* test outbound (SGSN-originated) NS-BLOCK procedure */
Harald Welteea3c7e92019-03-01 19:34:55 +0100392testcase TC_ns_so_block() runs on RAW_Test_CT {
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100393 f_init_ns_codec();
394 f_init_pcuif();
395
396 /* Expect inbound NS-RESET procedure */
397 as_rx_ns_reset_ack(oneshot := true);
398
399 /* wait for one ALIVE cycle, then ACK any further ALIVE in the background */
400 as_rx_alive_tx_ack(oneshot := true);
401 activate(as_rx_alive_tx_ack());
402
403 as_rx_ns_unblock_ack(oneshot := true);
404
405 f_outgoing_ns_alive();
406
407 f_outgoing_ns_block(NS_CAUSE_EQUIPMENT_FAILURE);
408 setverdict(pass);
409}
410
Harald Welte7fd25cf2019-03-21 22:14:02 +0100411/* Test component with PCUIF + BSSGP/NS Emulation (no L1CTL) */
412type component bssgp_pcuif_CT extends bssgp_CT, RAW_PCU_CT {
413}
414
415testcase TC_pcuif_suspend() runs on bssgp_pcuif_CT {
416 var OCT6 ra_id := enc_RoutingAreaIdentification(mp_gb_cfg.cell_id.ra_id);
417 var GprsTlli tlli := 'FFFFFFFF'O;
418
419 /* Initialize PCU interface side */
420 f_init_pcuif();
421
422 /* Initialize NS/BSSGP side */
423 f_init_bssgp();
424
425 f_sleep(1.0);
426 f_pcuif_tx(ts_PCUIF_SUSP_REQ(0, tlli, ra_id, 0));
427 BSSGP_SIG[0].receive(tr_BD_BSSGP(tr_BSSGP_SUSPEND(tlli, mp_gb_cfg.cell_id.ra_id)));
428
429 setverdict(pass);
430}
431
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100432
433control {
434 execute( TC_ns_reset() );
435 execute( TC_ns_reset_retrans() );
436 execute( TC_ns_alive() );
437 execute( TC_ns_alive_timeout_reset() );
438 execute( TC_ns_unblock() );
439 execute( TC_ns_unblock_retrans() );
440 execute( TC_ns_full_bringup() );
441 execute( TC_ns_so_block() );
Harald Welte7fd25cf2019-03-21 22:14:02 +0100442
443 execute( TC_pcuif_suspend() );
Harald Welte9fbcf4b2018-12-07 07:56:52 +0100444}
445
446
447
448
449
450
451}