From 78d8db98b76a7d32df4952d6e4d607799075ee75 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 15 Nov 2020 23:27:27 +0100 Subject: [PATCH] gbproxy: Add test for DL-UNITDATA Change-Id: I96d57cef29dd5e724e66767cc23320a5468a3ea3 --- gbproxy/GBProxy_Tests.ttcn | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/gbproxy/GBProxy_Tests.ttcn b/gbproxy/GBProxy_Tests.ttcn index 9ee909381..8837a632d 100644 --- a/gbproxy/GBProxy_Tests.ttcn +++ b/gbproxy/GBProxy_Tests.ttcn @@ -602,10 +602,48 @@ testcase TC_ul_unitdata() runs on test_CT f_cleanup(); } +/* send downlink-unitdata of a variety of different sizes; expect it to show up on PCU */ +private function f_TC_dl_unitdata(charstring id) runs on BSSGP_ConnHdlr { + var integer i; + + for (i := 0; i < 1024; i := i+1) { + var octetstring payload := f_rnd_octstring(i); + var template (value) PDU_BSSGP pdu_tx := + ts_BSSGP_DL_UD(g_pars.tlli, payload, omit, ts_BSSGP_IMSI(g_pars.imsi)); + /* we cannot use pdu_tx as there are some subtle differences in the length field :/ */ + var template (present) PDU_BSSGP pdu_rx := + tr_BSSGP_DL_UD(g_pars.tlli, payload, tr_BSSGP_IMSI(g_pars.imsi)); + + SGSN[0].send(pdu_tx); + alt { + [] PCU[0].receive(pdu_rx); + /* FIXME: Those should be handled before the ConnHdlr is started */ + [] PCU[0].receive(BssgpStatusIndication:{*,?,BVC_S_UNBLOCKED}) { repeat; } + [] PCU[0].receive { + setverdict(fail, "PCU Received unexpected"); + mtc.stop; + } + } + } + setverdict(pass); +} + +testcase TC_dl_unitdata() runs on test_CT +{ + var BSSGP_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_TC_dl_unitdata), testcasename(), g_pcu, g_sgsn, 2); + vc_conn.done; + /* TODO: start multiple handlers (UEs) on various cells on same and other NSEs */ + + f_cleanup(); +} control { execute( TC_BVC_bringup() ); execute( TC_ul_unitdata() ); + execute( TC_dl_unitdata() ); }