gbproxy: Test for sizes up to 1600 bytes, not just 1024 bytes

The NS specs state up to 1600 bytes "gross NS size" must be supported,
at least by the underlying FR layer. Let's test up to that.  Let's
also speed things up by using 4-byte size increments, and print
the size of the current message.

Change-Id: I76358323e79cfc3d0e9c979c716b7a552f3b8e3b
This commit is contained in:
Harald Welte 2020-11-29 16:04:07 +01:00 committed by laforge
parent f0310fc42f
commit 0d5fceb146
1 changed files with 7 additions and 2 deletions

View File

@ -40,6 +40,9 @@ import from GSM_RR_Types all;
/* mcc_mnc is 24.008 10.5.5.15 encoded. 262 42 */ /* mcc_mnc is 24.008 10.5.5.15 encoded. 262 42 */
const BcdMccMnc c_mcc_mnc := '262F42'H; const BcdMccMnc c_mcc_mnc := '262F42'H;
/* 48.016 section 6.1.4.2: The default maximum information field size of 1600 octets shall be supported on the Gb interface */
const integer max_fr_info_size := 1600;
modulepar { modulepar {
/* IP/port on which we run our internal GSUP/HLR emulation */ /* IP/port on which we run our internal GSUP/HLR emulation */
NSConfigurations mp_nsconfig_sgsn := { NSConfigurations mp_nsconfig_sgsn := {
@ -754,12 +757,13 @@ private function f_TC_ul_unitdata(charstring id) runs on BSSGP_ConnHdlr {
var BssgpBvcConfig bvcc := g_pars.pcu[ran_idx].cfg.bvc[0]; var BssgpBvcConfig bvcc := g_pars.pcu[ran_idx].cfg.bvc[0];
var integer i; var integer i;
for (i := 0; i < 1024; i := i+1) { for (i := 0; i < max_fr_info_size-4; i := i+4) {
var octetstring payload := f_rnd_octstring(i); var octetstring payload := f_rnd_octstring(i);
var template (value) PDU_BSSGP pdu_tx := ts_BSSGP_UL_UD(g_pars.tlli, bvcc.cell_id, payload); var template (value) PDU_BSSGP pdu_tx := ts_BSSGP_UL_UD(g_pars.tlli, bvcc.cell_id, payload);
/* we cannot use pdu_tx as there are some subtle differences in the length field :/ */ /* we cannot use pdu_tx as there are some subtle differences in the length field :/ */
var template (present) PDU_BSSGP pdu_rx := tr_BSSGP_UL_UD(g_pars.tlli, bvcc.cell_id, payload); var template (present) PDU_BSSGP pdu_rx := tr_BSSGP_UL_UD(g_pars.tlli, bvcc.cell_id, payload);
log("UL-UNITDATA(payload_size=", i);
f_pcu2sgsn(pdu_tx, pdu_rx); f_pcu2sgsn(pdu_tx, pdu_rx);
} }
setverdict(pass); setverdict(pass);
@ -781,7 +785,7 @@ testcase TC_ul_unitdata() runs on test_CT
private function f_TC_dl_unitdata(charstring id) runs on BSSGP_ConnHdlr { private function f_TC_dl_unitdata(charstring id) runs on BSSGP_ConnHdlr {
var integer i; var integer i;
for (i := 0; i < 1024; i := i+1) { for (i := 0; i < max_fr_info_size-4; i := i+4) {
var octetstring payload := f_rnd_octstring(i); var octetstring payload := f_rnd_octstring(i);
var template (value) PDU_BSSGP pdu_tx := var template (value) PDU_BSSGP pdu_tx :=
ts_BSSGP_DL_UD(g_pars.tlli, payload, omit, ts_BSSGP_IMSI(g_pars.imsi)); ts_BSSGP_DL_UD(g_pars.tlli, payload, omit, ts_BSSGP_IMSI(g_pars.imsi));
@ -789,6 +793,7 @@ private function f_TC_dl_unitdata(charstring id) runs on BSSGP_ConnHdlr {
var template (present) PDU_BSSGP pdu_rx := var template (present) PDU_BSSGP pdu_rx :=
tr_BSSGP_DL_UD(g_pars.tlli, payload, tr_BSSGP_IMSI(g_pars.imsi)); tr_BSSGP_DL_UD(g_pars.tlli, payload, tr_BSSGP_IMSI(g_pars.imsi));
log("DL-UNITDATA(payload_size=", i);
f_sgsn2pcu(pdu_tx, pdu_rx); f_sgsn2pcu(pdu_tx, pdu_rx);
} }
setverdict(pass); setverdict(pass);