diff --git a/gbproxy/GBProxy_Tests.ttcn b/gbproxy/GBProxy_Tests.ttcn index c496ca8ac..dd33106cd 100644 --- a/gbproxy/GBProxy_Tests.ttcn +++ b/gbproxy/GBProxy_Tests.ttcn @@ -337,6 +337,8 @@ type component test_CT extends CTRL_Adapter_CT { var GbInstances g_pcu; var GbInstances g_sgsn; + port NS_CTRL_PT NS_CTRL; + port BSSGP_CT_PROC_PT PROC; port BSSGP_BVC_MGMT_PT SGSN_MGMT; @@ -1130,6 +1132,53 @@ testcase TC_ul_unitdata() runs on test_CT f_cleanup(); } + +/* send uplink-unitdata of a variety of different sizes; expect it to show up on the only connected SGSN */ +private function f_TC_ul_unitdata_pool_failure(charstring id) runs on BSSGP_ConnHdlr { + var integer ran_idx := 0; + var BssgpBvcConfig bvcc := g_pars.pcu[ran_idx].cfg.bvc[0]; + var integer i; + + /* All data should arrive at the one SGSN that is still up */ + g_pars.sgsn_idx := 0; + + for (i := 0; i < max_fr_info_size-4; i := i+4) { + 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); + /* 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); + + log("UL-UNITDATA(payload_size=", i); + f_pcu2sgsn(pdu_tx, pdu_rx); + } + setverdict(pass); +} + +testcase TC_ul_unitdata_pool_failure() runs on test_CT +{ + var integer i; + var integer j; + + f_init(60.0); + + for (i := 1; i < lengthof(mp_nsconfig_sgsn); i := i+1) { + connect(self:NS_CTRL, g_sgsn[i].vc_NS:NS_CTRL); + for (j := 0; j < lengthof(mp_nsconfig_sgsn[i].nsvc); j := j+1) { + var uint16_t nsvci := mp_nsconfig_sgsn[i].nsvc[j].nsvci; + var NsDisableVcRequest tx_disar; + tx_disar.nsvci := nsvci; + NS_CTRL.send(tx_disar); + } + disconnect(self:NS_CTRL, g_sgsn[i].vc_NS:NS_CTRL); + } + /* Wait until gbproxy notices that the NSVCs are down */ + f_sleep(15.0); + + f_start_handlers(refers(f_TC_ul_unitdata_pool_failure), testcasename(), 1); + /* TODO: start multiple handlers (UEs) on various cells on same and other NSEs */ + 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; @@ -3461,6 +3510,7 @@ testcase TC_status_ptp_dl_bvci() runs on GlobalTest_CT control { execute( TC_BVC_bringup() ); execute( TC_ul_unitdata() ); + execute( TC_ul_unitdata_pool_failure() ); execute( TC_dl_unitdata() ); execute( TC_ra_capability() ); execute( TC_ra_capability_upd() ); diff --git a/gbproxy/osmo-gbproxy.cfg b/gbproxy/osmo-gbproxy.cfg index dab4ef354..d26956705 100644 --- a/gbproxy/osmo-gbproxy.cfg +++ b/gbproxy/osmo-gbproxy.cfg @@ -42,6 +42,6 @@ ns timer tns-block-retries 3 timer tns-reset 3 timer tns-reset-retries 3 - timer tns-test 30 - timer tns-alive 3 - timer tns-alive-retries 10 + timer tns-test 5 + timer tns-alive 2 + timer tns-alive-retries 3